berkeley-testfloat-3 icon indicating copy to clipboard operation
berkeley-testfloat-3 copied to clipboard

bfloat16_t definition missing?

Open CR3Swapper opened this issue 1 year ago • 3 comments

bfloat16_t is used but never defined. i am also unable to fine its definition inside of softfloat.

CR3Swapper avatar Jan 23 '24 05:01 CR3Swapper

bfloat16_t was added to softfloat's softfloat_types.h by this PR. https://github.com/ucb-bar/berkeley-softfloat-3/blob/080c31c72d5c3fd813584ea990e8a3aa10e902eb/source/include/softfloat_types.h#L51

So it should be present on a recent version of softfloat. Some issues certainly remain (I know at least one patch is being prepared to fix some warnings and some other format tests broken when BFLOAT16 is enabled). Could you provide more details ? (which target are you building on / for, what are the actual errors you get ?)

nibrunieAtSi5 avatar Feb 02 '24 04:02 nibrunieAtSi5

Same issue faced. Here is the error details.

FAILED: subprojects/berkeley-testfloat-3/libtestfloat.a.p/source_test_a_f32_z_ui64_x.c.o cc -m64 -mcx16 -Isubprojects/berkeley-testfloat-3/libtestfloat.a.p -Isubprojects/berkeley-testfloat-3 -I../qemu/subprojects/berkeley-testfloat-3 -Isubprojects/berkeley-softfloat-3 -I../qemu/subprojects/berkeley-softfloat-3 -I../qemu/subprojects/berkeley-softfloat-3/source/include -I../qemu/subprojects/berkeley-softfloat-3/source/8086-SSE -fdiagnostics-color=auto -Wall -Winvalid-pch -Werror -std=gnu99 -O2 -g -Wno-implicit-fallthrough -Wno-strict-prototypes -Wno-unknown-pragmas -Wno-uninitialized -Wno-missing-prototypes -Wno-return-type -Wno-unused-function -Wno-missing-format-attribute -Wno-error -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -fPIE -DSOFTFLOAT_ROUND_ODD -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32 -DSOFTFLOAT_FAST_INT64 -DFLOAT16 -DFLOAT64 -DEXTFLOAT80 -DFLOAT128 -DFLOAT_ROUND_ODD -DLONG_DOUBLE_IS_EXTFLOAT80 -MD -MQ subprojects/berkeley-testfloat-3/libtestfloat.a.p/source_test_a_f32_z_ui64_x.c.o -MF subprojects/berkeley-testfloat-3/libtestfloat.a.p/source_test_a_f32_z_ui64_x.c.o.d -o subprojects/berkeley-testfloat-3/libtestfloat.a.p/source_test_a_f32_z_ui64_x.c.o -c ../qemu/subprojects/berkeley-testfloat-3/source/test_a_f32_z_ui64_x.c In file included from ../qemu/subprojects/berkeley-testfloat-3/source/test_a_f32_z_ui64_x.c:42: ../qemu/subprojects/berkeley-testfloat-3/source/genCases.h:81:8: error: unknown type name ‘bfloat16_t’ 81 | extern bfloat16_t genCases_bf16_a, genCases_bf16_b, genCases_bf16_c; | ^~~~~~~~~~ ninja: build stopped: subcommand failed. make[1]: *** [Makefile:162: run-ninja] Error 1 make[1]: Leaving directory '/home/user/riscv-gnu-toolchain/build-qemu' make: *** [Makefile:913: stamps/build-qemu] Error 2

Thank you

chithambaramoorthii avatar Feb 02 '24 09:02 chithambaramoorthii

bfloat16_t was added to softfloat's softfloat_types.h by this PR. https://github.com/ucb-bar/berkeley-softfloat-3/blob/080c31c72d5c3fd813584ea990e8a3aa10e902eb/source/include/softfloat_types.h#L51

So it should be present on a recent version of softfloat. Some issues certainly remain (I know at least one patch is being prepared to fix some warnings and some other format tests broken when BFLOAT16 is enabled). Could you provide more details ? (which target are you building on / for, what are the actual errors you get ?)

i created a fork of testfloat to compile individual PE files. i can then run these exe's before and after transforming them via binary rewriting/obfuscation techniques to ensure we did not break any semantics of the code.

https://github.com/backengineering/testfloat-pe

I then included pre-compiled versions of these binaries into our larger set of test files which our CI pipeline uses everytime we change our obfuscation passes.

https://github.com/backengineering/bintests

I think i either didnt compile the bfloat related tests or i just commented them out.... Just creating this issue so it can be solved on your end of things, i can do without tests which use bfloat all together...

CR3Swapper avatar Feb 02 '24 18:02 CR3Swapper