Browse Source
Merge pull request #2112 from chihminchao/fix_bf16_conversion_to_ocp
Fix bf16 conversion to ocp
pull/2114/head
Andrew Waterman
10 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
5 additions and
5 deletions
-
softfloat/bf16_to_e4m3.c
-
softfloat/bf16_to_e5m2.c
-
softfloat/softfloat.h
|
|
|
@ -41,7 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
|
|
#include "specialize.h" |
|
|
|
#include "softfloat.h" |
|
|
|
|
|
|
|
e4m3_t bf16_to_e4m3( float16_t a, bool saturationMode ) |
|
|
|
e4m3_t bf16_to_e4m3( bfloat16_t a, bool saturationMode ) |
|
|
|
{ |
|
|
|
return f32_to_e4m3( bf16_to_f32( a ), saturationMode ); |
|
|
|
} |
|
|
|
|
|
|
|
@ -41,7 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
|
|
#include "specialize.h" |
|
|
|
#include "softfloat.h" |
|
|
|
|
|
|
|
e5m2_t bf16_to_e5m2( float16_t a, bool saturationMode ) |
|
|
|
e5m2_t bf16_to_e5m2( bfloat16_t a, bool saturationMode ) |
|
|
|
{ |
|
|
|
return f32_to_e5m2( bf16_to_f32( a ), saturationMode ); |
|
|
|
} |
|
|
|
|
|
|
|
@ -198,8 +198,8 @@ uint_fast8_t bf16_to_ui8( bfloat16_t, uint_fast8_t, bool ); |
|
|
|
uint_fast32_t bf16_to_ui32( bfloat16_t, uint_fast8_t, bool ); |
|
|
|
int_fast8_t bf16_to_i8( bfloat16_t, uint_fast8_t, bool ); |
|
|
|
int_fast32_t bf16_to_i32( bfloat16_t, uint_fast8_t, bool ); |
|
|
|
e4m3_t bf16_to_e4m3( float16_t, bool ); |
|
|
|
e5m2_t bf16_to_e5m2( float16_t, bool ); |
|
|
|
e4m3_t bf16_to_e4m3( bfloat16_t, bool ); |
|
|
|
e5m2_t bf16_to_e5m2( bfloat16_t, bool ); |
|
|
|
float32_t bf16_to_f32( bfloat16_t ); |
|
|
|
float64_t bf16_to_f64( bfloat16_t ); |
|
|
|
bfloat16_t bf16_add( bfloat16_t, bfloat16_t ); |
|
|
|
|