Skip to contentSkip to conversation

PPC64: Add support for ldbrx and stdbrx instructions

PATCH New David Gibson 1 participant 1 message Feb 10, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PPC64: Add support for ldbrx and stdbrx instructions

From: Thomas Huth <[email protected]>

These instructions for loading and storing byte-swapped 64-bit values have been introduced in PowerISA 2.06.

---
 target-ppc/cpu.h            |    4 ++-
 target-ppc/translate.c      |   52 +++++++++++++++++++++++++++++++++++-------
 target-ppc/translate_init.c |    2 +-
 3 files changed, 47 insertions(+), 11 deletions(-)

Alex, resending with the type updated as requested. Please review to make sure I haven't messed anything up in extending the GEN_LDX and GEN_STX macros to take the type2 field.

target-ppc/cpu.h +3 -1
index fbcf488..036b3b6 100644
@@ -1918,8 +1918,10 @@ enum {
     PPC2_DFP           = 0x0000000000000004ULL,
     /* Embedded.Processor Control                                            */
     PPC2_PRCNTL        = 0x0000000000000008ULL,
+    /* Byte-reversed, indexed, double-word load and store                    */
+    PPC2_DBRX          = 0x0000000000000010ULL,
 
-#define PPC_TCG_INSNS2 (PPC2_BOOKE206 | PPC2_PRCNTL)
+#define PPC_TCG_INSNS2 (PPC2_BOOKE206 | PPC2_PRCNTL | PPC2_DBRX)
 };
 
 /*****************************************************************************/
target-ppc/translate.c +43 -9

124 lines not on this page · raw message

target-ppc/translate_init.c +1 -1
index 6253076..087f2f0 100644
@@ -6571,7 +6571,7 @@ static void init_proc_970MP (CPUPPCState *env)
                               PPC_64B | PPC_ALTIVEC |                         \
                               PPC_SEGMENT_64B | PPC_SLBI |                    \
                               PPC_POPCNTB | PPC_POPCNTWD)
-#define POWERPC_INSNS2_POWER7 (PPC2_VSX | PPC2_DFP)
+#define POWERPC_INSNS2_POWER7 (PPC2_VSX | PPC2_DFP | PPC2_DBRX)
 #define POWERPC_MSRM_POWER7   (0x800000000204FF36ULL)
 #define POWERPC_MMU_POWER7    (POWERPC_MMU_2_06)
 #define POWERPC_EXCP_POWER7   (POWERPC_EXCP_POWER7)
Signature · 1 line
1.7.8.3