aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorStefan Schulze Frielinghaus <stefansf@linux.ibm.com>2020-10-18 19:53:49 +0200
committerStefan Schulze Frielinghaus <stefansf@linux.ibm.com>2020-10-20 08:35:15 +0200
commitbc252d990312274418de69ef2b3a829e03542ac5 (patch)
tree6c1135eb36678af001fe50b58e13fff86da24479 /gcc/config
parent970d683f67777319990b30302a21a860990e2ec8 (diff)
downloadgcc-bc252d990312274418de69ef2b3a829e03542ac5.zip
gcc-bc252d990312274418de69ef2b3a829e03542ac5.tar.gz
gcc-bc252d990312274418de69ef2b3a829e03542ac5.tar.bz2
IBM Z: Emit vector alignment hints for strlen
In case the vectorized version of strlen is used, then each memory access inside the loop is 16-byte aligned. Thus add this kind of information so that vector alignment hints can later on be emitted. gcc/ChangeLog: * config/s390/s390.c (s390_expand_vec_strlen): Add alignment for memory access inside loop.
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/s390/s390.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index dbb541b..f9b27f9 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -5955,6 +5955,7 @@ s390_expand_vec_strlen (rtx target, rtx string, rtx alignment)
rtx temp;
rtx len = gen_reg_rtx (QImode);
rtx cond;
+ rtx mem;
s390_load_address (str_addr_base_reg, XEXP (string, 0));
emit_move_insn (str_idx_reg, const0_rtx);
@@ -5996,10 +5997,10 @@ s390_expand_vec_strlen (rtx target, rtx string, rtx alignment)
LABEL_NUSES (loop_start_label) = 1;
/* Load 16 bytes of the string into VR. */
- emit_move_insn (str_reg,
- gen_rtx_MEM (V16QImode,
- gen_rtx_PLUS (Pmode, str_idx_reg,
- str_addr_base_reg)));
+ mem = gen_rtx_MEM (V16QImode,
+ gen_rtx_PLUS (Pmode, str_idx_reg, str_addr_base_reg));
+ set_mem_align (mem, 128);
+ emit_move_insn (str_reg, mem);
if (into_loop_label != NULL_RTX)
{
emit_label (into_loop_label);