; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s 2>%t | FileCheck %s ; RUN: FileCheck --check-prefix=WARN --allow-empty %s <%t ; If this check fails please read test/CodeGen/AArch64/README for instructions on how to resolve it. ; WARN-NOT: warning define @add_i64( %a, %b) { ; CHECK-LABEL: add_i64: ; CHECK: // %bb.0: ; CHECK-NEXT: add z0.d, z0.d, z1.d ; CHECK-NEXT: ret %res = add %a, %b ret %res } define @add_i32( %a, %b) { ; CHECK-LABEL: add_i32: ; CHECK: // %bb.0: ; CHECK-NEXT: add z0.s, z0.s, z1.s ; CHECK-NEXT: ret %res = add %a, %b ret %res } define @add_i16( %a, %b) { ; CHECK-LABEL: add_i16: ; CHECK: // %bb.0: ; CHECK-NEXT: add z0.h, z0.h, z1.h ; CHECK-NEXT: ret %res = add %a, %b ret %res } define @add_i8( %a, %b) { ; CHECK-LABEL: add_i8: ; CHECK: // %bb.0: ; CHECK-NEXT: add z0.b, z0.b, z1.b ; CHECK-NEXT: ret %res = add %a, %b ret %res } define @sub_i64( %a, %b) { ; CHECK-LABEL: sub_i64: ; CHECK: // %bb.0: ; CHECK-NEXT: sub z0.d, z0.d, z1.d ; CHECK-NEXT: ret %res = sub %a, %b ret %res } define @sub_i32( %a, %b) { ; CHECK-LABEL: sub_i32: ; CHECK: // %bb.0: ; CHECK-NEXT: sub z0.s, z0.s, z1.s ; CHECK-NEXT: ret %res = sub %a, %b ret %res } define @sub_i16( %a, %b) { ; CHECK-LABEL: sub_i16: ; CHECK: // %bb.0: ; CHECK-NEXT: sub z0.h, z0.h, z1.h ; CHECK-NEXT: ret %res = sub %a, %b ret %res } define @sub_i8( %a, %b) { ; CHECK-LABEL: sub_i8: ; CHECK: // %bb.0: ; CHECK-NEXT: sub z0.b, z0.b, z1.b ; CHECK-NEXT: ret %res = sub %a, %b ret %res } define @sqadd_i64( %a, %b) { ; CHECK-LABEL: sqadd_i64: ; CHECK: // %bb.0: ; CHECK-NEXT: sqadd z0.d, z0.d, z1.d ; CHECK-NEXT: ret %res = call @llvm.sadd.sat.nxv2i64( %a, %b) ret %res } define @sqadd_i32( %a, %b) { ; CHECK-LABEL: sqadd_i32: ; CHECK: // %bb.0: ; CHECK-NEXT: sqadd z0.s, z0.s, z1.s ; CHECK-NEXT: ret %res = call @llvm.sadd.sat.nxv4i32( %a, %b) ret %res } define @sqadd_i16( %a, %b) { ; CHECK-LABEL: sqadd_i16: ; CHECK: // %bb.0: ; CHECK-NEXT: sqadd z0.h, z0.h, z1.h ; CHECK-NEXT: ret %res = call @llvm.sadd.sat.nxv8i16( %a, %b) ret %res } define @sqadd_i8( %a, %b) { ; CHECK-LABEL: sqadd_i8: ; CHECK: // %bb.0: ; CHECK-NEXT: sqadd z0.b, z0.b, z1.b ; CHECK-NEXT: ret %res = call @llvm.sadd.sat.nxv16i8( %a, %b) ret %res } define @sqsub_i64( %a, %b) { ; CHECK-LABEL: sqsub_i64: ; CHECK: // %bb.0: ; CHECK-NEXT: sqsub z0.d, z0.d, z1.d ; CHECK-NEXT: ret %res = call @llvm.ssub.sat.nxv2i64( %a, %b) ret %res } define @sqsub_i32( %a, %b) { ; CHECK-LABEL: sqsub_i32: ; CHECK: // %bb.0: ; CHECK-NEXT: sqsub z0.s, z0.s, z1.s ; CHECK-NEXT: ret %res = call @llvm.ssub.sat.nxv4i32( %a, %b) ret %res } define @sqsub_i16( %a, %b) { ; CHECK-LABEL: sqsub_i16: ; CHECK: // %bb.0: ; CHECK-NEXT: sqsub z0.h, z0.h, z1.h ; CHECK-NEXT: ret %res = call @llvm.ssub.sat.nxv8i16( %a, %b) ret %res } define @sqsub_i8( %a, %b) { ; CHECK-LABEL: sqsub_i8: ; CHECK: // %bb.0: ; CHECK-NEXT: sqsub z0.b, z0.b, z1.b ; CHECK-NEXT: ret %res = call @llvm.ssub.sat.nxv16i8( %a, %b) ret %res } define @uqadd_i64( %a, %b) { ; CHECK-LABEL: uqadd_i64: ; CHECK: // %bb.0: ; CHECK-NEXT: uqadd z0.d, z0.d, z1.d ; CHECK-NEXT: ret %res = call @llvm.uadd.sat.nxv2i64( %a, %b) ret %res } define @uqadd_i32( %a, %b) { ; CHECK-LABEL: uqadd_i32: ; CHECK: // %bb.0: ; CHECK-NEXT: uqadd z0.s, z0.s, z1.s ; CHECK-NEXT: ret %res = call @llvm.uadd.sat.nxv4i32( %a, %b) ret %res } define @uqadd_i16( %a, %b) { ; CHECK-LABEL: uqadd_i16: ; CHECK: // %bb.0: ; CHECK-NEXT: uqadd z0.h, z0.h, z1.h ; CHECK-NEXT: ret %res = call @llvm.uadd.sat.nxv8i16( %a, %b) ret %res } define @uqadd_i8( %a, %b) { ; CHECK-LABEL: uqadd_i8: ; CHECK: // %bb.0: ; CHECK-NEXT: uqadd z0.b, z0.b, z1.b ; CHECK-NEXT: ret %res = call @llvm.uadd.sat.nxv16i8( %a, %b) ret %res } define @uqsub_i64( %a, %b) { ; CHECK-LABEL: uqsub_i64: ; CHECK: // %bb.0: ; CHECK-NEXT: uqsub z0.d, z0.d, z1.d ; CHECK-NEXT: ret %res = call @llvm.usub.sat.nxv2i64( %a, %b) ret %res } define @uqsub_i32( %a, %b) { ; CHECK-LABEL: uqsub_i32: ; CHECK: // %bb.0: ; CHECK-NEXT: uqsub z0.s, z0.s, z1.s ; CHECK-NEXT: ret %res = call @llvm.usub.sat.nxv4i32( %a, %b) ret %res } define @uqsub_i16( %a, %b) { ; CHECK-LABEL: uqsub_i16: ; CHECK: // %bb.0: ; CHECK-NEXT: uqsub z0.h, z0.h, z1.h ; CHECK-NEXT: ret %res = call @llvm.usub.sat.nxv8i16( %a, %b) ret %res } define @uqsub_i8( %a, %b) { ; CHECK-LABEL: uqsub_i8: ; CHECK: // %bb.0: ; CHECK-NEXT: uqsub z0.b, z0.b, z1.b ; CHECK-NEXT: ret %res = call @llvm.usub.sat.nxv16i8( %a, %b) ret %res } define @mla_i8( %a, %b, %c) { ; CHECK-LABEL: mla_i8: ; CHECK: // %bb.0: ; CHECK-NEXT: ptrue p0.b ; CHECK-NEXT: mla z2.b, p0/m, z0.b, z1.b ; CHECK-NEXT: mov z0.d, z2.d ; CHECK-NEXT: ret %prod = mul %a, %b %res = add %c, %prod ret %res } define @mla_i8_multiuse( %a, %b, %c, * %p) { ; CHECK-LABEL: mla_i8_multiuse: ; CHECK: // %bb.0: ; CHECK-NEXT: ptrue p0.b ; CHECK-NEXT: mul z1.b, p0/m, z1.b, z0.b ; CHECK-NEXT: add z0.b, z2.b, z1.b ; CHECK-NEXT: st1b { z1.b }, p0, [x0] ; CHECK-NEXT: ret %prod = mul %a, %b store %prod, * %p %res = add %c, %prod ret %res } define @mls_i8( %a, %b, %c) { ; CHECK-LABEL: mls_i8: ; CHECK: // %bb.0: ; CHECK-NEXT: ptrue p0.b ; CHECK-NEXT: mls z2.b, p0/m, z0.b, z1.b ; CHECK-NEXT: mov z0.d, z2.d ; CHECK-NEXT: ret %prod = mul %a, %b %res = sub %c, %prod ret %res } declare @llvm.sadd.sat.nxv16i8(, ) declare @llvm.sadd.sat.nxv8i16(, ) declare @llvm.sadd.sat.nxv4i32(, ) declare @llvm.sadd.sat.nxv2i64(, ) declare @llvm.ssub.sat.nxv16i8(, ) declare @llvm.ssub.sat.nxv8i16(, ) declare @llvm.ssub.sat.nxv4i32(, ) declare @llvm.ssub.sat.nxv2i64(, ) declare @llvm.uadd.sat.nxv16i8(, ) declare @llvm.uadd.sat.nxv8i16(, ) declare @llvm.uadd.sat.nxv4i32(, ) declare @llvm.uadd.sat.nxv2i64(, ) declare @llvm.usub.sat.nxv16i8(, ) declare @llvm.usub.sat.nxv8i16(, ) declare @llvm.usub.sat.nxv4i32(, ) declare @llvm.usub.sat.nxv2i64(, )