public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/99708] __SIZEOF_FLOAT128__ not defined on powerpc64le-linux
Date: Fri, 04 Mar 2022 09:28:45 +0000	[thread overview]
Message-ID: <bug-99708-4-vIu4T2AMVr@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99708-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99708

--- Comment #19 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
builddir/gcc/rs6000-builtins.cc:                               
ibm128_float_type_node,
builddir/gcc/rs6000-builtins.cc:    = build_function_type_list
(ibm128_float_type_node,
rs6000-builtin.cc:  else if (type_node == ibm128_float_type_node)
rs6000-builtin.cc:      ibm128_float_type_node = long_double_type_node;
rs6000-builtin.cc:        ibm128_float_type_node = make_node (REAL_TYPE);
rs6000-builtin.cc:        TYPE_PRECISION (ibm128_float_type_node) = 128;
rs6000-builtin.cc:        SET_TYPE_MODE (ibm128_float_type_node, IFmode);
rs6000-builtin.cc:        layout_type (ibm128_float_type_node);
rs6000-builtin.cc:      t = build_qualified_type (ibm128_float_type_node,
TYPE_QUAL_CONST);
rs6000-builtin.cc:      ptr_ibm128_float_type_node = build_pointer_type (t);
rs6000-builtin.cc:      lang_hooks.types.register_builtin_type
(ibm128_float_type_node,
rs6000-builtin.cc:      ieee128_float_type_node = long_double_type_node;
rs6000-builtin.cc:      ieee128_float_type_node = float128_type_node;
rs6000-builtin.cc:      t = build_qualified_type (ieee128_float_type_node,
TYPE_QUAL_CONST);
rs6000-builtin.cc:      ptr_ieee128_float_type_node = build_pointer_type (t);
rs6000-builtin.cc:      lang_hooks.types.register_builtin_type
(ieee128_float_type_node,
rs6000-builtin.cc:    ieee128_float_type_node = ibm128_float_type_node =
long_double_type_node;
rs6000.cc:       && ieee128_float_type_node == long_double_type_node)
rs6000.cc:        && ibm128_float_type_node == long_double_type_node))
rs6000-c.cc:  if (ibm128_float_type_node)
rs6000-c.cc:  if (ieee128_float_type_node)
rs6000.h:#define ieee128_float_type_node                
(rs6000_builtin_types[RS6000_BTI_ieee128_float])
rs6000.h:#define ibm128_float_type_node         
(rs6000_builtin_types[RS6000_BTI_ibm128_float])
rs6000.h:#define ptr_ieee128_float_type_node    
(rs6000_builtin_types[RS6000_BTI_ptr_ieee128_float])
rs6000.h:#define ptr_ibm128_float_type_node     
(rs6000_builtin_types[RS6000_BTI_ptr_ibm128_float])

I'd guess that else ieee128_float_type_node = ibm128_float_type_node =
long_double_type_node;
is there so that we don't ICE during the builtins creation (we need just
ibm128_float_type_node for it though).
Looking at other uses:
rs6000_type_string does:
  else if (type_node == ibm128_float_type_node)
    return "__ibm128";
could add type_node && to it.  And it also makes me wonder why there is no
ieee128_float_type_node case.
Rest of rs6000-builtin.cc is just the setup and could live without
else ieee128_float_type_node = ibm128_float_type_node = long_double_type_node;
Also, why do we have ptr_*_float_type_node at all when nothing uses those?
rs6000.cc will be fine even with *128_float_type_node NULL,
long_double_type_node is presumably always non-NULL.
rs6000-c.cc is what this PR talks about, so actually needs those to be NULL if
not supported
(but, we still want to move the __SIZEOF_FLOAT128__ handling next to __float128
macro IMNSHO,
if we add also __SIZEOF_IEEE128__ it could stay where __SIZEOF_FLOAT128__ is
defined now).
And finally the generated rs6000-builtins.cc, it does:
  tree df_ftype_if_ci
    = build_function_type_list (double_type_node,
                                ibm128_float_type_node,
                                integer_type_node,
                                NULL_TREE);
  tree if_ftype_df_df
    = build_function_type_list (ibm128_float_type_node,
                                double_type_node,
                                double_type_node,
                                NULL_TREE);
  rs6000_builtin_info[RS6000_BIF_PACK_IF].fntype
    = if_ftype_df_df;
  rs6000_builtin_decls[(int)RS6000_BIF_PACK_IF] = t
    = add_builtin_function ("__builtin_pack_ibm128",
                            if_ftype_df_df,
                            (int)RS6000_BIF_PACK_IF, BUILT_IN_MD,
                            NULL, NULL_TREE);
  TREE_READONLY (t) = 1;
  TREE_NOTHROW (t) = 1;
  rs6000_builtin_info[RS6000_BIF_UNPACK_IF].fntype
    = df_ftype_if_ci;
  rs6000_builtin_decls[(int)RS6000_BIF_UNPACK_IF] = t
    = add_builtin_function ("__builtin_unpack_ibm128",
                            df_ftype_if_ci,
                            (int)RS6000_BIF_UNPACK_IF, BUILT_IN_MD,
                            NULL, NULL_TREE);
  TREE_READONLY (t) = 1;
  TREE_NOTHROW (t) = 1;
