Commit 70f39347 authored by Doug Gilbert's avatar Doug Gilbert Committed by Patrick Williams

Unsigned compare immediate branch emitting wrong instructions

parent 63e29f0f
......@@ -1207,6 +1207,10 @@
{
if(GET_CODE(XEXP(op,1)) == CONST_INT )
{
if(GET_CODE( op ) == GEU ||
GET_CODE( op ) == GTU ||
GET_CODE( op ) == LEU ||
GET_CODE( op ) == LTU) return 0;
if((INTVAL(XEXP(op,1)) < 32) && (INTVAL(XEXP(op,1)) >= 0)) return 1;
else return 0;
}
......
......@@ -19148,12 +19148,14 @@ rs6000_emit_cbranch (enum machine_mode mode, rtx operands[])
//debug_rtx(loc_ref); // (label_ref 0)
loc_ref = gen_rtx_LABEL_REF (VOIDmode, operands[3]);
enum rtx_code code = GET_CODE (operands[0]);
// Split the compare and branch if not PPE42 or not optimized for size
// or can't meet the constraints of fused compare-branch.
if( (rs6000_cpu != PROCESSOR_PPE42) || !optimize_size ||
((GET_CODE (operands[2]) == CONST_INT) &&
((INTVAL(operands[2]) < 0) || (INTVAL(operands[2]) > 31))))
((INTVAL(operands[2]) < 0) || (INTVAL(operands[2]) > 31) ||
code==GTU || code==GEU || code==LTU || code==LEU )))
{
condition_rtx = rs6000_generate_compare (operands[0], mode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment