alu_wi.c 1.15 KB
/****************************************************************
  WHAT:	RSP SCALAR UNIT TEST GENERATOR FOR ALU_WWI FORMAT
  SCCS: @(#)alu_wi.c	1.1 03 Aug 1994
  FILE:	lui.c
   WHO:	Project Reality - Evan Y. Wang
   (C):	1994 Silicon Graphics, Inc.
 ****************************************************************/
#include <stdio.h>
#include "software.h"
#include "gen.h"
#include "suregre.h"

#define MAX_TCS	MAX_ALU_WI_TCS

#define GenCase()						\
    fprintf(outp,Templ,CurTcNo,ip->name,rR,			\
	    HHW(Reg[rR]),LHW(Reg[rR]),HHW(Imm),rT)

PRIVATE char *Templ =
    /* ChkAluWI(  n,Op,   rR,  RValH,  RValL,    Imm,   rT); */
    "\tChkAluWI(%2d,%s,r%-2d,0x%4.4X,0x%4.4X,0x%4.4X,r%-2d)\n";

PRIVATE	int LuiWI(outp, ip)
    FILE *outp;
    I_TABLE *ip;
{
    for (CntI=0; CntI<16; CntI++, CurTcNo++) {
	Imm = 0x00010000 << CntI;
	FILE_SPLIT {
	    Res = Imm;
	    GenCase();
	    UpdRegTR();
	}
	UpdRegID();
    }
    return 0;
}   /* LuiWI */

int AluWIGen(outp, ip)
    FILE *outp;
    I_TABLE *ip;
{
    switch (ip->vec) {
      case LUI_VEC:	return LuiWI(outp,ip);		break;
      default:		fprintf(stderr,
				"ERROR: AluWIGen\n");	break;
    }
}   /* AluWIGen */