diff options
author | Mike Pall <mike> | 2023-09-10 05:20:22 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2023-09-10 05:20:22 +0200 |
commit | cb413bf8f4814fe3e47c8c619602c7a161469faf (patch) | |
tree | de88d398f115fca8d258e818e226a75ba0326336 /src/lj_target.h | |
parent | 566532b8071c82125a65ad1bea0d5784991fa7a2 (diff) | |
download | luajit-cb413bf8f4814fe3e47c8c619602c7a161469faf.tar.gz luajit-cb413bf8f4814fe3e47c8c619602c7a161469faf.tar.bz2 luajit-cb413bf8f4814fe3e47c8c619602c7a161469faf.zip |
Windows/ARM64: Add initial support.
Only builds with native ARM64 Visual Studio for now.
Thanks to vanc and Stephen Just. #593 #964
Diffstat (limited to 'src/lj_target.h')
-rw-r--r-- | src/lj_target.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lj_target.h b/src/lj_target.h index 09d19bd9..e7322c07 100644 --- a/src/lj_target.h +++ b/src/lj_target.h | |||
@@ -58,9 +58,13 @@ typedef uint32_t RegSP; | |||
58 | #if LJ_TARGET_PPC || LJ_TARGET_MIPS || LJ_TARGET_ARM64 | 58 | #if LJ_TARGET_PPC || LJ_TARGET_MIPS || LJ_TARGET_ARM64 |
59 | typedef uint64_t RegSet; | 59 | typedef uint64_t RegSet; |
60 | #define RSET_BITS 6 | 60 | #define RSET_BITS 6 |
61 | #define rset_picktop_(rs) ((Reg)lj_fls64(rs)) | ||
62 | #define rset_pickbot_(rs) ((Reg)lj_ffs64(rs)) | ||
61 | #else | 63 | #else |
62 | typedef uint32_t RegSet; | 64 | typedef uint32_t RegSet; |
63 | #define RSET_BITS 5 | 65 | #define RSET_BITS 5 |
66 | #define rset_picktop_(rs) ((Reg)lj_fls(rs)) | ||
67 | #define rset_pickbot_(rs) ((Reg)lj_ffs(rs)) | ||
64 | #endif | 68 | #endif |
65 | 69 | ||
66 | #define RID2RSET(r) (((RegSet)1) << (r)) | 70 | #define RID2RSET(r) (((RegSet)1) << (r)) |
@@ -71,13 +75,6 @@ typedef uint32_t RegSet; | |||
71 | #define rset_set(rs, r) (rs |= RID2RSET(r)) | 75 | #define rset_set(rs, r) (rs |= RID2RSET(r)) |
72 | #define rset_clear(rs, r) (rs &= ~RID2RSET(r)) | 76 | #define rset_clear(rs, r) (rs &= ~RID2RSET(r)) |
73 | #define rset_exclude(rs, r) (rs & ~RID2RSET(r)) | 77 | #define rset_exclude(rs, r) (rs & ~RID2RSET(r)) |
74 | #if LJ_TARGET_PPC || LJ_TARGET_MIPS || LJ_TARGET_ARM64 | ||
75 | #define rset_picktop_(rs) ((Reg)(__builtin_clzll(rs)^63)) | ||
76 | #define rset_pickbot_(rs) ((Reg)__builtin_ctzll(rs)) | ||
77 | #else | ||
78 | #define rset_picktop_(rs) ((Reg)lj_fls(rs)) | ||
79 | #define rset_pickbot_(rs) ((Reg)lj_ffs(rs)) | ||
80 | #endif | ||
81 | 78 | ||
82 | /* -- Register allocation cost -------------------------------------------- */ | 79 | /* -- Register allocation cost -------------------------------------------- */ |
83 | 80 | ||