flt.s

Floating-Point Less Than Single-Precision

The flt.s instruction writes 1 to xd if fs1 is less than fs2, and 0 otherwise. If either operand is NaN, the result is 0 (not equal). If either operand is a NaN (signaling or quiet), the invalid flag is set.

Assembly format

flt.s xd, fs1, fs2

Decode Variables

Bits<5> fs2 = $encoding[24:20];
Bits<5> fs1 = $encoding[19:15];
Bits<5> xd = $encoding[11:7];

Execution

check_f_ok($encoding);
Bits<32> sp_value_a = F[fs1][31:0];
Bits<32> sp_value_b = F[fs2][31:0];
Bits<1> sign_a = sp_value_a[31];
Bits<1> sign_b = sp_value_b[31];
if (is_sp_nan?(sp_value_a) || is_sp_nan?(sp_value_b)) {
  set_fp_flag(FpFlag::NV);
  X[xd] = 0;
} else {
  if (sign_a != sign_b) {
    X[xd] = sign_a == 1) && ((sp_value_a[30:0] | sp_value_b[30:0]) != 0 ? 1 : 0;
  } else {
    X[xd] = sp_value_a != sp_value_b) && ((sign_a ^ ((sp_value_a < sp_value_b) ? 1 : 0 != 0)) ? 1 : 0;
  }
}

Exceptions

This instruction may result in the following synchronous exceptions:

  • IllegalInstruction

Encoding

svg

Defining extension

F

Access

M

Always

Containing profiles

  • Mandatory: RVA20S64, RVA20U64, RVA22S64, RVA22U64, RVA23S64, RVA23U64, RVB23S64, RVB23U64

  • Optional: RVI20U32, RVI20U64