2015-10-15 22:34:23 +08:00
|
|
|
; RUN: llc -march=mipsel -mattr=mips16 -relocation-model=pic -O3 < %s | FileCheck %s -check-prefix=16
|
2012-10-26 12:46:26 +08:00
|
|
|
|
|
|
|
@i = global i64 4294967295, align 8
|
|
|
|
@j = global i64 15, align 8
|
|
|
|
@ii = global i64 4294967295, align 8
|
|
|
|
@k = common global i64 0, align 8
|
|
|
|
@l = common global i64 0, align 8
|
|
|
|
@m = common global i64 0, align 8
|
|
|
|
|
|
|
|
define void @test1() nounwind {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load i64, i64* @i, align 8
|
|
|
|
%1 = load i64, i64* @j, align 8
|
2012-10-26 12:46:26 +08:00
|
|
|
%add = add nsw i64 %1, %0
|
|
|
|
store i64 %add, i64* @k, align 8
|
|
|
|
; 16: addu ${{[0-9]+}}, ${{[0-9]+}}, ${{[0-9]+}}
|
2017-06-30 04:59:47 +08:00
|
|
|
; 16: addu ${{[0-9]+}}, ${{[0-9]+}}, ${{[0-9]+}}
|
2017-07-13 19:28:05 +08:00
|
|
|
; 16: sltu ${{[0-9]+}}, ${{[0-9]+}}
|
|
|
|
; 16: move ${{[0-9]+}}, $24
|
2012-10-26 12:46:26 +08:00
|
|
|
; 16: addu ${{[0-9]+}}, ${{[0-9]+}}, ${{[0-9]+}}
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test2() nounwind {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load i64, i64* @i, align 8
|
|
|
|
%1 = load i64, i64* @j, align 8
|
2012-10-26 12:46:26 +08:00
|
|
|
%sub = sub nsw i64 %0, %1
|
|
|
|
; 16: subu ${{[0-9]+}}, ${{[0-9]+}}, ${{[0-9]+}}
|
|
|
|
; 16: sltu ${{[0-9]+}}, ${{[0-9]+}}
|
2017-07-13 19:28:05 +08:00
|
|
|
; 16: move ${{[0-9]+}}, $24
|
|
|
|
; 16: subu ${{[0-9]+}}, ${{[0-9]+}}, ${{[0-9]+}}
|
2012-10-26 12:46:26 +08:00
|
|
|
; 16: subu ${{[0-9]+}}, ${{[0-9]+}}, ${{[0-9]+}}
|
|
|
|
store i64 %sub, i64* @l, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test3() nounwind {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load i64, i64* @ii, align 8
|
2012-10-26 12:46:26 +08:00
|
|
|
%add = add nsw i64 %0, 15
|
|
|
|
; 16: addiu ${{[0-9]+}}, 15
|
|
|
|
; 16: sltu ${{[0-9]+}}, ${{[0-9]+}}
|
2017-07-13 19:28:05 +08:00
|
|
|
; 16: move ${{[0-9]+}}, $24
|
2012-10-26 12:46:26 +08:00
|
|
|
; 16: addu ${{[0-9]+}}, ${{[0-9]+}}, ${{[0-9]+}}
|
|
|
|
store i64 %add, i64* @m, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
|