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