Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: src/ppc/constants-ppc.h

Issue 2775413002: PPC: Declare X format assembler function with opcode list macro (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ppc/assembler-ppc.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/constants-ppc.h
diff --git a/src/ppc/constants-ppc.h b/src/ppc/constants-ppc.h
index 12a6a86409ed8b96295827245fb58ed204e1308b..b416e2fcc685c26da12dd6065459f262168e65bf 100644
--- a/src/ppc/constants-ppc.h
+++ b/src/ppc/constants-ppc.h
@@ -1077,63 +1077,149 @@ typedef uint32_t Instr;
/* Vector Compare Greater Than Unsigned Word */ \
V(vcmpgtuw, VCMPGTUW, 0x10000286)
-#define PPC_X_OPCODE_LIST(V) \
- /* Bit Permute Doubleword */ \
- V(bpermd, BPERMD, 0x7C0001F8) \
+#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) \
- /* Extend Sign Word */ \
- V(extsw, EXTSW, 0x7C0007B4) \
- /* Load Doubleword And Reserve Indexed */ \
- V(ldarx, LDARX, 0x7C0000A8) \
+ /* 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 Doubleword with Update Indexed */ \
- V(ldux, LDUX, 0x7C00006A) \
+ /* 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_UNUSED_LIST(V) \
+ /* Bit Permute Doubleword */ \
+ V(bpermd, BPERMD, 0x7C0001F8) \
+ /* Extend Sign Word */ \
+ V(extsw, EXTSW, 0x7C0007B4) \
+ /* Load Doubleword And Reserve Indexed */ \
+ V(ldarx, LDARX, 0x7C0000A8) \
/* Load Word Algebraic with Update Indexed */ \
V(lwaux, LWAUX, 0x7C0002EA) \
/* Load Word Algebraic Indexed */ \
V(lwax, LWAX, 0x7C0002AA) \
- /* Modulo Signed Dword */ \
- V(modsd, MODSD, 0x7C000612) \
- /* Modulo Unsigned Dword */ \
- V(modud, MODUD, 0x7C000212) \
- /* Population Count Doubleword */ \
- V(popcntd, POPCNTD, 0x7C0003F4) \
/* Parity Doubleword */ \
V(prtyd, PRTYD, 0x7C000174) \
- /* Shift Left Doubleword */ \
- V(sld, SLDX, 0x7C000036) \
- /* Shift Right Algebraic Doubleword */ \
- V(srad, SRAD, 0x7C000634) \
- /* Shift Right Doubleword */ \
- V(srd, SRDX, 0x7C000436) \
/* Store Doubleword Byte-Reverse Indexed */ \
V(stdbrx, STDBRX, 0x7C000528) \
/* Store Doubleword Conditional Indexed & record CR0 */ \
V(stdcx, STDCX, 0x7C0001AD) \
- /* Store Doubleword with Update Indexed */ \
- V(stdux, STDUX, 0x7C00016A) \
- /* Store Doubleword Indexed */ \
- V(stdx, STDX, 0x7C00012A) \
/* Trap Doubleword */ \
V(td, TD, 0x7C000088) \
- /* AND */ \
- V(andx, ANDX, 0x7C000038) \
- /* AND with Complement */ \
- V(andc, ANDCX, 0x7C000078) \
/* Branch Conditional to Branch Target Address Register */ \
V(bctar, BCTAR, 0x4C000460) \
- /* Compare */ \
- V(cmp, CMP, 0x7C000000) \
/* Compare Byte */ \
V(cmpb, CMPB, 0x7C0003F8) \
- /* Compare Logical */ \
- V(cmpl, CMPL, 0x7C000040) \
- /* Count Leading Zeros Word */ \
- V(cntlzw, CNTLZWX, 0x7C000034) \
/* Data Cache Block Flush */ \
V(dcbf, DCBF, 0x7C0000AC) \
/* Data Cache Block Store */ \
@@ -1146,94 +1232,36 @@ typedef uint32_t Instr;
V(dcbz, DCBZ, 0x7C0007EC) \
/* Equivalent */ \
V(eqv, EQV, 0x7C000238) \
- /* Extend Sign Byte */ \
- V(extsb, EXTSB, 0x7C000774) \
- /* Extend Sign Halfword */ \
- V(extsh, EXTSH, 0x7C000734) \
/* Instruction Cache Block Invalidate */ \
V(icbi, ICBI, 0x7C0007AC) \
/* Load Byte And Reserve Indexed */ \
V(lbarx, LBARX, 0x7C000068) \
- /* Load Byte and Zero with Update Indexed */ \
- V(lbzux, LBZUX, 0x7C0000EE) \
- /* Load Byte and Zero Indexed */ \
- V(lbzx, LBZX, 0x7C0000AE) \
/* Load Halfword And Reserve Indexed Xform */ \
V(lharx, LHARX, 0x7C0000E8) \
/* Load Halfword Algebraic with Update Indexed */ \
V(lhaux, LHAUX, 0x7C0002EE) \
- /* Load Halfword Algebraic Indexed */ \
- V(lhax, LHAX, 0x7C0002AE) \
- /* Load Halfword Byte-Reverse Indexed */ \
- V(lhbrx, LHBRX, 0x7C00062C) \
- /* Load Halfword and Zero with Update Indexed */ \
- V(lhzux, LHZUX, 0x7C00026E) \
- /* Load Halfword and Zero Indexed */ \
- V(lhzx, LHZX, 0x7C00022E) \
/* Load Word and Reserve Indexed */ \
V(lwarx, LWARX, 0x7C000028) \
- /* Load Word Byte-Reverse Indexed */ \
- V(lwbrx, LWBRX, 0x7C00042C) \
- /* Load Word and Zero with Update Indexed */ \
- V(lwzux, LWZUX, 0x7C00006E) \
- /* Load Word and Zero Indexed */ \
- V(lwzx, LWZX, 0x7C00002E) \
- /* Modulo Signed Word */ \
- V(mods, MODSW, 0x7C000616) \
- /* Modulo Unsigned Word */ \
- V(moduw, MODUW, 0x7C000216) \
/* NAND */ \
V(nand, NAND, 0x7C0003B8) \
- /* NOR */ \
- V(nor, NORX, 0x7C0000F8) \
- /* OR */ \
- V(orx, ORX, 0x7C000378) \
- /* OR with Complement */ \
- V(orc, ORC, 0x7C000338) \
- /* Population Count Byte-wise */ \
- V(popcntb, POPCNTB, 0x7C0000F4) \
- /* Population Count Words */ \
- V(popcntw, POPCNTW, 0x7C0002F4) \
/* Parity Word */ \
V(prtyw, PRTYW, 0x7C000134) \
- /* Shift Left Word */ \
- V(slw, SLWX, 0x7C000030) \
- /* Shift Right Algebraic Word */ \
- V(sraw, SRAW, 0x7C000630) \
- /* Shift Right Algebraic Word Immediate */ \
- V(srawi, SRAWIX, 0x7C000670) \
- /* Shift Right Word */ \
- V(srw, SRWX, 0x7C000430) \
/* Store Byte Conditional Indexed */ \
V(stbcx, STBCX, 0x7C00056D) \
- /* Store Byte with Update Indexed */ \
- V(stbux, STBUX, 0x7C0001EE) \
- /* Store Byte Indexed */ \
- V(stbx, STBX, 0x7C0001AE) \
/* Store Halfword Byte-Reverse Indexed */ \
V(sthbrx, STHBRX, 0x7C00072C) \
/* Store Halfword Conditional Indexed Xform */ \
V(sthcx, STHCX, 0x7C0005AD) \
- /* Store Halfword with Update Indexed */ \
- V(sthux, STHUX, 0x7C00036E) \
- /* Store Halfword Indexed */ \
- V(sthx, STHX, 0x7C00032E) \
/* Store Word Byte-Reverse Indexed */ \
V(stwbrx, STWBRX, 0x7C00052C) \
/* Store Word Conditional Indexed & record CR0 */ \
V(stwcx, STWCX, 0x7C00012D) \
- /* Store Word with Update Indexed */ \
- V(stwux, STWUX, 0x7C00016E) \
- /* Store Word Indexed */ \
- V(stwx, STWX, 0x7C00012E) \
/* Synchronize */ \
V(sync, SYNC, 0x7C0004AC) \
/* Trap Word */ \
V(tw, TW, 0x7C000008) \
/* ExecuExecuted No Operation */ \
V(xnop, XNOP, 0x68000000) \
- /* XOR */ \
- V(xorx, XORX, 0x7C000278) \
/* Convert Binary Coded Decimal To Declets */ \
V(cbcdtd, CBCDTD, 0x7C000274) \
/* Convert Declets To Binary Coded Decimal */ \
@@ -1432,30 +1460,14 @@ typedef uint32_t Instr;
V(ftdiv, FTDIV, 0xFC000100) \
/* Floating Test for software Square Root */ \
V(ftsqrt, FTSQRT, 0xFC000140) \
- /* Load Floating-Point Double with Update Indexed */ \
- V(lfdux, LFDUX, 0x7C0004EE) \
- /* Load Floating-Point Double Indexed */ \
- V(lfdx, LFDX, 0x7C0004AE) \
/* Load Floating-Point as Integer Word Algebraic Indexed */ \
V(lfiwax, LFIWAX, 0x7C0006AE) \
/* Load Floating-Point as Integer Word and Zero Indexed */ \
V(lfiwzx, LFIWZX, 0x7C0006EE) \
- /* Load Floating-Point Single with Update Indexed */ \
- V(lfsux, LFSUX, 0x7C00046E) \
- /* Load Floating-Point Single Indexed */ \
- V(lfsx, LFSX, 0x7C00042E) \
/* Move To Condition Register from FPSCR */ \
V(mcrfs, MCRFS, 0xFC000080) \
- /* Store Floating-Point Double with Update Indexed */ \
- V(stfdux, STFDUX, 0x7C0005EE) \
- /* Store Floating-Point Double Indexed */ \
- V(stfdx, STFDX, 0x7C0005AE) \
/* Store Floating-Point as Integer Word Indexed */ \
V(stfiwx, STFIWX, 0x7C0007AE) \
- /* Store Floating-Point Single with Update Indexed */ \
- V(stfsux, STFSUX, 0x7C00056E) \
- /* Store Floating-Point Single Indexed */ \
- V(stfsx, STFSX, 0x7C00052E) \
/* Load Floating-Point Double Pair Indexed */ \
V(lfdpx, LFDPX, 0x7C00062E) \
/* Store Floating-Point Double Pair Indexed */ \
@@ -1658,6 +1670,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) \
+ PPC_X_OPCODE_UNUSED_LIST(V)
+
+
#define PPC_EVS_OPCODE_LIST(V) \
/* Vector Select */ \
V(evsel, EVSEL, 0x10000278)
@@ -2875,7 +2897,6 @@ class Instruction {
PPC_SC_OPCODE_LIST(OPCODE_CASES)
return static_cast<Opcode>(opcode);
}
-printf("opcode = %x\n", InstructionBits());
UNIMPLEMENTED();
return static_cast<Opcode>(0);
}
« no previous file with comments | « src/ppc/assembler-ppc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698