Skip to contentSkip to conversation

target-ppc: fix bit extraction for FPBF and FPL

PATCH Applied Aurelien Jarno 3 participants 3 messages Aug 15, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-ppc: fix bit extraction for FPBF and FPL

Bit extraction for the FP BF and L field of the MTFSFI and MTFSF instructions is wrong and doesn't match the reference manual (which explain the bit number in big endian format). It has been broken in commit 7d08d85645def18eac2a9d672c1868a35e0bcf79.

This patch fixes this, which in turn fixes the problem reported by Khem Raj about the floor() function of libm.

---
 target-ppc/translate.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

I don't know if we still have time to get this into 1.6, hence the Cc:
to stable. In anycase it also needs to be fixed in 1.5.

target-ppc/translate.c +2 -2
index f07d70d..41f4048 100644
@@ -428,9 +428,9 @@ EXTRACT_HELPER(CRM, 12, 8);
 EXTRACT_HELPER(SR, 16, 4);
 
 /* mtfsf/mtfsfi */
-EXTRACT_HELPER(FPBF, 19, 3);
+EXTRACT_HELPER(FPBF, 23, 3);
 EXTRACT_HELPER(FPIMM, 12, 4);
-EXTRACT_HELPER(FPL, 21, 1);
+EXTRACT_HELPER(FPL, 25, 1);
 EXTRACT_HELPER(FPFLM, 17, 8);
 EXTRACT_HELPER(FPW, 16, 1);
 
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 10 lines · Aurelien Jarno

Bit extraction for the FP BF and L field of the MTFSFI and MTFSF instructions is wrong and doesn't match the reference manual (which explain the bit number in big endian format). It has been broken in commit 7d08d85645def18eac2a9d672c1868a35e0bcf79.

This patch fixes this, which in turn fixes the problem reported by Khem Raj about the floor() function of libm.

Thanks, applied to ppc-next.

Alex

#2 lore raw
In reply to Aurelien Jarno
Quoted 36 lines · Aurelien Jarno

Bit extraction for the FP BF and L field of the MTFSFI and MTFSF instructions is wrong and doesn't match the reference manual (which explain the bit number in big endian format). It has been broken in commit 7d08d85645def18eac2a9d672c1868a35e0bcf79.

This patch fixes this, which in turn fixes the problem reported by Khem Raj about the floor() function of libm.

---
target-ppc/translate.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)

I don't know if we still have time to get this into 1.6, hence the Cc:
to stable. In anycase it also needs to be fixed in 1.5.

target-ppc/translate.c +2 -2
index f07d70d..41f4048 100644
@@ -428,9 +428,9 @@ EXTRACT_HELPER(CRM, 12, 8);
 EXTRACT_HELPER(SR, 16, 4);
 
 /* mtfsf/mtfsfi */
-EXTRACT_HELPER(FPBF, 19, 3);
+EXTRACT_HELPER(FPBF, 23, 3);
 EXTRACT_HELPER(FPIMM, 12, 4);
-EXTRACT_HELPER(FPL, 21, 1);
+EXTRACT_HELPER(FPL, 25, 1);
 EXTRACT_HELPER(FPFLM, 17, 8);
 EXTRACT_HELPER(FPW, 16, 1);
 
Signature · 1 line
1.7.10.4

Thanks for quick turnaround, I have tested this patch and fixes the said issue.