Re: [PATCH] vect: Fix vectorized BIT_FIELD_REF for signed bit-fields [PR110557]

2023-07-07 Thread Xi Ruoyao via Gcc-patches
On Fri, 2023-07-07 at 08:15 +0200, Richard Biener wrote: /* snip */ > > +  bool sign_ext = (!TYPE_UNSIGNED (TREE_TYPE (bf_ref)) && > > +  TYPE_PRECISION (ret_type) > mask_width); > > +  bool widening = ((TYPE_PRECISION (TREE_TYPE (container)) < > > +  

Re: [PATCH] vect: Fix vectorized BIT_FIELD_REF for signed bit-fields [PR110557]

2023-07-07 Thread Richard Biener via Gcc-patches
On Thu, Jul 6, 2023 at 6:18 PM Xi Ruoyao via Gcc-patches wrote: > > If a bit-field is signed and it's wider than the output type, we must > ensure the extracted result sign-extended. But this was not handled > correctly. > > For example: > > int x : 8; > long y : 55; > bool z : 1; >

[PATCH] vect: Fix vectorized BIT_FIELD_REF for signed bit-fields [PR110557]

2023-07-06 Thread Xi Ruoyao via Gcc-patches
If a bit-field is signed and it's wider than the output type, we must ensure the extracted result sign-extended. But this was not handled correctly. For example: int x : 8; long y : 55; bool z : 1; The vectorized extraction of y was: vect__ifc__49.29_110 = MEM [(struct