Home | History | Annotate | Download | only in PowerPC
      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
      3 
      4 define signext i32 @memcmp8(i32* nocapture readonly %buffer1, i32* nocapture readonly %buffer2) {
      5 ; CHECK-LABEL: memcmp8:
      6 ; CHECK:       # %bb.0:
      7 ; CHECK-NEXT:    ldbrx 3, 0, 3
      8 ; CHECK-NEXT:    ldbrx 4, 0, 4
      9 ; CHECK-NEXT:    subfc 5, 3, 4
     10 ; CHECK-NEXT:    subfe 5, 4, 4
     11 ; CHECK-NEXT:    subfc 4, 4, 3
     12 ; CHECK-NEXT:    subfe 3, 3, 3
     13 ; CHECK-NEXT:    neg 4, 5
     14 ; CHECK-NEXT:    neg 3, 3
     15 ; CHECK-NEXT:    subf 3, 3, 4
     16 ; CHECK-NEXT:    extsw 3, 3
     17 ; CHECK-NEXT:    blr
     18   %t0 = bitcast i32* %buffer1 to i8*
     19   %t1 = bitcast i32* %buffer2 to i8*
     20   %call = tail call signext i32 @memcmp(i8* %t0, i8* %t1, i64 8)
     21   ret i32 %call
     22 }
     23 
     24 define signext i32 @memcmp4(i32* nocapture readonly %buffer1, i32* nocapture readonly %buffer2) {
     25 ; CHECK-LABEL: memcmp4:
     26 ; CHECK:       # %bb.0:
     27 ; CHECK-NEXT:    lwbrx 3, 0, 3
     28 ; CHECK-NEXT:    lwbrx 4, 0, 4
     29 ; CHECK-NEXT:    sub 5, 4, 3
     30 ; CHECK-NEXT:    sub 3, 3, 4
     31 ; CHECK-NEXT:    rldicl 4, 5, 1, 63
     32 ; CHECK-NEXT:    rldicl 3, 3, 1, 63
     33 ; CHECK-NEXT:    subf 3, 3, 4
     34 ; CHECK-NEXT:    extsw 3, 3
     35 ; CHECK-NEXT:    blr
     36   %t0 = bitcast i32* %buffer1 to i8*
     37   %t1 = bitcast i32* %buffer2 to i8*
     38   %call = tail call signext i32 @memcmp(i8* %t0, i8* %t1, i64 4)
     39   ret i32 %call
     40 }
     41 
     42 define signext i32 @memcmp2(i32* nocapture readonly %buffer1, i32* nocapture readonly %buffer2) {
     43 ; CHECK-LABEL: memcmp2:
     44 ; CHECK:       # %bb.0:
     45 ; CHECK-NEXT:    lhbrx 3, 0, 3
     46 ; CHECK-NEXT:    lhbrx 4, 0, 4
     47 ; CHECK-NEXT:    subf 3, 4, 3
     48 ; CHECK-NEXT:    extsw 3, 3
     49 ; CHECK-NEXT:    blr
     50   %t0 = bitcast i32* %buffer1 to i8*
     51   %t1 = bitcast i32* %buffer2 to i8*
     52   %call = tail call signext i32 @memcmp(i8* %t0, i8* %t1, i64 2)
     53   ret i32 %call
     54 }
     55 
     56 define signext i32 @memcmp1(i32* nocapture readonly %buffer1, i32* nocapture readonly %buffer2) {
     57 ; CHECK-LABEL: memcmp1:
     58 ; CHECK:       # %bb.0:
     59 ; CHECK-NEXT:    lbz 3, 0(3)
     60 ; CHECK-NEXT:    lbz 4, 0(4)
     61 ; CHECK-NEXT:    subf 3, 4, 3
     62 ; CHECK-NEXT:    extsw 3, 3
     63 ; CHECK-NEXT:    blr
     64   %t0 = bitcast i32* %buffer1 to i8*
     65   %t1 = bitcast i32* %buffer2 to i8*
     66   %call = tail call signext i32 @memcmp(i8* %t0, i8* %t1, i64 1) #2
     67   ret i32 %call
     68 }
     69 
     70 declare signext i32 @memcmp(i8*, i8*, i64)
     71