Bool allow_FX = False;
Bool allow_GX = False;
Bool allow_VX = False; // Equates to "supports Power ISA 2.06
+ Bool allow_DFP = False;
UInt hwcaps = archinfo->hwcaps;
Long delta;
allow_FX = (0 != (hwcaps & VEX_HWCAPS_PPC64_FX));
allow_GX = (0 != (hwcaps & VEX_HWCAPS_PPC64_GX));
allow_VX = (0 != (hwcaps & VEX_HWCAPS_PPC64_VX));
+ allow_DFP = (0 != (hwcaps & VEX_HWCAPS_PPC64_DFP));
} else {
allow_F = (0 != (hwcaps & VEX_HWCAPS_PPC32_F));
allow_V = (0 != (hwcaps & VEX_HWCAPS_PPC32_V));
allow_FX = (0 != (hwcaps & VEX_HWCAPS_PPC32_FX));
allow_GX = (0 != (hwcaps & VEX_HWCAPS_PPC32_GX));
allow_VX = (0 != (hwcaps & VEX_HWCAPS_PPC32_VX));
+ allow_DFP = (0 != (hwcaps & VEX_HWCAPS_PPC32_DFP));
}
/* The running delta */
case 0x202: // dsub - DFP Subtract
case 0x22: // dmul - DFP Mult
case 0x222: // ddiv - DFP Divide
- if (!allow_GX) goto decode_failure;
+ if (!allow_DFP) goto decode_noDFP;
if (dis_dfp_arith( theInstr ))
goto decode_success;
case 0x3CE: // fcfidus (implemented as native insn)
case 0x202: // dsubq - DFP Subtract
case 0x22: // dmulq - DFP Mult
case 0x222: // ddivq - DFP Divide
- if (!allow_GX) goto decode_failure;
+ if (!allow_DFP) goto decode_noDFP;
if (dis_dfp_arithq( theInstr ))
goto decode_success;
goto decode_failure;
vex_printf("disInstr(ppc): "
"declined to decode a Graphics-Optional insn.\n");
goto decode_failure;
+ decode_noDFP:
+ vassert(!allow_DFP);
+ vex_printf("disInstr(ppc): "
+ "declined to decode a Decimal Floating Point insn.\n");
+ goto decode_failure;
+
decode_failure:
/* All decode failures end up here. */
/* do some sanity checks */
mask32 = VEX_HWCAPS_PPC32_F | VEX_HWCAPS_PPC32_V
- | VEX_HWCAPS_PPC32_FX | VEX_HWCAPS_PPC32_GX | VEX_HWCAPS_PPC32_VX;
+ | VEX_HWCAPS_PPC32_FX | VEX_HWCAPS_PPC32_GX | VEX_HWCAPS_PPC32_VX
+ | VEX_HWCAPS_PPC32_DFP;
mask64 = VEX_HWCAPS_PPC64_V | VEX_HWCAPS_PPC64_FX
- | VEX_HWCAPS_PPC64_GX | VEX_HWCAPS_PPC64_VX;
+ | VEX_HWCAPS_PPC64_GX | VEX_HWCAPS_PPC64_VX | VEX_HWCAPS_PPC64_DFP;
if (mode64) {
vassert((hwcaps_guest & mask32) == 0);
/* do some sanity checks */
mask32 = VEX_HWCAPS_PPC32_F | VEX_HWCAPS_PPC32_V
- | VEX_HWCAPS_PPC32_FX | VEX_HWCAPS_PPC32_GX | VEX_HWCAPS_PPC32_VX;
+ | VEX_HWCAPS_PPC32_FX | VEX_HWCAPS_PPC32_GX | VEX_HWCAPS_PPC32_VX
+ | VEX_HWCAPS_PPC32_DFP;
mask64 = VEX_HWCAPS_PPC64_V | VEX_HWCAPS_PPC64_FX
- | VEX_HWCAPS_PPC64_GX | VEX_HWCAPS_PPC64_VX;
+ | VEX_HWCAPS_PPC64_GX | VEX_HWCAPS_PPC64_VX | VEX_HWCAPS_PPC64_DFP;
if (mode64) {
vassert((hwcaps_host & mask32) == 0);
const UInt FX = VEX_HWCAPS_PPC32_FX;
const UInt GX = VEX_HWCAPS_PPC32_GX;
const UInt VX = VEX_HWCAPS_PPC32_VX;
+ const UInt DFP = VEX_HWCAPS_PPC32_DFP;
UInt c = hwcaps;
if (c == 0) return "ppc32-int";
if (c == F) return "ppc32-int-flt";
if (c == (F|V|FX)) return "ppc32-int-flt-vmx-FX";
if (c == (F|V|GX)) return "ppc32-int-flt-vmx-GX";
if (c == (F|V|FX|GX)) return "ppc32-int-flt-vmx-FX-GX";
- if (c == (F|V|FX|GX|VX)) return "ppc32-int-flt-vmx-FX-GX-VX";
+ if (c == (F|V|FX|GX|DFP)) return "ppc32-int-flt-vmx-FX-GX-DFP";
+ if (c == (F|V|FX|GX|VX|DFP)) return "ppc32-int-flt-vmx-FX-GX-VX-DFP";
return NULL;
}
const UInt FX = VEX_HWCAPS_PPC64_FX;
const UInt GX = VEX_HWCAPS_PPC64_GX;
const UInt VX = VEX_HWCAPS_PPC64_VX;
+ const UInt DFP = VEX_HWCAPS_PPC64_DFP;
UInt c = hwcaps;
if (c == 0) return "ppc64-int-flt";
if (c == FX) return "ppc64-int-flt-FX";
if (c == (V|FX)) return "ppc64-int-flt-vmx-FX";
if (c == (V|GX)) return "ppc64-int-flt-vmx-GX";
if (c == (V|FX|GX)) return "ppc64-int-flt-vmx-FX-GX";
- if (c == (V|FX|GX|VX)) return "ppc64-int-flt-vmx-FX-GX-VX";
+ if (c == (V|FX|GX|DFP)) return "ppc64-int-flt-vmx-FX-GX-DFP";
+ if (c == (V|FX|GX|VX|DFP)) return "ppc64-int-flt-vmx-FX-GX-VX-DFP";
return NULL;
}
(fres,frsqrte,fsel,stfiwx) */
#define VEX_HWCAPS_PPC64_VX (1<<16) /* Vector-scalar floating-point (VSX); implies ISA 2.06 or higher */
+#define VEX_HWCAPS_PPC32_DFP (1<<17) /* Decimal Floating Point (DFP) -- e.g., dadd */
+#define VEX_HWCAPS_PPC64_DFP (1<<18) /* Decimal Floating Point (DFP) -- e.g., dadd */
+
/* s390x: Hardware capability encoding
Bits Information