[arm] Fix codegen for multiply instructions
authorVlad Brezae <brezaevlad@gmail.com>
Sun, 13 Dec 2015 22:13:00 +0000 (00:13 +0200)
committerVlad Brezae <brezaevlad@gmail.com>
Sun, 27 Dec 2015 09:51:29 +0000 (11:51 +0200)
The code worked because we never used mul with CPSR update and the code for ARMOP_MUL happens to be 0.

mono/arch/arm/arm-codegen.h

index 5ba36bbfaa8bafd5bb394a58b06437e2ea307cf4..3ee083f8010ffdf7bad83cc527f8d32e078e6b00 100644 (file)
@@ -485,19 +485,15 @@ typedef struct {
        arminstr_t cond   : 4;
 } ARMInstrMul;
 
-#define ARM_MUL_ID 0
-#define ARM_MUL_ID2 9
-#define ARM_MUL_MASK ((0xF << 24) | (0xF << 4))
-#define ARM_MUL_TAG ((ARM_MUL_ID << 24) | (ARM_MUL_ID2 << 4))
-
+#define ARM_MUL_ID 9
 #define ARM_DEF_MUL_COND(op, rd, rm, rs, rn, s, cond) \
        (rm)             | \
+       ARM_MUL_ID << 4  | \
        ((rs) << 8)      | \
        ((rn) << 12)     | \
        ((rd) << 16)     | \
-       ((s & 1) << 17)  | \
-       ((op & 7) << 18) | \
-       ARM_MUL_TAG      | \
+       ((s & 1) << 20)  | \
+       ((op & 7) << 21) | \
        ARM_DEF_COND(cond)
 
 /* Rd := (Rm * Rs)[31:0]; 32 x 32 -> 32 */