1 ; RUN: llc -verify-machineinstrs < %s -mtriple=arm64-apple-ios7.0 | 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
4 define i128 @test_simple(i128 %a, i128 %b, i128 %c) {
5 ; CHECK-LABEL: test_simple:
7 %valadd = add i128 %a, %b
8 ; CHECK-LE: adds [[ADDLO:x[0-9]+]], x0, x2
9 ; CHECK-LE-NEXT: adcs [[ADDHI:x[0-9]+]], x1, x3
10 ; CHECK-BE: adds [[ADDLO:x[0-9]+]], x1, x3
11 ; CHECK-BE-NEXT: adcs [[ADDHI:x[0-9]+]], x0, x2
13 %valsub = sub i128 %valadd, %c
14 ; CHECK-LE: subs x0, [[ADDLO]], x4
15 ; CHECK-LE: sbcs x1, [[ADDHI]], x5
16 ; CHECK-BE: subs x1, [[ADDLO]], x5
17 ; CHECK-BE: sbcs x0, [[ADDHI]], x4
23 define i128 @test_imm(i128 %a) {
24 ; CHECK-LABEL: test_imm:
26 %val = add i128 %a, 12
27 ; CHECK-LE: adds x0, x0, #12
28 ; CHECK-LE: adcs x1, x1, {{x[0-9]|xzr}}
29 ; CHECK-BE: adds x1, x1, #12
30 ; CHECK-BE: adcs x0, x0, {{x[0-9]|xzr}}
36 define i128 @test_shifted(i128 %a, i128 %b) {
37 ; CHECK-LABEL: test_shifted:
39 %rhs = shl i128 %b, 45
41 %val = add i128 %a, %rhs
42 ; CHECK-LE: adds x0, x0, x2, lsl #45
43 ; CHECK-LE: adcs x1, x1, {{x[0-9]}}
44 ; CHECK-BE: adds x1, x1, x3, lsl #45
45 ; CHECK-BE: adcs x0, x0, {{x[0-9]}}
51 define i128 @test_extended(i128 %a, i16 %b) {
52 ; CHECK-LABEL: test_extended:
54 %ext = sext i16 %b to i128
55 %rhs = shl i128 %ext, 3
57 %val = add i128 %a, %rhs
58 ; CHECK-LE: adds x0, x0, w2, sxth #3
59 ; CHECK-LE: adcs x1, x1, {{x[0-9]}}
60 ; CHECK-BE: adds x1, x1, w2, sxth #3
61 ; CHECK-BE: adcs x0, x0, {{x[0-9]}}