2014-04-14 13:18:48 +00:00
|
|
|
; RUN: llc -verify-machineinstrs < %s -mtriple=arm64-apple-ios7.0 | FileCheck --check-prefix=CHECK --check-prefix=CHECK-LE %s
|
2014-05-07 11:28:36 +00:00
|
|
|
; RUN: llc -verify-machineinstrs < %s -mtriple=arm64_be-none-linux-gnu | FileCheck --check-prefix=CHECK --check-prefix=CHECK-BE %s
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
define i128 @test_simple(i128 %a, i128 %b, i128 %c) {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test_simple:
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
%valadd = add i128 %a, %b
|
2014-03-26 14:51:22 +00:00
|
|
|
; CHECK-LE: adds [[ADDLO:x[0-9]+]], x0, x2
|
|
|
|
; CHECK-LE-NEXT: adcs [[ADDHI:x[0-9]+]], x1, x3
|
|
|
|
; CHECK-BE: adds [[ADDLO:x[0-9]+]], x1, x3
|
|
|
|
; CHECK-BE-NEXT: adcs [[ADDHI:x[0-9]+]], x0, x2
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
%valsub = sub i128 %valadd, %c
|
2014-03-26 14:51:22 +00:00
|
|
|
; CHECK-LE: subs x0, [[ADDLO]], x4
|
|
|
|
; CHECK-LE: sbcs x1, [[ADDHI]], x5
|
|
|
|
; CHECK-BE: subs x1, [[ADDLO]], x5
|
|
|
|
; CHECK-BE: sbcs x0, [[ADDHI]], x4
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
ret i128 %valsub
|
|
|
|
; CHECK: ret
|
|
|
|
}
|
|
|
|
|
|
|
|
define i128 @test_imm(i128 %a) {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test_imm:
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
%val = add i128 %a, 12
|
2014-03-26 14:51:22 +00:00
|
|
|
; CHECK-LE: adds x0, x0, #12
|
|
|
|
; CHECK-LE: adcs x1, x1, {{x[0-9]|xzr}}
|
|
|
|
; CHECK-BE: adds x1, x1, #12
|
|
|
|
; CHECK-BE: adcs x0, x0, {{x[0-9]|xzr}}
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
ret i128 %val
|
|
|
|
; CHECK: ret
|
|
|
|
}
|
|
|
|
|
|
|
|
define i128 @test_shifted(i128 %a, i128 %b) {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test_shifted:
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
%rhs = shl i128 %b, 45
|
|
|
|
|
|
|
|
%val = add i128 %a, %rhs
|
2014-03-26 14:51:22 +00:00
|
|
|
; CHECK-LE: adds x0, x0, x2, lsl #45
|
|
|
|
; CHECK-LE: adcs x1, x1, {{x[0-9]}}
|
|
|
|
; CHECK-BE: adds x1, x1, x3, lsl #45
|
|
|
|
; CHECK-BE: adcs x0, x0, {{x[0-9]}}
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
ret i128 %val
|
|
|
|
; CHECK: ret
|
|
|
|
}
|
|
|
|
|
|
|
|
define i128 @test_extended(i128 %a, i16 %b) {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test_extended:
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
%ext = sext i16 %b to i128
|
|
|
|
%rhs = shl i128 %ext, 3
|
|
|
|
|
|
|
|
%val = add i128 %a, %rhs
|
2014-03-26 14:51:22 +00:00
|
|
|
; CHECK-LE: adds x0, x0, w2, sxth #3
|
|
|
|
; CHECK-LE: adcs x1, x1, {{x[0-9]}}
|
|
|
|
; CHECK-BE: adds x1, x1, w2, sxth #3
|
|
|
|
; CHECK-BE: adcs x0, x0, {{x[0-9]}}
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
ret i128 %val
|
|
|
|
; CHECK: ret
|
|
|
|
}
|