search for: x86instrarithmetic

Displaying 16 results from an estimated 16 matches for "x86instrarithmetic".

2014 Jun 24
2
[LLVMdev] Bug in LEA16r (X86InstrArithmetic.td) ??
Hi, in X86InstrArithmetic.td, we have LEA16r defined as: def LEA16r : I<0x8D, MRMSrcMem, (outs GR16:$dst), (ins i32mem:$src), "lea{w}\t{$src|$dst}, {$dst|$src}", [], IIC_LEA_16>, OpSize16; Please correct me if I am wrong, but I think "ins i32mem" should be &q...
2014 Jun 24
2
[LLVMdev] Bug in LEA16r (X86InstrArithmetic.td) ??
On Tue, Jun 24, 2014 at 4:03 PM, Tim Northover <t.p.northover at gmail.com> wrote: > Hi Jun, > > On 24 June 2014 08:08, Jun Koi <junkoi2004 at gmail.com> wrote: > > def LEA16r : I<0x8D, MRMSrcMem, > > (outs GR16:$dst), (ins i32mem:$src), > > "lea{w}\t{$src|$dst}, {$dst|$src}", [], IIC_LEA_16>, > >
2018 Nov 14
2
Fw: How to define an instruction
...e some questions about instructions again. I have add a DAG successfully,I think.Because what I do can be compiled to LLVM IR and binary file. I guess, the schedule of an instruction tells the machine how to do . I don't konw if it's right. For example,there is the definition of IMUL32rr in X86InstrArithmetic.td. "WriteIMul32Reg" is the most important and the defines the multiplication. def IMUL32rr : I<0xAF, MRMSrcReg, (outs GR32:$dst), (ins GR32:$src1,GR32:$src2),"imul{l}\t{$src2, $dst|$dst, $src2}", [(set GR32:$dst, EFLAGS, (X86smul_flag GR32:$src1, GR32:$src2))]>,Sched&lt...
2018 Nov 14
2
Fw: How to define an instruction
...e some questions about instructions again. I have add a DAG successfully,I think.Because what I do can be compiled to LLVM IR and binary file. I guess, the schedule of an instruction tells the machine how to do . I don't konw if it's right. For example,there is the definition of IMUL32rr in X86InstrArithmetic.td. "WriteIMul32Reg" is the most important and the defines the multiplication. def IMUL32rr : I<0xAF, MRMSrcReg, (outs GR32:$dst), (ins GR32:$src1,GR32:$src2),"imul{l}\t{$src2, $dst|$dst, $src2}", [(set GR32:$dst, EFLAGS, (X86smul_flag GR32:$src1, GR32:$src2))]>,Sched&lt...
2018 Sep 12
2
There is an error “use of unknown builtin”
...embarrassed to ask such a simple question. I want to add an intrinsics(named max_qb) in x86 backend. In include/llvm/IR/IntrinsicsX86.td, I add a intrinsics (GCCBuiltin). In clang( BuiltinsX86.def ), I add a BUILTIN. And in x86 backend , I change : the X86InstrInfo.td to add def X86max_qb_flag , X86InstrArithmetic.td to add define of instruction , X86ISelLowering.cpp to add SDnode. It's succeed when LLVM compilates.But there is an error “use of unknown builtin '__builtin_x86_max_qb' ”,when I test the intrinsics. I do not know what I should do.I have been stranded here for 2 days. Grate for any su...
2018 Nov 07
2
how to add a instruction
...t;__builtin_x86_max_qb">, Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [Commutative]>; BUILTIN(__builtin_x86_max_qb, "iii", "") I define the intrinsic as Pseudo instruction,it succeed. But when mapping a new instruction.I don't know how to do. In x86InstrArithmetic.td. I add ,(To make sure the Sched is right, I use the WriteIMul16Reg ) def max_qb : I<0xF0,MRMSrcReg, (outs GR32:$dst), (ins GR32:$src1,GR32:$src2), "max_qb\t {$dst, $src1,$src2}", [(set GR32:$dst,(X86max_qb GR32:$src1, GR32:$src2))]>,Sched<[WriteIMul16Reg]>,OpSize32 ; when...
2018 Sep 17
2
error about adding an trinsics
...b, In /lib/Target/X86/X86SelLowering.cpp: case X86ISD::max_qb: return "X86ISD::max_qb"; In /lib/Target/X86/X86InstrInfo.td: def X86max_qb_flag : SDNode<"X86ISD::max_qb", SDTBinaryArithWithFlags, [SDNPCommutative]>; In /lib/Target/X86/X86InstrArithmetic.td: def max_qb : I<0xff,MRMSrcReg, (outs GR32:$dst), (ins GR32:$src1,GR32:$src2), "max_qb\t {$dst, $src1,$src2|$src1,$src2, $dst}", [(set GR32:$dst,EFLAGS,(X86max_qb_flag GR32:$src1, GR32:$src2))]>, Sched<[WriteIMul]>, TB, OpSize32 ; I think it can...
2014 Apr 22
2
[LLVMdev] where is F7 opcode for TEST instruction on X86?
...below. $ echo "0xf7 0xc0 0x00 0x00 0x00 0x22"|./Release+Asserts/bin/llvm-mc -disassemble -arch=x86 .section __TEXT,__text,regular,pure_instructions testl $570425344, %eax ## imm = 0x22000000 however, i cannot find anywhere this F7 opcode is defined in lib/Target/X86/X86InstrArithmetic.td. we only have TEST defined with F6 & other opcode like below. any hint please? thanks. let isCompare = 1 in { let Defs = [EFLAGS] in { let isCommutable = 1 in { def TEST8rr : BinOpRR_F<0x84, "test", Xi8 , X86testpat, MRMSrcReg>; def TEST16rr : BinOpRR_F...
2016 Oct 12
2
Generate Register Indirect mode instruction
...lt goes into memory, not a register? So, something like the following: define void @foo(i32 *%a) { entry: %0 = load i32, i32* %a, align 4 %add = add i32 %0, 3 store i32 %add, i32* %a, align 4 ret void } On x86, this gets turned into: addl $3, (%rdi) retq From X86InstrArithmetic.td: // BinOpMI8_RMW - Instructions like "add [mem], imm8". class BinOpMI8_RMW<string mnemonic, X86TypeInfo typeinfo, SDPatternOperator opnode, Format f> : BinOpMI8<mnemonic, typeinfo, f, [(store (opnode (load addr:$dst),...
2012 Jan 20
2
[LLVMdev] Tablegen: How to define an instruction that reads and writes the same register
Hi, Is it possible to define an Instruction with tablegen that reads and writes the same register? For example, an increment instruction that reads a value from a register, adds one to it and then writes the result back to the same register. Thanks, Tom
2012 Aug 21
3
[LLVMdev] Let's get rid of neverHasSideEffects
...rt of a multiclass when you define the *rm variant. X86 is the worst case because so many instructions can fold loads and stores. You can handle most of them by setting the mayLoad and mayStore flags in the big ArithBinOp multiclasses. You can see the problem in the big ArithBinOp_RF multiclass in X86InstrArithmetic.td. It's not obvious at a glance which of those instructions have patterns, and as a result we forgot to set neverHasSideEffects on the *_REV and *8i8 variants. I don't think it would detract to add "let mayLoad = 1 in {…}" around the *rm groups etc. Or you could set the flags on...
2012 Aug 21
0
[LLVMdev] Let's get rid of neverHasSideEffects
On Aug 21, 2012, at 2:02 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote: > All, > > TableGen likes to infer the MCID::UnmodeledSideEffects flag from an instruction's pattern. When an instruction doesn't have a pattern, it is assumed to have side effects. Hi Jakob, I don't understand what you're saying. Are you proposing that all properties (may load,
2012 Aug 21
0
[LLVMdev] Let's get rid of neverHasSideEffects
...lticlass when you define the *rm variant. X86 is the worst case because so many instructions can fold loads and stores. You can handle most of them by setting the mayLoad and mayStore flags in the big ArithBinOp multiclasses. > > You can see the problem in the big ArithBinOp_RF multiclass in X86InstrArithmetic.td. It's not obvious at a glance which of those instructions have patterns, and as a result we forgot to set neverHasSideEffects on the *_REV and *8i8 variants. I don't think it would detract to add "let mayLoad = 1 in {…}" around the *rm groups etc. Personally, I don't like...
2020 Mar 12
3
Getting up to speed with llvm backends. Machine Instruction operands.
Welcome to all Questions from veteran programmer with no LLVM backend experience evaluating llvm for creating a Hitachi 6309 backend. This post is about finding out more about machine instruction operands. The documentation I have read so far includes: - the online manuals - Building an LLVM Backend. Fraser Cormack Pierre-André Saulais - The Design of a Custom 32-bit RISC CPU
2012 Aug 21
8
[LLVMdev] Let's get rid of neverHasSideEffects
All, TableGen likes to infer the MCID::UnmodeledSideEffects flag from an instruction's pattern. When an instruction doesn't have a pattern, it is assumed to have side effects. It's possible to override this behavior by setting neverHasSideEffects = 1. It was originally the intention that most instructions have patterns, but that's not the way it worked out. It is often more
2016 Oct 10
8
Generate Register Indirect mode instruction
Hi All, I am new to llvm backend. I am trying out few examples to understand backend codegen. I have ported llvm LEG @ https://github.com/frasercrmck/llvm-leg to llvm 3.9 successfully. Currently, the LEG instructions are RISC load-store type instruction. I want to generate some instructions for register indirect mode, like following: IR: @a = local_unnamed_addr global i32 0, align 4 @b =