search for: addregfrm

Displaying 10 results from an estimated 10 matches for "addregfrm".

2011 Sep 30
2
[LLVMdev] LLVM backends instruction selection
I am new to the LLVM backends, I am wondering how instruction selection is done in LLVM backends, I looked at the .td files in Target/X86, they all seem to be small and do not deal with common X86 instructions, i.e. mov, push, pop, etc. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL:
2018 Mar 28
1
Taking over an x86 opcode for my own instruction
...I used was: 1. Find an unused opcode, e.g. 0xF1 in this table: http://ref.x86asm.net/coder32.html 2. Insert an instruction into lib/Target/X86/X86InstrInfo.td using this opcode. In this case, I used 0xF1, and created the following instruction: def CACHE_OPERAND_B64i : RIi64<0xF1, AddRegFrm, (outs GR64:$unused), (ins i64imm:$b), "cache_operand_b_i64\t$b", [(int_cache_operand_b_i64 i64imm:$b)]>, Requires<[In64BitMode]>; However, when I compile, I'm getting errors of the form: Error: Primary decode conflict: TEST64...
2008 Apr 04
0
[LLVMdev] Being able to know the jitted code-size before emitting
...only need to implement GetFunctionSize for X86 and that's not as horrible as you think it is. For each instruction: 1. Compute how many bytes of prefix. The code is there in X86CodeEmitter except all you need is the size, not the prefixes being emitted. 2. For each instruction format, e.g AddRegFrm, MRMDestReg, it's either only one single byte for opcode or one additional ModR/M byte. Again, all the information is right there. 3. Some memory instructions needs a SIB byte. 4. Process the operands! Some special handling for operands that made up of the memory address. But the logic is...
2018 Mar 28
0
x86 instruction format which takes a single 64-bit immediate
...Forms ----- Pseudo - No encoding/disassembling information is present. These should be removed/replaced with other instructions before we reach the encoding phase of codegen.; RawFrm - Instruction has no modrm byte. Operands are fixed registers. There may be an immediate present. AddRegFrm - Instruction encodes a register in bits 2:0 of the opcode. No modrm byte. Opcode should be a multiple of 8 for such an instruction. RawFrmMemOffs - Instruction encodes a fixed constant address in the instruction without modrm byte. Basically opcodes 0xA0-0xA3 RawFrmSrc - Instruction u...
2018 Mar 28
4
x86 instruction format which takes a single 64-bit immediate
I am attempting to create an instruction which takes a single 64-bit immediate. This doesn't seem like a thing that would exist already (because who needs an instruction which just takes an immediate?) How might I implement this easily? Perhaps I could use a format which encodes a register, which is then unused? Thanks for the help. Gus -------------- next part -------------- An HTML
2008 Apr 04
3
[LLVMdev] Being able to know the jitted code-size before emitting
Evan Cheng wrote: > On Apr 1, 2008, at 12:50 AM, Nicolas Geoffray wrote: > > > That's a hack. :-) It is if you think that code emitter should only be used for actually writing somewhere the data. It is not if you find it another useful utility ;-) > Some targets already have ways to compute the exact > size of a function. See ARM::GetFunctionSize()
2008 Apr 05
2
[LLVMdev] Being able to know the jitted code-size before emitting
...tFunctionSize for X86 and that's > not as horrible as you think it is. For each instruction: > 1. Compute how many bytes of prefix. The code is there in > X86CodeEmitter except all you need is the size, not the prefixes being > emitted. > 2. For each instruction format, e.g AddRegFrm, MRMDestReg, it's either > only one single byte for opcode or one additional ModR/M byte. Again, > all the information is right there. > 3. Some memory instructions needs a SIB byte. > 4. Process the operands! Some special handling for operands that made > up of the memory...
2008 Apr 05
0
[LLVMdev] Being able to know the jitted code-size before emitting
...that's >> not as horrible as you think it is. For each instruction: >> 1. Compute how many bytes of prefix. The code is there in >> X86CodeEmitter except all you need is the size, not the prefixes >> being >> emitted. >> 2. For each instruction format, e.g AddRegFrm, MRMDestReg, it's >> either >> only one single byte for opcode or one additional ModR/M byte. Again, >> all the information is right there. >> 3. Some memory instructions needs a SIB byte. >> 4. Process the operands! Some special handling for operands that made &...
2008 Apr 16
0
[LLVMdev] Being able to know the jitted code-size before emitting
...SymbolAddress(false); > + } else if (MO.isImmediate()) { > + FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc)); > + } else { > + assert(0 && "Unknown RawFrm operand!"); > + } > + } > + break; > + > + case X86II::AddRegFrm: > + ++FinalSize; > + > + if (CurOp != NumOps) { > + const MachineOperand &MO1 = MI.getOperand(CurOp++); > + unsigned Size = X86InstrInfo::sizeOfImm(Desc); > + if (MO1.isImmediate()) > + FinalSize += sizeConstant(Size); > + else { > +...
2008 Apr 15
4
[LLVMdev] Being able to know the jitted code-size before emitting
OK, here's a new patch that adds the infrastructure and the implementation for X86, ARM and PPC of GetInstSize and GetFunctionSize. Both functions are virtual functions defined in TargetInstrInfo.h. For X86, I moved some commodity functions from X86CodeEmitter to X86InstrInfo. What do you think? Nicolas Evan Cheng wrote: > > I think both of these belong to TargetInstrInfo. And