xref: /llvm-project/llvm/test/CodeGen/AArch64/sub-splat-sub.ll (revision b8c8bb07692cfb9a78049fd2fb5c46a91ee2e90f)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=aarch64-none-linux-gnu -mattr=+neon,+sve | FileCheck %s
3
4define <16 x i8> @subsubii8(<16 x i8> %a, i8 %b) {
5; CHECK-LABEL: subsubii8:
6; CHECK:       // %bb.0: // %entry
7; CHECK-NEXT:    dup v0.16b, w0
8; CHECK-NEXT:    ret
9entry:
10  %sub = sub i8 0, %b
11  %0 = insertelement <16 x i8> undef, i8 %sub, i32 0
12  %sh_prom = shufflevector <16 x i8> %0, <16 x i8> undef, <16 x i32> zeroinitializer
13  %sub2 = sub <16 x i8> zeroinitializer, %sh_prom
14  ret <16 x i8> %sub2
15}
16
17define <vscale x 16 x i8> @subsubni8(<vscale x 16 x i8> %a, i8 %b) {
18; CHECK-LABEL: subsubni8:
19; CHECK:       // %bb.0: // %entry
20; CHECK-NEXT:    mov z0.b, w0
21; CHECK-NEXT:    ret
22entry:
23  %sub = sub i8 0, %b
24  %0 = insertelement <vscale x 16 x i8> undef, i8 %sub, i32 0
25  %sh_prom = shufflevector <vscale x 16 x i8> %0, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
26  %sub2 = sub <vscale x 16 x i8> zeroinitializer, %sh_prom
27  ret <vscale x 16 x i8> %sub2
28}
29