search for: emitbyte

Displaying 20 results from an estimated 55 matches for "emitbyte".

2008 Feb 04
0
[LLVMdev] Exception handling in JIT
...es - This callback is invoked when a ULEB128 > needs to be > + /// written to the output stream. > + void emitULEB128Bytes(unsigned Value) { > + do { > + unsigned char Byte = Value & 0x7f; > + Value >>= 7; > + if (Value) Byte |= 0x80; > + emitByte(Byte); > + } while (Value); > + } > + > + /// emitSLEB128Bytes - This callback is invoked when a SLEB128 > needs to be > + /// written to the output stream. > + void emitSLEB128Bytes(int Value) { > + int Sign = Value >> (8 * sizeof(Value) - 1); > + bo...
2008 Feb 01
2
[LLVMdev] Exception handling in JIT
Dear all, Here's a new patch with Evan's comments (thx Evan!) and some cleanups. Now the (duplicated) exception handling code is in a new file: lib/ExecutionEngine/JIT/JITDwarfEmitter. This patch should work on linux/x86 and linux/ppc (tested). Nicolas -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: jit-exceptions.patch URL:
2013 Dec 12
3
[LLVMdev] [RFC PATCH 1/2] x86: Fix ModR/M byte output in 16-bit addressing mode
...se + RMfield = (IndexReg16 & 1) | ((7 - RMfield) << 1); + } + + if (Disp.isImm() && isDisp8(Disp.getImm())) { + // Use [REG]+disp8 form if we can, and for [BP] which cannot be encoded. + if (BaseRegNo == N86::EBP || Disp.getImm() != 0) { + EmitByte(ModRMByte(1, RegOpcodeField, RMfield), CurByte, OS); + EmitImmediate(Disp, MI.getLoc(), 1, FK_Data_1, CurByte, OS, Fixups); + return; + } else { + // No displacement + EmitByte(ModRMByte(0, RegOpcodeField, RMfield), CurByte, OS); + return; +...
2010 May 07
3
[LLVMdev] AsmPrinter behavior
I compile these two lines in llc @tst1 = internal global [4 x i8] zeroinitializer; @tst2 = internal global [4 x i8] [i8 0, i8 1, i8 2, i8 3]; @tst1 is emited via MCStreamer::EmitCommonSymbol while the other is emited via MCStreamer::EmitLabel followed by MCStreamer::EmitBytes from what I can tell, only symbols with common linkage should me emitted by MCStreamer::EmitCommonSymbol, is this the expected behavior or should I fix it? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/201...
2013 Dec 16
0
[LLVMdev] [RFC PATCH 1/2] x86: Fix ModR/M byte output in 16-bit addressing mode
...& 1) | ((7 - RMfield) << 1); > + } > + > + if (Disp.isImm() && isDisp8(Disp.getImm())) { > + // Use [REG]+disp8 form if we can, and for [BP] which cannot be > encoded. > + if (BaseRegNo == N86::EBP || Disp.getImm() != 0) { > + EmitByte(ModRMByte(1, RegOpcodeField, RMfield), CurByte, OS); > + EmitImmediate(Disp, MI.getLoc(), 1, FK_Data_1, CurByte, OS, > Fixups); > + return; > + } else { > + // No displacement > + EmitByte(ModRMByte(0, RegOpcodeField, RMfield), CurByte, O...
2016 Aug 05
2
XRay: Demo on x86_64/Linux almost done; some questions.
...t;getCurrentSectionOnly(); OutStreamer->SwitchSection(Section); for (const auto &Sled : Sleds) { OutStreamer->EmitSymbolValue(Sled.Sled, 8); OutStreamer->EmitSymbolValue(CurrentFnSym, 8); auto Kind = static_cast<uint8_t>(Sled.Kind); OutStreamer->EmitBytes( StringRef(reinterpret_cast<const char *>(&Kind), 1)); OutStreamer->EmitBytes( StringRef(reinterpret_cast<const char *>(&Sled.AlwaysInstrument), 1)); OutStreamer->EmitZeros(14); } OutStreamer->SwitchSection(PrevSection); } Sl...
2008 Mar 30
3
[LLVMdev] Being able to know the jitted code-size before emitting
Hi everyone, vmkit requires to know the size of a jitted method before emitting the method. This allows to allocate the correct size for the method. The attached patch creates this functionality when the flag SizedMemoryCode is on. In order to implement this functionality, i had to virtualize some MachineCodeEmitter functions. Is it OK to commit the patch? Thanks, Nicolas --------------
2013 Aug 22
0
[LLVMdev] [RFC PATCH] X32 ABI support for Clang/compiler-rt (Clang patch)
...fined (__LP64__) const unsigned Alignment = 8; uint8_t Buffer[8]; uint8_t *Cur = Buffer; @@ -481,7 +487,7 @@ JCE.emitAlignment(4); void *Result = (void*)JCE.getCurrentPCValue(); if (NotCC) { -#if defined (X86_64_JIT) +#if defined (X86_64_JIT) && defined (__LP64__) JCE.emitByte(0x49); // REX prefix JCE.emitByte(0xB8+2); // movabsq r10 JCE.emitWordLE((unsigned)(intptr_t)Target); @@ -496,7 +502,7 @@ return Result; } -#if defined (X86_64_JIT) +#if defined (X86_64_JIT) && defined (__LP64__) JCE.emitByte(0x49); // REX pre...
2008 Apr 01
2
[LLVMdev] Being able to know the jitted code-size before emitting
...false; >> + } >> + virtual void startFunctionStub(unsigned StubSize, unsigned >> Alignment) {} >> + virtual void *finishFunctionStub(const Function *F) { return 0; } >> + virtual void addRelocation(const llvm::MachineRelocation&) { } >> + virtual void emitByte(unsigned char B) { >> + CurBufferPtr++; >> + } >> + virtual void emitWordLE(unsigned W) { >> + CurBufferPtr+=4; >> + } >> + virtual void emitWordBE(unsigned W) { >> + CurBufferPtr+=4; >> + } >> + virtual void emitInt32(int Value)...
2008 Mar 31
0
[LLVMdev] Being able to know the jitted code-size before emitting
...erPtr); > + return false; > + } > + virtual void startFunctionStub(unsigned StubSize, unsigned > Alignment) {} > + virtual void *finishFunctionStub(const Function *F) { return 0; } > + virtual void addRelocation(const llvm::MachineRelocation&) { } > + virtual void emitByte(unsigned char B) { > + CurBufferPtr++; > + } > + virtual void emitWordLE(unsigned W) { > + CurBufferPtr+=4; > + } > + virtual void emitWordBE(unsigned W) { > + CurBufferPtr+=4; > + } > + virtual void emitInt32(int Value) { > + CurBufferPtr += 4; >...
2017 Sep 04
2
Issues in Vector Add Instruction Machine Code Emission
...uted at /lib/Target/X86/MCTargetDesc/X86BaseInfo.h:574! i made extensive use of gdb and after debugging i found the line with issue in X86MCCodeEmitter.cpp. Here NumOps=3 (all registers). and CurOp is 1st initialized to 0. then, the following code gets executed; case X86II::MRMDestReg: { EmitByte(BaseOpcode, CurByte, OS); unsigned SrcRegNum = CurOp + 1; //SrcRegNum=1 EmitRegModRMByte(MI.getOperand(CurOp), GetX86RegNum(MI.getOperand(SrcRegNum)), CurByte, OS); CurOp = SrcRegNum + 1; break; } so here CurOp becomes 2. After this; it comes to; else { // I...
2008 Apr 01
0
[LLVMdev] Being able to know the jitted code-size before emitting
...} >>> + virtual void startFunctionStub(unsigned StubSize, unsigned >>> Alignment) {} >>> + virtual void *finishFunctionStub(const Function *F) { return 0; } >>> + virtual void addRelocation(const llvm::MachineRelocation&) { } >>> + virtual void emitByte(unsigned char B) { >>> + CurBufferPtr++; >>> + } >>> + virtual void emitWordLE(unsigned W) { >>> + CurBufferPtr+=4; >>> + } >>> + virtual void emitWordBE(unsigned W) { >>> + CurBufferPtr+=4; >>> + } >>> +...
2008 Apr 04
3
[LLVMdev] Being able to know the jitted code-size before emitting
...+ virtual void startFunctionStub(unsigned StubSize, unsigned >>>> Alignment) {} >>>> + virtual void *finishFunctionStub(const Function *F) { return 0; } >>>> + virtual void addRelocation(const llvm::MachineRelocation&) { } >>>> + virtual void emitByte(unsigned char B) { >>>> + CurBufferPtr++; >>>> + } >>>> + virtual void emitWordLE(unsigned W) { >>>> + CurBufferPtr+=4; >>>> + } >>>> + virtual void emitWordBE(unsigned W) { >>>> + CurBufferPtr+=4; >...
2013 Aug 22
7
[LLVMdev] [RFC PATCH] X32 ABI support for Clang/compiler-rt
Hi, I'm working on bringing up complete coverage for a Gentoo x32 "desktop" system. I've been cooking up quite a few patches for various packages to push upstream, but right now, the biggest blocker is the lack of support for building with/codegen targeting x32 in llvm/clang. Since the x32 patches were sent last year, I see support code has landed in LLVM, and basic handling of
2008 Apr 05
2
[LLVMdev] Being able to know the jitted code-size before emitting
...ned >>>>>> Alignment) {} >>>>>> + virtual void *finishFunctionStub(const Function *F) { return >>>>>> 0; } >>>>>> + virtual void addRelocation(const llvm::MachineRelocation&) { } >>>>>> + virtual void emitByte(unsigned char B) { >>>>>> + CurBufferPtr++; >>>>>> + } >>>>>> + virtual void emitWordLE(unsigned W) { >>>>>> + CurBufferPtr+=4; >>>>>> + } >>>>>> + virtual void emitWordBE(unsigned...
2016 Jan 22
2
Is there a reason why MCAsmStreamer class doesn't have its own .h file?
...ently, and if this was available to be sub-classed, then these modifications would be more logical and not require altering the target independent code. · ‘MCAsmStream::EmitAssignment’ has been changed to accommodate our different syntax for ‘.alias’ directives. · ‘MCAsmStream::EmitBytes’ has been changed so that multiple lines of ‘.byte’ directives are emitted to avoid a line-length buffer limitation in our assembler when very large numbers of bytes are to be emitted. · ‘MCAsmStream::EmitFill’ has been changed to accommodate our different syntax for ‘.fill’ directives....
2013 Aug 22
3
[LLVMdev] [NEW PATCH] X32 ABI support for Clang/compiler-rt (Clang patch)
...fined (__LP64__) const unsigned Alignment = 8; uint8_t Buffer[8]; uint8_t *Cur = Buffer; @@ -481,7 +487,7 @@ JCE.emitAlignment(4); void *Result = (void*)JCE.getCurrentPCValue(); if (NotCC) { -#if defined (X86_64_JIT) +#if defined (X86_64_JIT) && defined (__LP64__) JCE.emitByte(0x49); // REX prefix JCE.emitByte(0xB8+2); // movabsq r10 JCE.emitWordLE((unsigned)(intptr_t)Target); @@ -496,7 +502,7 @@ return Result; } -#if defined (X86_64_JIT) +#if defined (X86_64_JIT) && defined (__LP64__) JCE.emitByte(0x49); // REX pre...
2008 Apr 05
0
[LLVMdev] Being able to know the jitted code-size before emitting
...t;>>>>>> + virtual void *finishFunctionStub(const Function *F) { return >>>>>>> 0; } >>>>>>> + virtual void addRelocation(const llvm::MachineRelocation&) >>>>>>> { } >>>>>>> + virtual void emitByte(unsigned char B) { >>>>>>> + CurBufferPtr++; >>>>>>> + } >>>>>>> + virtual void emitWordLE(unsigned W) { >>>>>>> + CurBufferPtr+=4; >>>>>>> + } >>>>>>> + virtual v...
2008 Apr 04
0
[LLVMdev] Being able to know the jitted code-size before emitting
...gned StubSize, unsigned >>>>> Alignment) {} >>>>> + virtual void *finishFunctionStub(const Function *F) { return >>>>> 0; } >>>>> + virtual void addRelocation(const llvm::MachineRelocation&) { } >>>>> + virtual void emitByte(unsigned char B) { >>>>> + CurBufferPtr++; >>>>> + } >>>>> + virtual void emitWordLE(unsigned W) { >>>>> + CurBufferPtr+=4; >>>>> + } >>>>> + virtual void emitWordBE(unsigned W) { >>>>&gt...
2008 Apr 07
2
[LLVMdev] Being able to know the jitted code-size before emitting
...t;>> + virtual void *finishFunctionStub(const Function *F) { return >>>>>>>> 0; } >>>>>>>> + virtual void addRelocation(const llvm::MachineRelocation&) >>>>>>>> { } >>>>>>>> + virtual void emitByte(unsigned char B) { >>>>>>>> + CurBufferPtr++; >>>>>>>> + } >>>>>>>> + virtual void emitWordLE(unsigned W) { >>>>>>>> + CurBufferPtr+=4; >>>>>>>> + } >>>>>&...