[LLVMdev] Using patterns inside patterns
Villmow, Micah
Micah.Villmow at amd.com
Thu Oct 30 09:18:12 PDT 2008
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 : Pat<(shl GPRI64:$src0, GPRI32:$src1),
(LCREATE (ISHL (LLO GPRI64:$src0), GPRI32:$src1),
(IOR (ISHL (LHI GPRI64:$src0), GPRI32:$src1), (IOR (USHR (LLO
GPRI64:$src0), (IADD (LOADCONST_i32 32), (INEGATE GPRI32:$src1))), (USHR
(LLO GPRI64:$src0), (IADD GPRI32:$src1, (LOADCONST_i32 -32))))))>;
However, I have two adds that I could map to subtractions, what I would
like to be able to do is:
def LSHL : Pat<(shl GPRI64:$src0, GPRI32:$src1),
(LCREATE (ISHL (LLO GPRI64:$src0), GPRI32:$src1),
(IOR (ISHL (LHI GPRI64:$src0), GPRI32:$src1), (IOR (USHR (LLO
GPRI64:$src0), (ISUB (LOADCONST_i32 32), GPRI32:$src1)), (USHR (LLO
GPRI64:$src0), (ISUB GPRI32:$src1, (LOADCONST_i32 32))))))>;
However my error is:
In LSHL: Unrecognized node 'ISUB'!
So, it obviously wants SDNodes and not Pat's, so is there a way I can
align this to get it so it will accept a Pat or to translate a Pat as an
SDNode?
________________________________
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
On Behalf Of Evan Cheng
Sent: Thursday, October 30, 2008 8:44 AM
To: LLVM Developers Mailing List
Subject: Re: [LLVMdev] Using patterns inside patterns
I am not sure what you are looking to do. Please provide a mark up
example.
Evan
On Oct 28, 2008, at 11:00 AM, Villmow, Micah wrote:
Is there currently a way to use a pattern inside of another pattern?
Micah Villmow
Systems Engineer
Advanced Technology & Performance
Advanced Micro Devices Inc.
4555 Great America Pkwy,
Santa Clara, CA. 95054
P: 408-572-6219
F: 408-572-6596
_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081030/056f0b65/attachment.html>
More information about the llvm-dev
mailing list