aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/fmin_d.h
blob: 486faa5622f952d81618495f48ae42245eeff39f (plain)
1
2
3
4
5
6
7
8
require_extension('D');
require_fp;
bool less = f64_lt_quiet(f64(FRS1), f64(FRS2)) ||
            (f64_eq(f64(FRS1), f64(FRS2)) && (f64(FRS1).v & F64_SIGN));
WRITE_FRD(less || isNaNF64UI(f64(FRS2).v) ? FRS1 : FRS2);
if (isNaNF64UI(f64(FRS1).v) && isNaNF64UI(f64(FRS2).v))
  WRITE_FRD(f64(defaultNaNF64UI));
set_fp_exceptions;