crackNum 3.20 → 3.21
raw patch · 6 files changed
+26/−8 lines, 6 files
Files
- CHANGES.md +9/−1
- GUI/tclGUI/crackNum.tcl +2/−0
- README.md +3/−4
- crackNum.cabal +2/−2
- src/CrackNum/Main.hs +5/−1
- src/CrackNum/TestSuite.hs +5/−0
CHANGES.md view
@@ -1,7 +1,15 @@ * Hackage: <http://hackage.haskell.org/package/crackNum> * GitHub: <http://github.com/LeventErkok/crackNum/> -* Latest Hackage released version: 3.20, 2026-08-13+* Latest Hackage released version: 3.21, 2026-08-16++### Version 3.21, 2026-08-16++ * Add support for TF32 (TensorFloat-32), via `-ftf32`. This is the 19-bit format+ with 8 exponent and 10 significand bits, i.e., the exponent range of single+ precision with the significand of half precision. Note that we crack the 19+ architectural bits; hardware typically carries these in a 32-bit container+ with the remaining bits unused. ### Version 3.20, 2026-08-13
GUI/tclGUI/crackNum.tcl view
@@ -38,6 +38,7 @@ {fe5m2 "FP8 (E5M2)" fixed e5m2} {fhp "Half" fixed hp} {fbp "Brain" fixed bp}+ {ftf32 "TF32" fixed tf32} {fsp "Single" fixed sp} {fdp "Double" fixed dp} {fcs "Custom" customFloat {}}@@ -453,6 +454,7 @@ dp { set state(selection) fdp } hp { set state(selection) fhp } bp { set state(selection) fbp }+ tf32 { set state(selection) ftf32 } e4m3 { set state(selection) fe4m3 } e5m2 { set state(selection) fe5m2 } fp4 { set state(selection) ffp4 }
README.md view
@@ -144,8 +144,7 @@ Then `crackNum --gui` just works. If you want to run a modified copy of the script, either put it on your PATH as `crackNum.tcl`, or point at it directly-with `CRACKNUM_TCL=/path/to/crackNum.tcl`. See-[`GUI/tclGUI/README.md`](GUI/tclGUI/README.md) for details.+with `CRACKNUM_TCL=/path/to/crackNum.tcl`. On both platforms, launch the GUI from the command line via the `--gui` option, which forwards any format/rounding flags and value to the app:@@ -156,8 +155,6 @@ $ crackNum --gui 0xdeadbeef -- open it pre-filled with a value to decode ``` -See [`GUI/swiftGUI/README.md`](GUI/swiftGUI/README.md) for macOS build details and other build targets.- ### Usage info ``` Usage: crackNum value OR binary/hex-pattern@@ -178,6 +175,7 @@ crackNum -f3+4 2.5 -- encode as float with 3 bits exponent, 4 bits significand crackNum -f3+4 2.5 -rRTZ -- encode as above, but use RTZ rounding mode. crackNum -fbp 2.5 -- encode as a brain-precision float+ crackNum -ftf32 2.5 -- encode as a TensorFloat-32 float crackNum -fdp 2.5 -- encode as a double-precision float crackNum -fe4m3 2.5 -- encode as an E4M3 FP8 float crackNum -fe5m2 2.5 -- encode as an E5M2 FP8 float@@ -189,6 +187,7 @@ crackNum -w4 0xE -- decode as 4-bit unsigned integer, from hex crackNum -f3+4 0b0111001 -- decode as float with 3 bits exponent, 4 bits significand crackNum -fbp 0x000F -- decode as a brain-precision float+ crackNum -ftf32 19\'h0000F -- decode as a TensorFloat-32 float crackNum -fdp 0x8000000000000000 -- decode as a double-precision float crackNum -fhp 0x8000 -- decode as a half-precision float crackNum -ffp4 0b0111 -- decode as an FP4 (E2M1) float
crackNum.cabal view
@@ -1,8 +1,8 @@ Cabal-version : 2.2 Name : crackNum-Version : 3.20+Version : 3.21 Synopsis : Crack various integer and floating-point data formats-Description : Crack IEEE-754 float formats and arbitrary sized words and integers, showing the layout.+Description : Crack IEEE-754 and other float formats and arbitrary sized words and integers, showing the layout. . For details, please see: <http://github.com/LeventErkok/crackNum/> License : BSD-3-Clause
src/CrackNum/Main.hs view
@@ -163,6 +163,7 @@ getFP :: String -> Flag getFP "hp" = Floating $ FP 5 11 getFP "bp" = Floating $ FP 8 8+getFP "tf32" = Floating $ FP 8 11 getFP "sp" = Floating SP getFP "dp" = Floating DP getFP "qp" = Floating $ FP 15 113@@ -178,8 +179,9 @@ , "" , " hp: Half float ( 5 + 11)" , " bp: Brain float ( 8 + 8)"+ , " tf32: TensorFloat-32 ( 8 + 11)" , " sp: Single precision ( 8 + 24)"- , " dp: Single precision (11 + 53)"+ , " dp: Double precision (11 + 53)" , " qp: Quad precision (15 + 113)" , " a+b: Arbitrary IEEE-754 ( a + b)" , " e5m2: FP8 format (IEEE-754) ( 5 + 3)"@@ -246,6 +248,7 @@ , " " ++ pn ++ " -f3+4 2.5 -- encode as float with 3 bits exponent, 4 bits significand" , " " ++ pn ++ " -f3+4 2.5 -rRTZ -- encode as above, but use RTZ rounding mode." , " " ++ pn ++ " -fbp 2.5 -- encode as a brain-precision float"+ , " " ++ pn ++ " -ftf32 2.5 -- encode as a TensorFloat-32 float" , " " ++ pn ++ " -fdp 2.5 -- encode as a double-precision float" , " " ++ pn ++ " -fe4m3 2.5 -- encode as an E4M3 FP8 float" , " " ++ pn ++ " -fe5m2 2.5 -- encode as an E5M2 FP8 float"@@ -257,6 +260,7 @@ , " " ++ pn ++ " -w4 0xE -- decode as 4-bit unsigned integer, from hex" , " " ++ pn ++ " -f3+4 0b0111001 -- decode as float with 3 bits exponent, 4 bits significand" , " " ++ pn ++ " -fbp 0x000F -- decode as a brain-precision float"+ , " " ++ pn ++ " -ftf32 19\\'h0000F -- decode as a TensorFloat-32 float" , " " ++ pn ++ " -fdp 0x8000000000000000 -- decode as a double-precision float" , " " ++ pn ++ " -fhp 0x8000 -- decode as a half-precision float" , " " ++ pn ++ " -ffp4 0b0111 -- decode as an FP4 (E2M1) float"
src/CrackNum/TestSuite.hs view
@@ -71,6 +71,9 @@ , gold "encode17" "-fsp -- -0x2p3" , gold "encode18" "-fdp -- 0x1.3" , gold "encode19" "-fhp -- 0x1.3p4"+ , gold "encode20" "-ftf32 2.5"+ , gold "encode21" "-ftf32 -- -inf"+ , gold "encode22" "-ftf32 nan" ] , testGroup "EncodeE4M3" [ gold "encodeE4M3_nan" "-fe4m3 nan"@@ -128,6 +131,8 @@ , gold "decode6" "-fhp -l8 128'hffffffffffffffffbdffaaffdc71fc60" , gold "decode7" "-fe5m2 0b01111011" , gold "decode8" "-w2 -rRNE 2\'h1"+ , gold "decode9" "-ftf32 19\'h0000F"+ , gold "decode10" "-ftf32 0b0_10000000_0100000000" ] , testGroup "DecodeE4M3" [ gold ("decodeE4M3_" ++ show (if sign then (-val :: Int) else val))