Skip to contentSkip to conversation

target-ppc: fix SPE evcmp* instructions

PATCH Applied Nathan Froyd 2 participants 2 messages Feb 23, 2010 – Feb 27, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-ppc: fix SPE evcmp* instructions

The CRF_{CH,CL,CH_OR_CL,CH_AND_CL} constants were all off by one bit position. Because of this, the SPE evcmp* family of instructions would store values in the result condition register that were also off by one bit position.

Fixed by using the CRF_{LT,GT,EQ,SO} constants for the shift amounts.

---
 target-ppc/cpu.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
target-ppc/cpu.h +4 -4
index d15bba1..63aeb86 100644
@@ -834,10 +834,10 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)
 #define CRF_GT        2
 #define CRF_EQ        1
 #define CRF_SO        0
-#define CRF_CH        (1 << 4)
-#define CRF_CL        (1 << 3)
-#define CRF_CH_OR_CL  (1 << 2)
-#define CRF_CH_AND_CL (1 << 1)
+#define CRF_CH        (1 << CRF_LT)
+#define CRF_CL        (1 << CRF_GT)
+#define CRF_CH_OR_CL  (1 << CRF_EQ)
+#define CRF_CH_AND_CL (1 << CRF_SO)
 
 /* XER definitions */
 #define XER_SO  31
Signature · 1 line
1.6.3.2
#1 lore raw
Quoted 8 lines · Nathan Froyd

The CRF_{CH,CL,CH_OR_CL,CH_AND_CL} constants were all off by one bit position. Because of this, the SPE evcmp* family of instructions would store values in the result condition register that were also off by one bit position.

Fixed by using the CRF_{LT,GT,EQ,SO} constants for the shift amounts.

Thanks, applied.

Quoted 29 lines
---
 target-ppc/cpu.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
target-ppc/cpu.h +4 -4
index d15bba1..63aeb86 100644
@@ -834,10 +834,10 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)
 #define CRF_GT        2
 #define CRF_EQ        1
 #define CRF_SO        0
-#define CRF_CH        (1 << 4)
-#define CRF_CL        (1 << 3)
-#define CRF_CH_OR_CL  (1 << 2)
-#define CRF_CH_AND_CL (1 << 1)
+#define CRF_CH        (1 << CRF_LT)
+#define CRF_CL        (1 << CRF_GT)
+#define CRF_CH_OR_CL  (1 << CRF_EQ)
+#define CRF_CH_AND_CL (1 << CRF_SO)
 
 /* XER definitions */
 #define XER_SO  31
Signature · 1 line
1.6.3.2
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net