2016-06-24 12:23:17 +00:00
|
|
|
; RUN: llc -march=mips64el -mcpu=mips64r2 < %s | FileCheck -check-prefixes=ALL,MIPS %s
|
|
|
|
; RUN: llc -march=mips64el -mcpu=mips64r6 -mattr=micromips < %s | FileCheck -check-prefixes=ALL,MICROMIPS %s
|
2011-09-30 03:18:46 +00:00
|
|
|
|
|
|
|
define i64 @f0(i64 %a0, i64 %a1) nounwind readnone {
|
|
|
|
entry:
|
2016-06-16 07:06:25 +00:00
|
|
|
; ALL: dsllv
|
2011-09-30 03:18:46 +00:00
|
|
|
%shl = shl i64 %a0, %a1
|
|
|
|
ret i64 %shl
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @f1(i64 %a0, i64 %a1) nounwind readnone {
|
|
|
|
entry:
|
2016-06-16 07:06:25 +00:00
|
|
|
; ALL: dsrav
|
2011-09-30 03:18:46 +00:00
|
|
|
%shr = ashr i64 %a0, %a1
|
|
|
|
ret i64 %shr
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @f2(i64 %a0, i64 %a1) nounwind readnone {
|
|
|
|
entry:
|
2016-06-16 07:06:25 +00:00
|
|
|
; ALL: dsrlv
|
2011-09-30 03:18:46 +00:00
|
|
|
%shr = lshr i64 %a0, %a1
|
|
|
|
ret i64 %shr
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @f3(i64 %a0) nounwind readnone {
|
|
|
|
entry:
|
2016-06-16 07:06:25 +00:00
|
|
|
; ALL: dsll ${{[0-9]+}}, ${{[0-9]+}}, 10
|
2011-09-30 03:18:46 +00:00
|
|
|
%shl = shl i64 %a0, 10
|
|
|
|
ret i64 %shl
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @f4(i64 %a0) nounwind readnone {
|
|
|
|
entry:
|
2016-06-16 07:06:25 +00:00
|
|
|
; ALL: dsra ${{[0-9]+}}, ${{[0-9]+}}, 10
|
2011-09-30 03:18:46 +00:00
|
|
|
%shr = ashr i64 %a0, 10
|
|
|
|
ret i64 %shr
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @f5(i64 %a0) nounwind readnone {
|
|
|
|
entry:
|
2016-06-16 07:06:25 +00:00
|
|
|
; ALL: dsrl ${{[0-9]+}}, ${{[0-9]+}}, 10
|
2011-09-30 03:18:46 +00:00
|
|
|
%shr = lshr i64 %a0, 10
|
|
|
|
ret i64 %shr
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @f6(i64 %a0) nounwind readnone {
|
|
|
|
entry:
|
2016-06-16 07:06:25 +00:00
|
|
|
; ALL: dsll ${{[0-9]+}}, ${{[0-9]+}}, 40
|
2011-09-30 03:18:46 +00:00
|
|
|
%shl = shl i64 %a0, 40
|
|
|
|
ret i64 %shl
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @f7(i64 %a0) nounwind readnone {
|
|
|
|
entry:
|
2016-06-16 07:06:25 +00:00
|
|
|
; ALL: dsra ${{[0-9]+}}, ${{[0-9]+}}, 40
|
2011-09-30 03:18:46 +00:00
|
|
|
%shr = ashr i64 %a0, 40
|
|
|
|
ret i64 %shr
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @f8(i64 %a0) nounwind readnone {
|
|
|
|
entry:
|
2016-06-16 07:06:25 +00:00
|
|
|
; ALL: dsrl ${{[0-9]+}}, ${{[0-9]+}}, 40
|
2011-09-30 03:18:46 +00:00
|
|
|
%shr = lshr i64 %a0, 40
|
|
|
|
ret i64 %shr
|
|
|
|
}
|
2011-09-30 18:51:46 +00:00
|
|
|
|
|
|
|
define i64 @f9(i64 %a0, i64 %a1) nounwind readnone {
|
|
|
|
entry:
|
2015-04-21 10:49:03 +00:00
|
|
|
; CHECK-NOT: sll
|
2016-06-16 07:06:25 +00:00
|
|
|
; ALL: drotrv
|
2011-09-30 18:51:46 +00:00
|
|
|
%shr = lshr i64 %a0, %a1
|
|
|
|
%sub = sub i64 64, %a1
|
|
|
|
%shl = shl i64 %a0, %sub
|
|
|
|
%or = or i64 %shl, %shr
|
|
|
|
ret i64 %or
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @f10(i64 %a0, i64 %a1) nounwind readnone {
|
|
|
|
entry:
|
2015-04-21 10:49:03 +00:00
|
|
|
; CHECK-NOT: sll
|
2016-06-16 07:06:25 +00:00
|
|
|
; ALL: drotrv
|
2011-09-30 18:51:46 +00:00
|
|
|
%shl = shl i64 %a0, %a1
|
|
|
|
%sub = sub i64 64, %a1
|
|
|
|
%shr = lshr i64 %a0, %sub
|
|
|
|
%or = or i64 %shr, %shl
|
|
|
|
ret i64 %or
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @f11(i64 %a0) nounwind readnone {
|
|
|
|
entry:
|
2016-06-16 07:06:25 +00:00
|
|
|
; ALL: drotr ${{[0-9]+}}, ${{[0-9]+}}, 10
|
2011-09-30 18:51:46 +00:00
|
|
|
%shr = lshr i64 %a0, 10
|
|
|
|
%shl = shl i64 %a0, 54
|
|
|
|
%or = or i64 %shr, %shl
|
|
|
|
ret i64 %or
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @f12(i64 %a0) nounwind readnone {
|
|
|
|
entry:
|
2016-06-16 07:06:25 +00:00
|
|
|
; ALL: drotr ${{[0-9]+}}, ${{[0-9]+}}, 54
|
2011-09-30 18:51:46 +00:00
|
|
|
%shl = shl i64 %a0, 10
|
|
|
|
%shr = lshr i64 %a0, 54
|
|
|
|
%or = or i64 %shl, %shr
|
|
|
|
ret i64 %or
|
|
|
|
}
|
|
|
|
|
|
|
|
|