Skip to contentSkip to conversation

target-ppc: SPR_BOOKE_ESR not set on FP exceptions

PATCH Applied Aaron Larson 2 participants 2 messages Jun 22, 2017 – Jul 2, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-ppc: SPR_BOOKE_ESR not set on FP exceptions

Properly set the book E exception syndrome register when a floating point exception occurs.

Currently on a book E processor, the POWERPC_EXCP_FP exception handler fails to set "env->spr[SPR_BOOKE_ESR] = ESR_FP;" as required by the book E specification.

---
 target/ppc/excp_helper.c | 1 +
 1 file changed, 1 insertion(+)
target/ppc/excp_helper.c +1 -0
index 9cb2123..7a82bdd 100644
@@ -282,6 +282,7 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp)
              * precise in the MSR.
              */
             msr |= 0x00100000;
+            env->spr[SPR_BOOKE_ESR] = ESR_FP;
             break;
         case POWERPC_EXCP_INVAL:
             LOG_EXCP("Invalid instruction at " TARGET_FMT_lx "\n", env->nip);
Signature · 1 line
2.7.4
Applied
#1 lore raw
Quoted 8 lines · Aaron Larson

Properly set the book E exception syndrome register when a floating point exception occurs.

Currently on a book E processor, the POWERPC_EXCP_FP exception handler fails to set "env->spr[SPR_BOOKE_ESR] = ESR_FP;" as required by the book E specification.

Applied to ppc-for-2.10.

Quoted 16 lines
---
 target/ppc/excp_helper.c | 1 +
 1 file changed, 1 insertion(+)
target/ppc/excp_helper.c +1 -0
index 9cb2123..7a82bdd 100644
@@ -282,6 +282,7 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp)
              * precise in the MSR.
              */
             msr |= 0x00100000;
+            env->spr[SPR_BOOKE_ESR] = ESR_FP;
             break;
         case POWERPC_EXCP_INVAL:
             LOG_EXCP("Invalid instruction at " TARGET_FMT_lx "\n", env->nip);
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson