diff mbox series

[08/52] vms: Replace use of LONG_DOUBLE_TYPE_SIZE

Message ID ad5c9ead1eb40f12ae5d4b7816b93eb8a220620c.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 a.m. UTC
Joseph pointed out "floating types should have their mode,
not a poorly defined precision value" in the discussion[1],
as he and Richi suggested, the existing macros
{FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE will be replaced with a
hook mode_for_floating_type.  To be prepared for that, this
patch is to replace use of LONG_DOUBLE_TYPE_SIZE in vms port
with TYPE_PRECISION of long_double_type_node.

[1] https://gcc.gnu.org/pipermail/gcc-patches/2024-May/651209.html

gcc/ChangeLog:

	* config/vms/vms.cc (vms_patch_builtins): Use TYPE_PRECISION of
	long_double_type_node to replace LONG_DOUBLE_TYPE_SIZE.
---
 gcc/config/vms/vms.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Kewen.Lin June 12, 2024, 9:36 a.m. UTC | #1
Hi,

Gentle ping:

https://gcc.gnu.org/pipermail/gcc-patches/2024-June/653342.html

BR,
Kewen

on 2024/6/3 11:00, Kewen Lin wrote:
> Joseph pointed out "floating types should have their mode,
> not a poorly defined precision value" in the discussion[1],
> as he and Richi suggested, the existing macros
> {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE will be replaced with a
> hook mode_for_floating_type.  To be prepared for that, this
> patch is to replace use of LONG_DOUBLE_TYPE_SIZE in vms port
> with TYPE_PRECISION of long_double_type_node.
> 
> [1] https://gcc.gnu.org/pipermail/gcc-patches/2024-May/651209.html
> 
> gcc/ChangeLog:
> 
> 	* config/vms/vms.cc (vms_patch_builtins): Use TYPE_PRECISION of
> 	long_double_type_node to replace LONG_DOUBLE_TYPE_SIZE.
> ---
>  gcc/config/vms/vms.cc | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/gcc/config/vms/vms.cc b/gcc/config/vms/vms.cc
> index d468c79e559..2fcc673c8a9 100644
> --- a/gcc/config/vms/vms.cc
> +++ b/gcc/config/vms/vms.cc
> @@ -141,6 +141,7 @@ vms_patch_builtins (void)
>    if (builtin_decl_implicit_p (BUILT_IN_FWRITE_UNLOCKED))
>      set_builtin_decl_implicit_p (BUILT_IN_FWRITE_UNLOCKED, false);
>  
> +  unsigned long_double_type_size = TYPE_PRECISION (long_double_type_node);
>    /* Define aliases for names.  */
>    for (i = 0; i < NBR_CRTL_NAMES; i++)
>      {
> @@ -179,7 +180,7 @@ vms_patch_builtins (void)
>  	  vms_add_crtl_xlat (alt, nlen + 1, res, rlen);
>  
>  	  /* Long double version.  */
> -	  res[rlen - 1] = (LONG_DOUBLE_TYPE_SIZE == 128 ? 'X' : 'T');
> +	  res[rlen - 1] = (long_double_type_size == 128 ? 'X' : 'T');
>  	  alt[nlen] = 'l';
>  	  vms_add_crtl_xlat (alt, nlen + 1, res, rlen);
>  
> @@ -223,7 +224,7 @@ vms_patch_builtins (void)
>        if (n->flags & VMS_CRTL_FLOAT64)
>          res[rlen++] = 't';
>  
> -      if ((n->flags & VMS_CRTL_FLOAT128) && LONG_DOUBLE_TYPE_SIZE == 128)
> +      if ((n->flags & VMS_CRTL_FLOAT128) && long_double_type_size == 128)
>          res[rlen++] = 'x';
>  
>        memcpy (res + rlen, n->name, nlen);
diff mbox series

Patch

diff --git a/gcc/config/vms/vms.cc b/gcc/config/vms/vms.cc
index d468c79e559..2fcc673c8a9 100644
--- a/gcc/config/vms/vms.cc
+++ b/gcc/config/vms/vms.cc
@@ -141,6 +141,7 @@  vms_patch_builtins (void)
   if (builtin_decl_implicit_p (BUILT_IN_FWRITE_UNLOCKED))
     set_builtin_decl_implicit_p (BUILT_IN_FWRITE_UNLOCKED, false);
 
+  unsigned long_double_type_size = TYPE_PRECISION (long_double_type_node);
   /* Define aliases for names.  */
   for (i = 0; i < NBR_CRTL_NAMES; i++)
     {
@@ -179,7 +180,7 @@  vms_patch_builtins (void)
 	  vms_add_crtl_xlat (alt, nlen + 1, res, rlen);
 
 	  /* Long double version.  */
-	  res[rlen - 1] = (LONG_DOUBLE_TYPE_SIZE == 128 ? 'X' : 'T');
+	  res[rlen - 1] = (long_double_type_size == 128 ? 'X' : 'T');
 	  alt[nlen] = 'l';
 	  vms_add_crtl_xlat (alt, nlen + 1, res, rlen);
 
@@ -223,7 +224,7 @@  vms_patch_builtins (void)
       if (n->flags & VMS_CRTL_FLOAT64)
         res[rlen++] = 't';
 
-      if ((n->flags & VMS_CRTL_FLOAT128) && LONG_DOUBLE_TYPE_SIZE == 128)
+      if ((n->flags & VMS_CRTL_FLOAT128) && long_double_type_size == 128)
         res[rlen++] = 'x';
 
       memcpy (res + rlen, n->name, nlen);