diff options
author | Adam Jackson <ajax@redhat.com> | 2014-07-22 11:05:32 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-07-28 12:20:44 -0700 |
commit | 29eaa61cb210e0c67004bc567af0c15d48aad626 (patch) | |
tree | 4fb59bb9a8a87a0fd677e3be1bad7585ccbb2230 /mi/micoord.h | |
parent | 6ddd164508f81e9582b66061b385bd34ac1ccb7e (diff) |
mi: Remove semi-arbitrary arch awareness in packed coordinate macros
The majority of arches end up on the right-shift path here. I can't
think of any arch where that'd be slower than a divide, and semantically
it makes more sense to think of this as a shift operation anyway.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'mi/micoord.h')
-rw-r--r-- | mi/micoord.h | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/mi/micoord.h b/mi/micoord.h index 481e418c5..c83bffd90 100644 --- a/mi/micoord.h +++ b/mi/micoord.h @@ -32,27 +32,7 @@ /* Macros which handle a coordinate in a single register */ -/* - * Most compilers will convert divisions by 65536 into shifts, if signed - * shifts exist. If your machine does arithmetic shifts and your compiler - * can't get it right, add to this line. - */ - -/* - * mips compiler - what a joke - it CSEs the 65536 constant into a reg - * forcing as to use div instead of shift. Let's be explicit. - */ - -#if defined(mips) || \ - defined(sparc) || defined(__sparc64__) || \ - defined(__alpha) || defined(__alpha__) || \ - defined(__i386__) || defined(__i386) || defined(__ia64__) || \ - defined(__s390x__) || defined(__s390__) || \ - defined(__amd64__) || defined(amd64) || defined(__amd64) #define GetHighWord(x) (((int) (x)) >> 16) -#else -#define GetHighWord(x) (((int) (x)) / 65536) -#endif #if IMAGE_BYTE_ORDER == MSBFirst #define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int) ((short) (i)))) |