aboutsummaryrefslogtreecommitdiff
path: root/src/lj_def.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_def.h')
-rw-r--r--src/lj_def.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lj_def.h b/src/lj_def.h
index 3c43be78..8624aed2 100644
--- a/src/lj_def.h
+++ b/src/lj_def.h
@@ -111,7 +111,7 @@ typedef uintptr_t BloomFilter;
111#define bloomset(b, x) ((b) |= bloombit((x))) 111#define bloomset(b, x) ((b) |= bloombit((x)))
112#define bloomtest(b, x) ((b) & bloombit((x))) 112#define bloomtest(b, x) ((b) & bloombit((x)))
113 113
114#if defined(__GNUC__) 114#if defined(__GNUC__) || defined(__psp2__)
115 115
116#define LJ_NORET __attribute__((noreturn)) 116#define LJ_NORET __attribute__((noreturn))
117#define LJ_ALIGN(n) __attribute__((aligned(n))) 117#define LJ_ALIGN(n) __attribute__((aligned(n)))
@@ -119,7 +119,7 @@ typedef uintptr_t BloomFilter;
119#define LJ_AINLINE inline __attribute__((always_inline)) 119#define LJ_AINLINE inline __attribute__((always_inline))
120#define LJ_NOINLINE __attribute__((noinline)) 120#define LJ_NOINLINE __attribute__((noinline))
121 121
122#if defined(__ELF__) || defined(__MACH__) 122#if defined(__ELF__) || defined(__MACH__) || defined(__psp2__)
123#if !((defined(__sun__) && defined(__svr4__)) || defined(__CELLOS_LV2__)) 123#if !((defined(__sun__) && defined(__svr4__)) || defined(__CELLOS_LV2__))
124#define LJ_NOAPI extern __attribute__((visibility("hidden"))) 124#define LJ_NOAPI extern __attribute__((visibility("hidden")))
125#endif 125#endif
@@ -150,6 +150,9 @@ static LJ_AINLINE uint32_t lj_fls(uint32_t x)
150#if defined(__arm__) 150#if defined(__arm__)
151static LJ_AINLINE uint32_t lj_bswap(uint32_t x) 151static LJ_AINLINE uint32_t lj_bswap(uint32_t x)
152{ 152{
153#if defined(__psp2__)
154 return __builtin_rev(x);
155#else
153 uint32_t r; 156 uint32_t r;
154#if __ARM_ARCH_6__ || __ARM_ARCH_6J__ || __ARM_ARCH_6T2__ || __ARM_ARCH_6Z__ ||\ 157#if __ARM_ARCH_6__ || __ARM_ARCH_6J__ || __ARM_ARCH_6T2__ || __ARM_ARCH_6Z__ ||\
155 __ARM_ARCH_6ZK__ || __ARM_ARCH_7__ || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ 158 __ARM_ARCH_6ZK__ || __ARM_ARCH_7__ || __ARM_ARCH_7A__ || __ARM_ARCH_7R__
@@ -163,6 +166,7 @@ static LJ_AINLINE uint32_t lj_bswap(uint32_t x)
163#endif 166#endif
164 return ((r & 0xff00ffffu) >> 8) ^ lj_ror(x, 8); 167 return ((r & 0xff00ffffu) >> 8) ^ lj_ror(x, 8);
165#endif 168#endif
169#endif
166} 170}
167 171
168static LJ_AINLINE uint64_t lj_bswap64(uint64_t x) 172static LJ_AINLINE uint64_t lj_bswap64(uint64_t x)