summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/compiler.h
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2014-07-22 10:58:57 -0400
committerKeith Packard <keithp@keithp.com>2014-07-28 12:18:13 -0700
commitda2b2671863655776d60102ddc7af61470d14022 (patch)
treea3a86ef35e344362d52a6050a5bb41869ba427f2 /hw/xfree86/common/compiler.h
parente03c902e03dea7a6a98ad5fb00580b9404b67c4d (diff)
xfree86: Unspecialize gcc variants of unaligned memory access
Yes yes, very clever, memmove works fine on gcc too, let's just do the portable thing since none of this is performance code. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw/xfree86/common/compiler.h')
-rw-r--r--hw/xfree86/common/compiler.h69
1 files changed, 0 insertions, 69 deletions
diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index 556fa7f0e..54ebb73ca 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -238,73 +238,6 @@ extern unsigned short ldw_brx(volatile unsigned char *, int);
#define write_mem_barrier() /* NOP */
#endif
-#ifdef __GNUC__
-
-/* Define some packed structures to use with unaligned accesses */
-
-struct __una_u64 {
- uint64_t x __attribute__ ((packed));
-};
-struct __una_u32 {
- uint32_t x __attribute__ ((packed));
-};
-struct __una_u16 {
- uint16_t x __attribute__ ((packed));
-};
-
-/* Elemental unaligned loads */
-
-static __inline__ uint64_t
-ldq_u(uint64_t * p)
-{
- const struct __una_u64 *ptr = (const struct __una_u64 *) p;
-
- return ptr->x;
-}
-
-static __inline__ uint32_t
-ldl_u(uint32_t * p)
-{
- const struct __una_u32 *ptr = (const struct __una_u32 *) p;
-
- return ptr->x;
-}
-
-static __inline__ uint16_t
-ldw_u(uint16_t * p)
-{
- const struct __una_u16 *ptr = (const struct __una_u16 *) p;
-
- return ptr->x;
-}
-
-/* Elemental unaligned stores */
-
-static __inline__ void
-stq_u(uint64_t val, uint64_t * p)
-{
- struct __una_u64 *ptr = (struct __una_u64 *) p;
-
- ptr->x = val;
-}
-
-static __inline__ void
-stl_u(uint32_t val, uint32_t * p)
-{
- struct __una_u32 *ptr = (struct __una_u32 *) p;
-
- ptr->x = val;
-}
-
-static __inline__ void
-stw_u(uint16_t val, uint16_t * p)
-{
- struct __una_u16 *ptr = (struct __una_u16 *) p;
-
- ptr->x = val;
-}
-#else /* !__GNUC__ */
-
#include <string.h> /* needed for memmove */
static __inline__ uint64_t
@@ -358,8 +291,6 @@ stw_u(uint16_t val, uint16_t * p)
memmove(p, &tmp, sizeof(*p));
}
-#endif /* __GNUC__ */
-
#ifdef __GNUC__
#if (defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) && (defined(__alpha__))