This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, i386]: macroize rotate patterns


Hello!

This patch macroizes rotate patterns. In addition, it introduces patterns for 128bit integer rotates and (for bonus points ;) ) also adds a testcase that exercises added functionality.

The patch merges *_one_bit_* patterns into master patterns and macroizes merged patterns with mode iterator as well as code iterator. This results in a removal of 244 lines of code from i386.md.

2010-04-12 Uros Bizjak <ubizjak@gmail.com>

    * config/i386/i386.md (any_rotate): New code iterator.
    (rotate_insn): New code attribute.
    (rotate): Ditto.
    (SWIM124): New mode iterator.
    (<rotate_insn>ti3): New expander.
    (<rotate_insn>di3): Macroize expander from {rotl,rotr}di3 using
    any_rotate code iterator.
    (<rotate_insn><mode>3) Macroize expander from {rotl,rotr}{qi,hi,si}3
    using any_rotate code iterator and SWIM124 mode iterator.
    (ix86_rotlti3): New insn_and_split pattern.
    (ix86_rotrti3): Ditto.
    (ix86_rotl<dwi>3_doubleword): Macroize insn_and_split pattern from
    ix86_rotl{di,ti}3 patterns.
    (ix86_rotr<dwi>3_doubleword): Ditto from ix86_rotr{di,ti}3 patterns.
    (*<rotate_insn><mode>3_1): Merge with *{rotl,rotr}{qi,hi,si}3_1_one_bit
    and *{rotl,rotr}di3_1_one_bit_rex64. Macroize insn from
    *{rotl,rotr}{qi,hi,si}3_1 and *{rotl,rotr}di3_1_rex64 using any_rotate
    code iterator and SWI mode iterator.
    (*<rotate_insn>si3_1_zext): Merge with *{rotl,rotr}si3_1_one_bit_zext.
    Macroize insn from {rotl,rotr}si3_1_zext using any_rotate
    code iterator.
    (*<rotate_insn>qi3_1_slp): Merge with *{rotl,rotr}qi3_1_one_bit_slp.
    Macroize insn from {rotl,rotr}qi3_1_slp using any_rotate code iterator.
    (bswap rotatert splitter): Add splitter.
    (bswap splitter): Macroize splitter using any_rotate code iterator.
    Add insn predicate to split only for TARGET_USE_XCHGB or when
    optimizing function for size.

testsuite/ChangeLog:

2010-04-12 Uros Bizjak <ubizjak@gmail.com>

* gcc.target/i386/rotate-2.c: New test.

Patch was tested on x86_64-pc-linux-gnu {,-m32}. Patch was committed to mainline.

Uros.

Attachment: x86-rotate.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]