Unfortunately it is a generated file.  Dunno what is best for that,
not registering the builtins at all if ibm128_float_type_node is NULL,
or keep doing what it used to, register those with some other type.

  parent reply	other threads:[~2022-03-04  9:28 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22  9:56 [Bug target/99708] New: " jakub at gcc dot gnu.org
2021-03-22 16:42 ` [Bug target/99708] " segher at gcc dot gnu.org
2021-03-22 17:38 ` jakub at gcc dot gnu.org
2021-03-23 20:37 ` segher at gcc dot gnu.org
2021-03-24 10:17 ` jakub at gcc dot gnu.org
2021-03-24 14:50 ` redi at gcc dot gnu.org
2021-03-24 20:57 ` segher at gcc dot gnu.org
2021-03-24 21:13 ` redi at gcc dot gnu.org
2022-03-03 15:34 ` redi at gcc dot gnu.org
2022-03-03 15:37 ` redi at gcc dot gnu.org
2022-03-03 15:39 ` redi at gcc dot gnu.org
2022-03-03 16:30 ` segher at gcc dot gnu.org
2022-03-03 16:35 ` segher at gcc dot gnu.org
2022-03-03 17:05 ` jakub at gcc dot gnu.org
2022-03-03 17:52 ` jakub at gcc dot gnu.org
2022-03-03 18:01 ` jakub at gcc dot gnu.org
2022-03-03 18:07 ` jakub at gcc dot gnu.org
2022-03-03 23:03 ` segher at gcc dot gnu.org
2022-03-03 23:05 ` segher at gcc dot gnu.org
2022-03-04  9:28 ` jakub at gcc dot gnu.org [this message]
2022-03-04 13:46 ` segher at gcc dot gnu.org
2022-03-04 17:37 ` jakub at gcc dot gnu.org
2022-03-04 18:07 ` segher at gcc dot gnu.org
2022-03-04 18:07 ` segher at gcc dot gnu.org
2022-03-04 18:10 ` jakub at gcc dot gnu.org
2022-03-04 19:03 ` segher at gcc dot gnu.org
2022-03-04 19:30 ` jakub at gcc dot gnu.org
2022-03-04 20:22 ` segher at gcc dot gnu.org
2022-03-05 16:23 ` cvs-commit at gcc dot gnu.org
2022-03-06  1:16 ` cvs-commit at gcc dot gnu.org
2022-03-07 20:46 ` segher at gcc dot gnu.org
2022-03-10  9:31 ` cvs-commit at gcc dot gnu.org
2022-03-10 23:02 ` ebotcazou at gcc dot gnu.org
2022-03-10 23:10 ` jakub at gcc dot gnu.org
2022-03-11 23:43 ` cvs-commit at gcc dot gnu.org
2022-03-12  0:09 ` cvs-commit at gcc dot gnu.org
2022-05-20  2:36 ` bergner at gcc dot gnu.org
2023-04-15  2:58 ` cvs-commit at gcc dot gnu.org
2023-04-15  8:51 ` redi at gcc dot gnu.org
2023-04-15  8:52 ` redi at gcc dot gnu.org
2024-04-10 15:48 ` meissner at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-99708-4-vIu4T2AMVr@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).