diff options
| author | amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-06 00:19:07 +0000 |
|---|---|---|
| committer | amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-06 00:19:07 +0000 |
| commit | 75e370bf372f6f79893e2055274f4e144e654fc5 (patch) | |
| tree | a7be3e357f1cfffb597c51ba7a8d89e09bc5a8f7 | |
| parent | a61eea5a11c681a3625b25af7757d6b75a0c71bb (diff) | |
| download | ppe42-gcc-75e370bf372f6f79893e2055274f4e144e654fc5.tar.gz ppe42-gcc-75e370bf372f6f79893e2055274f4e144e654fc5.zip | |
* config/rs6000/rs6000.md (bswapdi 2nd splitter): Don't swap words
twice for little-endian.
(ashrdi3_no_power, ashrdi3): Support little-endian.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198618 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/config/rs6000/rs6000.md | 34 |
2 files changed, 29 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5c2aea36ed9..e2cfb396000 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-05-06 Alan Modra <amodra@gmail.com> + + * config/rs6000/rs6000.md (bswapdi 2nd splitter): Don't swap words + twice for little-endian. + (ashrdi3_no_power, ashrdi3): Support little-endian. + 2013-05-06 Oleg Endo <olegendo@gcc.gnu.org> PR target/55303 diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index bdf19f8df47..1e65ac1cde0 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -2329,16 +2329,14 @@ { word_high = change_address (dest, SImode, addr1); word_low = change_address (dest, SImode, addr2); - emit_insn (gen_bswapsi2 (word_high, src_si)); - emit_insn (gen_bswapsi2 (word_low, op3_si)); } else { word_high = change_address (dest, SImode, addr2); word_low = change_address (dest, SImode, addr1); - emit_insn (gen_bswapsi2 (word_low, src_si)); - emit_insn (gen_bswapsi2 (word_high, op3_si)); } + emit_insn (gen_bswapsi2 (word_high, src_si)); + emit_insn (gen_bswapsi2 (word_low, op3_si)); }") (define_split @@ -6634,10 +6632,25 @@ [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r") (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r") (match_operand:SI 2 "const_int_operand" "M,i")))] - "TARGET_32BIT && !TARGET_POWERPC64 && WORDS_BIG_ENDIAN" - "@ - srawi %0,%1,31\;srawi %L0,%1,%h2 - srwi %L0,%L1,%h2\;insrwi %L0,%1,%h2,0\;srawi %0,%1,%h2" + "!TARGET_POWERPC64" + "* +{ + switch (which_alternative) + { + default: + gcc_unreachable (); + case 0: + if (WORDS_BIG_ENDIAN) + return \"srawi %0,%1,31\;srawi %L0,%1,%h2\"; + else + return \"srawi %L0,%L1,31\;srawi %0,%L1,%h2\"; + case 1: + if (WORDS_BIG_ENDIAN) + return \"srwi %L0,%L1,%h2\;insrwi %L0,%1,%h2,0\;srawi %0,%1,%h2\"; + else + return \"srwi %0,%1,%h2\;insrwi %0,%L1,%h2,0\;srawi %L0,%L1,%h2\"; + } +}" [(set_attr "type" "two,three") (set_attr "length" "8,12")]) @@ -7734,13 +7747,12 @@ [(set (match_operand:DI 0 "gpc_reg_operand" "") (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "") (match_operand:SI 2 "reg_or_cint_operand" "")))] - "WORDS_BIG_ENDIAN" + "" " { if (TARGET_POWERPC64) ; - else if (TARGET_32BIT && GET_CODE (operands[2]) == CONST_INT - && WORDS_BIG_ENDIAN) + else if (GET_CODE (operands[2]) == CONST_INT) { emit_insn (gen_ashrdi3_no_power (operands[0], operands[1], operands[2])); DONE; |

