[PATCH] D56058: [ORC][MIPS] Setup t9 register and call function through this register

Simon Atanasyan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 12 03:16:07 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL351000: [ORC][MIPS] Setup t9 register and call function through this register (authored by atanasyan, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D56058?vs=179437&id=181432#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56058/new/

https://reviews.llvm.org/D56058

Files:
  llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcABISupport.h
  llvm/trunk/lib/ExecutionEngine/Orc/OrcABISupport.cpp


Index: llvm/trunk/lib/ExecutionEngine/Orc/OrcABISupport.cpp
===================================================================
--- llvm/trunk/lib/ExecutionEngine/Orc/OrcABISupport.cpp
+++ llvm/trunk/lib/ExecutionEngine/Orc/OrcABISupport.cpp
@@ -610,23 +610,19 @@
       0x8fa40008,                    // 0xe8: lw $a0,8($sp)
       0x27bd0068,                    // 0xec: addiu $sp,$sp,104
       0x0300f825,                    // 0xf0: move $ra, $t8
-      0x00000000                     // 0xf4: jr $v0/v1
+      0x00000000,                    // 0xf4: move $t9, $v0/v1
+      0x03200008                     // 0xf8: jr $t9
   };
 
   const unsigned ReentryFnAddrOffset = 0x7c;   // JIT re-entry fn addr lui
   const unsigned CallbackMgrAddrOffset = 0x6c; // Callback manager addr lui
-  const unsigned offsett = 0xf4;
+  const unsigned Offsett = 0xf4;
 
   memcpy(ResolverMem, ResolverCode, sizeof(ResolverCode));
 
-  //Depending on endian return value will be in v0 or v1.
-  uint32_t JumpV0 = 0x00400008;
-  uint32_t JumpV1 = 0x00600008;
-
-  if(isBigEndian == true)
-    memcpy(ResolverMem + offsett, &JumpV1, sizeof(JumpV1));
-  else
-    memcpy(ResolverMem + offsett, &JumpV0, sizeof(JumpV0));
+  // Depending on endian return value will be in v0 or v1.
+  uint32_t MoveVxT9 = isBigEndian ? 0x0060c825 : 0x0040c825;
+  memcpy(ResolverMem + Offsett, &MoveVxT9, sizeof(MoveVxT9));
 
   uint64_t CallMgrAddr = reinterpret_cast<uint64_t>(CallbackMgr);
   uint32_t CallMgrLUi = 0x3c040000 | (((CallMgrAddr + 0x8000) >> 16) & 0xFFFF);
@@ -814,7 +810,8 @@
       0xdfa30008,                     // 0x10c: ld v1, 8(sp)
       0x67bd00d0,                     // 0x110: daddiu $sp,$sp,208
       0x0300f825,                     // 0x114: move $ra, $t8
-      0x00400008                      // 0x118: jr $v0
+      0x0040c825,                     // 0x118: move $t9, $v0
+      0x03200008                      // 0x11c: jr $t9
   };
 
   const unsigned ReentryFnAddrOffset = 0x8c;   // JIT re-entry fn addr lui
Index: llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcABISupport.h
===================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcABISupport.h
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcABISupport.h
@@ -245,7 +245,7 @@
 public:
   static const unsigned PointerSize = 4;
   static const unsigned TrampolineSize = 20;
-  static const unsigned ResolverCodeSize = 0xf8;
+  static const unsigned ResolverCodeSize = 0xfc;
   using IndirectStubsInfo = GenericIndirectStubsInfo<16>;
 
   using JITReentryFn = JITTargetAddress (*)(void *CallbackMgr,
@@ -287,7 +287,7 @@
 public:
   static const unsigned PointerSize = 8;
   static const unsigned TrampolineSize = 40;
-  static const unsigned ResolverCodeSize = 0x11C;
+  static const unsigned ResolverCodeSize = 0x120;
 
   using IndirectStubsInfo = GenericIndirectStubsInfo<32>;
   using JITReentryFn = JITTargetAddress (*)(void *CallbackMgr,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56058.181432.patch
Type: text/x-patch
Size: 2959 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190112/b060a470/attachment.bin>


More information about the llvm-commits mailing list