Displaying 20 results from an estimated 3000 matches similar to: "Parsing Operands at TableGen Level"
2015 Aug 17
2
Print the Binary Form of an Instruction
Hi all,
I have defined an instruction in the InstFormat.td and InstrInfo.td files.
I also wrote a CodeEmitter class for that, and now I have a .inc file after
compilation that seems like it might be correct, BUT, I would like to see
what will be generated when the assembly code is converted to the binary
machine code!
Is there any command in TableGen or a test class to do so?
Cheers,
ES
2015 Sep 17
2
Register Number
Dear all,
in my TestRegisterInfo.td file, I defined a register like this:
class TestReg<bits<6> enc, string name> : Register<name> {
let HWEncoding{5-0} = enc;
let Namespace = "TEST";
}
def D0 : TestReg<0x01, "d0">, DwarfRegNum<[1]>;
but when I compile, the result I have in TestGenAsmMatcher.inc is this:
case 'd': // 7
2015 Sep 17
2
Register Number
On 9/17/2015 7:04 AM, Sky Flyer via llvm-dev wrote:
> It seems like d0 is always 14!
> I check it with ARMGenAsmMatcher.inc it was the same!
> How is it possible? because it should give the same register value that
> matches the underlying platform not any autogenerated value!?
The returned number is the register id as defined in
<YourTarget>GenRegisterInfo.inc. These numbers
2015 Dec 14
2
Tablegen definition question
Hi,
That's what the DecoderMethod is for. Similarly ParserMatchClass for the
asm parser and PrintMethod for the asm printer:
def CondCodeOperand : AsmOperandClass { let Name = "CondCode"; }
def pred : PredicateOperand<OtherVT, (ops i32imm, i32imm),
(ops (i32 14), (i32 zero_reg))> {
let PrintMethod = "printPredicateOperand";
2015 Dec 14
2
Tablegen definition question
Hello James,
that was also what I've planned to do but just wasn't sure. Thanks for
that.
On Mon, Dec 14, 2015 at 11:52 AM, James Molloy <james at jamesmolloy.co.uk>
wrote:
> Hi,
>
> You can't nest operands like that - it must be a flattened list. So:
>
> def *Xpred* : PredicateOperand<OtherVT, (ops *i32imm, i32imm*, i32imm),
> (ops (i32 14), (i32
2013 Jun 05
1
[LLVMdev] TableGen lookup table recipe?
Is it possible to define lookup tables as a list in tablegen, to map one
value to another? Here's the template I was working on:
=========================================
class LookupTable {
list<int> mapping = [0, 8, 16, 24, 32];
}
def LUT : LookupTable;
class MyRegister<name, index> : Register<name> {
let HWEncoding = LUT.mapping[index];
int otherVal = index;
2014 Jul 31
3
[LLVMdev] initialize register attributes in instruction definition
Hi All,
Is it possible to initialize(set up) register attributes when we define an instruction?
like
if a register is defined like this:
" class SC_Register<bits<8> register_num,
REG_FLAG SC_X,
REG_FLAG SC_Y,
REG_FLAG SC_Z,
REG_FLAG SC_W,
string asmstr> : Register<asmstr>
{
let HWEncoding{7-0} =
2017 Feb 10
2
generated HWEncoding based register decoders
Is there any reason why we can't generate HWEncoding based decoders for registers for mc disassemblers?
This is a concept patch to explore wether it'd work, and for my target, it does the right thing. I have one case where I have to shift a field over 2 bits, but I handle that in the glue. If I had a HWEncoding encoding on a per register class basis, I could have made it work without
2014 Aug 01
2
[LLVMdev] initialize register attributes in instruction definition
On Jul 31, 2014, at 7:23 PM, Tom Stellard <tom at stellard.net> wrote:
> On Thu, Jul 31, 2014 at 06:41:06PM -0400, kewuzhang wrote:
>> Hi All,
>>
>> Is it possible to initialize(set up) register attributes when we define an instruction?
>>
>> like
>>
>> if a register is defined like this:
>>
>> " class
2015 Dec 14
2
Tablegen definition question
Hi All,
In ARMInstFormats.td predicate is defined this way:
*def pred : PredicateOperand<OtherVT, (ops i32imm, i32imm),*
*(ops (i32 14), (i32 zero_reg))> {...}*
I use the same definition in my code. But I have another version of
predicate which is exactly the same but it is a condition code plus a
quantifier! (e.g. Xpred = (pred + i32imm)).
I was wondering how we can define a sub sub
2015 Sep 14
2
TableGen MCInstrDesc Instruction Size Zero
Dear all,
I am trying to write an AsmParser and a CodeEmitter for simple ADD
instruction.
Here is what I have in the TestGenInstrInfo.td:
*extern const MCInstrDesc TestInsts[] = {...{ 23, 3, 1, 0, 0, 0, 0x0ULL,
nullptr, nullptr, OperandInfo13, 0, nullptr }, // Inst #23 = ADD8_rr...}*
I parse the instruction successfully but I am not sure what I did wrong
that the Size (as you can see in
2015 Nov 26
2
Accessing TableGen defined variable in the cpp code
Hello all,
I would like to assign some bits in the instructions, based on the order of
mnemonics that appear in a special order. I can do it in TableGen itself,
but it will not be well maintainable based on the things I want to
accomplish.
Therefor, I would like to do it in the c++ file which is waaay easier (at
least in the concept!!).
Imagine I have this in my base class in TableGen:
2015 Nov 05
2
constant string as an assembly operand
Hi Tom,
Thanks.
It should be always ABC.
What should be the iops? just (ins i8imm:$val)? what would be the
placeholder for a constant string in "ins"?
On Thu, Nov 5, 2015 at 4:33 PM, Tom Stellard <tom at stellard.net> wrote:
> On Thu, Nov 05, 2015 at 03:20:45PM +0100, Sky Flyer via llvm-dev wrote:
> > Hello all,
> >
> > how can one can describe a constant
2015 Nov 06
2
Instructions with no operand
On 11/6/2015 11:35 AM, Sky Flyer via llvm-dev wrote:
> Guys, I stuck at this point. Could you please give me a hint how to
> solve this problem without touching the LLVM backbone?!
> Why LLVM doesn't let me define an instruction consisting of an operator
> with no operand?
Could you try it without the pattern? I.e. just this:
class TestInst<string opc, string asmstr,
2016 Apr 20
2
Link using a linker script
For example something like STARTUP (
http://wiki.osdev.org/Linker_Scripts#STARTUP) is not accepted by the LLVM
LLD. :-/
On Wed, Apr 20, 2016 at 9:08 PM, Sky Flyer <skylake007 at gmail.com> wrote:
> Yeah I found it, that's nice. Thanks a milion.
> Could you please tell me how can I specify my bootstrap (startup code) in
> the linking process?
>
>
> On Wed, Apr 20, 2016
2016 Aug 23
2
How to describe the RegisterInfo?
Yes, the arch is just as you said, something like AMD GPU, but Intel GPU
don't have separate register file for 'scalar/vector'.
In fact my idea of defining the register tuples was borrowed from
SIRegisterInfo.td in AMD GPU.
But seems that AMD GPU mainly support i32/i64 register type, while Intel
GPU also support byte/short register type.
So I have to start defining the registers from
2016 Apr 20
2
Link using a linker script
search for VAStart.
Cheers,
Rafael
On 20 April 2016 at 14:18, Sky Flyer <skylake007 at gmail.com> wrote:
> Hi Rafael,
>
> Thanks a lot.
> For example the start entry for me is 0x11000 by default which I don't know
> where it come from! I thought there should be a default thing that sets this
> entry address.
>
> On Wed, Apr 20, 2016 at 8:05 PM, Rafael EspĂndola
2008 Sep 12
2
[LLVMdev] Selection Condition Codes
I am attempting to lower the selectCC instruction to the instruction set
of the backend I'm working on and I cannot seem to find a way to
correctly implement this instruction. I know how this instruction should
get implemented; I just have yet to find a way to do it. I want the
select_cc instruction to be lowered into a comparison followed by a
conditional move. I've attempted to use a
2015 Nov 05
2
constant string as an assembly operand
Hello all,
how can one can describe a constant string as an operand in the assembly
instruction?
for example imagine this instruction:
xyz 14 ABC
where "xyz" is the operator, 14 is an immediate value, and because of
assembly dialect, there should be a constant string with the value of ABC
follow the immediate value. How is this possible?
What should be the dat describing the
2015 Oct 19
2
Instructions with no operand
Hi all,
I am trying to implement an instruction with no operand for example "clr"
in TableGen.
-----------------------------------------
e.g.
*InstrInfo.td:*
class TestInst<string opc, string asmstr, dag oops, dag iops,
list<dag> pattern> : Instruction { ... }
def int_no_operand : Intrinsic<[]>;
class ALU<string opc> : TestInst<opc,