Skip to content

Commit d40f326

Browse files
authored
[LoongArch64] amend the gcinfo. (#85092)
1 parent 470145b commit d40f326

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/coreclr/inc/gcinfotypes.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -783,8 +783,8 @@ void FASTCALL decodeCallPattern(int pattern,
783783
#define DENORMALIZE_STACK_SLOT(x) ((x)<<3)
784784
#define NORMALIZE_CODE_LENGTH(x) ((x)>>2) // All Instructions are 4 bytes long
785785
#define DENORMALIZE_CODE_LENGTH(x) ((x)<<2)
786-
#define NORMALIZE_STACK_BASE_REGISTER(x) ((x)^22) // Encode Frame pointer fp=$22 as zero
787-
#define DENORMALIZE_STACK_BASE_REGISTER(x) ((x)^22)
786+
#define NORMALIZE_STACK_BASE_REGISTER(x) ((x) == 22 ? 0 : 1) // Encode Frame pointer fp=$22 as zero
787+
#define DENORMALIZE_STACK_BASE_REGISTER(x) ((x) == 0 ? 22 : 3)
788788
#define NORMALIZE_SIZE_OF_STACK_AREA(x) ((x)>>3)
789789
#define DENORMALIZE_SIZE_OF_STACK_AREA(x) ((x)<<3)
790790
#define CODE_OFFSETS_NEED_NORMALIZATION 0
@@ -804,8 +804,7 @@ void FASTCALL decodeCallPattern(int pattern,
804804
#define CODE_LENGTH_ENCBASE 8
805805
#define SIZE_OF_RETURN_KIND_IN_SLIM_HEADER 2
806806
#define SIZE_OF_RETURN_KIND_IN_FAT_HEADER 4
807-
////TODO for LOONGARCH64.
808-
// FP/SP encoded as 0 or 2 ??
807+
// FP/SP encoded as 0 or 1.
809808
#define STACK_BASE_REGISTER_ENCBASE 2
810809
#define SIZE_OF_STACK_AREA_ENCBASE 3
811810
#define SIZE_OF_EDIT_AND_CONTINUE_PRESERVED_AREA_ENCBASE 4

0 commit comments

Comments
 (0)