[PATCH] Improve V?TImode shifts (PR target/82370)

H.J. Lu hjl.tools@gmail.com
Tue Oct 24 12:47:00 GMT 2017


On Fri, Oct 20, 2017 at 12:33 PM, Kirill Yukhin <kirill.yukhin@gmail.com> wrote:
> Hello Jakub, Uroš, Jakub
> On 04 Oct 21:35, Jakub Jelinek wrote:
>> Hi!
>>
>> The following patch tweaks the TImode vector shifts similarly
>> to the earlier vector shift patch, so that for shifts by immediate
>> we can accept a memory input.  Additionally, it removes the vec_shl_*
>> expander, because the middle-end has dropped that a few years ago,
>> and merges the left and right shift patterns using code iterators.
>> Appart from the code/names that can be handled by mode attributes,
>> the only difference was that one of the insns had
>> (set_attr "atom_unit" "sishuf")
>> and the other didn't.  I hope that is just an error, I'd really expect
>> both vpslldq and vpsrldq to use the same atom unit, isn't that the case?
> This was introduced back in 2010. So, I have no info.
> What I can see from config/atom.md:
> ;; if palignr or psrldq
> (define_insn_reservation  "atom_sseishft_2" 1
>   (and (eq_attr "cpu" "atom")
>        (and (eq_attr "type" "sseishft")
>             (and (eq_attr "atom_unit" "sishuf")
>                  (match_operand 2 "immediate_operand"))))
>   "atom-simple-0")
>
> This leads back to initial commit of atom.md.
> So, discrimination of psrldq and pslldq looks intentional.
>
> On the over hand, I see in Software Optimization Guide, Table 14-2 that
> PSRLDQ and PSLLDQ occupy same line which directs both insns to port-0 (p 14-18).
> So, looking from that point, definition for PSLLDQ which allow either of port-0
> and port-1 looks wrong (atom-simple-either reservation).
>
> In absence of other information, I'd play on safe side and leave things as they
> occur right now.
>

I prefer to leave atom.md ASIS.  As for (set_attr "atom_unit"
"sishuf"), it was added
for

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

You can drop (set_attr "atom_unit" "sishuf") if gcc.target/i386/sse2-vec-2a.c
still compiles.


-- 
H.J.



More information about the Gcc-patches mailing list