diff options
author | Andrew Lenharth <andrewl@lenharth.org> | 2005-07-28 18:14:47 +0000 |
---|---|---|
committer | Andrew Lenharth <andrewl@lenharth.org> | 2005-07-28 18:14:47 +0000 |
commit | 1ec48e8683efedb695f5daedcf7045ed17656cce (patch) | |
tree | a52d166f85c9e3c25b8ef4c7934ae6c78431fa3b /llvm/lib/Target/Alpha/AlphaJITInfo.cpp | |
parent | 3faa82219ad19d5e19ebdd90a2d4434d40b565ad (diff) | |
download | bcm5719-llvm-1ec48e8683efedb695f5daedcf7045ed17656cce.tar.gz bcm5719-llvm-1ec48e8683efedb695f5daedcf7045ed17656cce.zip |
support bsr, and more .td simplification
llvm-svn: 22543
Diffstat (limited to 'llvm/lib/Target/Alpha/AlphaJITInfo.cpp')
-rw-r--r-- | llvm/lib/Target/Alpha/AlphaJITInfo.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/llvm/lib/Target/Alpha/AlphaJITInfo.cpp b/llvm/lib/Target/Alpha/AlphaJITInfo.cpp index 3fae43c53f7..0f7e4f34c37 100644 --- a/llvm/lib/Target/Alpha/AlphaJITInfo.cpp +++ b/llvm/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; } } |