aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/fmax_q.h
blob: 7dd7884a678f23c23e2ee2a4a805ee4c5b093405 (plain)
1
2
3
4
5
6
7
8
9
require_extension('Q');
require_fp;
bool greater = f128_lt_quiet(f128(FRS2), f128(FRS1)) ||
               (f128_eq(f128(FRS2), f128(FRS1)) && (f128(FRS2).v[1] & F64_SIGN));
if (isNaNF128(f128(FRS1)) && isNaNF128(f128(FRS2)))
  WRITE_FRD(f128(defaultNaNF128()));
else
  WRITE_FRD(greater || isNaNF128(f128(FRS2)) ? FRS1 : FRS2);
set_fp_exceptions;