This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Difficulty matching machine description to target - any way to specify a minimum register width ?
- From: Richard Henderson <rth at redhat dot com>
- To: pauls at dataworx dot com dot au
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 06 Jan 2012 09:23:00 +1100
- Subject: Re: Difficulty matching machine description to target - any way to specify a minimum register width ?
- References: <4F058AA1.8040802@dataworx.com.au>
On 01/05/2012 10:33 PM, Paul S wrote:
> (define_insn "addqi3i"
> [(set (match_operand:HI 0 "register_operand" "=r")
> (plus:HI (match_operand:HI 1 "register_operand" "%0")
> (sign_extend:HI (match_operand:QI 2 "memory_operand" "m"))))]
Two things are wrong with this pattern:
(1) % is incorrect because the operands are not the same mode.
That's probably the root cause of all your failures.
(2) Embedded operands are canonically first in commutative operands.
So this should be
[(set (match_operand:HI 0 "register_operand" "=r")
(plus:HI (sign_extend:HI (match_operand:QI 1 "memory_operand" "m"))
(match_operand:HI 2 "register_operand" "0")))]
r~