1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple=powerpc64le-unknown-gnu-linux < %s | FileCheck %s -check-prefix=CHECK
4 define signext i32 @memcmp8(ptr nocapture readonly %buffer1, ptr nocapture readonly %buffer2) {
5 ; CHECK-LABEL: memcmp8:
7 ; CHECK-NEXT: ldbrx 3, 0, 3
8 ; CHECK-NEXT: ldbrx 4, 0, 4
9 ; CHECK-NEXT: subc 5, 4, 3
10 ; CHECK-NEXT: subfe 5, 4, 4
11 ; CHECK-NEXT: subc 4, 3, 4
12 ; CHECK-NEXT: subfe 3, 3, 3
13 ; CHECK-NEXT: neg 5, 5
14 ; CHECK-NEXT: neg 3, 3
15 ; CHECK-NEXT: sub 3, 5, 3
16 ; CHECK-NEXT: extsw 3, 3
18 %call = tail call signext i32 @memcmp(ptr %buffer1, ptr %buffer2, i64 8)
22 define signext i32 @memcmp4(ptr nocapture readonly %buffer1, ptr nocapture readonly %buffer2) {
23 ; CHECK-LABEL: memcmp4:
25 ; CHECK-NEXT: lwbrx 3, 0, 3
26 ; CHECK-NEXT: lwbrx 4, 0, 4
27 ; CHECK-NEXT: sub 5, 4, 3
28 ; CHECK-NEXT: sub 3, 3, 4
29 ; CHECK-NEXT: rldicl 5, 5, 1, 63
30 ; CHECK-NEXT: rldicl 3, 3, 1, 63
31 ; CHECK-NEXT: sub 3, 5, 3
32 ; CHECK-NEXT: extsw 3, 3
34 %call = tail call signext i32 @memcmp(ptr %buffer1, ptr %buffer2, i64 4)
38 define signext i32 @memcmp2(ptr nocapture readonly %buffer1, ptr nocapture readonly %buffer2) {
39 ; CHECK-LABEL: memcmp2:
41 ; CHECK-NEXT: lhbrx 3, 0, 3
42 ; CHECK-NEXT: lhbrx 4, 0, 4
43 ; CHECK-NEXT: sub 3, 3, 4
44 ; CHECK-NEXT: extsw 3, 3
46 %call = tail call signext i32 @memcmp(ptr %buffer1, ptr %buffer2, i64 2)
50 define signext i32 @memcmp1(ptr nocapture readonly %buffer1, ptr nocapture readonly %buffer2) {
51 ; CHECK-LABEL: memcmp1:
53 ; CHECK-NEXT: lbz 3, 0(3)
54 ; CHECK-NEXT: lbz 4, 0(4)
55 ; CHECK-NEXT: sub 3, 3, 4
56 ; CHECK-NEXT: extsw 3, 3
58 %call = tail call signext i32 @memcmp(ptr %buffer1, ptr %buffer2, i64 1) #2
62 declare signext i32 @memcmp(ptr, ptr, i64)