// Check Flag Settings for MAX/MIN
# mach: bfin

.include "testutils.inc"
	start

	init_r_regs 0;
	ASTAT = R0;

	r0=1;
	r1= -1;
	r2=min(r1,r0);
	_DBG ASTAT;
//r3=ASTAT;
//dbga (r3.l, 0x2);
//dbga (r3.h, 0x0);
	cc = az;
	r7 = cc;
	dbga( r7.l, 0);
	cc = an;
	r7 = cc;
	dbga( r7.l, 1);
	cc = av0;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av0s;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1s;
	r7 = cc;
	dbga( r7.l, 0);
	dbga (r2.l, 0xffff);
	dbga (r2.h, 0xffff);

	r2=min(r0,r1);
	_DBG ASTAT;
//r3=ASTAT;
//dbga (r3.l, 0x2);
//dbga (r3.h, 0x0);
	cc = az;
	r7 = cc;
	dbga( r7.l, 0);
	cc = an;
	r7 = cc;
	dbga( r7.l, 1);
	cc = av0;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av0s;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1s;
	r7 = cc;
	dbga( r7.l, 0);
	dbga (r2.l, 0xffff);
	dbga (r2.h, 0xffff);

	r2=max(r1,r0);
	_DBG ASTAT;
//r3=ASTAT;
//dbga (r3.l, 0x0);
//dbga (r3.h, 0x0);
	cc = az;
	r7 = cc;
	dbga( r7.l, 0);
	cc = an;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av0;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av0s;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1s;
	r7 = cc;
	dbga( r7.l, 0);
	dbga (r2.l, 0x1);
	dbga (r2.h, 0x0);

	r2=max(r0,r1);
	_DBG ASTAT;
//r3=ASTAT;
//dbga (r3.l, 0x0);
//dbga (r3.h, 0x0);
	cc = az;
	r7 = cc;
	dbga( r7.l, 0);
	cc = an;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av0;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av0s;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1s;
	r7 = cc;
	dbga( r7.l, 0);
	dbga (r2.l, 0x1);
	dbga (r2.h, 0x0);

	r0.h=1;
	r2=min(r1,r0) (v);
	_DBG ASTAT;
//r3=ASTAT;
//dbga (r3.l, 0x2);
//dbga (r3.h, 0x0);
	cc = az;
	r7 = cc;
	dbga( r7.l, 0);
	cc = an;
	r7 = cc;
	dbga( r7.l, 1);
	cc = av0;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av0s;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1s;
	r7 = cc;
	dbga( r7.l, 0);
	dbga (r2.l, 0xffff);
	dbga (r2.h, 0xffff);

	r2=min(r0,r1) (v);
	_DBG ASTAT;
//r3=ASTAT;
//dbga (r3.l, 0x2);
//dbga (r3.h, 0x0);
	cc = az;
	r7 = cc;
	dbga( r7.l, 0);
	cc = an;
	r7 = cc;
	dbga( r7.l, 1);
	cc = av0;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av0s;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1s;
	r7 = cc;
	dbga( r7.l, 0);
	dbga (r2.l, 0xffff);
	dbga (r2.h, 0xffff);

	r2=max(r1,r0) (v);
	_DBG ASTAT;
//r3=ASTAT;
//dbga (r3.l, 0x0);
//dbga (r3.h, 0x0);
	cc = az;
	r7 = cc;
	dbga( r7.l, 0);
	cc = an;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av0;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av0s;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1s;
	r7 = cc;
	dbga( r7.l, 0);
	dbga (r2.l, 0x1);
	dbga (r2.h, 0x1);

	r2=max(r0,r1) (v);
	_DBG ASTAT;
//r3=ASTAT;
//dbga (r3.l, 0x0);
//dbga (r3.h, 0x0);
	cc = az;
	r7 = cc;
	dbga( r7.l, 0);
	cc = an;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av0;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av0s;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1s;
	r7 = cc;
	dbga( r7.l, 0);
	dbga (r2.l, 0x1);
	dbga (r2.h, 0x1);

	r0=0;
	r2=max(r1,r0);
	_DBG ASTAT;
//r3=ASTAT;
//dbga (r3.l, 0x1);
//dbga (r3.h, 0x0);
	cc = az;
	r7 = cc;
	dbga( r7.l, 1);
	cc = an;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av0;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av0s;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1s;
	r7 = cc;
	dbga( r7.l, 0);
	dbga (r2.l, 0x0);
	dbga (r2.h, 0x0);

	r0.h=1;
	r2=max(r1,r0) (v);
	_DBG ASTAT;
//r3=ASTAT;
//dbga (r3.l, 0x1);
//dbga (r3.h, 0x0);
	cc = az;
	r7 = cc;
	dbga( r7.l, 1);
	cc = an;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av0;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av0s;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1;
	r7 = cc;
	dbga( r7.l, 0);
	cc = av1s;
	r7 = cc;
	dbga( r7.l, 0);
	dbga (r2.l, 0x0);
	dbga (r2.h, 0x1);

	pass
