This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Usage: | |
| # ./testfloat_gen -level1 f16_to_f32_mulAdd | head -n 10000 | python3 ~/MiscScripts/random_fp_visualizer.py "FP16 FP16 FP32 FP32" | |
| from sys import stdin | |
| import matplotlib.pyplot as plt | |
| import argparse | |
| # this script expects to read from <stdin> BF16 values | |
| # encoded in hexadecimal, e.g.: | |
| # DE00 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /** Minimal sanity test for softfloat bf16_to_f32 function | |
| * | |
| * build: | |
| * gcc test_bf16_to_f32.c softfloat.a -Isource/include/ -o test_bf16_to_f32 | |
| */ | |
| #include <stdbool.h> | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <inttypes.h> | |
| #include "internals.h" | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /** | |
| * build: | |
| * gcc test_f32_to_bf16.c softfloat.a -Isource/include/ -o test_f32_to_bf16 | |
| */ | |
| #include <stdbool.h> | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <inttypes.h> | |
| #include "internals.h" | |
| #include "softfloat.h" |