Previous 199869 Revisions Next

r17688 Friday 7th September, 2012 at 02:20:41 UTC by R. Belmont
DRC: Give C backend x86/x64 shift=0 behavior for consistency [R. Belmont]
[src/emu/cpu]drcbec.c

trunk/src/emu/cpu/drcbec.c
r17687r17688
982982         case MAKE_OPCODE_SHORT(OP_CMP, 4, 1):      // CMP     src1,src2[,f]
983983            temp32 = PARAM0 - PARAM1;
984984            flags = FLAGS32_NZCV_SUB(temp32, PARAM0, PARAM1);
985//                printf("CMP: %08x - %08x = flags %x\n", PARAM0, PARAM1, flags);
985986            break;
986987
987988         case MAKE_OPCODE_SHORT(OP_MULU, 4, 0):      // MULU    dst,edst,src1,src2[,f]
r17687r17688
11201121         case MAKE_OPCODE_SHORT(OP_SHL, 4, 1):
11211122            shift = PARAM2 & 31;
11221123            temp32 = PARAM1 << shift;
1123            flags = FLAGS32_NZ(temp32);
1124            if (shift != 0) flags |= ((PARAM1 << (shift - 1)) >> 31) & FLAG_C;
1124            if (shift != 0)
1125                {
1126                    flags = FLAGS32_NZ(temp32);
1127                    flags |= ((PARAM1 << (shift - 1)) >> 31) & FLAG_C;
1128                }
11251129            PARAM0 = temp32;
11261130            break;
11271131
r17687r17688
11321136         case MAKE_OPCODE_SHORT(OP_SHR, 4, 1):
11331137            shift = PARAM2 & 31;
11341138            temp32 = PARAM1 >> shift;
1135            flags = FLAGS32_NZ(temp32);
1136            if (shift != 0) flags |= (PARAM1 >> (shift - 1)) & FLAG_C;
1139            if (shift != 0)
1140                {
1141                    flags = FLAGS32_NZ(temp32);
1142                    flags |= (PARAM1 >> (shift - 1)) & FLAG_C;
1143                }
11371144            PARAM0 = temp32;
11381145            break;
11391146
r17687r17688
11441151         case MAKE_OPCODE_SHORT(OP_SAR, 4, 1):
11451152            shift = PARAM2 & 31;
11461153            temp32 = (INT32)PARAM1 >> shift;
1147            flags = FLAGS32_NZ(temp32);
1148            if (shift != 0) flags |= (PARAM1 >> (shift - 1)) & FLAG_C;
1154            if (shift != 0)
1155                {
1156                    flags = FLAGS32_NZ(temp32);
1157                    flags |= (PARAM1 >> (shift - 1)) & FLAG_C;
1158                }
11491159            PARAM0 = temp32;
11501160            break;
11511161
r17687r17688
11571167         case MAKE_OPCODE_SHORT(OP_ROL, 4, 1):
11581168            shift = PARAM2 & 31;
11591169            temp32 = (PARAM1 << shift) | (PARAM1 >> ((32 - shift) & 31));
1160            flags = FLAGS32_NZ(temp32);
1161            if (shift != 0) flags |= ((PARAM1 << (shift - 1)) >> 31) & FLAG_C;
1170            if (shift != 0)
1171                {
1172                    flags = FLAGS32_NZ(temp32);
1173                    flags |= ((PARAM1 << (shift - 1)) >> 31) & FLAG_C;
1174                }
11621175            PARAM0 = temp32;
11631176            break;
11641177

Previous 199869 Revisions Next


© 1997-2024 The MAME Team