Skip to content

Commit 4699f5b

Browse files
committed
Add thread local softfloat_fp8Mode variable to control the 8 bit floating point format
Will eventaully be hooked up to architectural register to control toggel.
1 parent 6e28d7e commit 4699f5b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

softfloat/softfloat.h

+10
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ enum {
6969
softfloat_tininess_afterRounding = 1
7070
};
7171

72+
/*----------------------------------------------------------------------------
73+
| Software floating-point 8-bit mode.
74+
*----------------------------------------------------------------------------*/
75+
extern THREAD_LOCAL uint_fast8_t softfloat_fp8Mode;
76+
enum {
77+
softfloat_fp8_8p5 = 0,
78+
softfloat_fp8_8p4 = 1,
79+
softfloat_fp8_8p3 = 2
80+
};
81+
7282
/*----------------------------------------------------------------------------
7383
| Software floating-point rounding mode. (Mode "odd" is supported only if
7484
| SoftFloat is compiled with macro 'SOFTFLOAT_ROUND_ODD' defined.)

softfloat/softfloat_state.c

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4444
#define THREAD_LOCAL
4545
#endif
4646

47+
THREAD_LOCAL uint_fast8_t softfloat_fp8Mode = softfloat_fp8_8p5;
4748
THREAD_LOCAL uint_fast8_t softfloat_roundingMode = softfloat_round_near_even;
4849
THREAD_LOCAL uint_fast8_t softfloat_detectTininess = init_detectTininess;
4950
THREAD_LOCAL uint_fast8_t softfloat_exceptionFlags = 0;

0 commit comments

Comments
 (0)