(match_operand:V2DI 3 "aarch64_simd_lshift_imm" "Dl")))]
"TARGET_SHA3"
{
+ /* Translate the RTL left-rotate amount into the assembly right-rotate
+ amount. Modulo by 64 to ensure that a left-rotate of 0 is emitted
+ as a right-rotate of 0 as accepted by the assembly instruction. */
operands[3]
- = GEN_INT (64 - INTVAL (unwrap_const_vec_duplicate (operands[3])));
- return "xar\\t%0.2d, %1.2d, %2.2d, %3";
+ = GEN_INT ((64 - INTVAL (unwrap_const_vec_duplicate (operands[3])))
+ % 64);
+ return "xar\\t%0.2d, %1.2d, %2.2d, #%3";
}
[(set_attr "type" "crypto_sha3")]
)
(match_operand:SI 3 "aarch64_simd_shift_imm_di")))]
"TARGET_SHA3"
{
- operands[3]
- = aarch64_simd_gen_const_vector_dup (V2DImode,
- 64 - INTVAL (operands[3]));
+ operands[3]
+ = aarch64_simd_gen_const_vector_dup (V2DImode,
+ /* In the edge case of a 0 rotate
+ amount leave as is. */
+ operands[3] == CONST0_RTX (SImode)
+ ? 0 : 64 - INTVAL (operands[3]));
}
)
--- /dev/null
+/* PR target/123584. */
+/* { dg-do compile } */
+/* { dg-options "-march=armv8.2-a+sha3" } */
+
+#include <arm_neon.h>
+uint64x2_t
+simde_vld1q_u64(uint64x2_t simde_vld1q_u64_a, uint64x2_t simde_vld1q_u64_b) {
+ return vxarq_u64(simde_vld1q_u64_a, simde_vld1q_u64_b, 0);
+}