mc2.c 1.43 KB
/****************************************************************
  WHAT:	RSP SCALAR UNIT TEST GENERATOR FOR MC2 FORMAT
  SCCS: %W% %G%
  PTLS:	$Id: mc2.c,v 1.1.1.1 2002/05/02 03:29:15 blythe Exp $
  FILE:	mc2 - move between SU GPR and VU element register
  ENGR:	Evan Y. Wang
  PROJ:	Project Reality
  (CR):	1994 Silicon Graphics, Inc.
 ****************************************************************/
#include <stdio.h>
#include "software.h"
#include "gen.h"
#include "suregre.h"

#define MAX_TCS	MAX_MC2_TCS

#define GenCase()						\
    fprintf(outp,Templ,CurTcNo,ip->name,			\
	    rA, rB, rR, rT, vT, El,				\
	    HHW(OpA), LHW(OpA), HHW(OpB), LHW(OpB),		\
	    HHW(Res), LHW(Res), HHW(Imm), LHW(Imm))

PRIVATE	char *Templ =
    /* ChkMc2(  n,Op,   rA,   rB,   rR,   rT, vT,El,     AH,     AL,     BH,     BL,     RH,     RL,     TH,     TL); */
    "\tChkMc2(%2d,%s,r%-2d,r%-2d,r%-2d,r%-2d,v%d,%d,0x%4.4X,0x%4.4X,0x%4.4X,0x%4.4X,0x%4.4X,0x%4.4X,0x%4.4X,0x%4.4X)\n";

int Mc2Gen(outp, ip)
    FILE *outp;			/* output file handle		*/
    I_TABLE *ip;		/* instruction table entry ptr	*/
{
    int i, j;

    /* Test VCO */
    for (i=0; i<32; i++) {
	vT = i;
	for (j=0; j<8; j++) {
	    El = 2*j;
	    OpA = (4<<i) | (2<<(j<<1)) | (1<<(i&7));
	    OpB = (0x80000000>>i) | (0x10000>>j) | (0x80>>(i&7));
	    FILE_SPLIT {
		Res = ip->proc(OpA,OpB);
		GenCase();
		UpdRegTABR();
	    }

	    CurTcNo++;
	    UpdRegID();
	}
    }

    return 0;

}   /* Mc2Gen */