2007-11-20 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / arch / amd64 / amd64-codegen.h
index e0127f12c0c621b6ab91c8c1bfe306e26721366a..c5cfda0a9644233531edca5ed3701973cf659a00 100644 (file)
@@ -156,17 +156,15 @@ typedef union {
 
 #define amd64_alu_reg_imm_size(inst,opc,reg,imm,size)  \
        do {    \
-               if ((reg) == X86_EAX) { \
-                       amd64_emit_rex(inst, size, 0, 0, 0); \
-                       *(inst)++ = (((unsigned char)(opc)) << 3) + 5;  \
-                       x86_imm_emit32 ((inst), (imm)); \
-                       break;  \
-               }       \
                if (x86_is_imm8((imm))) {       \
                        amd64_emit_rex(inst, size, 0, 0, (reg)); \
                        *(inst)++ = (unsigned char)0x83;        \
                        x86_reg_emit ((inst), (opc), (reg));    \
                        x86_imm_emit8 ((inst), (imm));  \
+               } else if ((reg) == X86_EAX) {  \
+                       amd64_emit_rex(inst, size, 0, 0, 0); \
+                       *(inst)++ = (((unsigned char)(opc)) << 3) + 5;  \
+                       x86_imm_emit32 ((inst), (imm)); \
                } else {        \
                        amd64_emit_rex(inst, size, 0, 0, (reg)); \
                        *(inst)++ = (unsigned char)0x81;        \