1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple aarch64-none-linux-gnu -mattr=+dotprod < %s | FileCheck %s
4 define fastcc void @test_sdot_v4i8(i8* noalias nocapture %0, i8* noalias nocapture readonly %1, i8* noalias nocapture readonly %2) {
5 ; CHECK-LABEL: test_sdot_v4i8:
6 ; CHECK: // %bb.0: // %entry
7 ; CHECK-NEXT: ldr w8, [x2]
8 ; CHECK-NEXT: ldr w9, [x1]
9 ; CHECK-NEXT: dup v0.2s, wzr
10 ; CHECK-NEXT: fmov s1, w8
11 ; CHECK-NEXT: fmov s2, w9
12 ; CHECK-NEXT: sdot v0.2s, v1.8b, v2.8b
13 ; CHECK-NEXT: fmov x8, d0
14 ; CHECK-NEXT: str w8, [x0]
17 %3 = bitcast i8* %0 to i32*
18 %4 = load i8, i8* %1, align 1
19 %5 = sext i8 %4 to i32
20 %6 = load i8, i8* %2, align 1
21 %7 = sext i8 %6 to i32
22 %8 = mul nsw i32 %7, %5
23 %9 = getelementptr inbounds i8, i8* %1, i64 1
24 %10 = load i8, i8* %9, align 1
25 %11 = sext i8 %10 to i32
26 %12 = getelementptr inbounds i8, i8* %2, i64 1
27 %13 = load i8, i8* %12, align 1
28 %14 = sext i8 %13 to i32
29 %15 = mul nsw i32 %14, %11
30 %16 = add nsw i32 %15, %8
31 %17 = getelementptr inbounds i8, i8* %1, i64 2
32 %18 = load i8, i8* %17, align 1
33 %19 = sext i8 %18 to i32
34 %20 = getelementptr inbounds i8, i8* %2, i64 2
35 %21 = load i8, i8* %20, align 1
36 %22 = sext i8 %21 to i32
37 %23 = mul nsw i32 %22, %19
38 %24 = add nsw i32 %23, %16
39 %25 = getelementptr inbounds i8, i8* %1, i64 3
40 %26 = load i8, i8* %25, align 1
41 %27 = sext i8 %26 to i32
42 %28 = getelementptr inbounds i8, i8* %2, i64 3
43 %29 = load i8, i8* %28, align 1
44 %30 = sext i8 %29 to i32
45 %31 = mul nsw i32 %30, %27
46 %32 = add nsw i32 %31, %24
47 store i32 %32, i32* %3, align 64
51 define fastcc void @test_udot_v4i8(i8* noalias nocapture %0, i8* noalias nocapture readonly %1, i8* noalias nocapture readonly %2) {
52 ; CHECK-LABEL: test_udot_v4i8:
53 ; CHECK: // %bb.0: // %entry
54 ; CHECK-NEXT: ldr w8, [x2]
55 ; CHECK-NEXT: ldr w9, [x1]
56 ; CHECK-NEXT: dup v0.2s, wzr
57 ; CHECK-NEXT: fmov s1, w8
58 ; CHECK-NEXT: fmov s2, w9
59 ; CHECK-NEXT: udot v0.2s, v1.8b, v2.8b
60 ; CHECK-NEXT: fmov x8, d0
61 ; CHECK-NEXT: str w8, [x0]
64 %3 = bitcast i8* %0 to i32*
65 %4 = load i8, i8* %1, align 1
66 %5 = zext i8 %4 to i32
67 %6 = load i8, i8* %2, align 1
68 %7 = zext i8 %6 to i32
69 %8 = mul nsw i32 %7, %5
70 %9 = getelementptr inbounds i8, i8* %1, i64 1
71 %10 = load i8, i8* %9, align 1
72 %11 = zext i8 %10 to i32
73 %12 = getelementptr inbounds i8, i8* %2, i64 1
74 %13 = load i8, i8* %12, align 1
75 %14 = zext i8 %13 to i32
76 %15 = mul nsw i32 %14, %11
77 %16 = add nsw i32 %15, %8
78 %17 = getelementptr inbounds i8, i8* %1, i64 2
79 %18 = load i8, i8* %17, align 1
80 %19 = zext i8 %18 to i32
81 %20 = getelementptr inbounds i8, i8* %2, i64 2
82 %21 = load i8, i8* %20, align 1
83 %22 = zext i8 %21 to i32
84 %23 = mul nsw i32 %22, %19
85 %24 = add nsw i32 %23, %16
86 %25 = getelementptr inbounds i8, i8* %1, i64 3
87 %26 = load i8, i8* %25, align 1
88 %27 = zext i8 %26 to i32
89 %28 = getelementptr inbounds i8, i8* %2, i64 3
90 %29 = load i8, i8* %28, align 1
91 %30 = zext i8 %29 to i32
92 %31 = mul nsw i32 %30, %27
93 %32 = add nsw i32 %31, %24
94 store i32 %32, i32* %3, align 64