From 4709653ad0801b1d9a55b915aa71fe5a524954e2 Mon Sep 17 00:00:00 2001 From: uros Date: Mon, 12 Apr 2010 20:20:54 +0000 Subject: [PATCH] * config/i386/i386.md (any_rotate): New code iterator. (rotate_insn): New code attribute. (rotate): Ditto. (SWIM124): New mode iterator. (ti3): New expander. (di3): Macroize expander from {rotl,rotr}di3 using any_rotate code iterator. (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_rotl3_doubleword): Macroize insn_and_split pattern from ix86_rotl{di,ti}3 patterns. (ix86_rotr3_doubleword): Ditto from ix86_rotr{di,ti}3 patterns. (*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. (*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. (*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: * gcc.target/i386/rotate-2.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158243 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 68 +++++++++++++++++++++++++++++++++---------------- gcc/config/i386/i386.md | 27 +++++++++++++++----- gcc/testsuite/ChangeLog | 5 +++- 3 files changed, 71 insertions(+), 29 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cb33d45e371..e4b942974b3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,33 @@ +2010-04-12 Uros Bizjak + + * config/i386/i386.md (any_rotate): New code iterator. + (rotate_insn): New code attribute. + (rotate): Ditto. + (SWIM124): New mode iterator. + (ti3): New expander. + (di3): Macroize expander from {rotl,rotr}di3 using + any_rotate code iterator. + (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_rotl3_doubleword): Macroize insn_and_split pattern from + ix86_rotl{di,ti}3 patterns. + (ix86_rotr3_doubleword): Ditto from ix86_rotr{di,ti}3 patterns. + (*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. + (*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. + (*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. + 2010-04-12 Steve Ellcey * config/pa/pa.c (emit_move_sequence): Remove use of @@ -95,8 +125,7 @@ * ipa.c (cgraph_postorder): Adjust postorder to guarantee single-iteration always-inline inlining. * ipa-inline.c (cgraph_mark_inline): Do not return anything. - (cgraph_decide_inlining): Do not handle always-inline - specially. + (cgraph_decide_inlining): Do not handle always-inline specially. (try_inline): Remove always-inline cycle detection special case. Do not recurse on always-inlines. (cgraph_early_inlining): Do not iterate if not optimizing. @@ -151,25 +180,20 @@ * config/i386/i386.md (any_shiftrt): New code iterator. (shiftrt_insn): New code attribute. (shiftrt): Ditto. - (3): Macroize expander from ashr3 and - lshr3 using any_shiftrt code iterator. + (3): Macroize expander from {ashr,lshr}3 + using any_shiftrt code iterator. (*3_doubleword): Macroize insn_and_split from - *ashr3_doubleword and *lshr3_doubleword using - any_shiftrt code iterator. + *{ashr,lshr}3_doubleword using any_shiftrt code iterator. (*3_doubleword peephole2): Macroize peephole2 pattern from corresponding peephole2 patterns. - (*3_1): Macroize insn from *ashr3_1 - and *lshr3_1 using any_shiftrt code iterator. - (*si3_1_zext): Ditto from *ashrsi3_1_zext - and *lshrsi3_1_zext. - (*qi3_1_slp): Ditto from *ashrqi3_1_slp - and *lshrqi3_1_slp. - (*3_cmp): Ditto from *ashr3_cmp - and *lshr3_cmp. - (*3_cmp_zext): Ditto from *ashr3_cmp_zext - and *lshr3_cmp_zext. - (*3_cconly): Ditto from *ashr3_cconly - and *lshr3_cconly. + (*3_1): Macroize insn from *{ashr,lshr}3_1 + using any_shiftrt code iterator. + (*si3_1_zext): Ditto from *{ashr,lshr}si3_1_zext. + (*qi3_1_slp): Ditto from *{ashr,lshr}qi3_1_slp. + (*3_cmp): Ditto from *{ashr,lshr}3_cmp. + (*3_cmp_zext): Ditto from + *{ashr,lshr}3_cmp_zext. + (*3_cconly): Ditto from *{ashr,lshr}3_cconly. 2010-04-11 Uros Bizjak @@ -187,8 +211,8 @@ (*lshr3_doubleword peephole2): Macroize peephole2 pattern from corresponding peephole2 patterns. (*lshr3_1): Merge with *lshr{qi,hi,si}3_1_one_bit and - *lshrdi3_1_one_bit_rex64. Macroize insn from *lshr{qi,hi,si}3_cmp - and *lshrdi3_cmp_rex64 using SWI mode iterator. + *lshrdi3_1_one_bit_rex64. Macroize insn from *lshr{qi,hi,si}3_1 + and *lshrdi3_1_rex64 using SWI mode iterator. (*lshrsi3_1_zext): Merge with *lshrsi3_1_one_bit_zext. (*lshrqi3_1_slp): Merge with *lshrqi3_1_one_bit_slp. (*lshr3_cmp): Merge with *lshr{qi,hi,si}3_one_bit_cmp and @@ -215,8 +239,8 @@ (x86_shift_adj_3): Macroize expander from x86_shift_adj_3 and x86_64_shift_adj_3 using SWI48 mode iterator. (*ashr3_1): Merge with *ashr{qi,hi,si}3_1_one_bit and - *ashrdi3_1_one_bit_rex64. Macroize insn from *ashr{qi,hi,si}3_cmp - and *ashrdi3_cmp_rex64 using SWI mode iterator. + *ashrdi3_1_one_bit_rex64. Macroize insn from *ashr{qi,hi,si}3_1 + and *ashrdi3_1_rex64 using SWI mode iterator. (*ashrsi3_1_zext): Merge with *ashrsi3_1_one_bit_zext. (*ashrqi3_1_slp): Merge with *ashrqi3_1_one_bit_slp. (*ashr3_cmp): Merge with *ashr{qi,hi,si}3_one_bit_cmp and diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 2c2abaf0209..0b0a4f4ff36 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -752,6 +752,15 @@ ;; Base name for insn mnemonic. (define_code_attr shiftrt [(lshiftrt "shr") (ashiftrt "sar")]) +;; Mapping of rotate operators +(define_code_iterator any_rotate [rotate rotatert]) + +;; Base name for define_insn +(define_code_attr rotate_insn [(rotate "rotl") (rotatert "rotr")]) + +;; Base name for insn mnemonic. +(define_code_attr rotate [(rotate "rol") (rotatert "ror")]) + ;; Mapping of abs neg operators (define_code_iterator absneg [abs neg]) @@ -10722,8 +10731,10 @@ (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (, mode, operands)" { - if (operands[2] == const1_rtx - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) + if (REG_P (operands[2])) + return "{}\t{%b2, %0|%0, %b2}"; + else if (operands[2] == const1_rtx + && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) return "{}\t%0"; else return "{}\t{%2, %0|%0, %2}"; @@ -10746,8 +10757,10 @@ (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (, SImode, operands)" { - if (operands[2] == const1_rtx - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) + if (REG_P (operands[2])) + return "{l}\t{%b2, %k0|%k0, %b2}"; + else if (operands[2] == const1_rtx + && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) return "{l}\t%k0"; else return "{l}\t{%2, %k0|%k0, %2}"; @@ -10772,8 +10785,10 @@ || (operands[1] == const1_rtx && TARGET_SHIFT1))" { - if (operands[1] == const1_rtx - && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) + if (REG_P (operands[1])) + return "{b}\t{%b1, %0|%0, %b1}"; + else if (operands[1] == const1_rtx + && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) return "{b}\t%0"; else return "{b}\t{%1, %0|%0, %1}"; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index aeb80a1da5d..ebfa2a9f4ab 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,8 +1,11 @@ +2010-04-12 Uros Bizjak + + * gcc.target/i386/rotate-2.c: New test. + 2010-04-12 Jason Merrill PR c++/43641 * g++.dg/cpp0x/lambda/lambda-conv4.C: New. - * g++.dg/cpp0x/lambda/lambda-deduce2.C: New. 2010-04-12 Fabien Chene -- 2.11.0