• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 --show-mc-encoding| FileCheck %s --check-prefix=NOADX --check-prefix=CHECK
2; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=broadwell --show-mc-encoding| FileCheck %s --check-prefix=ADX --check-prefix=CHECK
3
4declare i8 @llvm.x86.addcarryx.u32(i8, i32, i32, i8*)
5
6define i8 @test_addcarryx_u32(i8 %c, i32 %a, i32 %b, i8* %ptr) {
7; CHECK-LABEL: test_addcarryx_u32
8; CHECK: addb
9; ADX: adcxl
10; CHECK: setb
11; CHECK: retq
12  %ret = tail call i8 @llvm.x86.addcarryx.u32(i8 %c, i32 %a, i32 %b, i8* %ptr)
13  ret i8 %ret;
14}
15
16declare i8 @llvm.x86.addcarryx.u64(i8, i64, i64, i8*)
17
18define i8 @test_addcarryx_u64(i8 %c, i64 %a, i64 %b, i8* %ptr) {
19; CHECK-LABEL: test_addcarryx_u64
20; CHECK: addb
21; ADX: adcxq
22; CHECK: setb
23; CHECK: retq
24  %ret = tail call i8 @llvm.x86.addcarryx.u64(i8 %c, i64 %a, i64 %b, i8* %ptr)
25  ret i8 %ret;
26}
27
28declare i8 @llvm.x86.addcarry.u32(i8, i32, i32, i8*)
29
30define i8 @test_addcarry_u32(i8 %c, i32 %a, i32 %b, i8* %ptr) {
31; CHECK-LABEL: test_addcarry_u32
32; CHECK: addb
33; ADX: adcxl
34; NOADX: adcl
35; CHECK: setb
36; CHECK: retq
37  %ret = tail call i8 @llvm.x86.addcarry.u32(i8 %c, i32 %a, i32 %b, i8* %ptr)
38  ret i8 %ret;
39}
40
41declare i8 @llvm.x86.addcarry.u64(i8, i64, i64, i8*)
42
43define i8 @test_addcarry_u64(i8 %c, i64 %a, i64 %b, i8* %ptr) {
44; CHECK-LABEL: test_addcarry_u64
45; CHECK: addb
46; ADX: adcxq
47; NOADX: adcq
48; CHECK: setb
49; CHECK: retq
50  %ret = tail call i8 @llvm.x86.addcarry.u64(i8 %c, i64 %a, i64 %b, i8* %ptr)
51  ret i8 %ret;
52}
53
54declare i8 @llvm.x86.subborrow.u32(i8, i32, i32, i8*)
55
56define i8 @test_subborrow_u32(i8 %c, i32 %a, i32 %b, i8* %ptr) {
57; CHECK-LABEL: test_subborrow_u32
58; CHECK: addb
59; CHECK: sbbl
60; CHECK: setb
61; CHECK: retq
62  %ret = tail call i8 @llvm.x86.subborrow.u32(i8 %c, i32 %a, i32 %b, i8* %ptr)
63  ret i8 %ret;
64}
65
66declare i8 @llvm.x86.subborrow.u64(i8, i64, i64, i8*)
67
68define i8 @test_subborrow_u64(i8 %c, i64 %a, i64 %b, i8* %ptr) {
69; CHECK-LABEL: test_subborrow_u64
70; CHECK: addb
71; CHECK: sbbq
72; CHECK: setb
73; CHECK: retq
74  %ret = tail call i8 @llvm.x86.subborrow.u64(i8 %c, i64 %a, i64 %b, i8* %ptr)
75  ret i8 %ret;
76}
77
78