RISC-V: Support -fexcess-precision=16

Message ID 20220909094326.22995-1-palmer@rivosinc.com
State New, archived
Headers
Series RISC-V: Support -fexcess-precision=16 |

Commit Message

Palmer Dabbelt Sept. 9, 2022, 9:43 a.m. UTC
  This fixes f19a327077e ("Support -fexcess-precision=16 which will enable
FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16 when backend supports _Float16.") on
RISC-V targets.

gcc/ChangeLog

	PR target/106815
	* config/riscv/riscv.cc (riscv_excess_precision): Add support
	for EXCESS_PRECISION_TYPE_FLOAT16.
---
 gcc/config/riscv/riscv.cc | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Kito Cheng Sept. 9, 2022, 9:56 a.m. UTC | #1
LGTM, seems like you have landed now, see you soon :)

On Fri, Sep 9, 2022 at 5:44 PM Palmer Dabbelt <palmer@rivosinc.com> wrote:
>
> This fixes f19a327077e ("Support -fexcess-precision=16 which will enable
> FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16 when backend supports _Float16.") on
> RISC-V targets.
>
> gcc/ChangeLog
>
>         PR target/106815
>         * config/riscv/riscv.cc (riscv_excess_precision): Add support
>         for EXCESS_PRECISION_TYPE_FLOAT16.
> ---
>  gcc/config/riscv/riscv.cc | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
> index 675d92c0961..9b6d3e95b1b 100644
> --- a/gcc/config/riscv/riscv.cc
> +++ b/gcc/config/riscv/riscv.cc
> @@ -5962,6 +5962,7 @@ riscv_excess_precision (enum excess_precision_type type)
>        return (TARGET_ZFH ? FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16
>                          : FLT_EVAL_METHOD_PROMOTE_TO_FLOAT);
>      case EXCESS_PRECISION_TYPE_IMPLICIT:
> +    case EXCESS_PRECISION_TYPE_FLOAT16:
>        return FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16;
>      default:
>        gcc_unreachable ();
> --
> 2.34.1
>
  
Palmer Dabbelt Sept. 30, 2022, 10:23 p.m. UTC | #2
On Fri, 09 Sep 2022 02:56:26 PDT (-0700), Kito Cheng wrote:
> LGTM, seems like you have landed now, see you soon :)

Committed.

>
> On Fri, Sep 9, 2022 at 5:44 PM Palmer Dabbelt <palmer@rivosinc.com> wrote:
>>
>> This fixes f19a327077e ("Support -fexcess-precision=16 which will enable
>> FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16 when backend supports _Float16.") on
>> RISC-V targets.
>>
>> gcc/ChangeLog
>>
>>         PR target/106815
>>         * config/riscv/riscv.cc (riscv_excess_precision): Add support
>>         for EXCESS_PRECISION_TYPE_FLOAT16.
>> ---
>>  gcc/config/riscv/riscv.cc | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
>> index 675d92c0961..9b6d3e95b1b 100644
>> --- a/gcc/config/riscv/riscv.cc
>> +++ b/gcc/config/riscv/riscv.cc
>> @@ -5962,6 +5962,7 @@ riscv_excess_precision (enum excess_precision_type type)
>>        return (TARGET_ZFH ? FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16
>>                          : FLT_EVAL_METHOD_PROMOTE_TO_FLOAT);
>>      case EXCESS_PRECISION_TYPE_IMPLICIT:
>> +    case EXCESS_PRECISION_TYPE_FLOAT16:
>>        return FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16;
>>      default:
>>        gcc_unreachable ();
>> --
>> 2.34.1
>>
To:          gcc-patches@gcc.gnu.org
CC:          gcc-patches@gcc.gnu.org
Subject:     Re: [PATCH] RISC-V: Support -fexcess-precision=16
In-Reply-To: <CA+yXCZCeULa9pUpP73UwjG0dGZDvbkFTDE8KHqVb8JiT-vpEiQ@mail.gmail.com>

On Fri, 09 Sep 2022 02:56:26 PDT (-0700), gcc-patches@gcc.gnu.org wrote:
> LGTM, seems like you have landed now, see you soon :)
>
> On Fri, Sep 9, 2022 at 5:44 PM Palmer Dabbelt <palmer@rivosinc.com> wrote:
>>
>> This fixes f19a327077e ("Support -fexcess-precision=16 which will enable
>> FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16 when backend supports _Float16.") on
>> RISC-V targets.
>>
>> gcc/ChangeLog
>>
>>         PR target/106815
>>         * config/riscv/riscv.cc (riscv_excess_precision): Add support
>>         for EXCESS_PRECISION_TYPE_FLOAT16.
>> ---
>>  gcc/config/riscv/riscv.cc | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
>> index 675d92c0961..9b6d3e95b1b 100644
>> --- a/gcc/config/riscv/riscv.cc
>> +++ b/gcc/config/riscv/riscv.cc
>> @@ -5962,6 +5962,7 @@ riscv_excess_precision (enum excess_precision_type type)
>>        return (TARGET_ZFH ? FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16
>>                          : FLT_EVAL_METHOD_PROMOTE_TO_FLOAT);
>>      case EXCESS_PRECISION_TYPE_IMPLICIT:
>> +    case EXCESS_PRECISION_TYPE_FLOAT16:
>>        return FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16;
>>      default:
>>        gcc_unreachable ();
>> --
>> 2.34.1
>>
  

Patch

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 675d92c0961..9b6d3e95b1b 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -5962,6 +5962,7 @@  riscv_excess_precision (enum excess_precision_type type)
       return (TARGET_ZFH ? FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16
 			 : FLT_EVAL_METHOD_PROMOTE_TO_FLOAT);
     case EXCESS_PRECISION_TYPE_IMPLICIT:
+    case EXCESS_PRECISION_TYPE_FLOAT16:
       return FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16;
     default:
       gcc_unreachable ();