public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/106532] riscv fails to build enabling ZBA/ZBB/ZBC/ZBS by default for 32bit
Date: Fri, 05 Aug 2022 00:40:54 +0000	[thread overview]
Message-ID: <bug-106532-4-Ijc2pfGKrK@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106532-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Oh why oh why:
  /* Check whether the constant can be loaded in a single
     instruction with zbs extensions.  */
  if (TARGET_64BIT && TARGET_ZBS && SINGLE_BIT_MASK_OPERAND (INTVAL (op)))
    return false;


But:
  if (TARGET_ZBS && SINGLE_BIT_MASK_OPERAND (value))
    {
      /* Simply BSETI.  */
      codes[0].code = UNKNOWN;
      codes[0].value = value;

      /* RISC-V sign-extends all 32bit values that live in a 32bit
         register.  To avoid paradoxes, we thus need to use the
         sign-extended (negative) representation (-1 << 31) for the
         value, if we want to build (1 << 31) in SImode.  This will
         then expand to an LUI instruction.  */
      if (mode == SImode && value == (HOST_WIDE_INT_1U << 31))
        codes[0].value = (HOST_WIDE_INT_M1U << 31);

      return 1;
    }

  parent reply	other threads:[~2022-08-05  0:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04 23:32 [Bug target/106532] New: " pinskia at gcc dot gnu.org
2022-08-04 23:32 ` [Bug target/106532] " pinskia at gcc dot gnu.org
2022-08-04 23:36 ` pinskia at gcc dot gnu.org
2022-08-04 23:50 ` pinskia at gcc dot gnu.org
2022-08-05  0:17 ` pinskia at gcc dot gnu.org
2022-08-05  0:18 ` pinskia at gcc dot gnu.org
2022-08-05  0:40 ` pinskia at gcc dot gnu.org [this message]
2022-08-05  1:02 ` pinskia at gcc dot gnu.org
2022-08-05  2:44 ` pinskia at gcc dot gnu.org
2022-08-11 15:44 ` kito at gcc dot gnu.org
2023-01-04 17:14 ` pinskia at gcc dot gnu.org
2023-05-01 19:20 ` pinskia at gcc dot gnu.org
2023-05-01 19:32 ` david_harris at hmc dot edu

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-106532-4-Ijc2pfGKrK@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).