aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/Alpha/AlphaJITInfo.cpp
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2005-07-28 18:14:47 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2005-07-28 18:14:47 +0000
commit98169be50bbec4cd3406c7e6557c8661764f2a94 (patch)
tree8269420c0d6f43a0afdae822fd30389f66dd1397 /lib/Target/Alpha/AlphaJITInfo.cpp
parentfe660397e14ecba84e792ada489f2bda7269b413 (diff)
downloadexternal_llvm-98169be50bbec4cd3406c7e6557c8661764f2a94.zip
external_llvm-98169be50bbec4cd3406c7e6557c8661764f2a94.tar.gz
external_llvm-98169be50bbec4cd3406c7e6557c8661764f2a94.tar.bz2
support bsr, and more .td simplification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22543 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Alpha/AlphaJITInfo.cpp')
-rw-r--r--lib/Target/Alpha/AlphaJITInfo.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/Target/Alpha/AlphaJITInfo.cpp b/lib/Target/Alpha/AlphaJITInfo.cpp
index 3fae43c..0f7e4f3 100644
--- a/lib/Target/Alpha/AlphaJITInfo.cpp
+++ b/lib/Target/Alpha/AlphaJITInfo.cpp
@@ -245,6 +245,7 @@ void AlphaJITInfo::relocate(void *Function, MachineRelocation *MR,
for (unsigned i = 0; i != NumRelocs; ++i, ++MR) {
unsigned *RelocPos = (unsigned*)Function + MR->getMachineCodeOffset()/4;
long idx = 0;
+ bool doCommon = true;
switch ((Alpha::RelocationType)MR->getRelocationType()) {
default: assert(0 && "Unknown relocation type!");
case Alpha::reloc_literal:
@@ -289,9 +290,18 @@ void AlphaJITInfo::relocate(void *Function, MachineRelocation *MR,
assert(0 && "Cannot handle gpdist yet");
}
break;
+ case Alpha::reloc_bsr: {
+ idx = (((unsigned char*)MR->getResultPointer() -
+ (unsigned char*)RelocPos) >> 2) + 1; //skip first 2 inst of fun
+ *RelocPos |= (idx & ((1 << 21)-1));
+ doCommon = false;
+ break;
+ }
+ }
+ if (doCommon) {
+ short x = (short)idx;
+ assert(x == idx);
+ *(short*)RelocPos = x;
}
- short x = (short)idx;
- assert(x == idx);
- *(short*)RelocPos = x;
}
}