jump optimizations

Danish Samad danishsamad@yahoo.com
Thu Mar 7 02:00:00 GMT 2002


hello,

how do you tell gcc, through the machine dexcription,
to do jump optimization as shown in the sample code
below:

c code:             assembly code
 i=3; 
 j=3;
 if (i > j)         cmp	r3, r2	[length = 4]
	            ble	.L3
   k=i+j;
 else
   k=i-j;


In the c code above it checks if i>j but when
converting to assembly it checks if it is <= and
branches to the label corresponding to else

In my machine description I have specified

(define_expand "bgt"
 [(set (reg:CC 32) (gt:SI (match_dup 1) (match_dup
2)))
   (set (pc)
	(if_then_else (gt (reg:CC 32) (const_int 0))
	         (label_ref (match_operand 0 "" ""))
		 (pc)))]
  ""
  "
{
operands[1] = av_compare_op0; ;;saved earlier
operands[2] = av_compare_op1;
}
")  

both the RTL patterns generated from the define_expand
have define_insns to generate assembly but my assembly
generated is not jump optimized it generates two jump
labels one for the if condition and one for the else
condition. How do I optimize it?

regards,
danish


__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/
-------------- next part --------------
An embedded message was scrubbed...
From: MAILER-DAEMON@sources.redhat.com
Subject: failure notice
Date: 7 Mar 2002 09:55:14 -0000
Size: 2674
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20020307/cab9351e/attachment.eml>


More information about the Gcc mailing list