Skip to content

Commit

Permalink
arm: expand handling of movmisalign for DImode [PR102125]
Browse files Browse the repository at this point in the history
DImode is currently handled only for machines with vector modes
enabled, but this is unduly restrictive and is generally better done
in core registers.

gcc/ChangeLog:

	PR target/102125
	* config/arm/arm.md (movmisaligndi): New define_expand.
	* config/arm/vec-common.md (movmisalign<mode>): Iterate over VDQ mode.
  • Loading branch information
Richard Earnshaw committed Sep 13, 2021
1 parent 408e8b9 commit f0cfd07
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions gcc/config/arm/arm.md
Original file line number Diff line number Diff line change
Expand Up @@ -12617,6 +12617,22 @@
}"
)

;; movmisalign for DImode
(define_expand "movmisaligndi"
[(match_operand:DI 0 "general_operand")
(match_operand:DI 1 "general_operand")]
"unaligned_access"
{
rtx lo_op0 = gen_lowpart (SImode, operands[0]);
rtx lo_op1 = gen_lowpart (SImode, operands[1]);
rtx hi_op0 = gen_highpart_mode (SImode, DImode, operands[0]);
rtx hi_op1 = gen_highpart_mode (SImode, DImode, operands[1]);

emit_insn (gen_movmisalignsi (lo_op0, lo_op1));
emit_insn (gen_movmisalignsi (hi_op0, hi_op1));
DONE;
})

;; movmisalign patterns for HImode and SImode.
(define_expand "movmisalign<mode>"
[(match_operand:HSI 0 "general_operand")
Expand Down
4 changes: 2 additions & 2 deletions gcc/config/arm/vec-common.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@
})

(define_expand "movmisalign<mode>"
[(set (match_operand:VDQX 0 "neon_perm_struct_or_reg_operand")
(unspec:VDQX [(match_operand:VDQX 1 "neon_perm_struct_or_reg_operand")]
[(set (match_operand:VDQ 0 "neon_perm_struct_or_reg_operand")
(unspec:VDQ [(match_operand:VDQ 1 "neon_perm_struct_or_reg_operand")]
UNSPEC_MISALIGNED_ACCESS))]
"ARM_HAVE_<MODE>_LDST && !BYTES_BIG_ENDIAN
&& unaligned_access && !TARGET_REALLY_IWMMXT"
Expand Down

0 comments on commit f0cfd07

Please sign in to comment.