diff options
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r-- | llvm/test/CodeGen/AArch64/aarch64-sve-asm-negative.ll | 12 | ||||
-rw-r--r-- | llvm/test/CodeGen/AArch64/aarch64-sve-asm.ll | 44 | ||||
-rw-r--r-- | llvm/test/CodeGen/AArch64/arm64-inline-asm.ll | 2 |
3 files changed, 58 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/aarch64-sve-asm-negative.ll b/llvm/test/CodeGen/AArch64/aarch64-sve-asm-negative.ll new file mode 100644 index 00000000000..ad483f40efb --- /dev/null +++ b/llvm/test/CodeGen/AArch64/aarch64-sve-asm-negative.ll @@ -0,0 +1,12 @@ +; RUN: not llc -mtriple aarch64-none-linux-gnu -mattr=+neon -o %t.s -filetype=asm %s 2>&1 | FileCheck %s + +; The 'y' constraint only applies to SVE vector registers (Z0-Z7) +; The test below ensures that we get an appropriate error should the +; constraint be used with a Neon register. + +; Function Attrs: nounwind readnone +; CHECK: error: couldn't allocate input reg for constraint 'y' +define <4 x i32> @test_neon(<4 x i32> %in1, <4 x i32> %in2) { + %1 = tail call <4 x i32> asm "add $0.4s, $1.4s, $2.4s", "=w,w,y"(<4 x i32> %in1, <4 x i32> %in2) + ret <4 x i32> %1 +} diff --git a/llvm/test/CodeGen/AArch64/aarch64-sve-asm.ll b/llvm/test/CodeGen/AArch64/aarch64-sve-asm.ll new file mode 100644 index 00000000000..2ebb0830810 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/aarch64-sve-asm.ll @@ -0,0 +1,44 @@ +; RUN: llc < %s -mtriple aarch64-none-linux-gnu -mattr=+sve -stop-after=finalize-isel | FileCheck %s --check-prefix=CHECK + +target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128" +target triple = "aarch64-none-linux-gnu" + +; Function Attrs: nounwind readnone +; CHECK: [[ARG1:%[0-9]+]]:zpr = COPY $z1 +; CHECK: [[ARG2:%[0-9]+]]:zpr = COPY $z0 +; CHECK: [[ARG3:%[0-9]+]]:zpr = COPY [[ARG2]] +; CHECK: [[ARG4:%[0-9]+]]:zpr_3b = COPY [[ARG1]] +define <vscale x 16 x i8> @test_svadd_i8(<vscale x 16 x i8> %Zn, <vscale x 16 x i8> %Zm) { + %1 = tail call <vscale x 16 x i8> asm "add $0.b, $1.b, $2.b", "=w,w,y"(<vscale x 16 x i8> %Zn, <vscale x 16 x i8> %Zm) + ret <vscale x 16 x i8> %1 +} + +; Function Attrs: nounwind readnone +; CHECK: [[ARG1:%[0-9]+]]:zpr = COPY $z1 +; CHECK: [[ARG2:%[0-9]+]]:zpr = COPY $z0 +; CHECK: [[ARG3:%[0-9]+]]:zpr = COPY [[ARG2]] +; CHECK: [[ARG4:%[0-9]+]]:zpr_4b = COPY [[ARG1]] +define <vscale x 2 x i64> @test_svsub_i64(<vscale x 2 x i64> %Zn, <vscale x 2 x i64> %Zm) { + %1 = tail call <vscale x 2 x i64> asm "sub $0.d, $1.d, $2.d", "=w,w,x"(<vscale x 2 x i64> %Zn, <vscale x 2 x i64> %Zm) + ret <vscale x 2 x i64> %1 +} + +; Function Attrs: nounwind readnone +; CHECK: [[ARG1:%[0-9]+]]:zpr = COPY $z1 +; CHECK: [[ARG2:%[0-9]+]]:zpr = COPY $z0 +; CHECK: [[ARG3:%[0-9]+]]:zpr = COPY [[ARG2]] +; CHECK: [[ARG4:%[0-9]+]]:zpr_3b = COPY [[ARG1]] +define <vscale x 8 x half> @test_svfmul_f16(<vscale x 8 x half> %Zn, <vscale x 8 x half> %Zm) { + %1 = tail call <vscale x 8 x half> asm "fmul $0.h, $1.h, $2.h", "=w,w,y"(<vscale x 8 x half> %Zn, <vscale x 8 x half> %Zm) + ret <vscale x 8 x half> %1 +} + +; Function Attrs: nounwind readnone +; CHECK: [[ARG1:%[0-9]+]]:zpr = COPY $z1 +; CHECK: [[ARG2:%[0-9]+]]:zpr = COPY $z0 +; CHECK: [[ARG3:%[0-9]+]]:zpr = COPY [[ARG2]] +; CHECK: [[ARG4:%[0-9]+]]:zpr_4b = COPY [[ARG1]] +define <vscale x 4 x float> @test_svfmul_f(<vscale x 4 x float> %Zn, <vscale x 4 x float> %Zm) { + %1 = tail call <vscale x 4 x float> asm "fmul $0.s, $1.s, $2.s", "=w,w,x"(<vscale x 4 x float> %Zn, <vscale x 4 x float> %Zm) + ret <vscale x 4 x float> %1 +} diff --git a/llvm/test/CodeGen/AArch64/arm64-inline-asm.ll b/llvm/test/CodeGen/AArch64/arm64-inline-asm.ll index 82e0a1c3748..3b8b4d84873 100644 --- a/llvm/test/CodeGen/AArch64/arm64-inline-asm.ll +++ b/llvm/test/CodeGen/AArch64/arm64-inline-asm.ll @@ -138,6 +138,8 @@ entry: %a = alloca [2 x float], align 4 %arraydecay = getelementptr inbounds [2 x float], [2 x float]* %a, i32 0, i32 0 %0 = load <2 x float>, <2 x float>* %data, align 8 + call void asm sideeffect "ldr ${1:z}, [$0]\0A", "r,w"(float* %arraydecay, <2 x float> %0) nounwind + ; CHECK: ldr {{z[0-9]+}}, [{{x[0-9]+}}] call void asm sideeffect "ldr ${1:q}, [$0]\0A", "r,w"(float* %arraydecay, <2 x float> %0) nounwind ; CHECK: ldr {{q[0-9]+}}, [{{x[0-9]+}}] call void asm sideeffect "ldr ${1:d}, [$0]\0A", "r,w"(float* %arraydecay, <2 x float> %0) nounwind |