diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-20 19:35:55 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-20 19:35:55 +0000 |
commit | 0934d9697bba119f2b19d0ab53247300bf9da095 (patch) | |
tree | a99c28e30a1ffc590503139ffa75a83bdb771164 /gcc/config/alpha/alpha.md | |
parent | a2a5e014edf4b391aea3313909a457ce3f1755d9 (diff) | |
download | gcc-0934d9697bba119f2b19d0ab53247300bf9da095.tar.gz |
PR target/28623
* config/alpha/alpha.c (get_unaligned_address): Remove extra_offset
argument; update all callers.
(get_unaligned_offset): New.
* config/alpha/alpha.md (extendqidi2, extendhidi2): Don't use
get_unaligned_address, just pass on the address directly.
(unaligned_extendqidi): Use gen_lowpart instead of open-coding
the subreg in the helper patterns.
(unaligned_extendqidi_le): Use get_unaligned_offset.
(unaligned_extendqidi_be, unaligned_extendhidi_le): Likewise.
(unaligned_extendhidi_be): Likewise.
(unaligned_extendhidi): Tidy.
* config/alpha/alpha-protos.h: Update.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124002 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/alpha/alpha.md')
-rw-r--r-- | gcc/config/alpha/alpha.md | 83 |
1 files changed, 32 insertions, 51 deletions
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md index 7f323af83ea..b86a4777621 100644 --- a/gcc/config/alpha/alpha.md +++ b/gcc/config/alpha/alpha.md @@ -1664,10 +1664,7 @@ if (unaligned_memory_operand (operands[1], QImode)) { - rtx seq - = gen_unaligned_extendqidi (operands[0], - get_unaligned_address (operands[1], 1)); - + rtx seq = gen_unaligned_extendqidi (operands[0], XEXP (operands[1], 0)); alpha_set_memflags (seq, operands[1]); emit_insn (seq); DONE; @@ -1727,9 +1724,7 @@ if (unaligned_memory_operand (operands[1], HImode)) { - rtx seq - = gen_unaligned_extendhidi (operands[0], - get_unaligned_address (operands[1], 2)); + rtx seq = gen_unaligned_extendhidi (operands[0], XEXP (operands[1], 0)); alpha_set_memflags (seq, operands[1]); emit_insn (seq); @@ -1744,12 +1739,13 @@ ;; as a pattern saves one instruction. The code is similar to that for ;; the unaligned loads (see below). ;; -;; Operand 1 is the address + 1 (+2 for HI), operand 0 is the result. +;; Operand 1 is the address, operand 0 is the result. (define_expand "unaligned_extendqidi" [(use (match_operand:QI 0 "register_operand" "")) (use (match_operand:DI 1 "address_operand" ""))] "" { + operands[0] = gen_lowpart (DImode, operands[0]); if (WORDS_BIG_ENDIAN) emit_insn (gen_unaligned_extendqidi_be (operands[0], operands[1])); else @@ -1758,48 +1754,40 @@ }) (define_expand "unaligned_extendqidi_le" - [(set (match_dup 2) (match_operand:DI 1 "address_operand" "")) - (set (match_dup 3) - (mem:DI (and:DI (plus:DI (match_dup 2) (const_int -1)) - (const_int -8)))) + [(set (match_dup 3) + (mem:DI (and:DI (match_operand:DI 1 "" "") (const_int -8)))) (set (match_dup 4) (ashift:DI (match_dup 3) (minus:DI (const_int 64) (ashift:DI (and:DI (match_dup 2) (const_int 7)) (const_int 3))))) - (set (subreg:DI (match_operand:QI 0 "register_operand" "") 0) + (set (match_operand:DI 0 "register_operand" "") (ashiftrt:DI (match_dup 4) (const_int 56)))] "! WORDS_BIG_ENDIAN" { - operands[2] = gen_reg_rtx (DImode); + operands[2] = get_unaligned_offset (operands[1], 1); operands[3] = gen_reg_rtx (DImode); operands[4] = gen_reg_rtx (DImode); }) (define_expand "unaligned_extendqidi_be" - [(set (match_dup 2) (match_operand:DI 1 "address_operand" "")) - (set (match_dup 3) (plus:DI (match_dup 2) (const_int -1))) + [(set (match_dup 3) + (mem:DI (and:DI (match_operand:DI 1 "" "") (const_int -8)))) (set (match_dup 4) - (mem:DI (and:DI (match_dup 3) - (const_int -8)))) - (set (match_dup 5) (plus:DI (match_dup 2) (const_int -2))) - (set (match_dup 6) - (ashift:DI (match_dup 4) + (ashift:DI (match_dup 3) (ashift:DI (and:DI - (plus:DI (match_dup 5) (const_int 1)) + (plus:DI (match_dup 2) (const_int 1)) (const_int 7)) (const_int 3)))) - (set (subreg:DI (match_operand:QI 0 "register_operand" "") 0) - (ashiftrt:DI (match_dup 6) (const_int 56)))] + (set (match_operand:DI 0 "register_operand" "") + (ashiftrt:DI (match_dup 4) (const_int 56)))] "WORDS_BIG_ENDIAN" { - operands[2] = gen_reg_rtx (DImode); + operands[2] = get_unaligned_offset (operands[1], -1); operands[3] = gen_reg_rtx (DImode); operands[4] = gen_reg_rtx (DImode); - operands[5] = gen_reg_rtx (DImode); - operands[6] = gen_reg_rtx (DImode); }) (define_expand "unaligned_extendhidi" @@ -1808,17 +1796,16 @@ "" { operands[0] = gen_lowpart (DImode, operands[0]); - emit_insn ((WORDS_BIG_ENDIAN - ? gen_unaligned_extendhidi_be - : gen_unaligned_extendhidi_le) (operands[0], operands[1])); + if (WORDS_BIG_ENDIAN) + emit_insn (gen_unaligned_extendhidi_be (operands[0], operands[1])); + else + emit_insn (gen_unaligned_extendhidi_le (operands[0], operands[1])); DONE; }) (define_expand "unaligned_extendhidi_le" - [(set (match_dup 2) (match_operand:DI 1 "address_operand" "")) - (set (match_dup 3) - (mem:DI (and:DI (plus:DI (match_dup 2) (const_int -2)) - (const_int -8)))) + [(set (match_dup 3) + (mem:DI (and:DI (match_operand:DI 1 "" "") (const_int -8)))) (set (match_dup 4) (ashift:DI (match_dup 3) (minus:DI (const_int 64) @@ -1829,34 +1816,28 @@ (ashiftrt:DI (match_dup 4) (const_int 48)))] "! WORDS_BIG_ENDIAN" { - operands[2] = gen_reg_rtx (DImode); + operands[2] = get_unaligned_offset (operands[1], 2); operands[3] = gen_reg_rtx (DImode); operands[4] = gen_reg_rtx (DImode); }) (define_expand "unaligned_extendhidi_be" - [(set (match_dup 2) (match_operand:DI 1 "address_operand" "")) - (set (match_dup 3) (plus:DI (match_dup 2) (const_int -2))) + [(set (match_dup 3) + (mem:DI (and:DI (match_operand:DI 1 "" "") (const_int -8)))) (set (match_dup 4) - (mem:DI (and:DI (match_dup 3) - (const_int -8)))) - (set (match_dup 5) (plus:DI (match_dup 2) (const_int -3))) - (set (match_dup 6) - (ashift:DI (match_dup 4) + (ashift:DI (match_dup 3) (ashift:DI (and:DI - (plus:DI (match_dup 5) (const_int 1)) + (plus:DI (match_dup 2) (const_int 1)) (const_int 7)) (const_int 3)))) (set (match_operand:DI 0 "register_operand" "") - (ashiftrt:DI (match_dup 6) (const_int 48)))] + (ashiftrt:DI (match_dup 4) (const_int 48)))] "WORDS_BIG_ENDIAN" { - operands[2] = gen_reg_rtx (DImode); + operands[2] = get_unaligned_offset (operands[1], -1); operands[3] = gen_reg_rtx (DImode); operands[4] = gen_reg_rtx (DImode); - operands[5] = gen_reg_rtx (DImode); - operands[6] = gen_reg_rtx (DImode); }) (define_insn "*extxl_const" @@ -6133,7 +6114,7 @@ else scratch = gen_rtx_REG (DImode, REGNO (operands[2])); - addr = get_unaligned_address (operands[1], 0); + addr = get_unaligned_address (operands[1]); operands[0] = gen_rtx_REG (DImode, REGNO (operands[0])); seq = gen_unaligned_loadqi (operands[0], addr, scratch, operands[0]); alpha_set_memflags (seq, operands[1]); @@ -6167,7 +6148,7 @@ else scratch = gen_rtx_REG (DImode, REGNO (operands[2])); - addr = get_unaligned_address (operands[1], 0); + addr = get_unaligned_address (operands[1]); operands[0] = gen_rtx_REG (DImode, REGNO (operands[0])); seq = gen_unaligned_loadhi (operands[0], addr, scratch, operands[0]); alpha_set_memflags (seq, operands[1]); @@ -6191,7 +6172,7 @@ } else { - rtx addr = get_unaligned_address (operands[0], 0); + rtx addr = get_unaligned_address (operands[0]); rtx scratch1 = gen_rtx_REG (DImode, REGNO (operands[2])); rtx scratch2 = gen_rtx_REG (DImode, REGNO (operands[2]) + 1); rtx scratch3 = scratch1; @@ -6223,7 +6204,7 @@ } else { - rtx addr = get_unaligned_address (operands[0], 0); + rtx addr = get_unaligned_address (operands[0]); rtx scratch1 = gen_rtx_REG (DImode, REGNO (operands[2])); rtx scratch2 = gen_rtx_REG (DImode, REGNO (operands[2]) + 1); rtx scratch3 = scratch1; |