INSERT[D1LANG];
INSERT[ALUD1];

TITLE[D1TEST2];

RMREGION[RGN1];
RESERVE[2];
RVN[RTEMP1];
RVN[RTEMP2];

DEVICE[DSP,123];
BR[MDS,0];
BR[L,1];

START:	RBASE←RBASE[RGN1];	*Simple goto, FF not ok.
	T←RTEMP1;		*Simple goto, FF ok.

	WAKEUP[FLT], GOTO[NEXT3,ALU<0];
				*Conditional goto, condition in JCN
	T←RTEMP1;
	DBLGOTO[NEXT4,NEXT5,ALU>=0];
				*Conditional goto, condition in FF
NEXT3:	T←RTEMP1;
NEXT4:	T←RTEMP2;
NEXT5:	T←RTEMP1, RETURN;	*Return

TOP LEVEL;

START1:	RBASE←RBASE[RGN1];	*Simple branch, FF not ok.
	T←RTEMP1;		*Simple branch, FF ok.

	WAKEUP[FLT], GLOBAL;	*GLOBAL placement, FF not ok..
	T←RTEMP1, AT[34];	*AT placement, same page as GLOBAL.
	BRANCH[NEXT,ALU>=0];	*Conditional branch, branch condition
				*in FF.
	DBLBRANCH[NEXT1,NEXT2,ALU<0], WAKEUP[FLT];
				*Conditional, JCN branch condition.
NEXT:	T←RTEMP1;
NEXT1:	T←RTEMP2;
NEXT2:	T←RTEMP1;
	CALL[SUBR1];		*Call, FF ok.
	CALL[SUBR1], WAKEUP[FLT];	*Call, FF not ok.
	DBLCALL[SUBR1,SUBR2,ALU<0];	*Conditional call, B.C. in FF
	DBLCALL[SUBR1,SUBR2,ALU<0,R ODD], RTEMP1;
				*Conditional call, B.C. in JCN and FF
	GOTO[NEXT2];

SUBROUTINE;
SUBR1:	CORETURN;
	T←T;
	RETURN;
SUBR2:	RETURN;

INSSET[0,1];	*Instruction set 0, 1 target on IFU dispatches

CONS:	T←RTEMP1;
	RTEMP1←T, IFUJUMP[0];
IFUREG[1,1,MDS,34,0,CONS];	*CONS is IFU target

INSSET[1,2];	*Instruction set 1, 2 targets on IFU dispatches

FOOP:	T←RTEMP1;
	RTEMP1←T;
	T←RTEMP1, IFUJUMP[0];
IFUREG[1,1,MDS,34,0,FOOP];	*FOOP and FOOP+1 are targets
IFUREG[2,1,MDS,33,0,FOOP];

IFUJMP[3,1,1,0];	*No target constraint on type JUMP
IFUJMP[4,1,1,0];

GOOP:	T←RTEMP1, IFUJUMP[0];
	RTEMP1←T, IFUJUMP[1];

IFUREG[5,1,MDS,34,0,GOOP];

INSSET[2,3];	*Instruction set 2, 3 targets

HOOP:	T←RTEMP1, IFUJUMP[0];
	RTEMP1←T, IFUJUMP[1];
	T←T;
	RTEMP1←RTEMP1, IFUJUMP[2];
IFUREG[0,1,MDS,34,0,HOOP];

INSSET[3,4];	*Instruction set 4, 4 targets

IOOP:	T←T, IFUJUMP[0];
	T←RTEMP1, IFUJUMP[1];
	T←T, WAKEUP[FLT], IFUJUMP[2];
	RTEMP1←RTEMP1, WAKEUP[FLT], IFUJUMP[3];
IFUREG[0,1,MDS,34,0,IOOP];

END;