Skip to contentSkip to conversation

target/microblaze: Fix FPU2 instruction check

PATCH In review Joe Komlodi 2 participants 3 messages May 11, 2020 – May 13, 2020

lore
Share & tools
lore
#0 lore raw

cover target/microblaze: Fix FPU2 instruction check

Hi all,

This fixes a backwards if statement that caused Microblaze FPU2 instructions to not be executed, even if use-fpu=2 in the DTS.

Thanks!
Joe

Joe Komlodi (1):
target/microblaze: Fix FPU2 instruction check

 target/microblaze/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 target/microblaze: Fix FPU2 instruction check

The check to see if we can use FPU2 instructions would return 0 if cfg.use_fpu == 2, rather than returning the PVR2_USE_FPU2_MASK.

This would cause all FPU2 instructions (fsqrt, flt, fint) to not be used.

---
 target/microblaze/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/microblaze/translate.c +1 -1
index 4e7f903a..329743b 100644
@@ -1391,7 +1391,7 @@ static int dec_check_fpuv2(DisasContext *dc)
         tcg_gen_movi_i64(cpu_SR[SR_ESR], ESR_EC_FPU);
         t_gen_raise_exception(dc, EXCP_HW_EXCP);
     }
-    return (dc->cpu->cfg.use_fpu == 2) ? 0 : PVR2_USE_FPU2_MASK;
+    return (dc->cpu->cfg.use_fpu == 2) ? PVR2_USE_FPU2_MASK : 0;
 }
 
 static void dec_fpu(DisasContext *dc)
Signature · 1 line
2.7.4
Reviewed-by on the v1 series
#2 lore raw
In reply to Joe Komlodi
Quoted 7 lines · Joe Komlodi

Hi all,

This fixes a backwards if statement that caused Microblaze FPU2 instructions to not be executed, even if use-fpu=2 in the DTS.

Thanks!
Joe

Quoted 10 lines

Joe Komlodi (1):
target/microblaze: Fix FPU2 instruction check

 target/microblaze/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.7.4