public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: HAO CHEN GUI <guihaoc@linux.ibm.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>, David <dje.gcc@gmail.com>,
	"Kewen.Lin" <linkw@linux.ibm.com>,
	Peter Bergner <bergner@linux.ibm.com>
Subject: Re: [PATCH, rs6000] TARGET_MADDLD should include TARGET_POWERPC64
Date: Thu, 4 Aug 2022 12:24:57 -0500	[thread overview]
Message-ID: <20220804172457.GN25951@gate.crashing.org> (raw)
In-Reply-To: <56510994-541d-e6c7-0b26-6e72e4f030c0@linux.ibm.com>

Hi!

On Thu, Aug 04, 2022 at 11:17:48AM +0800, HAO CHEN GUI wrote:
> On 4/8/2022 上午 12:54, Segher Boessenkool wrote:
> > Hrm.  But the maddld insn is useful for SImode as well, in 32-bit mode,
> > it is just its name that is a bit confusing then.  Sorry for confusing
> > things :-(
> > 
> > Add a test for SImode maddld as well?
> 
>  Thanks for your comments.
> 
>  Just want to double confirm that a maddld test case with "-m32" and
> "-mpowerpc64" is needed. As far as I understand, maddld is a 64-bit
> instruction and it should be used with "-mpowerpc64" in a 32-bit register
> environment.

Nope.  The instruction is fine in pure 32 bit as well.

Almost all instructions actually work on 64 bits, but for many
(including this maddld) the low 32 bits of the result make sense on
their own, as a 32-bit operation done on the low 32 bits of the input
registers.

We have
  (define_mode_iterator GPR [SI (DI "TARGET_POWERPC64")])
so that :DI will not be used for plain -m32 compilations, but it can
(and will, and should) be used for -m32 -mpowerpc64, and :SI can be used
for -m32 in every case.

Instructions that look at the top 32 bits of a GPR need an explicit
TARGET_POWERPC64.


Segher

      reply	other threads:[~2022-08-04 17:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-03  8:24 HAO CHEN GUI
2022-08-03  9:23 ` Kewen.Lin
2022-08-03 16:54 ` Segher Boessenkool
2022-08-04  3:17   ` HAO CHEN GUI
2022-08-04 17:24     ` Segher Boessenkool [this message]

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=20220804172457.GN25951@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=guihaoc@linux.ibm.com \
    --cc=linkw@linux.ibm.com \
    /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).