From e25fb13bcd2fb2b108c3fe1d94831229adeb7e37 Mon Sep 17 00:00:00 2001 From: Philipp Tomsich Date: Tue, 9 May 2023 17:32:05 +0200 Subject: Zfa: fix NX handling for the fround/froundnx family The initial implementation (together with the SAIL code and the tests) had gotten the NX variants backwards (as in 'an inexact result is ok' vs. 'set NX is inexact'). Update all 4 instructions. Signed-off-by: Philipp Tomsich --- riscv/insns/fround_d.h | 2 +- riscv/insns/fround_h.h | 2 +- riscv/insns/fround_q.h | 2 +- riscv/insns/fround_s.h | 2 +- riscv/insns/froundnx_d.h | 2 +- riscv/insns/froundnx_h.h | 2 +- riscv/insns/froundnx_q.h | 2 +- riscv/insns/froundnx_s.h | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/riscv/insns/fround_d.h b/riscv/insns/fround_d.h index 1127135..0e8a1ba 100644 --- a/riscv/insns/fround_d.h +++ b/riscv/insns/fround_d.h @@ -1,5 +1,5 @@ require_extension('D'); require_extension(EXT_ZFA); require_fp; -WRITE_FRD_D(f64_roundToInt(FRS1_D, RM, true)); +WRITE_FRD_D(f64_roundToInt(FRS1_D, RM, false)); set_fp_exceptions; diff --git a/riscv/insns/fround_h.h b/riscv/insns/fround_h.h index 6417a39..0c6cdae 100644 --- a/riscv/insns/fround_h.h +++ b/riscv/insns/fround_h.h @@ -1,5 +1,5 @@ require_extension(EXT_ZFH); require_extension(EXT_ZFA); require_fp; -WRITE_FRD_H(f16_roundToInt(FRS1_H, RM, true)); +WRITE_FRD_H(f16_roundToInt(FRS1_H, RM, false)); set_fp_exceptions; diff --git a/riscv/insns/fround_q.h b/riscv/insns/fround_q.h index 51ebce2..91bab77 100644 --- a/riscv/insns/fround_q.h +++ b/riscv/insns/fround_q.h @@ -1,5 +1,5 @@ require_extension('Q'); require_extension(EXT_ZFA); require_fp; -WRITE_FRD(f128_roundToInt(f128(FRS1), RM, true)); +WRITE_FRD(f128_roundToInt(f128(FRS1), RM, false)); set_fp_exceptions; diff --git a/riscv/insns/fround_s.h b/riscv/insns/fround_s.h index 272897e..f6e75f5 100644 --- a/riscv/insns/fround_s.h +++ b/riscv/insns/fround_s.h @@ -1,5 +1,5 @@ require_extension('F'); require_extension(EXT_ZFA); require_fp; -WRITE_FRD_F(f32_roundToInt(FRS1_F, RM, true)); +WRITE_FRD_F(f32_roundToInt(FRS1_F, RM, false)); set_fp_exceptions; diff --git a/riscv/insns/froundnx_d.h b/riscv/insns/froundnx_d.h index 0e8a1ba..1127135 100644 --- a/riscv/insns/froundnx_d.h +++ b/riscv/insns/froundnx_d.h @@ -1,5 +1,5 @@ require_extension('D'); require_extension(EXT_ZFA); require_fp; -WRITE_FRD_D(f64_roundToInt(FRS1_D, RM, false)); +WRITE_FRD_D(f64_roundToInt(FRS1_D, RM, true)); set_fp_exceptions; diff --git a/riscv/insns/froundnx_h.h b/riscv/insns/froundnx_h.h index 0c6cdae..6417a39 100644 --- a/riscv/insns/froundnx_h.h +++ b/riscv/insns/froundnx_h.h @@ -1,5 +1,5 @@ require_extension(EXT_ZFH); require_extension(EXT_ZFA); require_fp; -WRITE_FRD_H(f16_roundToInt(FRS1_H, RM, false)); +WRITE_FRD_H(f16_roundToInt(FRS1_H, RM, true)); set_fp_exceptions; diff --git a/riscv/insns/froundnx_q.h b/riscv/insns/froundnx_q.h index 91bab77..51ebce2 100644 --- a/riscv/insns/froundnx_q.h +++ b/riscv/insns/froundnx_q.h @@ -1,5 +1,5 @@ require_extension('Q'); require_extension(EXT_ZFA); require_fp; -WRITE_FRD(f128_roundToInt(f128(FRS1), RM, false)); +WRITE_FRD(f128_roundToInt(f128(FRS1), RM, true)); set_fp_exceptions; diff --git a/riscv/insns/froundnx_s.h b/riscv/insns/froundnx_s.h index f6e75f5..272897e 100644 --- a/riscv/insns/froundnx_s.h +++ b/riscv/insns/froundnx_s.h @@ -1,5 +1,5 @@ require_extension('F'); require_extension(EXT_ZFA); require_fp; -WRITE_FRD_F(f32_roundToInt(FRS1_F, RM, false)); +WRITE_FRD_F(f32_roundToInt(FRS1_F, RM, true)); set_fp_exceptions; -- cgit v1.1