Skip to content

Commit

Permalink
Add thread local softfloat_fp8Mode variable to control the 8 bit floa…
Browse files Browse the repository at this point in the history
…ting point format

Will eventaully be hooked up to architectural register to control toggel.
  • Loading branch information
rbuchner-aril committed Feb 6, 2025
1 parent 6e28d7e commit 4699f5b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions softfloat/softfloat.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ enum {
softfloat_tininess_afterRounding = 1
};

/*----------------------------------------------------------------------------
| Software floating-point 8-bit mode.
*----------------------------------------------------------------------------*/
extern THREAD_LOCAL uint_fast8_t softfloat_fp8Mode;
enum {
softfloat_fp8_8p5 = 0,
softfloat_fp8_8p4 = 1,
softfloat_fp8_8p3 = 2
};

/*----------------------------------------------------------------------------
| Software floating-point rounding mode. (Mode "odd" is supported only if
| SoftFloat is compiled with macro 'SOFTFLOAT_ROUND_ODD' defined.)
Expand Down
1 change: 1 addition & 0 deletions softfloat/softfloat_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define THREAD_LOCAL
#endif

THREAD_LOCAL uint_fast8_t softfloat_fp8Mode = softfloat_fp8_8p5;
THREAD_LOCAL uint_fast8_t softfloat_roundingMode = softfloat_round_near_even;
THREAD_LOCAL uint_fast8_t softfloat_detectTininess = init_detectTininess;
THREAD_LOCAL uint_fast8_t softfloat_exceptionFlags = 0;
Expand Down

0 comments on commit 4699f5b

Please sign in to comment.