LoongArch64: Add some constant definitions

Co-developed-by: Qiqi Huang <huangqiqi@loongson.cn>
This commit is contained in:
Xiaolin Zhao 2022-07-27 16:21:18 +08:00
parent 9ef79d869c
commit 07c315164f
2 changed files with 13 additions and 8 deletions

View File

@ -67,6 +67,10 @@
#endif
#endif
//#elif LJ_TARGET_LOONGARCH64
//#define JIT_F_GS464V (JIT_F_CPU << 0)
//#define JIT_F_CPUSTRING "\6GS464V"
#else
#define JIT_F_CPUSTRING ""
@ -363,7 +367,7 @@ enum {
LJ_K64_M2P64_31 = LJ_K64_M2P64,
#endif
#endif
#if LJ_TARGET_MIPS
#if LJ_TARGET_MIPS || LJ_TARGET_LOONGARCH64
LJ_K64_2P31, /* 2^31 */
#if LJ_64
LJ_K64_2P63, /* 2^63 */
@ -372,7 +376,7 @@ enum {
#endif
LJ_K64__MAX,
};
#define LJ_K64__USED (LJ_TARGET_X86ORX64 || LJ_TARGET_MIPS)
#define LJ_K64__USED (LJ_TARGET_X86ORX64 || LJ_TARGET_MIPS || LJ_TARGET_LOONGARCH64)
enum {
#if LJ_TARGET_X86ORX64
@ -382,16 +386,17 @@ enum {
LJ_K32_2P52_2P31, /* 2^52 + 2^31 */
LJ_K32_2P52, /* 2^52 */
#endif
#if LJ_TARGET_PPC || LJ_TARGET_MIPS
#if LJ_TARGET_PPC || LJ_TARGET_MIPS || LJ_TARGET_LOONGARCH64
LJ_K32_2P31, /* 2^31 */
#endif
#if LJ_TARGET_MIPS64
#if LJ_TARGET_MIPS64 || LJ_TARGET_LOONGARCH64
LJ_K32_2P63, /* 2^63 */
LJ_K32_M2P64, /* -2^64 */
#endif
LJ_K32__MAX
};
#define LJ_K32__USED (LJ_TARGET_X86ORX64 || LJ_TARGET_PPC || LJ_TARGET_MIPS)
#define LJ_K32__USED \
(LJ_TARGET_X86ORX64 || LJ_TARGET_PPC || LJ_TARGET_MIPS || LJ_TARGET_LOONGARCH64)
/* Get 16 byte aligned pointer to SIMD constant. */
#define LJ_KSIMD(J, n) \

View File

@ -329,17 +329,17 @@ void lj_trace_initstate(global_State *g)
J->k64[LJ_K64_2P64].u64 = U64x(43f00000,00000000);
J->k32[LJ_K32_M2P64_31] = LJ_64 ? 0xdf800000 : 0xcf000000;
#endif
#if LJ_TARGET_X86ORX64 || LJ_TARGET_MIPS64
#if LJ_TARGET_X86ORX64 || LJ_TARGET_MIPS64 || LJ_TARGET_LOONGARCH64
J->k64[LJ_K64_M2P64].u64 = U64x(c3f00000,00000000);
#endif
#if LJ_TARGET_PPC
J->k32[LJ_K32_2P52_2P31] = 0x59800004;
J->k32[LJ_K32_2P52] = 0x59800000;
#endif
#if LJ_TARGET_PPC || LJ_TARGET_MIPS
#if LJ_TARGET_PPC || LJ_TARGET_MIPS || LJ_TARGET_LOONGARCH64
J->k32[LJ_K32_2P31] = 0x4f000000;
#endif
#if LJ_TARGET_MIPS
#if LJ_TARGET_MIPS || LJ_TARGET_LOONGARCH64
J->k64[LJ_K64_2P31].u64 = U64x(41e00000,00000000);
#if LJ_64
J->k64[LJ_K64_2P63].u64 = U64x(43e00000,00000000);