Skip to content

Commit 993fc48

Browse files
Omar Almatovrbuchner-aril
authored andcommitted
(1/4) Add OCP e4m3 and e5m2 to list of f8 modes
1 parent 4bb97ee commit 993fc48

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

softfloat/softfloat.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,14 @@ enum {
7474
*----------------------------------------------------------------------------*/
7575
extern THREAD_LOCAL uint_fast8_t softfloat_fp8Mode;
7676
enum {
77-
softfloat_fp8_8p5 = 0,
78-
softfloat_fp8_8p4 = 1,
79-
softfloat_fp8_8p3 = 2
77+
softfloat_fp8_8p5 = 0,
78+
softfloat_fp8_8p4 = 1,
79+
softfloat_fp8_8p3 = 2,
80+
softfloat_fp8_e4m3 = 3,
81+
softfloat_fp8_e5m2 = 4
8082
};
8183

82-
extern THREAD_LOCAL uint_fast8_t softfloat_fp8ExpWidths[3];
84+
extern THREAD_LOCAL uint_fast8_t softfloat_fp8ExpWidths[5];
8385

8486
/*----------------------------------------------------------------------------
8587
| Software floating-point rounding mode. (Mode "odd" is supported only if

softfloat/softfloat_state.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4545
#endif
4646

4747
THREAD_LOCAL uint_fast8_t softfloat_fp8Mode = softfloat_fp8_8p5;
48-
THREAD_LOCAL uint_fast8_t softfloat_fp8ExpWidths[3] = {3, 4, 5};
48+
THREAD_LOCAL uint_fast8_t softfloat_fp8ExpWidths[5] = {3, 4, 5, 4, 5};
4949
THREAD_LOCAL uint_fast8_t softfloat_roundingMode = softfloat_round_near_even;
5050
THREAD_LOCAL uint_fast8_t softfloat_detectTininess = init_detectTininess;
5151
THREAD_LOCAL uint_fast8_t softfloat_exceptionFlags = 0;

0 commit comments

Comments
 (0)