Displaying 20 results from an estimated 3000 matches similar to: "[LLVMdev] Multi-Instruction Patterns"
2008 Sep 23
0
[LLVMdev] Multi-Instruction Patterns
On Sep 23, 2008, at 11:26 AM, David Greene wrote:
> Are there any examples of using tablegen to generate multiple machine
> instructions from a single pattern? Or do these cases always have
> to be
> manually expanded?
PPC has a bunch of examples, for example:
// Arbitrary immediate support. Implement in terms of LIS/ORI.
def : Pat<(i32 imm:$imm),
(ORI (LIS (HI16
2007 Jan 09
2
[LLVMdev] Pattern matching questions
On Tue, 9 Jan 2007, Evan Cheng wrote:
>> - How does one deal with multiple instruction sequences in a pattern?
>> To load a constant is a two instruction sequence, but both
>> instructions only take two operands (assume that r3 is a 32-bit
>> register):
>>
>> ilhu $3, 45 # r3 = (45 << 16)
>> iohl $3, 5 # r3 |= 5
2008 Sep 24
2
[LLVMdev] Multi-Instruction Patterns
Chris Lattner wrote:
> On Sep 23, 2008, at 11:26 AM, David Greene wrote:
>
>> Are there any examples of using tablegen to generate multiple machine
>> instructions from a single pattern? Or do these cases always have
>> to be
>> manually expanded?
>
> PPC has a bunch of examples, for example:
>
> // Arbitrary immediate support. Implement in terms of
2007 Jan 10
0
[LLVMdev] Pattern matching questions
Chris Lattner wrote:
>>It is possible to write multi-instruction pattern, e.g.
>>X86InstrSSE.td line 1911. But how are you defining HI16 and LO16?
>>Sounds like you want to define them as SDNodeXform that returns upper
>>and lower 16 bits respectively. Take a look at PSxLDQ_imm in
>>X86InstrSSE.td as an example.
>
>
> Another good example is the PPC
2008 Oct 30
1
[LLVMdev] Using patterns inside patterns
I do not have access to a subtraction routine, as it is considered add
with negation on the second parameter, so I have this pattern:
// integer subtraction
// a - b ==> a + (-b)
def ISUB : Pat<(sub GPRI32:$src0, GPRI32:$src1),
(IADD GPRI32:$src0, (INEGATE GPRI32:$src1))>;
I am attemping to do 64 bit integer shifts and using the following
pattern:
def LSHL :
2004 Oct 06
3
flac-1.1.1 completely broken on linux/ppc and on macosx if built with the standard toolchain (not xcode)
Sadly the latest optimization broke completely everything.
The asm code isn't gas compliant. the libFLAC linker script has a typo,
disabling the asm optimization and/or altivec won't let a correct build
anyway.
Instant fixes for the asm stuff:
sed -i -e"s:;:\#:" on the lpc_asm.s
to load address instead of addis+ori you could use
lis and la and PLEASE use the @l(register)
2007 Jan 09
3
[LLVMdev] Pattern matching questions
I was able to resolve my previous question about dealing with custom
loads/stores, and following Chris' suggestion, the IBM Cell SPU backend
can generate code for "int main(void) { return 0; }" without crashing
llc. There's a lot of work still to be done... like getting frame
offsets correctly computed and hauling in the raft of intrinsics that
the Cell SDK defines.
Three quick
2012 Jul 20
2
[LLVMdev] Help with Instruction Expansion on Mips
Thanks for your reply.
We are trying to implement a simple Mips-based CPU with just for teaching
purpose, so we delete some instructions which are not commonly used, thus
the task won't be too hard for students. I am responsible for modifying the
compiler so that the compiler won't emit unsupported instructions.
In order to avoid "can not select" error, I am trying to expand
2007 Jan 09
0
[LLVMdev] Pattern matching questions
On Jan 9, 2007, at 10:01 AM, Scott Michel wrote:
> I was able to resolve my previous question about dealing with custom
> loads/stores, and following Chris' suggestion, the IBM Cell SPU
> backend
> can generate code for "int main(void) { return 0; }" without crashing
> llc. There's a lot of work still to be done... like getting frame
> offsets correctly
2008 Sep 24
3
[LLVMdev] Multi-Instruction Patterns
On Wed, September 24, 2008 12:10 am, Evan Cheng wrote:
>
> On Sep 23, 2008, at 7:17 PM, David Greene wrote:
>
>> Chris Lattner wrote:
>>> On Sep 23, 2008, at 11:26 AM, David Greene wrote:
>>>
>>>> Are there any examples of using tablegen to generate multiple
>>>> machine
>>>> instructions from a single pattern? Or do these cases
2012 Jul 20
0
[LLVMdev] Help with Instruction Expansion on Mips
YOu have to look for which DAG fragments are not being matched.
Then you can create patterns for those using alternate sequences.
When you disablea given instruction, don't just disable it, but also
look at what pattern it was matching.
Then create a patten for that using remaining instructions or in some
cases you might have to call a library function, as in the case of
floating
2012 Aug 09
2
[LLVMdev] Pseudo instructions expansion
Hi all,
I'm trying to solve a problem that we have in implementation of the assembler for Mips platform in llvm. Mips has some pseudo instructions that, depending on the arguments can be emitted as one or more real instructions by the assembler.
For example load immediate instruction can have multiple expansions depending on a size of immediate operand:
This expansion is for 0 ≤ j ≤ 65535.
li
2018 Mar 09
2
[SelectionDAG] [TargetOp] How to get sub-half of immediate?
Hi all,
This seems like a dumb question but while setting up a pattern in TD
file, I got stuck on trying to get each half of an immediate as the
half-sized type (ie. i64 imm -> pair of i32 imm's). Is there an existing
way to do it? I've tried the 'EXTRACT_SUBREG' but that seems to error at
the end of scheduling. Looking at Target.td, I'm not sure which opcode
is meant
2010 Nov 17
1
[LLVMdev] [llvm-commits] [patch] ARM/MC/ELF add new stub for movt/movw in ARMFixupKinds
+llvmdev
-llvmcommits
On Fri, Nov 12, 2010 at 8:03 AM, Jim Grosbach <grosbach at apple.com> wrote:
> Sorta. getBinaryCodeForInst() is auto-generated by tablegen, so shouldn't be modified directly. The target can register hooks for instruction operands for any special encoding needs, including registering fixups, using the EncoderMethod string. For an example, have a look at the
2018 Mar 09
0
[SelectionDAG] [TargetOp] How to get sub-half of immediate?
Hi Kevin,
To get some portion of a constant immediate you can use SDNodeXForms to
transform constant SDNodes into other values. For a worked example, in the
MIPS backend we use this for constant synthesis by materializing the value into a
register:
(From lib/Target/MipsInstrInfo.td):
// Transformation Function - get the lower 16 bits.
def LO16 : SDNodeXForm<imm, [{
return getImm(N,
2015 Nov 22
2
[lld] R_MIPS_HI16 / R_MIPS_LO16 calculation
On Sun, Nov 22, 2015 at 1:28 AM, Rui Ueyama <ruiu at google.com> wrote:
> I'm not sure if I understand the semantics of HI16 and LO16 relocations. If
> my understanding is correct, a pair of HI16 and LO16 represents an addend
> AHL. AHL is computed by (AHI<<16) | (ALO&0xFFFF). Can't we apply HI16 and
> LO16 relocations separately and produce the same relocation
2014 Aug 22
2
[LLVMdev] Help with definition of subregisters; spill, rematerialization and implicit uses
Hi Quentin,
On 08/19/14 18:58, Quentin Colombet wrote:
[...]
> It seems that you will have to debug further the *** Bad machine code: Instruction loads from dead spill slot *** before we can be of any help.
Yes, I've done some more digging. Sorry for the long mail...
I get:
Inline spilling aN40_0_7:%vreg1954 [5000r,5056r:0)[5056r,5348r:1)
0 at 5000r 1 at 5056r
At this point I have
2014 Aug 15
2
[LLVMdev] Help with definition of subregisters; spill, rematerialization and implicit uses
Hi,
I have a problem regarding sub-register definitions and LiveIntervals on
our target. When a subregister is defined, other parts of the register
are always left untouched - they are neither read or def:ed.
It however seems that Codegen treats subregister definitions as somehow
clobbering the whole register.
The SSA-code looks like this after isel:
(Reg0 and Reg1 are 16bit registers. Reg2,
2007 Mar 22
1
[LLVMdev] Backend: 2 address + 17bit immediate
Hello,
Im (trying) to write a backend for a simple 32bit processor architecture,
with a single instruction format having no condition code registers.
www.docm.mmu.ac.uk/STAFF/A.Nisbet/Sabre.pdf is the short 15 page document
describing the architecture of Sabre. It is a Celoxica developed
research/teaching processor, pages 5-8 contain relevant information for
targetting it from a new compiler
2012 Aug 09
0
[LLVMdev] Pseudo instructions expansion
Hi Vladimir,
The pass you refer to isn't used by the assembler at all. That's strictly a compiler codegen thing. The assembler equivalents are expressed via InstAlias constructions. Again, though, those are for a single output instruction, so you need something more. Sprecifically, you can handle assembly pseudo-instructions in C++ code. Something like the ARM assembler's