Re: Re: [PATCH v2 1/1] [RISC-V] Add support for _Bfloat16

2024-05-04 Thread Xiao Zeng
2024-05-04 23:23  Jeff Law  wrote:
>
 
>
>
>On 4/2/24 3:22 AM, Xiao Zeng wrote:
>> 1 At point ,
>>    BF16 has already been completed "post public review".
>>
>> 2 LLVM has also added support for RISCV BF16 in
>>  and
>> .
>>
>> 3 According to the discussion 
>> ,
>>    this use __bf16 and use DF16b in riscv_mangle_type like x86.
>>
>> Below test are passed for this patch
>>  * The riscv fully regression test.
>>
>> gcc/ChangeLog:
>>
>> * config/riscv/iterators.md: New mode iterator HFBF.
>> * config/riscv/riscv-builtins.cc (riscv_init_builtin_types):
>> Initialize data type _Bfloat16.
>> * config/riscv/riscv-modes.def (FLOAT_MODE): New.
>> (ADJUST_FLOAT_FORMAT): New.
>> * config/riscv/riscv.cc (riscv_mangle_type): Support for BFmode.
>> (riscv_scalar_mode_supported_p): Ditto.
>> (riscv_libgcc_floating_mode_supported_p): Ditto.
>> (riscv_init_libfuncs): Set the conversion method for BFmode and
>> HFmode.
>> (riscv_block_arith_comp_libfuncs_for_mode): Set the arithmetic
>> and comparison libfuncs for the mode.
>> * config/riscv/riscv.md (mode" ): Add BF.
>> (movhf): Support for BFmode.
>> (mov): Ditto.
>> (*movhf_softfloat): Ditto.
>> (*mov_softfloat): Ditto.
>>
>> libgcc/ChangeLog:
>>
>> * config/riscv/sfp-machine.h (_FP_NANFRAC_B): New.
>> (_FP_NANSIGN_B): Ditto.
>> * config/riscv/t-softfp32: Add support for BF16 libfuncs.
>> * config/riscv/t-softfp64: Ditto.
>> * soft-fp/floatsibf.c: For si -> bf16.
>> * soft-fp/floatunsibf.c: For unsi -> bf16.
>>
>> gcc/testsuite/ChangeLog:
>>
>> * gcc.target/riscv/bf16_arithmetic.c: New test.
>> * gcc.target/riscv/bf16_call.c: New test.
>> * gcc.target/riscv/bf16_comparison.c: New test.
>> * gcc.target/riscv/bf16_float_libcall_convert.c: New test.
>> * gcc.target/riscv/bf16_integer_libcall_convert.c: New test.
>Just some nits.  In t-softfp32 and t-softfp64 the code you've added
>should be using tabs, not 8 spaces, as noted by the CI "Lint Status":
>
>https://github.com/ewlu/gcc-precommit-ci/issues/1412#issuecomment-2031568644
In the future, my patch will strictly adhere to the formatting suggestions 
provided by CI.

>
>With that fixed, this is fine for the trunk.  No need to repost, 
>go ahead and commit.
Currently, I do not have commit permission. Can I have this permission?

>
>Thanks for your patience,
>Jeff
 
Thanks
Xiao Zeng



Re: Re:[PATCH v2 1/1] [RISC-V] Add support for _Bfloat16

2024-04-03 Thread Xiao Zeng
2024-04-03 11:19  Jin Ma  wrote:
>
 
>> gcc/testsuite/ChangeLog:
>>
>> * gcc.target/riscv/bf16_arithmetic.c: New test.
>> * gcc.target/riscv/bf16_call.c: New test.
>> * gcc.target/riscv/bf16_comparison.c: New test.
>> * gcc.target/riscv/bf16_float_libcall_convert.c: New test.
>> * gcc.target/riscv/bf16_integer_libcall_convert.c: New test.
>
>  Hi, I have test this patch and it is very good. I think we need to add some
>runable tests to ensure that the results are right for various types of
>conversions, operations, and libfuncs. 
Yes, we must ensure that running tests is also feasible.

A great testcase has already been provided in the gcc test suite: 
gcc/testsuite/g++.dg/cpp23/ext-floating14.C

So, I didn't add any test cases to run the tests.
>
>BR,
>Jin
 
Thanks
Xiao Zeng