mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
ef92cf50d6
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211932 91177308-0d34-0410-b5e6-96231b3b80d8
33 lines
646 B
LLVM
33 lines
646 B
LLVM
; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
|
|
|
|
|
|
; CHECK: bfe0
|
|
define i32 @bfe0(i32 %a) {
|
|
; CHECK: bfe.u32 %r{{[0-9]+}}, %r{{[0-9]+}}, 4, 4
|
|
; CHECK-NOT: shr
|
|
; CHECK-NOT: and
|
|
%val0 = ashr i32 %a, 4
|
|
%val1 = and i32 %val0, 15
|
|
ret i32 %val1
|
|
}
|
|
|
|
; CHECK: bfe1
|
|
define i32 @bfe1(i32 %a) {
|
|
; CHECK: bfe.u32 %r{{[0-9]+}}, %r{{[0-9]+}}, 3, 3
|
|
; CHECK-NOT: shr
|
|
; CHECK-NOT: and
|
|
%val0 = ashr i32 %a, 3
|
|
%val1 = and i32 %val0, 7
|
|
ret i32 %val1
|
|
}
|
|
|
|
; CHECK: bfe2
|
|
define i32 @bfe2(i32 %a) {
|
|
; CHECK: bfe.u32 %r{{[0-9]+}}, %r{{[0-9]+}}, 5, 3
|
|
; CHECK-NOT: shr
|
|
; CHECK-NOT: and
|
|
%val0 = ashr i32 %a, 5
|
|
%val1 = and i32 %val0, 7
|
|
ret i32 %val1
|
|
}
|