diff --git a/src/fpnew_cast_multi.sv b/src/fpnew_cast_multi.sv index 04692cad..b41b2690 100644 --- a/src/fpnew_cast_multi.sv +++ b/src/fpnew_cast_multi.sv @@ -720,13 +720,13 @@ module fpnew_cast_multi #( logic [WIDTH-1:0] fp_result, int_result; fpnew_pkg::status_t fp_status, int_status; - assign fp_regular_status.NV = src_is_int_q & (of_before_round | of_after_round); // overflow is invalid for I2F casts + assign fp_regular_status.NV = 1'b0; // floating-point results are always valid assign fp_regular_status.DZ = 1'b0; // no divisions - assign fp_regular_status.OF = ~src_is_int_q & (~info_q.is_inf & (of_before_round | of_after_round)); // inf casts no OF + assign fp_regular_status.OF = (src_is_int_q | ~info_q.is_inf) & (of_before_round | of_after_round); // inf casts no OF assign fp_regular_status.UF = uf_after_round & fp_regular_status.NX; - assign fp_regular_status.NX = src_is_int_q ? (| fp_round_sticky_bits) // overflow is invalid in i2f - : (| fp_round_sticky_bits) | (~info_q.is_inf & (of_before_round | of_after_round)); - assign int_regular_status = '{NX: (| int_round_sticky_bits), default: 1'b0}; + assign fp_regular_status.NX = (| fp_round_sticky_bits) | ((src_is_int_q | ~info_q.is_inf) & (of_before_round | of_after_round)); + assign int_regular_status = '{NV: of_before_round | of_after_round, // overflow is invalid for F2I casts + NX: (| int_round_sticky_bits), default: 1'b0}; assign fp_result = fp_result_is_special ? fp_special_result : fmt_result[dst_fmt_q2]; assign fp_status = fp_result_is_special ? fp_special_status : fp_regular_status;