diff options
author | Jack Carter <jcarter@mips.com> | 2012-08-31 18:06:48 +0000 |
---|---|---|
committer | Jack Carter <jcarter@mips.com> | 2012-08-31 18:06:48 +0000 |
commit | 3185f9a2ea80afec30064b7cd095f82c31dc154e (patch) | |
tree | 00e44379ea6fc446b71b0e8fcba494ef4996add7 /test/MC/Mips | |
parent | e4fb6eae9997e80bfedb251ca3251cbed884d4ff (diff) | |
download | external_llvm-3185f9a2ea80afec30064b7cd095f82c31dc154e.zip external_llvm-3185f9a2ea80afec30064b7cd095f82c31dc154e.tar.gz external_llvm-3185f9a2ea80afec30064b7cd095f82c31dc154e.tar.bz2 |
The instruction DINS may be transformed into DINSU or DEXTM depending
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@163010 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/Mips')
-rw-r--r-- | test/MC/Mips/mips64extins.ll | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/MC/Mips/mips64extins.ll b/test/MC/Mips/mips64extins.ll index b15409e..ebe8f86 100644 --- a/test/MC/Mips/mips64extins.ll +++ b/test/MC/Mips/mips64extins.ll @@ -26,3 +26,32 @@ entry: ret i64 %and } +define i64 @dins(i64 %i, i64 %j) nounwind readnone { +entry: +; CHECK: dins ${{[0-9]+}}, ${{[0-9]+}}, 8, 10 + %shl2 = shl i64 %j, 8 + %and = and i64 %shl2, 261888 + %and3 = and i64 %i, -261889 + %or = or i64 %and3, %and + ret i64 %or +} + +define i64 @dinsm(i64 %i, i64 %j) nounwind readnone { +entry: +; CHECK: dinsm ${{[0-9]+}}, ${{[0-9]+}}, 10, 1 + %shl4 = shl i64 %j, 10 + %and = and i64 %shl4, 8796093021184 + %and5 = and i64 %i, -8796093021185 + %or = or i64 %and5, %and + ret i64 %or +} + +define i64 @dinsu(i64 %i, i64 %j) nounwind readnone { +entry: +; CHECK: dinsu ${{[0-9]+}}, ${{[0-9]+}}, 8, 13 + %shl4 = shl i64 %j, 40 + %and = and i64 %shl4, 9006099743113216 + %and5 = and i64 %i, -9006099743113217 + %or = or i64 %and5, %and + ret i64 %or +} |