diff mbox series

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

Message ID 0348fc190a61972c782a3bff13716aec0ece2d76.1717134752.git.linkw@linux.ibm.com
State New
Headers show
Series Replace {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE with new hook | expand

Commit Message

Kewen.Lin June 3, 2024, 3:01 a.m. UTC
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.
---
 gcc/config/gcn/gcn.h | 3 ---
 1 file changed, 3 deletions(-)

Comments

Andrew Stubbs June 3, 2024, 9:14 a.m. UTC | #1
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_SIZE	  64
>   #define DEFAULT_SIGNED_CHAR	  1
>   #define PCC_BITFIELD_TYPE_MATTERS 1
>
Kewen.Lin June 3, 2024, 9:41 a.m. UTC | #2
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
>>   
>
Jakub Jelinek June 3, 2024, 9:57 a.m. UTC | #3
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
diff mbox series

Patch

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