Skip to content

Commit 120f7f5

Browse files
author
Stefan Mach
committed
🔖 Release 0.5.5
2 parents c0826db + 94ff400 commit 120f7f5

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

docs/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,18 @@ Versions of the IP in the same major relase are "pin-compatible" with each other
99

1010

1111
## [Unreleased]
12+
1213
### Added
1314
### Changed
1415
### Fixed
1516

1617

18+
## [0.5.5] - 2019-06-02
19+
20+
### Fixed
21+
- UF flag handling according to IEEE754-2008 (#11)
22+
23+
1724
## [0.5.4] - 2019-06-02
1825

1926
### Added

src/fpnew_cast_multi.sv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ module fpnew_cast_multi #(
557557
end
558558

559559
// Classification after rounding select by destination format
560-
assign uf_after_round = fmt_uf_after_round[dst_fmt_q2] & ~result_true_zero; // zero is not UF
560+
assign uf_after_round = fmt_uf_after_round[dst_fmt_q2];
561561
assign of_after_round = fmt_of_after_round[dst_fmt_q2];
562562

563563
// Negative integer result needs to be brought into two's complement
@@ -669,7 +669,7 @@ module fpnew_cast_multi #(
669669
NV: src_is_int_q & (of_before_round | of_after_round), // overflow is invalid for I2F casts
670670
DZ: 1'b0, // no divisions
671671
OF: ~src_is_int_q & (~info_q2.is_inf & (of_before_round | of_after_round)), // inf casts no OF
672-
UF: uf_after_round,
672+
UF: uf_after_round & fp_regular_status.NX,
673673
NX: src_is_int_q ? (| fp_round_sticky_bits) // overflow is invalid in i2f
674674
: (| fp_round_sticky_bits) | (~info_q2.is_inf & (of_before_round | of_after_round))
675675
};

src/fpnew_f2fcast.sv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ module fpnew_f2fcast #(
319319
NV: 1'b0, // only valid cases are handled in regular path
320320
DZ: 1'b0, // no divisions
321321
OF: ~info_a.is_inf & (of_before_round | of_after_round), // rounding can introduce new overflow
322-
UF: uf_after_round, // true zero results don't count as underflow
322+
UF: uf_after_round & regular_status.NX, // only inexact results raise UF
323323
NX: (| round_sticky_bits) | (~info_a.is_inf & (of_before_round | of_after_round))
324324
};
325325

src/fpnew_fma.sv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ module fpnew_fma #(
616616
NV: 1'b0, // only valid cases are handled in regular path
617617
DZ: 1'b0, // no divisions
618618
OF: of_before_round | of_after_round, // rounding can introduce new overflow
619-
UF: uf_after_round & ~result_zero, // true zero results don't count as underflow
619+
UF: uf_after_round & regular_status.NX, // only inexact results raise UF
620620
NX: (| round_sticky_bits) | of_before_round | of_after_round // RS bits mean loss in precision
621621
};
622622

src/fpnew_fma_multi.sv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ module fpnew_fma_multi #(
741741
end
742742

743743
// Classification after rounding select by destination format
744-
assign uf_after_round = fmt_uf_after_round[dst_fmt_q2] & ~result_zero; // zero is not UF
744+
assign uf_after_round = fmt_uf_after_round[dst_fmt_q2];
745745
assign of_after_round = fmt_of_after_round[dst_fmt_q2];
746746

747747

@@ -757,7 +757,7 @@ module fpnew_fma_multi #(
757757
NV: 1'b0, // only valid cases are handled in regular path
758758
DZ: 1'b0, // no divisions
759759
OF: of_before_round | of_after_round, // rounding can introduce new overflow
760-
UF: uf_after_round & ~result_zero, // true zero results don't count as underflow
760+
UF: uf_after_round & regular_status.NX, // only inexact results raise UF
761761
NX: (| round_sticky_bits) | of_before_round | of_after_round // RS bits mean loss in precision
762762
};
763763

0 commit comments

Comments
 (0)