This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Expanding an ADDSI3 into 2 x ADDHI3 does not work
- From: BjÃrn Haase <bjoern dot m dot haase at web dot de>
- To: gcc at gcc dot gnu dot org
- Cc: "mhauff at bigpond dot net dot au" <mhauff at bigpond dot net dot au>
- Date: Thu, 16 Jun 2005 10:08:16 +0200
- Subject: Re: Expanding an ADDSI3 into 2 x ADDHI3 does not work
- References: <12211316.1118819765880.JavaMail.imail@web02sl>
> If I use:
> (define_expand "addsi"
> [(set (match_operand:SI 0 "general_operand" "=g")
> (plus:SI (match_operand:SI 1 "general_operand" "g")
> (match_operand:SI 2 "general_operand" "g")))]
> ""
> "{
> emit_insn (gen_addhi3 (custom_subword(operands[0], 0, SImode),
> custom_subword(operands[1], 0, SImode),
> custom_subword(operands[2], 0, SImode)));
> emit_insn (gen_addhi3 (custom_subword(operands[0], 1, SImode),
> custom_subword(operands[1], 1, SImode),
> custom_subword(operands[2], 1, SImode)));
> DONE;
> }" )
>
> the output becomes a mess of addqi, cmpqi, and branches.
Would it help to use (define_expand "addsi3" ...) instead of (define_expand
"addsi" ...) ?
Yours,
BjÃrn