mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Implement the llvm.bit.part_select.iN.iN.iN overloaded intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35678 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
14
test/CodeGen/Generic/bit-intrinsics.ll
Normal file
14
test/CodeGen/Generic/bit-intrinsics.ll
Normal file
@@ -0,0 +1,14 @@
|
||||
; Make sure this testcase is supported by all code generators. Either the
|
||||
; intrinsic is supported natively or IntrinsicLowering provides it.
|
||||
; RUN: llvm-as < %s | llc
|
||||
|
||||
|
||||
declare i32 @llvm.bit.part.select.i32.i32(i32 %x, i32 %hi, i32 %lo)
|
||||
declare i16 @llvm.bit.part.select.i16.i16(i16 %x, i32 %hi, i32 %lo)
|
||||
define i32 @bit_part_select(i32 %A, i16 %B) {
|
||||
%a = call i32 @llvm.bit.part.select.i32.i32(i32 %A, i32 8, i32 0)
|
||||
%b = call i16 @llvm.bit.part.select.i16.i16(i16 %B, i32 8, i32 0)
|
||||
%c = zext i16 %b to i32
|
||||
%d = add i32 %a, %c
|
||||
ret i32 %d
|
||||
}
|
Reference in New Issue
Block a user