On 11/19/20 8:35 PM, Maciej W. Rozycki wrote: > The middle end does not refer to `ctzqi2'/`ctzhi2' or `ffsqi2'/`ffshi2' > patterns by name where `__builtin_ctz' or `__builtin_ffs' respectively > is invoked for an argument of the QImode or HImode type, and instead it > extends the data type before passing it to `ctzsi2' or `ffssi2'. > > Avoid the redundant operation and use a peephole2 to convert it to the > right RTL expression that will collapse the two operations into a single > machine instruction instead unless we need the extended intermediate > result for another purpose. > > gcc/ > * config/vax/builtins.md: Add a peephole2 for QImode and HImode > `ctz' operations. > (any_extend): New code iterator. > > gcc/testsuite/ > * gcc.target/vax/ctzhi.c: New test. > * gcc.target/vax/ctzqi.c: New test. > * gcc.target/vax/ffshi.c: New test. > * gcc.target/vax/ffsqi.c: New test. OK jeff
- Re: [PATCH 12/31] VAX: Actually enable `buil... Jeff Law via Gcc-patches
- [PATCH 13/31] VAX: Add a test for the SImode `ffs... Maciej W. Rozycki
- Re: [PATCH 13/31] VAX: Add a test for the SI... Jeff Law via Gcc-patches
- [PATCH 14/31] VAX: Add tests for `sync_lock_test_... Maciej W. Rozycki
- Re: [PATCH 14/31] VAX: Add tests for `sync_l... Jeff Law via Gcc-patches
- [PATCH 15/31] VAX: Provide the `ctz' operation Maciej W. Rozycki
- Re: [PATCH 15/31] VAX: Provide the `ctz' ope... Jeff Law via Gcc-patches
- [PATCH 16/31] VAX: Also provide QImode and HImode... Maciej W. Rozycki
- Re: [PATCH 16/31] VAX: Also provide QImode a... Jeff Law via Gcc-patches
- [PATCH 17/31] VAX: Actually produce QImode and HI... Maciej W. Rozycki
- Re: [PATCH 17/31] VAX: Actually produce QImo... Jeff Law via Gcc-patches
- [PATCH 18/31] VAX: Add a test for the `cpymemhi' ... Maciej W. Rozycki
- Re: [PATCH 18/31] VAX: Add a test for the `c... Jeff Law via Gcc-patches
- [PATCH 19/31] VAX: Add the `movmemhi' instruction Maciej W. Rozycki
- Re: [PATCH 19/31] VAX: Add the `movmemhi' in... Jeff Law via Gcc-patches
- [PATCH 20/31] VAX: Fix predicates and constraints... Maciej W. Rozycki
- Re: [PATCH 20/31] VAX: Fix predicates and co... Jeff Law via Gcc-patches
- [PATCH 21/31] VAX: Remove EXTV/EXTZV/INSV instruc... Maciej W. Rozycki
- Re: [PATCH 21/31] VAX: Remove EXTV/EXTZV/INS... Jeff Law via Gcc-patches
- [PATCH 22/31] VAX: Ensure PIC mode address is adj... Maciej W. Rozycki
- Re: [PATCH 22/31] VAX: Ensure PIC mode addre... Jeff Law via Gcc-patches