This Operation comes directly from the instruction owner; the page does not rewrite its behavior.
34
5pure func E2M3NumericFormatDescriptor() => NumericFormatDescriptor6begin7 return NumericFormatDescriptor {8 available = TRUE, kind = NumericFormatKind_FixedBinary,9 carrier_bits = 8, lane_bits = 6, lanes_per_carrier = 1,10 sign_bits = 1, sign_bit = 5,11 exponent_bits_min = 2, exponent_bits_max = 2,12 fraction_bits_min = 3, fraction_bits_max = 3,13 exponent_bias_available = TRUE, exponent_bias = 1,14 required_low_zero_bits = 0, required_high_zero_bits = 2,15 has_zero = TRUE, has_signed_zero = TRUE, has_subnormal = TRUE,16 has_infinity = FALSE, has_quiet_nan = FALSE,17 has_signaling_nan = FALSE18 };19end;20
21pure func E2M3FiniteDecomposition(value: bits(8))22 => (boolean, boolean, Word, integer {-1074..1023})23begin24 if value[7:6] != Zeros{2} then25 return (FALSE, FALSE, Zeros{PTO_XLEN}, 0);26 end;27 let exponent = value[4:3];28 let fraction = value[2:0];29 if exponent == Zeros{2} then30 if fraction == Zeros{3} then31 return (TRUE, value[5] == '1', Zeros{PTO_XLEN}, 0);32 else return (TRUE, value[5] == '1',33 ZeroExtend{PTO_XLEN}(fraction), -3);34 end;35 else return (TRUE, value[5] == '1',36 LSL(Zeros{PTO_XLEN} + 1, 3) +37 ZeroExtend{PTO_XLEN}(fraction),38 (UInt(exponent) - (1 + 3))39 as integer {-1074..1023});40 end;41end;42
43pure func E2M3EncodingValid(value: bits(8)) => boolean44begin45 return value[7:6] == Zeros{2};46end;47pure func ClassifyE2M3(value: bits(8)) => NumericValueClass48begin49 let exponent = value[4:3];50 let fraction = value[2:0];51 return NumericValueClassFromFiniteSign(value[5],52 exponent == Zeros{2} && fraction == Zeros{3},53 exponent == Zeros{2} && fraction != Zeros{3});54end;55
56pure func E2M3SignedZeroEncodings() => (Word, Word)57begin58 return (Zeros{PTO_XLEN}, Zeros{PTO_XLEN} + 0x20);59end;
View the complete ASL owner
1234
5pure func E2M3NumericFormatDescriptor() => NumericFormatDescriptor6begin7 return NumericFormatDescriptor {8 available = TRUE, kind = NumericFormatKind_FixedBinary,9 carrier_bits = 8, lane_bits = 6, lanes_per_carrier = 1,10 sign_bits = 1, sign_bit = 5,11 exponent_bits_min = 2, exponent_bits_max = 2,12 fraction_bits_min = 3, fraction_bits_max = 3,13 exponent_bias_available = TRUE, exponent_bias = 1,14 required_low_zero_bits = 0, required_high_zero_bits = 2,15 has_zero = TRUE, has_signed_zero = TRUE, has_subnormal = TRUE,16 has_infinity = FALSE, has_quiet_nan = FALSE,17 has_signaling_nan = FALSE18 };19end;20
21pure func E2M3FiniteDecomposition(value: bits(8))22 => (boolean, boolean, Word, integer {-1074..1023})23begin24 if value[7:6] != Zeros{2} then25 return (FALSE, FALSE, Zeros{PTO_XLEN}, 0);26 end;27 let exponent = value[4:3];28 let fraction = value[2:0];29 if exponent == Zeros{2} then30 if fraction == Zeros{3} then31 return (TRUE, value[5] == '1', Zeros{PTO_XLEN}, 0);32 else return (TRUE, value[5] == '1',33 ZeroExtend{PTO_XLEN}(fraction), -3);34 end;35 else return (TRUE, value[5] == '1',36 LSL(Zeros{PTO_XLEN} + 1, 3) +37 ZeroExtend{PTO_XLEN}(fraction),38 (UInt(exponent) - (1 + 3))39 as integer {-1074..1023});40 end;41end;42
43pure func E2M3EncodingValid(value: bits(8)) => boolean44begin45 return value[7:6] == Zeros{2};46end;47pure func ClassifyE2M3(value: bits(8)) => NumericValueClass48begin49 let exponent = value[4:3];50 let fraction = value[2:0];51 return NumericValueClassFromFiniteSign(value[5],52 exponent == Zeros{2} && fraction == Zeros{3},53 exponent == Zeros{2} && fraction != Zeros{3});54end;55
56pure func E2M3SignedZeroEncodings() => (Word, Word)57begin58 return (Zeros{PTO_XLEN}, Zeros{PTO_XLEN} + 0x20);59end;6061