public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eric Botcazou <ebotcazou@adacore.com>
To: Richard Biener <rguenther@suse.de>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH][RFC] Introduce BIT_FIELD_INSERT
Date: Mon, 16 May 2016 08:24:00 -0000	[thread overview]
Message-ID: <1767442.te1Re9SKKQ@polaris> (raw)
In-Reply-To: <alpine.LSU.2.11.1605131239490.18037@t29.fhfr.qr>

> The following patch adds BIT_FIELD_INSERT, an operation to
> facilitate doing bitfield inserts on registers (as opposed
> to currently where we'd have a BIT_FIELD_REF store).

Why not call it BIT_FIELD_INSERT_EXPR instead to make it clear that it's an 
expression and not a mere operation?

> Originally this was developed as part of bitfield lowering
> where bitfield stores were lowered into read-modify-write
> cycles and the modify part, instead of doing shifting and masking,
> be kept in a more high-level form to ease combining them.
> 
> A second use case (the above is still valid) is vector element
> inserts which we currently can only do via memory or
> by extracting all components and re-building the vector using
> a CONSTRUCTOR.  For this second use case I added code
> re-writing the BIT_FIELD_REF stores the C family FEs produce
> into BIT_FIELD_INSERT when update-address-taken can otherwise
> re-write a decl into SSA form (the testcase shows we miss
> a similar opportunity with the MEM_REF form of a vector insert,
> I plan to fix that for the final submission).

The description in tree.def looks off then, it only mentions words and 
integral types.

> One speciality of BIT_FIELD_INSERT as opposed to BIT_FIELD_REF
> is that the size of the insertion is given implicitely via the
> type size/precision of the value to insert.  That avoids
> introducing ways to have quaternary ops in folding and GIMPLE stmts.

Yes, it's a bit unfortunate, but sensible.  Maybe add a ??? note about that.

-- 
Eric Botcazou

  parent reply	other threads:[~2016-05-16  8:24 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13 10:51 Richard Biener
2016-05-16  0:55 ` Bill Schmidt
2016-05-16 12:37   ` Bill Schmidt
2016-05-17  7:52     ` Richard Biener
2016-05-16  8:24 ` Eric Botcazou [this message]
2016-05-17  7:50   ` Richard Biener
2016-05-17  8:13     ` Eric Botcazou
2016-05-17 15:19     ` Michael Matz
2016-05-19 13:23       ` Richard Biener
2016-05-19 15:21         ` Eric Botcazou
2016-05-20  8:59           ` Richard Biener
2016-05-20 11:25             ` Jakub Jelinek
2016-05-20 11:41               ` Richard Biener
2016-05-20 11:52                 ` Jakub Jelinek
2016-05-20 11:53                   ` Richard Biener
2016-05-20 14:11 ` Andi Kleen
2016-05-20 15:12   ` Marc Glisse
2016-05-20 15:54     ` Andi Kleen
2016-05-20 16:08       ` Jakub Jelinek
2016-05-20 19:25         ` Richard Biener
2016-05-20 17:08       ` Marc Glisse
2018-11-15  1:27 ` Andrew Pinski
2018-11-15  8:29   ` Richard Biener
2018-11-15  8:31     ` Richard Biener
2019-12-17  2:41       ` Andrew Pinski
2019-12-17  3:25         ` Andrew Pinski
2020-01-07  7:37         ` Richard Biener
2020-01-07  9:40           ` Andrew Pinski
2020-01-07 10:04             ` Richard Biener
2020-01-07 11:14               ` Richard Sandiford
2020-01-07 11:38                 ` Richard Biener
2020-01-07 11:52                   ` Richard Sandiford

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=1767442.te1Re9SKKQ@polaris \
    --to=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    /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).