summaryrefslogtreecommitdiff
path: root/gcc/config/epiphany
diff options
context:
space:
mode:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-28 13:21:59 +0000
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-28 13:21:59 +0000
commit09399c7dc05400a19ae7c1bde08163044dbe0a17 (patch)
tree925ac860d8010e7cc2630f43bd8515877a33e8c8 /gcc/config/epiphany
parent99d1a463f3720e3d8a605d500424ed441ccf9d55 (diff)
downloadgcc-09399c7dc05400a19ae7c1bde08163044dbe0a17.tar.gz
* config/epiphany/epiphany.md (mov<mode>, *mov<mode>_insn): Check
for misaligned memory operands. * config/epiphany/predicates.md (misaligned_operand): New predicate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193890 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/epiphany')
-rw-r--r--gcc/config/epiphany/epiphany.md5
-rw-r--r--gcc/config/epiphany/predicates.md5
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/config/epiphany/epiphany.md b/gcc/config/epiphany/epiphany.md
index 22863e8150e..f65087025e6 100644
--- a/gcc/config/epiphany/epiphany.md
+++ b/gcc/config/epiphany/epiphany.md
@@ -325,6 +325,7 @@
if (epiphany_vect_align != 4 /* == 8 */
&& !reload_in_progress
&& (GET_CODE (operands[0]) == MEM || GET_CODE (operands[1]) == MEM)
+ && !misaligned_operand (operands[1], <MODE>mode)
&& (GET_CODE (operands[0]) != SUBREG
|| (GET_MODE_SIZE (GET_MODE (SUBREG_REG (operands[0])))
!= GET_MODE_SIZE (<MODE>mode)
@@ -355,7 +356,9 @@
ldrd %0,%X1
strd %1,%X0"
"reload_completed
- && ((!MEM_P (operands[0]) && !MEM_P (operands[1]))
+ && (((!MEM_P (operands[0]) || misaligned_operand (operands[0], <MODE>mode))
+ && (!MEM_P (operands[1])
+ || misaligned_operand (operands[1], <MODE>mode)))
|| epiphany_vect_align == 4)"
[(set (match_dup 2) (match_dup 3))
(set (match_dup 4) (match_dup 5))]
diff --git a/gcc/config/epiphany/predicates.md b/gcc/config/epiphany/predicates.md
index 6e96af9fed4..4cbff589b8e 100644
--- a/gcc/config/epiphany/predicates.md
+++ b/gcc/config/epiphany/predicates.md
@@ -350,3 +350,8 @@
(define_predicate "nonsymbolic_immediate_operand"
(ior (match_test "immediate_operand (op, mode)")
(match_code "const_vector"))) /* Is this specific enough? */
+
+;; Return true if OP is misaligned memory operand
+(define_predicate "misaligned_operand"
+ (and (match_code "mem")
+ (match_test "MEM_ALIGN (op) < GET_MODE_ALIGNMENT (mode)")))