This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Exploiting dual mode operation, implementation.
- From: Leehod Baruch <LEEHOD at il dot ibm dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Mircea Namolaru <NAMOLARU at il dot ibm dot com>, sleehodb at t2 dot technion dot ac dot il, Steven Bosscher <stevenb at suse dot de>
- Date: Sun, 31 Jul 2005 18:31:10 +0300
- Subject: Re: [PATCH] Exploiting dual mode operation, implementation.
Hello,
Thank you for your response.
I'm sorry for my late response,
I was on a couple of weeks leave for exams.
> Unfortunately, you don't
> describe the patterns you've encountered and how/why calling
> make_compound_operation helps.
Well, the simplification in which I've used
make_compound_operation was ment to simplify patterns like:
set (reg:DI 100) (sign_extend:DI (subreg:SI (reg:DI 10)))
set (reg:DI 200) (sign_extend:DI (subreg:SI (reg:DI 20)))
set (reg:CC 300) (compare:CC (reg:DI 100) (reg:DI 200))
into this:
set (reg:CC 300)
(compare:CC (subreg:SI (reg:DI 10)) (subreg:SI (reg:DI 20)))
The problem is that paterns like
(sign_extend:DI (subreg:SI (reg:DI 10)))
are transformed to this:
(ashiftrt:DI (ashift:DI (reg:DI 10)
(const_int 32 [0x20]))
(const_int 32 [0x20]))
My solution was to export make_compound_operation and transform
the pattern back to it's original pattern.
>From your note I understood that this is not recommended.
Do you think that I should look for the transformed pattern directly?
meaning that if I find:
set (reg:DI 100) (ashiftrt:DI (ashift:DI (reg:DI 10)
(const_int 32 [0x20]))
(const_int 32 [0x20]))
set (reg:DI 200) (ashiftrt:DI (ashift:DI (reg:DI 20)
(const_int 32 [0x20]))
(const_int 32 [0x20]))
set (reg:CC 300) (compare:CC (reg:DI 100) (reg:DI 200))
I should simplify it into this:
set (reg:CC 300)
(compare:CC (subreg:SI (reg:DI 10)) (subreg:SI (reg:DI 20)))
This should work, but I'm not sure about the general case in which
the mode of the registers and the sign extensions can be any mode.
Thanks,
Leehod.