Re: [PATCH 17/52] gcn: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-03 Thread Jakub Jelinek
On Mon, Jun 03, 2024 at 05:41:11PM +0800, Kewen.Lin wrote:
> > GCN does have some partially implemented support for HFmode ... do I need 
> > to do something new for that to work?
> 
> For this hook, no, as it's mainly for float, double and long double types (C 
> language supported non decimal floating
> point types).  If you are referring to _Float16, I guess you may be 
> interested in another hook TARGET_FLOATN_MODE
> which is for FloatN types.

You don't need a new hook for that, the current _FloatNN discovery code is all
that is needed.  There should be just one mode for the IEEE compliant
implementations for each size (there is the _Float16 vs. __bf16 but the
latter isn't IEEE compliant, or just IEEE like), so tree.cc should figure
everything out together with the current langhooks.

Jakub



Re: [PATCH 17/52] gcn: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-03 Thread Kewen.Lin
Hi Andrew,

on 2024/6/3 17:14, Andrew Stubbs wrote:
> On 03/06/2024 04:01, Kewen Lin wrote:
>> This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE
>> defines in gcn port.
>>
>> gcc/ChangeLog:
>>
>> * config/gcn/gcn.h (FLOAT_TYPE_SIZE): Remove.
>> (DOUBLE_TYPE_SIZE): Likewise.
>> (LONG_DOUBLE_TYPE_SIZE): Likewise.
> 
> 
> Assuming that this does not enable some long-double mode support that wasn't 
> present before then this LGTM.

Thanks!  Yes, it doesn't, as the default hook implementation returns DFmode for 
long double type.

> 
> GCN does have some partially implemented support for HFmode ... do I need to 
> do something new for that to work?

For this hook, no, as it's mainly for float, double and long double types (C 
language supported non decimal floating
point types).  If you are referring to _Float16, I guess you may be interested 
in another hook TARGET_FLOATN_MODE
which is for FloatN types.

BR,
Kewen

> 
> Andrew
> 
>> ---
>>   gcc/config/gcn/gcn.h | 3 ---
>>   1 file changed, 3 deletions(-)
>>
>> diff --git a/gcc/config/gcn/gcn.h b/gcc/config/gcn/gcn.h
>> index afa615320ca..e3bfd29c17d 100644
>> --- a/gcc/config/gcn/gcn.h
>> +++ b/gcc/config/gcn/gcn.h
>> @@ -111,9 +111,6 @@
>>   #define INT_TYPE_SIZE  32
>>   #define LONG_TYPE_SIZE  64
>>   #define LONG_LONG_TYPE_SIZE  64
>> -#define FLOAT_TYPE_SIZE  32
>> -#define DOUBLE_TYPE_SIZE  64
>> -#define LONG_DOUBLE_TYPE_SIZE  64
>>   #define DEFAULT_SIGNED_CHAR  1
>>   #define PCC_BITFIELD_TYPE_MATTERS 1
>>   
> 



Re: [PATCH 17/52] gcn: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-03 Thread Andrew Stubbs

On 03/06/2024 04:01, Kewen Lin wrote:

This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE
defines in gcn port.

gcc/ChangeLog:

* config/gcn/gcn.h (FLOAT_TYPE_SIZE): Remove.
(DOUBLE_TYPE_SIZE): Likewise.
(LONG_DOUBLE_TYPE_SIZE): Likewise.



Assuming that this does not enable some long-double mode support that 
wasn't present before then this LGTM.


GCN does have some partially implemented support for HFmode ... do I 
need to do something new for that to work?


Andrew


---
  gcc/config/gcn/gcn.h | 3 ---
  1 file changed, 3 deletions(-)

diff --git a/gcc/config/gcn/gcn.h b/gcc/config/gcn/gcn.h
index afa615320ca..e3bfd29c17d 100644
--- a/gcc/config/gcn/gcn.h
+++ b/gcc/config/gcn/gcn.h
@@ -111,9 +111,6 @@
  #define INT_TYPE_SIZE   32
  #define LONG_TYPE_SIZE  64
  #define LONG_LONG_TYPE_SIZE 64
-#define FLOAT_TYPE_SIZE  32
-#define DOUBLE_TYPE_SIZE 64
-#define LONG_DOUBLE_TYPE_SIZE64
  #define DEFAULT_SIGNED_CHAR 1
  #define PCC_BITFIELD_TYPE_MATTERS 1