2017-08-02 08:28:10 +08:00
|
|
|
; RUN: llc < %s -mtriple=i686-- | FileCheck %s
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-- -O0 | FileCheck %s -check-prefix=CHECK-X64
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-- -O2 | FileCheck %s -check-prefix=CHECK-X64
|
2009-04-01 03:39:24 +08:00
|
|
|
|
2015-04-21 14:28:36 +08:00
|
|
|
; CHECK-LABEL: shift1
|
|
|
|
define void @shift1(i256 %x, i256 %a, i256* nocapture %r) nounwind readnone {
|
2009-04-01 03:39:24 +08:00
|
|
|
entry:
|
|
|
|
%0 = ashr i256 %x, %a
|
|
|
|
store i256 %0, i256* %r
|
|
|
|
ret void
|
|
|
|
}
|
2015-04-21 14:28:36 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: shift2
|
|
|
|
define i256 @shift2(i256 %c) nounwind
|
|
|
|
{
|
|
|
|
%b = shl i256 1, %c ; %c must not be a constant
|
|
|
|
; Special case when %c is 0:
|
2018-10-30 04:10:42 +08:00
|
|
|
; CHECK-X64: testb [[REG:%(bpl|r[0-9]+b)]], {{%(bpl|r[0-9]+b)}}
|
2015-04-21 14:28:36 +08:00
|
|
|
; CHECK-X64: cmoveq
|
|
|
|
ret i256 %b
|
|
|
|
}
|