search for: emitbranchtoat

Displaying 7 results from an estimated 7 matches for "emitbranchtoat".

2006 May 14
2
[LLVMdev] JIT machine code deletion
On Fri, 12 May 2006, Ralph Corderoy wrote: >> If you don't *know* that all (e.g.) function pointers to this code are >> dead (which means that execution could come back to the function), you >> should use the ExecutionEngine::recompileAndRelinkFunction(F) method. > > recompileAndRelinkFunction() overwrites the old machine code with a > branch to the new. Is it
2006 May 14
0
[LLVMdev] JIT machine code deletion
...new branch instructions? > > Yes. OK. > > A quick look suggests the x86 takes five bytes, PowerPC 16, > > PPC should be 4 bytes in the normal case. It is up to the backend to > implement this API correctly... if it doesn't, that's a bug: please > report it! No, EmitBranchToAt() always emits 16 bytes. AtI[0] = BUILD_LIS(12, Addr >> 16); // lis r12, hi16(address) AtI[1] = BUILD_ORI(12, 12, Addr); // ori r12, r12, low16(address) AtI[2] = BUILD_MTCTR(12); // mtctr r12 AtI[3] = BUILD_BCTR(isCall); // bctr/bctrl but I underst...
2008 Jun 16
0
[LLVMdev] PowerPC instruction cache invalidation
On Mon, 16 Jun 2008, Gary Benson wrote: > When you genetate code on PowerPC you need to explicitly invalidate > the instruction cache to force the processor to reread it. In LLVM > there is code to do this for function stubs on Macintosh, but not > for other platforms and not for JITted code generally. Applied, thanks!
2008 Jun 17
1
[LLVMdev] PowerPC instruction cache invalidation
...eSize = 32; @@ -352,8 +349,6 @@ asm volatile("icbi 0, %0" : : "r"(Line)); asm volatile("isync"); #endif - -#endif } void *PPCJITInfo::emitFunctionStub(const Function* F, void *Fn, @@ -372,7 +367,7 @@ MCE.emitWordBE(0); MCE.emitWordBE(0); EmitBranchToAt(Addr, (intptr_t)Fn, false, is64Bit); - SyncICache((void*)Addr, 7*4); + InvalidateInstructionCache((void*)Addr, 7*4); return MCE.finishFunctionStub(F); } @@ -400,7 +395,7 @@ MCE.emitWordBE(0); MCE.emitWordBE(0); EmitBranchToAt(BranchAddr, (intptr_t)Fn, true, is64Bit); - Syn...
2008 Jun 16
6
[LLVMdev] PowerPC instruction cache invalidation
Hi all, When you genetate code on PowerPC you need to explicitly invalidate the instruction cache to force the processor to reread it. In LLVM there is code to do this for function stubs on Macintosh, but not for other platforms and not for JITted code generally. The attached patch adds support for GNU platforms, but I can't figure out a nice way to call it for all generated code. Can
2006 May 12
2
[LLVMdev] JIT machine code deletion
Hi All, I just implemented an often-requested feature: the ability to delete machine code out of the JIT's code buffer (the ExecutionEngine::freeMachineCodeForFunction(F) method). The implementation uses a very general free-list mechanism for tracking free ranges in the buffer, and it works perfectly in my simple test cases designed to cover all of the code paths. However, I don't
2006 May 12
0
[LLVMdev] JIT machine code deletion
...eAndRelinkFunction() overwrites the old machine code with a branch to the new. Is it always guaranteed that there's space to write the new branch instructions? A quick look suggests the x86 takes five bytes, PowerPC 16, and the Alpha's implementation is an assert(0) but if it did call its EmitBranchToAt() then that would be 76. Could the original machine code be smaller? Cheers, Ralph.