)
(define_insn "*extend<SHORT:mode><GPI:mode>2_aarch64"
- [(set (match_operand:GPI 0 "register_operand" "=r,r")
- (sign_extend:GPI (match_operand:SHORT 1 "nonimmediate_operand" "r,m")))]
+ [(set (match_operand:GPI 0 "register_operand" "=r,r,r")
+ (sign_extend:GPI (match_operand:SHORT 1 "nonimmediate_operand" "r,m,w")))]
""
"@
sxt<SHORT:size>\t%<GPI:w>0, %w1
- ldrs<SHORT:size>\t%<GPI:w>0, %1"
- [(set_attr "type" "extend,load_4")]
+ ldrs<SHORT:size>\t%<GPI:w>0, %1
+ smov\t%w0, %1.<SHORT:size>[0]"
+ [(set_attr "type" "extend,load_4,neon_to_gp")
+ (set_attr "arch" "*,*,fp")]
)
(define_insn "*zero_extend<SHORT:mode><GPI:mode>2_aarch64"
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=armv8.2-a+sve" } */
+
+/* Check that we avoid an explicit sxth in favour of smov. */
+
+#include <arm_sve.h>
+
+int foo(svint16_t a) {
+ return svminv_s16(svptrue_b16(), a);
+}
+
+/* { dg-final { scan-assembler-not "sxth" } } */
#include "clastb_2.c"
/* { dg-final { scan-tree-dump "operating on partial vectors." "vect" } } */
-/* { dg-final { scan-assembler {\tclastb\tw[0-9]+, p[0-7], w[0-9]+, z[0-9]+\.h} } } */
+/* { dg-final { scan-assembler {\tclastb\th[0-9]+, p[0-7], h[0-9]+, z[0-9]+\.h} } } */