This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc port to StarCore
----- Original Message -----
From: Alan Lehotsky <apl@alum.mit.edu>
To: David Livshin <dlivshin@zahav.net.il>
Cc: <gcc@gcc.gnu.org>
Sent: Thursday, May 02, 2002 2:20 PM
Subject: Re: gcc port to StarCore
> At 8:38 AM +0200 5/2/02, David Livshin wrote:
> >
> > > Can you post the define_expand and/or define_insn for these?
> >>
> >
> >You are right - the pattern is:
> >
> >
> >( define_expand "cmpsi"
> > [ ( set ( cc0 )
> > ( compare ( match_operand:SI 0 "drREG_operand" "d,z" )
> > ( match_operand:SI 1 "drREG_operand" "d,z" )
> > )
> > )
> > ]
> > ""
> > "
> > {
> > StarCore_DefineExpand_cmp( operands, FALSE, FALSE );
> > DONE;
> > }"
> >)
>
>
> Well, this would prevent the initial generation of compares with
> literals as operands - but for most ports, the compiler will
> initially "load" literals into pseudo-registers ANYWAY and let the
> various optimization passes figure out which things are better off as
> immediate values.
>
> I should have just asked for your DEFINE_INSN that matches the
> compare patterns. Also, you
> use a function to actually generate the RTL - so I can't see what
> sort of RTL you're really producing
> or consuming!
StarCore_DefineExpand_cmp( operands, FALSE, FALSE );
is just saving operands and data about comapre ( e.g. is it FloatingPoint
compare ):
void StarCore_DefineExpand_cmp( rtx *operands, bool Is_FP, bool Is_TST )
{
StarCore_cmp.op0 = operands[0];
StarCore_cmp.op1 = operands[1];
StarCore_cmp.IsFP = Is_FP;
StarCore_cmp.IsTST = Is_TST;
} /* StarCore_DefineExpand_cmp */
>
> How about posting:
>
> 1/ The rtl dump for your simple example - the first one, and
> possibly the
> combine dump.
Will gladly do that if my guess ( that follows ) is wrong.
>
> 2/ the DEFINE_INSNs for compares
after expanding "cmpsi" as described above I expand conditional jumps ( e.g.
"bgt" ) emitting, among other things,
emit_insn( gen_cmpsiEXPANDED( StarCore_cmp.op0, StarCore_cmp.op1,
GEN_INT( ( int )cndt_code ),
gen_reg_rtx( SImode ) ) );
where:
( define_insn "cmpsiEXPANDED"
[ ( parallel [ ( unspec:SI [ ( match_operand:SI 0 "drREG_operand" "d,z" )
( match_operand:SI 1 "drREG_operand" "d,z" )
( match_operand:SI 2 "immediate_operand" "" )
]
UNSPEC_CMPsi
)
( set ( cc0 ) ( match_operand:SI 3 "" "" ) )
]
)
]
""
"* return (char *)StarCore_DefineInsn_cmpsi( operands, insn );"
)
with StarCore_DefineInsn_cmpsi being routine that just emits StarCore
machine code.
Is "unspec' what is preventing constant holding in compare?