Skip to contentSkip to conversation

target/riscv: Fix froundnx.h nanbox check

PATCH Applied Branislav Brzak 3 participants 4 messages Jun 9, 2024 – Jun 21, 2024 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/riscv: Fix froundnx.h nanbox check

helper_froundnx_h function mistakenly uses single percision nanbox check instead of the half percision one. This patch fixes the issue.

---
 target/riscv/fpu_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/riscv/fpu_helper.c +1 -1
index 871a70a316..91b1a56d10 100644
@@ -676,7 +676,7 @@ uint64_t helper_fround_h(CPURISCVState *env, uint64_t rs1)
 
 uint64_t helper_froundnx_h(CPURISCVState *env, uint64_t rs1)
 {
-    float16 frs1 = check_nanbox_s(env, rs1);
+    float16 frs1 = check_nanbox_h(env, rs1);
     frs1 = float16_round_to_int(frs1, &env->fp_status);
     return nanbox_h(env, frs1);
 }
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Branislav Brzak

helper_froundnx_h function mistakenly uses single percision nanbox check instead of the half percision one. This patch fixes the issue.

Alistair

Quoted 21 lines
---
 target/riscv/fpu_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/riscv/fpu_helper.c +1 -2
index 871a70a316..91b1a56d10 100644
@@ -676,7 +676,7 @@ uint64_t helper_fround_h(CPURISCVState *env, uint64_t rs1)
 
 uint64_t helper_froundnx_h(CPURISCVState *env, uint64_t rs1)
 {
-    float16 frs1 = check_nanbox_s(env, rs1);
+    float16 frs1 = check_nanbox_h(env, rs1);
     frs1 = float16_round_to_int(frs1, &env->fp_status);
     return nanbox_h(env, frs1);
 }
--

2.34.1

Reviewed-by on v1 1/1
#2 lore raw
In reply to Branislav Brzak

target/riscv/fpu_helper.c uint64_t helper_fround_h(CPURISCVState *env, uint64_t rs1) · line 682

Quoted 13 lines · Branislav Brzak

t/riscv/fpu_helper.c b/target/riscv/fpu_helper.c
index 871a70a316..91b1a56d10 100644

target/riscv/fpu_helper.c +1 -1
@@ -676,7 +676,7 @@ uint64_t helper_fround_h(CPURISCVState *env, uint64_t rs1)
 
  uint64_t helper_froundnx_h(CPURISCVState *env, uint64_t rs1)
  {
-    float16 frs1 = check_nanbox_s(env, rs1);
+    float16 frs1 = check_nanbox_h(env, rs1);
      frs1 = float16_round_to_int(frs1, &env->fp_status);
      return nanbox_h(env, frs1);
  }

r~

#3 lore raw
In reply to Branislav Brzak
Quoted 5 lines · Branislav Brzak

helper_froundnx_h function mistakenly uses single percision nanbox check instead of the half percision one. This patch fixes the issue.

Thanks!

Applied to riscv-to-apply.next

Alistair

Quoted 21 lines
---
 target/riscv/fpu_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/riscv/fpu_helper.c +1 -2
index 871a70a316..91b1a56d10 100644
@@ -676,7 +676,7 @@ uint64_t helper_fround_h(CPURISCVState *env, uint64_t rs1)
 
 uint64_t helper_froundnx_h(CPURISCVState *env, uint64_t rs1)
 {
-    float16 frs1 = check_nanbox_s(env, rs1);
+    float16 frs1 = check_nanbox_h(env, rs1);
     frs1 = float16_round_to_int(frs1, &env->fp_status);
     return nanbox_h(env, frs1);
 }
--

2.34.1