diff options
author | Mike Pall <mike> | 2010-08-03 22:09:12 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2010-08-03 22:09:12 +0200 |
commit | 33ef1fa52405f1417d90a289eb2bd00c367e6195 (patch) | |
tree | 3aa501f343e458f1b9d05a02895c755043c4113e /src/lj_def.h | |
parent | a6b7952f7e095883d9a277f26b844ae1c9248999 (diff) | |
download | luajit-33ef1fa52405f1417d90a289eb2bd00c367e6195.tar.gz luajit-33ef1fa52405f1417d90a289eb2bd00c367e6195.tar.bz2 luajit-33ef1fa52405f1417d90a289eb2bd00c367e6195.zip |
Untangle some target dependencies.
Diffstat (limited to 'src/lj_def.h')
-rw-r--r-- | src/lj_def.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lj_def.h b/src/lj_def.h index de4ad1be..f6b5432d 100644 --- a/src/lj_def.h +++ b/src/lj_def.h | |||
@@ -140,7 +140,12 @@ static LJ_AINLINE uint32_t lj_fls(uint32_t x) | |||
140 | #define lj_fls(x) ((uint32_t)(__builtin_clz(x)^31)) | 140 | #define lj_fls(x) ((uint32_t)(__builtin_clz(x)^31)) |
141 | #endif | 141 | #endif |
142 | 142 | ||
143 | #if defined(__i386__) || defined(__x86_64__) | 143 | #if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 |
144 | static LJ_AINLINE uint32_t lj_bswap(uint32_t x) | ||
145 | { | ||
146 | return (uint32_t)__builtin_bswap32((int32_t)x); | ||
147 | } | ||
148 | #elif defined(__i386__) || defined(__x86_64__) | ||
144 | static LJ_AINLINE uint32_t lj_bswap(uint32_t x) | 149 | static LJ_AINLINE uint32_t lj_bswap(uint32_t x) |
145 | { | 150 | { |
146 | uint32_t r; __asm__("bswap %0" : "=r" (r) : "0" (x)); return r; | 151 | uint32_t r; __asm__("bswap %0" : "=r" (r) : "0" (x)); return r; |