[RISC-V][JIT] Fix encoding of CallGCregs (#87467)
authorDong-Heon Jung <clamp03@gmail.com>
Tue, 13 Jun 2023 19:18:09 +0000 (04:18 +0900)
committerGitHub <noreply@github.com>
Tue, 13 Jun 2023 19:18:09 +0000 (21:18 +0200)
- It fixes what Encoding and Decoding logic handle CallGCregs differently.

src/coreclr/jit/emitinl.h

index 488ba76..ec35ecc 100644 (file)
@@ -376,23 +376,23 @@ inline ssize_t emitter::emitGetInsAmdAny(instrDesc* id)
         encodeMask |= 0x08;
     if ((regmask & RBM_S5) != RBM_NONE)
         encodeMask |= 0x10;
+    if ((regmask & RBM_S6) != RBM_NONE)
+        encodeMask |= 0x20;
 
     id->idReg1((regNumber)encodeMask); // Save in idReg1
 
     encodeMask = 0;
 
-    if ((regmask & RBM_S6) != RBM_NONE)
-        encodeMask |= 0x01;
     if ((regmask & RBM_S7) != RBM_NONE)
-        encodeMask |= 0x02;
+        encodeMask |= 0x01;
     if ((regmask & RBM_S8) != RBM_NONE)
-        encodeMask |= 0x04;
+        encodeMask |= 0x02;
     if ((regmask & RBM_S9) != RBM_NONE)
-        encodeMask |= 0x08;
+        encodeMask |= 0x04;
     if ((regmask & RBM_S10) != RBM_NONE)
-        encodeMask |= 0x10;
+        encodeMask |= 0x08;
     if ((regmask & RBM_S11) != RBM_NONE)
-        encodeMask |= 0x20;
+        encodeMask |= 0x10;
 
     id->idReg2((regNumber)encodeMask); // Save in idReg2