case E_TFmode:
return gen_store_pair_dw_tftf (mem1, reg1, mem2, reg2);
+ case E_V4SImode:
+ return gen_vec_store_pairv4siv4si (mem1, reg1, mem2, reg2);
+
default:
gcc_unreachable ();
}
case E_TFmode:
return gen_load_pair_dw_tftf (reg1, mem1, reg2, mem2);
+ case E_V4SImode:
+ return gen_load_pairv4siv4si (reg1, mem1, reg2, mem2);
+
default:
gcc_unreachable ();
}
aarch64_copy_one_block_and_progress_pointers (rtx *src, rtx *dst,
machine_mode mode)
{
+ /* Handle 256-bit memcpy separately. We do this by making 2 adjacent memory
+ address copies using V4SImode so that we can use Q registers. */
+ if (known_eq (GET_MODE_BITSIZE (mode), 256))
+ {
+ mode = V4SImode;
+ rtx reg1 = gen_reg_rtx (mode);
+ rtx reg2 = gen_reg_rtx (mode);
+ /* "Cast" the pointers to the correct mode. */
+ *src = adjust_address (*src, mode, 0);
+ *dst = adjust_address (*dst, mode, 0);
+ /* Emit the memcpy. */
+ emit_insn (aarch64_gen_load_pair (mode, reg1, *src, reg2,
+ aarch64_progress_pointer (*src)));
+ emit_insn (aarch64_gen_store_pair (mode, *dst, reg1,
+ aarch64_progress_pointer (*dst), reg2));
+ /* Move the pointers forward. */
+ *src = aarch64_move_pointer (*src, 32);
+ *dst = aarch64_move_pointer (*dst, 32);
+ return;
+ }
+
rtx reg = gen_reg_rtx (mode);
/* "Cast" the pointers to the correct mode. */
/* Convert n to bits to make the rest of the code simpler. */
n = n * BITS_PER_UNIT;
- /* Maximum amount to copy in one go. The AArch64 back-end has integer modes
- larger than TImode, but we should not use them for loads/stores here. */
- const int copy_limit = GET_MODE_BITSIZE (TImode);
+ /* Maximum amount to copy in one go. We allow 256-bit chunks based on the
+ AARCH64_EXTRA_TUNE_NO_LDP_STP_QREGS tuning parameter and TARGET_SIMD. */
+ const int copy_limit = ((aarch64_tune_params.extra_tuning_flags
+ & AARCH64_EXTRA_TUNE_NO_LDP_STP_QREGS)
+ || !TARGET_SIMD)
+ ? GET_MODE_BITSIZE (TImode) : 256;
while (n > 0)
{
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#define N 8
+extern int src[N], dst[N];
+
+void
+foo (void)
+{
+ __builtin_memcpy (dst, src, N * sizeof (int));
+}
+
+/* { dg-final { scan-assembler {ldp\tq[0-9]*} } } */
+/* { dg-final { scan-assembler-not {ldp\tx[0-9]*} } } */
+/* { dg-final { scan-assembler {stp\tq[0-9]*} } } */
+/* { dg-final { scan-assembler-not {stp\tx[0-9]*} } } */
struct S0 f3;
};
-void fn1 () {
- struct S2 b = {0, 1, 7, 4073709551611, 4, 8, 7};
+void fn1 (struct S2 b) {
a = b.f3;
}
-/* { dg-final { scan-assembler-times {ldp\s+x[0-9]+} 2 } } */
-/* { dg-final { scan-assembler-times {stp\s+x[0-9]+} 2 } } */
+/* { dg-final { scan-assembler-times {ldp\s+q[0-9]+} 1 } } */
+/* { dg-final { scan-assembler-times {stp\s+q[0-9]+} 1 } } */
/* { dg-final { scan-assembler-not {ld[1-3]} } } */