mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-29 13:32:33 +00:00
714313b482
on the size of the extraction and its position in the 64 bit word. This patch allows support of the dext transformations with mips64 direct object output. 0 <= msb < 32 0 <= lsb < 32 0 <= pos < 32 1 <= size <= 32 DINS The field is entirely contained in the right-most word of the doubleword 32 <= msb < 64 0 <= lsb < 32 0 <= pos < 32 2 <= size <= 64 DINSM The field straddles the words of the doubleword 32 <= msb < 64 32 <= lsb < 64 32 <= pos < 64 1 <= size <= 32 DINSU The field is entirely contained in the left-most word of the doubleword git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162782 91177308-0d34-0410-b5e6-96231b3b80d8
29 lines
685 B
LLVM
29 lines
685 B
LLVM
; RUN: llc -march=mips64el -filetype=obj -mcpu=mips64r2 -mattr=n64 %s -o - \
|
|
; RUN: | llvm-objdump -disassemble -triple mips64el -mattr +mips64r2 - \
|
|
; RUN: | FileCheck %s
|
|
|
|
define i64 @dext(i64 %i) nounwind readnone {
|
|
entry:
|
|
; CHECK: dext ${{[0-9]+}}, ${{[0-9]+}}, 5, 10
|
|
%shr = lshr i64 %i, 5
|
|
%and = and i64 %shr, 1023
|
|
ret i64 %and
|
|
}
|
|
|
|
define i64 @dextu(i64 %i) nounwind readnone {
|
|
entry:
|
|
; CHECK: dextu ${{[0-9]+}}, ${{[0-9]+}}, 2, 6
|
|
%shr = lshr i64 %i, 34
|
|
%and = and i64 %shr, 63
|
|
ret i64 %and
|
|
}
|
|
|
|
define i64 @dextm(i64 %i) nounwind readnone {
|
|
entry:
|
|
; CHECK: dextm ${{[0-9]+}}, ${{[0-9]+}}, 5, 2
|
|
%shr = lshr i64 %i, 5
|
|
%and = and i64 %shr, 17179869183
|
|
ret i64 %and
|
|
}
|
|
|