1 ; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu | FileCheck --check-prefix=CHECK --check-prefix=CHECK-LE %s
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64_be-none-linux-gnu | FileCheck --check-prefix=CHECK --check-prefix=CHECK-BE %s
3 ; RUN: llc -verify-machineinstrs < %s -mtriple=arm64-apple-ios7.0 | FileCheck --check-prefix=CHECK --check-prefix=CHECK-LE %s
4 ; RUN: llc -verify-machineinstrs < %s -mtriple=arm64_be-none-linux-gnu | FileCheck --check-prefix=CHECK --check-prefix=CHECK-BE %s
6 define i128 @test_simple(i128 %a, i128 %b, i128 %c) {
7 ; CHECK-LABEL: test_simple:
9 %valadd = add i128 %a, %b
10 ; CHECK-LE: adds [[ADDLO:x[0-9]+]], x0, x2
11 ; CHECK-LE-NEXT: adcs [[ADDHI:x[0-9]+]], x1, x3
12 ; CHECK-BE: adds [[ADDLO:x[0-9]+]], x1, x3
13 ; CHECK-BE-NEXT: adcs [[ADDHI:x[0-9]+]], x0, x2
15 %valsub = sub i128 %valadd, %c
16 ; CHECK-LE: subs x0, [[ADDLO]], x4
17 ; CHECK-LE: sbcs x1, [[ADDHI]], x5
18 ; CHECK-BE: subs x1, [[ADDLO]], x5
19 ; CHECK-BE: sbcs x0, [[ADDHI]], x4
25 define i128 @test_imm(i128 %a) {
26 ; CHECK-LABEL: test_imm:
28 %val = add i128 %a, 12
29 ; CHECK-LE: adds x0, x0, #12
30 ; CHECK-LE: adcs x1, x1, {{x[0-9]|xzr}}
31 ; CHECK-BE: adds x1, x1, #12
32 ; CHECK-BE: adcs x0, x0, {{x[0-9]|xzr}}
38 define i128 @test_shifted(i128 %a, i128 %b) {
39 ; CHECK-LABEL: test_shifted:
41 %rhs = shl i128 %b, 45
43 %val = add i128 %a, %rhs
44 ; CHECK-LE: adds x0, x0, x2, lsl #45
45 ; CHECK-LE: adcs x1, x1, {{x[0-9]}}
46 ; CHECK-BE: adds x1, x1, x3, lsl #45
47 ; CHECK-BE: adcs x0, x0, {{x[0-9]}}
53 define i128 @test_extended(i128 %a, i16 %b) {
54 ; CHECK-LABEL: test_extended:
56 %ext = sext i16 %b to i128
57 %rhs = shl i128 %ext, 3
59 %val = add i128 %a, %rhs
60 ; CHECK-LE: adds x0, x0, w2, sxth #3
61 ; CHECK-LE: adcs x1, x1, {{x[0-9]}}
62 ; CHECK-BE: adds x1, x1, w2, sxth #3
63 ; CHECK-BE: adcs x0, x0, {{x[0-9]}}