1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=arm64-apple-ios7.0 | FileCheck --check-prefix=CHECK-LE %s
3 ; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64_be-none-linux-gnu | FileCheck --check-prefix=CHECK-BE %s
5 define i128 @test_simple(i128 %a, i128 %b, i128 %c) {
6 ; CHECK-LE-LABEL: test_simple:
8 ; CHECK-LE-NEXT: adds x8, x0, x2
9 ; CHECK-LE-NEXT: adc x9, x1, x3
10 ; CHECK-LE-NEXT: subs x0, x8, x4
11 ; CHECK-LE-NEXT: sbc x1, x9, x5
14 ; CHECK-BE-LABEL: test_simple:
16 ; CHECK-BE-NEXT: adds x8, x1, x3
17 ; CHECK-BE-NEXT: adc x9, x0, x2
18 ; CHECK-BE-NEXT: subs x1, x8, x5
19 ; CHECK-BE-NEXT: sbc x0, x9, x4
22 %valadd = add i128 %a, %b
24 %valsub = sub i128 %valadd, %c
29 define i128 @test_imm(i128 %a) {
30 ; CHECK-LE-LABEL: test_imm:
32 ; CHECK-LE-NEXT: adds x0, x0, #12
33 ; CHECK-LE-NEXT: cinc x1, x1, hs
36 ; CHECK-BE-LABEL: test_imm:
38 ; CHECK-BE-NEXT: adds x1, x1, #12
39 ; CHECK-BE-NEXT: cinc x0, x0, hs
42 %val = add i128 %a, 12
47 define i128 @test_shifted(i128 %a, i128 %b) {
48 ; CHECK-LE-LABEL: test_shifted:
50 ; CHECK-LE-NEXT: extr x8, x3, x2, #19
51 ; CHECK-LE-NEXT: adds x0, x0, x2, lsl #45
52 ; CHECK-LE-NEXT: adc x1, x1, x8
55 ; CHECK-BE-LABEL: test_shifted:
57 ; CHECK-BE-NEXT: extr x8, x2, x3, #19
58 ; CHECK-BE-NEXT: adds x1, x1, x3, lsl #45
59 ; CHECK-BE-NEXT: adc x0, x0, x8
62 %rhs = shl i128 %b, 45
64 %val = add i128 %a, %rhs
69 define i128 @test_extended(i128 %a, i16 %b) {
70 ; CHECK-LE-LABEL: test_extended:
72 ; CHECK-LE-NEXT: ; kill: def $w2 killed $w2 def $x2
73 ; CHECK-LE-NEXT: sxth x8, w2
74 ; CHECK-LE-NEXT: adds x0, x0, w2, sxth #3
75 ; CHECK-LE-NEXT: asr x9, x8, #63
76 ; CHECK-LE-NEXT: extr x8, x9, x8, #61
77 ; CHECK-LE-NEXT: adc x1, x1, x8
80 ; CHECK-BE-LABEL: test_extended:
82 ; CHECK-BE-NEXT: // kill: def $w2 killed $w2 def $x2
83 ; CHECK-BE-NEXT: sxth x8, w2
84 ; CHECK-BE-NEXT: adds x1, x1, w2, sxth #3
85 ; CHECK-BE-NEXT: asr x9, x8, #63
86 ; CHECK-BE-NEXT: extr x8, x9, x8, #61
87 ; CHECK-BE-NEXT: adc x0, x0, x8
90 %ext = sext i16 %b to i128
91 %rhs = shl i128 %ext, 3
93 %val = add i128 %a, %rhs