Skip to content

Commit

Permalink
loongarch: Add SLJIT_UPPER_BITS_SIGN_EXTENDED (#276)
Browse files Browse the repository at this point in the history
Notice that in LoongArch V1.1 (LA664 and later), the
SLJIT_UPPER_BITS_IGNORED should also be true, however due to a
micro-architecture bug, 3A5000 (LA464) will needs the upper 32
bits of source register is sign extended while doing 32 bits
division (e.g. div.w), otherwise it will output garbage result.

See: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html
Chapter 1.5.1 Item 7
  • Loading branch information
lrzlin authored Nov 19, 2024
1 parent c0fd3d1 commit 9dc3a4c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sljit_src/sljitConfigInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_sw sljit_exec_offset(void *code);
#define SLJIT_LOCALS_OFFSET_BASE 0
#define SLJIT_MASKED_SHIFT 1
#define SLJIT_MASKED_SHIFT32 1
#define SLJIT_UPPER_BITS_SIGN_EXTENDED 1

#elif (defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED)

Expand Down

0 comments on commit 9dc3a4c

Please sign in to comment.