Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mips] Add support for MCJIT for MIPS32r6
Add support for resolving MIPS32r6 relocations in MCJIT. Patch by Vladimir Radosavljevic. Differential Revision: http://reviews.llvm.org/D10687 llvm-svn: 241442
- Loading branch information
1 parent
d6a62cc
commit 0326a06
Showing
3 changed files
with
112 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32R6_relocations.s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# RUN: llvm-mc -triple=mipsel-unknown-linux -mcpu=mips32r6 -relocation-model=pic -code-model=small -filetype=obj -o %T/test_ELF_O32R6.o %s | ||
# RUN: llc -mtriple=mipsel-unknown-linux -mcpu=mips32r6 -relocation-model=pic -filetype=obj -o %T/test_ELF_ExternalFunction_O32R6.o %S/Inputs/ExternalFunction.ll | ||
# RUN: llvm-rtdyld -triple=mipsel-unknown-linux -mcpu=mips32r6 -verify -map-section test_ELF_O32R6.o,.text=0x1000 -map-section test_ELF_ExternalFunction_O32R6.o,.text=0x10000 -check=%s %/T/test_ELF_O32R6.o %T/test_ELF_ExternalFunction_O32R6.o | ||
|
||
# RUN: llvm-mc -triple=mips-unknown-linux -mcpu=mips32r6 -relocation-model=pic -code-model=small -filetype=obj -o %T/test_ELF_O32R6.o %s | ||
# RUN: llc -mtriple=mips-unknown-linux -mcpu=mips32r6 -relocation-model=pic -filetype=obj -o %T/test_ELF_ExternalFunction_O32R6.o %S/Inputs/ExternalFunction.ll | ||
# RUN: llvm-rtdyld -triple=mips-unknown-linux -mcpu=mips32r6 -verify -map-section test_ELF_O32R6.o,.text=0x1000 -map-section test_ELF_ExternalFunction_O32R6.o,.text=0x10000 -check=%s %/T/test_ELF_O32R6.o %T/test_ELF_ExternalFunction_O32R6.o | ||
|
||
.text | ||
.abicalls | ||
.nan 2008 | ||
.text | ||
.set nomicromips | ||
.set nomips16 | ||
.set noreorder | ||
.set nomacro | ||
.set noat | ||
|
||
.align 3 | ||
.globl bar | ||
.type bar,@function | ||
|
||
bar: | ||
# Test R_MIPS_PC19_S2 relocation. | ||
# rtdyld-check: decode_operand(R_MIPS_PC19_S2, 1)[20:0] = (foo - R_MIPS_PC19_S2)[20:0] | ||
R_MIPS_PC19_S2: | ||
lwpc $6,foo | ||
|
||
# Test R_MIPS_PC21_S2 relocation. | ||
# rtdyld-check: decode_operand(R_MIPS_PC21_S2, 1)[22:0] = (foo - next_pc(R_MIPS_PC21_S2))[22:0] | ||
R_MIPS_PC21_S2: | ||
bnezc $5,foo | ||
|
||
# Test R_MIPS_PC26_S2 relocation. | ||
# rtdyld-check: decode_operand(R_MIPS_PC26_S2, 0)[27:0] = (foo - next_pc(R_MIPS_PC26_S2))[27:0] | ||
R_MIPS_PC26_S2: | ||
balc foo | ||
|
||
# Test R_MIPS_PCHI16 relocation. | ||
# rtdyld-check: decode_operand(R_MIPS_PCHI16, 1)[15:0] = (foo - R_MIPS_PCHI16 + 0x8000)[31:16] | ||
R_MIPS_PCHI16: | ||
aluipc $5, %pcrel_hi(foo) | ||
|
||
# Test R_MIPS_PCLO16 relocation. | ||
# rtdyld-check: decode_operand(R_MIPS_PCLO16, 2)[15:0] = (foo - R_MIPS_PCLO16)[15:0] | ||
R_MIPS_PCLO16: | ||
addiu $5, $5, %pcrel_lo(foo) | ||
|
||
.size bar, .-bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters