diff options
Diffstat (limited to 'riscv/insns/fminm_q.h')
-rw-r--r-- | riscv/insns/fminm_q.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/riscv/insns/fminm_q.h b/riscv/insns/fminm_q.h new file mode 100644 index 0000000..bccd7ed --- /dev/null +++ b/riscv/insns/fminm_q.h @@ -0,0 +1,17 @@ +require_extension('Q'); +require_extension(EXT_ZFA); +require_fp; +ui128_f128 ui1; +ui1.f = f128(FRS1); +ui128_f128 ui2; +ui2.f = f128(FRS2); +bool less = f128_lt_quiet(f128(FRS1), f128(FRS2)) || + (f128_eq(f128(FRS1), f128(FRS2)) && (signF128UI64(ui1.ui.v64))); +if (isNaNF128UI(ui1.ui.v64, ui1.ui.v0) || isNaNF128UI(ui2.ui.v64, ui2.ui.v0)) { + ui128_f128 ui; + ui.ui.v64 = defaultNaNF128UI64; + ui.ui.v0 = defaultNaNF128UI0; + WRITE_FRD(f128(ui.f)); + } else + WRITE_FRD(less ? f128(FRS1) : f128(FRS2)); +set_fp_exceptions; |