Index: src/ppc/constants-ppc.h |
diff --git a/src/ppc/constants-ppc.h b/src/ppc/constants-ppc.h |
index b416e2fcc685c26da12dd6065459f262168e65bf..e1929dbf634c733c77925b034bb84d9a8f27cbf9 100644 |
--- a/src/ppc/constants-ppc.h |
+++ b/src/ppc/constants-ppc.h |
@@ -1077,125 +1077,141 @@ typedef uint32_t Instr; |
/* Vector Compare Greater Than Unsigned Word */ \ |
V(vcmpgtuw, VCMPGTUW, 0x10000286) |
-#define PPC_X_OPCODE_A_FORM_LIST(V) \ |
- /* Modulo Signed Dword */ \ |
- V(modsd, MODSD, 0x7C000612) \ |
- /* Modulo Unsigned Dword */ \ |
- V(modud, MODUD, 0x7C000212) \ |
- /* Modulo Signed Word */ \ |
- V(modsw, MODSW, 0x7C000616) \ |
- /* Modulo Unsigned Word */ \ |
- V(moduw, MODUW, 0x7C000216) \ |
- |
-#define PPC_X_OPCODE_B_FORM_LIST(V) \ |
- /* XOR */ \ |
- V(xor_, XORX, 0x7C000278) \ |
- /* AND */ \ |
- V(and_, ANDX, 0x7C000038) \ |
- /* AND with Complement */ \ |
- V(andc, ANDCX, 0x7C000078) \ |
- /* OR */ \ |
- V(orx, ORX, 0x7C000378) \ |
- /* OR with Complement */ \ |
- V(orc, ORC, 0x7C000338) \ |
- /* NOR */ \ |
- V(nor, NORX, 0x7C0000F8) \ |
- /* Shift Right Word */ \ |
- V(srw, SRWX, 0x7C000430) \ |
- /* Shift Left Word */ \ |
- V(slw, SLWX, 0x7C000030) \ |
- /* Shift Right Algebraic Word */ \ |
- V(sraw, SRAW, 0x7C000630) \ |
- /* Shift Left Doubleword */ \ |
- V(sld, SLDX, 0x7C000036) \ |
- /* Shift Right Algebraic Doubleword */ \ |
- V(srad, SRAD, 0x7C000634) \ |
- /* Shift Right Doubleword */ \ |
- V(srd, SRDX, 0x7C000436) \ |
- |
-#define PPC_X_OPCODE_C_FORM_LIST(V) \ |
- /* Count Leading Zeros Word */ \ |
- V(cntlzw, CNTLZWX, 0x7C000034) \ |
- /* Count Leading Zeros Doubleword */ \ |
- V(cntlzd, CNTLZDX, 0x7C000074) \ |
- /* Population Count Byte-wise */ \ |
- V(popcntb, POPCNTB, 0x7C0000F4) \ |
- /* Population Count Words */ \ |
- V(popcntw, POPCNTW, 0x7C0002F4) \ |
- /* Population Count Doubleword */ \ |
- V(popcntd, POPCNTD, 0x7C0003F4) \ |
- /* Extend Sign Byte */ \ |
- V(extsb, EXTSB, 0x7C000774) \ |
- /* Extend Sign Halfword */ \ |
- V(extsh, EXTSH, 0x7C000734) \ |
- |
-#define PPC_X_OPCODE_D_FORM_LIST(V) \ |
- /* Load Halfword Byte-Reverse Indexed */ \ |
- V(lhbrx, LHBRX, 0x7C00062C) \ |
- /* Load Word Byte-Reverse Indexed */ \ |
- V(lwbrx, LWBRX, 0x7C00042C) \ |
- /* Load Doubleword Byte-Reverse Indexed */ \ |
- V(ldbrx, LDBRX, 0x7C000428) \ |
- /* Load Byte and Zero Indexed */ \ |
- V(lbzx, LBZX, 0x7C0000AE) \ |
- /* Load Byte and Zero with Update Indexed */ \ |
- V(lbzux, LBZUX, 0x7C0000EE) \ |
- /* Load Halfword and Zero Indexed */ \ |
- V(lhzx, LHZX, 0x7C00022E) \ |
- /* Load Halfword and Zero with Update Indexed */ \ |
- V(lhzux, LHZUX, 0x7C00026E) \ |
- /* Load Halfword Algebraic Indexed */ \ |
- V(lhax, LHAX, 0x7C0002AE) \ |
- /* Load Word and Zero Indexed */ \ |
- V(lwzx, LWZX, 0x7C00002E) \ |
- /* Load Word and Zero with Update Indexed */ \ |
- V(lwzux, LWZUX, 0x7C00006E) \ |
- /* Load Doubleword Indexed */ \ |
- V(ldx, LDX, 0x7C00002A) \ |
- /* Load Doubleword with Update Indexed */ \ |
- V(ldux, LDUX, 0x7C00006A) \ |
- /* Load Floating-Point Double Indexed */ \ |
- V(lfdx, LFDX, 0x7C0004AE) \ |
- /* Load Floating-Point Single Indexed */ \ |
- V(lfsx, LFSX, 0x7C00042E) \ |
- /* Load Floating-Point Double with Update Indexed */ \ |
- V(lfdux, LFDUX, 0x7C0004EE) \ |
- /* Load Floating-Point Single with Update Indexed */ \ |
- V(lfsux, LFSUX, 0x7C00046E) \ |
- /* Store Byte with Update Indexed */ \ |
- V(stbux, STBUX, 0x7C0001EE) \ |
- /* Store Byte Indexed */ \ |
- V(stbx, STBX, 0x7C0001AE) \ |
- /* Store Halfword with Update Indexed */ \ |
- V(sthux, STHUX, 0x7C00036E) \ |
- /* Store Halfword Indexed */ \ |
- V(sthx, STHX, 0x7C00032E) \ |
- /* Store Word with Update Indexed */ \ |
- V(stwux, STWUX, 0x7C00016E) \ |
- /* Store Word Indexed */ \ |
- V(stwx, STWX, 0x7C00012E) \ |
- /* Store Doubleword with Update Indexed */ \ |
- V(stdux, STDUX, 0x7C00016A) \ |
- /* Store Doubleword Indexed */ \ |
- V(stdx, STDX, 0x7C00012A) \ |
- /* Store Floating-Point Double with Update Indexed */ \ |
- V(stfdux, STFDUX, 0x7C0005EE) \ |
- /* Store Floating-Point Double Indexed */ \ |
- V(stfdx, STFDX, 0x7C0005AE) \ |
- /* Store Floating-Point Single with Update Indexed */ \ |
- V(stfsux, STFSUX, 0x7C00056E) \ |
- /* Store Floating-Point Single Indexed */ \ |
- V(stfsx, STFSX, 0x7C00052E) \ |
- |
-#define PPC_X_OPCODE_E_FORM_LIST(V) \ |
- /* Shift Right Algebraic Word Immediate */ \ |
- V(srawi, SRAWIX, 0x7C000670) \ |
- |
-#define PPC_X_OPCODE_F_FORM_LIST(V) \ |
- /* Compare */ \ |
- V(cmp, CMP, 0x7C000000) \ |
- /* Compare Logical */ \ |
- V(cmpl, CMPL, 0x7C000040) \ |
+#define PPC_X_OPCODE_A_FORM_LIST(V) \ |
+ /* Modulo Signed Dword */ \ |
+ V(modsd, MODSD, 0x7C000612) \ |
+ /* Modulo Unsigned Dword */ \ |
+ V(modud, MODUD, 0x7C000212) \ |
+ /* Modulo Signed Word */ \ |
+ V(modsw, MODSW, 0x7C000616) \ |
+ /* Modulo Unsigned Word */ \ |
+ V(moduw, MODUW, 0x7C000216) |
+ |
+#define PPC_X_OPCODE_B_FORM_LIST(V) \ |
+ /* XOR */ \ |
+ V(xor_, XORX, 0x7C000278) \ |
+ /* AND */ \ |
+ V(and_, ANDX, 0x7C000038) \ |
+ /* AND with Complement */ \ |
+ V(andc, ANDCX, 0x7C000078) \ |
+ /* OR */ \ |
+ V(orx, ORX, 0x7C000378) \ |
+ /* OR with Complement */ \ |
+ V(orc, ORC, 0x7C000338) \ |
+ /* NOR */ \ |
+ V(nor, NORX, 0x7C0000F8) \ |
+ /* Shift Right Word */ \ |
+ V(srw, SRWX, 0x7C000430) \ |
+ /* Shift Left Word */ \ |
+ V(slw, SLWX, 0x7C000030) \ |
+ /* Shift Right Algebraic Word */ \ |
+ V(sraw, SRAW, 0x7C000630) \ |
+ /* Shift Left Doubleword */ \ |
+ V(sld, SLDX, 0x7C000036) \ |
+ /* Shift Right Algebraic Doubleword */ \ |
+ V(srad, SRAD, 0x7C000634) \ |
+ /* Shift Right Doubleword */ \ |
+ V(srd, SRDX, 0x7C000436) |
+ |
+#define PPC_X_OPCODE_C_FORM_LIST(V) \ |
+ /* Count Leading Zeros Word */ \ |
+ V(cntlzw, CNTLZWX, 0x7C000034) \ |
+ /* Count Leading Zeros Doubleword */ \ |
+ V(cntlzd, CNTLZDX, 0x7C000074) \ |
+ /* Population Count Byte-wise */ \ |
+ V(popcntb, POPCNTB, 0x7C0000F4) \ |
+ /* Population Count Words */ \ |
+ V(popcntw, POPCNTW, 0x7C0002F4) \ |
+ /* Population Count Doubleword */ \ |
+ V(popcntd, POPCNTD, 0x7C0003F4) \ |
+ /* Extend Sign Byte */ \ |
+ V(extsb, EXTSB, 0x7C000774) \ |
+ /* Extend Sign Halfword */ \ |
+ V(extsh, EXTSH, 0x7C000734) |
+ |
+#define PPC_X_OPCODE_D_FORM_LIST(V) \ |
+ /* Load Halfword Byte-Reverse Indexed */ \ |
+ V(lhbrx, LHBRX, 0x7C00062C) \ |
+ /* Load Word Byte-Reverse Indexed */ \ |
+ V(lwbrx, LWBRX, 0x7C00042C) \ |
+ /* Load Doubleword Byte-Reverse Indexed */ \ |
+ V(ldbrx, LDBRX, 0x7C000428) \ |
+ /* Load Byte and Zero Indexed */ \ |
+ V(lbzx, LBZX, 0x7C0000AE) \ |
+ /* Load Byte and Zero with Update Indexed */ \ |
+ V(lbzux, LBZUX, 0x7C0000EE) \ |
+ /* Load Halfword and Zero Indexed */ \ |
+ V(lhzx, LHZX, 0x7C00022E) \ |
+ /* Load Halfword and Zero with Update Indexed */ \ |
+ V(lhzux, LHZUX, 0x7C00026E) \ |
+ /* Load Halfword Algebraic Indexed */ \ |
+ V(lhax, LHAX, 0x7C0002AE) \ |
+ /* Load Word and Zero Indexed */ \ |
+ V(lwzx, LWZX, 0x7C00002E) \ |
+ /* Load Word and Zero with Update Indexed */ \ |
+ V(lwzux, LWZUX, 0x7C00006E) \ |
+ /* Load Doubleword Indexed */ \ |
+ V(ldx, LDX, 0x7C00002A) \ |
+ /* Load Doubleword with Update Indexed */ \ |
+ V(ldux, LDUX, 0x7C00006A) \ |
+ /* Load Floating-Point Double Indexed */ \ |
+ V(lfdx, LFDX, 0x7C0004AE) \ |
+ /* Load Floating-Point Single Indexed */ \ |
+ V(lfsx, LFSX, 0x7C00042E) \ |
+ /* Load Floating-Point Double with Update Indexed */ \ |
+ V(lfdux, LFDUX, 0x7C0004EE) \ |
+ /* Load Floating-Point Single with Update Indexed */ \ |
+ V(lfsux, LFSUX, 0x7C00046E) \ |
+ /* Store Byte with Update Indexed */ \ |
+ V(stbux, STBUX, 0x7C0001EE) \ |
+ /* Store Byte Indexed */ \ |
+ V(stbx, STBX, 0x7C0001AE) \ |
+ /* Store Halfword with Update Indexed */ \ |
+ V(sthux, STHUX, 0x7C00036E) \ |
+ /* Store Halfword Indexed */ \ |
+ V(sthx, STHX, 0x7C00032E) \ |
+ /* Store Word with Update Indexed */ \ |
+ V(stwux, STWUX, 0x7C00016E) \ |
+ /* Store Word Indexed */ \ |
+ V(stwx, STWX, 0x7C00012E) \ |
+ /* Store Doubleword with Update Indexed */ \ |
+ V(stdux, STDUX, 0x7C00016A) \ |
+ /* Store Doubleword Indexed */ \ |
+ V(stdx, STDX, 0x7C00012A) \ |
+ /* Store Floating-Point Double with Update Indexed */ \ |
+ V(stfdux, STFDUX, 0x7C0005EE) \ |
+ /* Store Floating-Point Double Indexed */ \ |
+ V(stfdx, STFDX, 0x7C0005AE) \ |
+ /* Store Floating-Point Single with Update Indexed */ \ |
+ V(stfsux, STFSUX, 0x7C00056E) \ |
+ /* Store Floating-Point Single Indexed */ \ |
+ V(stfsx, STFSX, 0x7C00052E) |
+ |
+#define PPC_X_OPCODE_E_FORM_LIST(V) \ |
+ /* Shift Right Algebraic Word Immediate */ \ |
+ V(srawi, SRAWIX, 0x7C000670) |
+ |
+#define PPC_X_OPCODE_F_FORM_LIST(V) \ |
+ /* Compare */ \ |
+ V(cmp, CMP, 0x7C000000) \ |
+ /* Compare Logical */ \ |
+ V(cmpl, CMPL, 0x7C000040) |
+ |
+#define PPC_X_OPCODE_EH_S_FORM_LIST(V) \ |
+ /* Store Byte Conditional Indexed */ \ |
+ V(stbcx, STBCX, 0x7C00056D) \ |
+ /* Store Halfword Conditional Indexed Xform */ \ |
+ V(sthcx, STHCX, 0x7C0005AD) \ |
+ /* Store Word Conditional Indexed & record CR0 */ \ |
+ V(stwcx, STWCX, 0x7C00012D) |
+ |
+#define PPC_X_OPCODE_EH_L_FORM_LIST(V) \ |
+ /* Load Byte And Reserve Indexed */ \ |
+ V(lbarx, LBARX, 0x7C000068) \ |
+ /* Load Halfword And Reserve Indexed Xform */ \ |
+ V(lharx, LHARX, 0x7C0000E8) \ |
+ /* Load Word and Reserve Indexed */ \ |
+ V(lwarx, LWARX, 0x7C000028) |
#define PPC_X_OPCODE_UNUSED_LIST(V) \ |
/* Bit Permute Doubleword */ \ |
@@ -1234,28 +1250,14 @@ typedef uint32_t Instr; |
V(eqv, EQV, 0x7C000238) \ |
/* Instruction Cache Block Invalidate */ \ |
V(icbi, ICBI, 0x7C0007AC) \ |
- /* Load Byte And Reserve Indexed */ \ |
- V(lbarx, LBARX, 0x7C000068) \ |
- /* Load Halfword And Reserve Indexed Xform */ \ |
- V(lharx, LHARX, 0x7C0000E8) \ |
- /* Load Halfword Algebraic with Update Indexed */ \ |
- V(lhaux, LHAUX, 0x7C0002EE) \ |
- /* Load Word and Reserve Indexed */ \ |
- V(lwarx, LWARX, 0x7C000028) \ |
/* NAND */ \ |
V(nand, NAND, 0x7C0003B8) \ |
/* Parity Word */ \ |
V(prtyw, PRTYW, 0x7C000134) \ |
- /* Store Byte Conditional Indexed */ \ |
- V(stbcx, STBCX, 0x7C00056D) \ |
/* Store Halfword Byte-Reverse Indexed */ \ |
V(sthbrx, STHBRX, 0x7C00072C) \ |
- /* Store Halfword Conditional Indexed Xform */ \ |
- V(sthcx, STHCX, 0x7C0005AD) \ |
/* Store Word Byte-Reverse Indexed */ \ |
V(stwbrx, STWBRX, 0x7C00052C) \ |
- /* Store Word Conditional Indexed & record CR0 */ \ |
- V(stwcx, STWCX, 0x7C00012D) \ |
/* Synchronize */ \ |
V(sync, SYNC, 0x7C0004AC) \ |
/* Trap Word */ \ |
@@ -1670,16 +1672,16 @@ typedef uint32_t Instr; |
/* Wait for Interrupt */ \ |
V(wait, WAIT, 0x7C00007C) |
-#define PPC_X_OPCODE_LIST(V) \ |
- PPC_X_OPCODE_A_FORM_LIST(V) \ |
- PPC_X_OPCODE_B_FORM_LIST(V) \ |
- PPC_X_OPCODE_C_FORM_LIST(V) \ |
- PPC_X_OPCODE_D_FORM_LIST(V) \ |
- PPC_X_OPCODE_E_FORM_LIST(V) \ |
- PPC_X_OPCODE_F_FORM_LIST(V) \ |
+#define PPC_X_OPCODE_LIST(V) \ |
+ PPC_X_OPCODE_A_FORM_LIST(V) \ |
+ PPC_X_OPCODE_B_FORM_LIST(V) \ |
+ PPC_X_OPCODE_C_FORM_LIST(V) \ |
+ PPC_X_OPCODE_D_FORM_LIST(V) \ |
+ PPC_X_OPCODE_E_FORM_LIST(V) \ |
+ PPC_X_OPCODE_F_FORM_LIST(V) \ |
+ PPC_X_OPCODE_EH_L_FORM_LIST(V) \ |
PPC_X_OPCODE_UNUSED_LIST(V) |
- |
#define PPC_EVS_OPCODE_LIST(V) \ |
/* Vector Select */ \ |
V(evsel, EVSEL, 0x10000278) |
@@ -2507,37 +2509,36 @@ typedef uint32_t Instr; |
/* System Call */ \ |
V(sc, SC, 0x44000002) |
- |
-#define PPC_OPCODE_LIST(V) \ |
- PPC_X_OPCODE_LIST(V) \ |
- PPC_XO_OPCODE_LIST(V) \ |
- PPC_DS_OPCODE_LIST(V) \ |
- PPC_DQ_OPCODE_LIST(V) \ |
- PPC_MDS_OPCODE_LIST(V) \ |
- PPC_MD_OPCODE_LIST(V) \ |
- PPC_XS_OPCODE_LIST(V) \ |
- PPC_D_OPCODE_LIST(V) \ |
- PPC_I_OPCODE_LIST(V) \ |
- PPC_B_OPCODE_LIST(V) \ |
- PPC_XL_OPCODE_LIST(V) \ |
- PPC_A_OPCODE_LIST(V) \ |
- PPC_XFX_OPCODE_LIST(V) \ |
- PPC_M_OPCODE_LIST(V) \ |
- PPC_SC_OPCODE_LIST(V) \ |
- PPC_Z23_OPCODE_LIST(V) \ |
- PPC_Z22_OPCODE_LIST(V) \ |
- PPC_EVX_OPCODE_LIST(V) \ |
- PPC_XFL_OPCODE_LIST(V) \ |
- PPC_EVS_OPCODE_LIST(V) \ |
- PPC_VX_OPCODE_LIST(V) \ |
- PPC_VA_OPCODE_LIST(V) \ |
- PPC_VC_OPCODE_LIST(V) \ |
- PPC_XX1_OPCODE_LIST(V) \ |
- PPC_XX2_OPCODE_LIST(V) \ |
- PPC_XX3_OPCODE_LIST(V) \ |
+#define PPC_OPCODE_LIST(V) \ |
+ PPC_X_OPCODE_LIST(V) \ |
+ PPC_X_OPCODE_EH_S_FORM_LIST(V) \ |
+ PPC_XO_OPCODE_LIST(V) \ |
+ PPC_DS_OPCODE_LIST(V) \ |
+ PPC_DQ_OPCODE_LIST(V) \ |
+ PPC_MDS_OPCODE_LIST(V) \ |
+ PPC_MD_OPCODE_LIST(V) \ |
+ PPC_XS_OPCODE_LIST(V) \ |
+ PPC_D_OPCODE_LIST(V) \ |
+ PPC_I_OPCODE_LIST(V) \ |
+ PPC_B_OPCODE_LIST(V) \ |
+ PPC_XL_OPCODE_LIST(V) \ |
+ PPC_A_OPCODE_LIST(V) \ |
+ PPC_XFX_OPCODE_LIST(V) \ |
+ PPC_M_OPCODE_LIST(V) \ |
+ PPC_SC_OPCODE_LIST(V) \ |
+ PPC_Z23_OPCODE_LIST(V) \ |
+ PPC_Z22_OPCODE_LIST(V) \ |
+ PPC_EVX_OPCODE_LIST(V) \ |
+ PPC_XFL_OPCODE_LIST(V) \ |
+ PPC_EVS_OPCODE_LIST(V) \ |
+ PPC_VX_OPCODE_LIST(V) \ |
+ PPC_VA_OPCODE_LIST(V) \ |
+ PPC_VC_OPCODE_LIST(V) \ |
+ PPC_XX1_OPCODE_LIST(V) \ |
+ PPC_XX2_OPCODE_LIST(V) \ |
+ PPC_XX3_OPCODE_LIST(V) \ |
PPC_XX4_OPCODE_LIST(V) |
- |
enum Opcode : uint32_t { |
#define DECLARE_INSTRUCTION(name, opcode_name, opcode_value) \ |
opcode_name = opcode_value, |
@@ -2616,6 +2617,11 @@ enum RCBit { // Bit 0 |
SetRC = 1, // LT,GT,EQ,SO |
LeaveRC = 0 // None |
}; |
+// Exclusive Access hint bit |
+enum EHBit { // Bit 0 |
+ SetEH = 1, // Exclusive Access |
+ LeaveEH = 0 // Atomic Update |
+}; |
// Link bit |
enum LKBit { // Bit 0 |
@@ -2813,7 +2819,8 @@ class Instruction { |
opcode = extcode | BitField(10, 0); |
switch (opcode) { |
PPC_VX_OPCODE_LIST(OPCODE_CASES) |
- return static_cast<Opcode>(opcode); |
+ PPC_X_OPCODE_EH_S_FORM_LIST(OPCODE_CASES) |
+ return static_cast<Opcode>(opcode); |
} |
opcode = extcode | BitField(9, 0); |
switch (opcode) { |