1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-- | FileCheck %s
4 declare i4 @llvm.usub.sat.i4(i4, i4)
5 declare i8 @llvm.usub.sat.i8(i8, i8)
6 declare i16 @llvm.usub.sat.i16(i16, i16)
7 declare i32 @llvm.usub.sat.i32(i32, i32)
8 declare i64 @llvm.usub.sat.i64(i64, i64)
10 define i32 @func(i32 %x, i32 %y) nounwind {
13 ; CHECK-NEXT: subs w8, w0, w1
14 ; CHECK-NEXT: csel w0, wzr, w8, lo
16 %tmp = call i32 @llvm.usub.sat.i32(i32 %x, i32 %y);
20 define i64 @func2(i64 %x, i64 %y) nounwind {
23 ; CHECK-NEXT: subs x8, x0, x1
24 ; CHECK-NEXT: csel x0, xzr, x8, lo
26 %tmp = call i64 @llvm.usub.sat.i64(i64 %x, i64 %y);
30 define i16 @func16(i16 %x, i16 %y) nounwind {
31 ; CHECK-LABEL: func16:
33 ; CHECK-NEXT: lsl w8, w0, #16
34 ; CHECK-NEXT: subs w8, w8, w1, lsl #16
35 ; CHECK-NEXT: csel w8, wzr, w8, lo
36 ; CHECK-NEXT: lsr w0, w8, #16
38 %tmp = call i16 @llvm.usub.sat.i16(i16 %x, i16 %y);
42 define i8 @func8(i8 %x, i8 %y) nounwind {
45 ; CHECK-NEXT: lsl w8, w0, #24
46 ; CHECK-NEXT: subs w8, w8, w1, lsl #24
47 ; CHECK-NEXT: csel w8, wzr, w8, lo
48 ; CHECK-NEXT: lsr w0, w8, #24
50 %tmp = call i8 @llvm.usub.sat.i8(i8 %x, i8 %y);
54 define i4 @func3(i4 %x, i4 %y) nounwind {
57 ; CHECK-NEXT: lsl w8, w0, #28
58 ; CHECK-NEXT: subs w8, w8, w1, lsl #28
59 ; CHECK-NEXT: csel w8, wzr, w8, lo
60 ; CHECK-NEXT: lsr w0, w8, #28
62 %tmp = call i4 @llvm.usub.sat.i4(i4 %x, i4 %y);