35.3.6.1. INTEGER COMPARE AND CONDITIONAL JUMPS ON SPARC




SPARC format 2
+-----------------------+
| 31..30	00	|
| 29		a	|
| 28	 	0	|
| 27..25	rcond	|
| 24..22	opcode	|
| 21..20	disp16hi|
| 19		p	|
| 18..14	rs1	|
| 12..0		disp16lo|	
+-----------------------+



(Branch on Integer Register with Prediction)

Operation	opcode	rcond	Description
brz		011	001	Branch on Register zero
brlez		011	010	Branch on Register Less Than or Equal to Zero
brlz		011	011	Branch on Register Less Then Zero
brnz		011	101	Branch on Register not zero
brgz		011	110	Branch on Register Greater that zero
brgez		011	111	Branch in Register Greater Than or Equal to 0


ops{,a}{,pt|,pn}	reg(rs1),label

Options:					p
	,pt	Predict Taken	(default)	
	,pn	Predict Not Taken		

	,a	Annul

	Branch		Test
	brnz		not Z		
	brz		Z
	brgez		not N
	brlz		N
	brlez		N or Z
	brgz		not (N or Z)


	if (cond)
	{
		PC <- PC + ( 4 * sign_extend(disp16) )
	}



SPARC format 2
+-----------------------+
| 31..30	00	|
| 29		a	|
| 28..25	cond	|
| 24..22	opcode	|
| 21..0		disp22	|
+-----------------------+

(Branch on Integer Conditional Codes)


Operation	opcode	rcond	Description
ba		010	1000	Bracnch Always
bn		010	0000	Branch Never
bne		010	1001	Branch on Not Equal
be		010	0001	Branch on Equal
bg		010	1010	Branch on Greater	
ble		010	0010	Branch on Less or Equal
bge		010	1011	Branch on Greater or Equal
bl		010	0011	Branch on Less
bgu		010	1100	Branch on Greater Unsigned
bleu		010	0100	Branch on Less or Equal Unsigned
bcc		010	1101	Branch on Carry Clear (Greater than or Equal US)
bcs		010	0101	Branch on Carry Set (Less than, Unsigned)
bpos		010	1110	Branch on Positive
bneg		010	0110	Branch on Negative
bvc		010	1111	Branch on Overflow Clear
bvs		010	0111	Branch on Overflow Set

ops {,a}	label

	Operation	Synonim
	bne		bnz
	be		bz
	bcc		bgeu
	bcs		blu


	if (cond)
	{
		PC <- PC + ( 4 * sign_extend(disp22) )
	}


SPARC format 2
+-----------------------+
| 31..30	00	|
| 29		a	|
| 28..25	cond	|
| 24..22	opcode	|
| 21		cc1	|
| 20		cc0	|
| 19		p	|
| 18..0		disp19	|
+-----------------------+


(Branch on Integer Conditional Codes with Prediction)

Operation	opcode	rcond	Description
bpa		001	1000	Bracnch Always
bpn		001	0000	Branch Never
bpne		001	1001	Branch on Not Equal
bpe		001	0001	Branch on Equal
bpg		001	1010	Branch on Greater	
bple		001	0010	Branch on Less or Equal
bpge		001	1011	Branch on Greater or Equal
bpl		001	0011	Branch on Less
bpgu		001	1100	Branch on Greater Unsigned
bpleu		001	0100	Branch on Less or Equal Unsigned
bpcc		001	1101	Branch on Carry Clear (Greater than or Equal US)
bpcs		001	0101	Branch on Carry Set (Less than, Unsigned)
bppos		001	1110	Branch on Positive
bpneg		001	0110	Branch on Negative
bpvc		001	1111	Branch on Overflow Clear
bpvs		001	0111	Branch on Overflow Set


ops {,a} {,pt | ,pn }	i_or_x_cc, label

	cc1    cc0	Conditional code
	0  	0	icc
	0	1	---
	1	0	xcc
	1	1	---


	if (cond)
	{
		PC <- PC + ( 4 * sign_extend(disp19) )
	}



// ----------------------------------------------------------------------


Index Prev Next