Re: [PATCH] libgccjit: Add support for setting the alignment [PR104293]

Bernhard Reutner-Fischer rep.dot.nop@gmail.com
Wed Apr 13 11:47:46 GMT 2022


On 12 April 2022 23:51:34 CEST, David Malcolm via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>On Sat, 2022-04-09 at 13:50 -0400, Antoni Boucher wrote:
>> Here's the updated patch.
>> 

>I've pushed the patch to trunk for GCC 12 as r12-8120-g6e5ad1cc24a315.
>
>https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=6e5ad1cc24a315d07f24c95d76c269cafe2a8182


>> > > +   in C, but in bits instead of bytes.
>> > 
>> > If we're doing it in bytes, this will need updating, of course.
>> > 
>> > Maybe rename the int param from "alignment" to "bytes" to make this
>> > clearer.
>> > 
>> > Probably should be unsigned as well.

>> > > +void
>> > > +gcc_jit_lvalue_set_alignment (gcc_jit_lvalue *lvalue,
>> > > +                             int alignment)
>> > > +{
>> > > +  RETURN_IF_FAIL (lvalue, NULL, NULL, "NULL lvalue");
>> > 
>> > Should the alignment be unsigned?  What if the user passes in
>> > negative?
>> > 
>> > Does it have to be a power of two?  If so, ideally we should reject
>> > non-power-of-two here.

The wrapper was changed to unsigned bytes.
set_alignment still takes int bytes AFAICS?

Now I think there are or may be machine dependent max alignment, aren't there? If there are, they are enforced later in the pipeline I assume?

thanks,


More information about the Jit mailing list