⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 funcs.cc

📁 ml-rsim 多处理器模拟器 支持类bsd操作系统
💻 CC
📖 第 1 页 / 共 5 页
字号:
  ldi(inst, proc, (int)0);}void fnLDSB(instance *inst,ProcState *proc){  ldi(inst, proc, (char)1);}void fnLDSH(instance *inst,ProcState *proc){  ldi(inst, proc, (short)1);}void fnLDD(instance *inst,ProcState *proc){  char *pa = GetMap(inst, proc);  unsigned *ptr = (unsigned *)pa;  if (ptr)    {      inst->rdvalipair.a = endian_swap(*ptr);      ptr++;      inst->rdvalipair.b = endian_swap(*ptr);    }  else    inst->exception_code = BUSERR;}void fnLDX(instance *inst,ProcState *proc){  ldi(inst, proc, (unsigned)0);}/* Templates for long-long's do not seem to compile with the SC-4.0 for   SPARC v8, so the long-long version of ldi is specified separately. */void ldll(instance *inst, ProcState *proc, unsigned long long t){  char *pa = GetMap(inst, proc);  unsigned long long *ptr = (unsigned long long *)pa;   if (ptr)    {      unsigned long long result = *ptr;      result = endian_swap(result);      if (t)	result = SE(result, sizeof(unsigned long long)*8);      inst->rdvalll = result;    }  else    inst->exception_code = BUSERR;}void fnLDF(instance *inst,ProcState *proc){  char *pa = GetMap(inst,proc);  float *ptr = (float *)pa;  if (ptr)    {      float result = *ptr;      result = endian_swap(result);      int *ip = (int *) &result;      int *dp = (int*)&(inst->rdvalfh);      *dp = *ip; /* single-precision */    }  else    inst->exception_code = BUSERR;}void fnLDDF(instance *inst,ProcState *proc){  char *pa = GetMap(inst,proc);  double *ptr = (double *)pa;  if (ptr)    {      double result = *ptr;      result = endian_swap(result);      long long *ip = (long long *) &result;      *((long long *) &(inst->rdvalf)) = *ip; /* double-precision */    }  else    inst->exception_code = BUSERR;}void fnLDQF(instance *inst,ProcState *proc){  char *pa = GetMap(inst,proc);  double *ptr = (double *)pa;  if (ptr)    {      double result = *ptr;      result = endian_swap(result);      long long *ip = (long long *) &result;      *((long long *) &(inst->rdvalf)) = *ip; /* double-precision */    }  else    inst->exception_code = BUSERR;}/****** Template for a variety of integer stores  *******/template <class T> void sti(instance *inst, ProcState *proc, T){  char *pa = GetMap(inst, proc);    T *ptr = (T *)pa;  *ptr = endian_swap((T)(inst->rs1vali));}void fnSTW(instance *inst,ProcState *proc){  sti(inst, proc, (int)0);}void fnSTB(instance *inst,ProcState *proc){  sti(inst, proc, (char)0);}void fnSTH(instance *inst,ProcState *proc){  sti(inst,proc,(short)0);}void fnSTX(instance *inst,ProcState *proc){  sti(inst,proc,(unsigned)0);}void fnSTF(instance *inst,ProcState *proc){  char *pa = GetMap(inst,proc);  float *ptr = (float *)pa;  int *ip = (int*)&(inst->rs1valfh);  *((int*)pa) = endian_swap(*ip);}void fnSTDF(instance *inst,ProcState *proc){  char *pa = GetMap(inst,proc);  double *ptr = (double *)pa;  long long *ip = (long long*)&(inst->rs1valf);  *((long long*)pa) = endian_swap(*ip);}void fnSTQF(instance *inst,ProcState *proc){  char *pa = GetMap(inst,proc);  double *ptr = (double *)pa;  long long *ip = (long long*)&(inst->rs1valf);  *((long long*)pa) = endian_swap(*ip);}void fnSTD(instance *inst,ProcState *proc){  char *pa = GetMap(inst,proc);  unsigned *ptr = (unsigned *)pa;  *ptr = endian_swap(inst->rs1valipair.a);  ptr++;  *ptr = endian_swap(inst->rs1valipair.b);}#define fnSTDA fnSTDvoid fnLDUWA(instance *inst,ProcState *proc){  ldi(inst,proc,(unsigned)0);}void fnLDUBA(instance *inst,ProcState *proc){  ldi(inst,proc,(unsigned char)0);}void fnLDUHA(instance *inst,ProcState *proc){  ldi(inst,proc,(unsigned short)0);}void fnLDSWA(instance *inst,ProcState *proc){  ldi(inst,proc,(int)0);}void fnLDSBA(instance *inst,ProcState *proc){  ldi(inst,proc,(char)1);}void fnLDSHA(instance *inst,ProcState *proc){  ldi(inst,proc,(short)1);}#define fnLDDA fnLDDvoid fnLDXA(instance *inst,ProcState *proc){  ldi(inst,proc,(unsigned)0);}#define fnLDFA  fnLDF#define fnLDDFA fnLDDF#define fnLDQFA fnLDQFvoid fnSTWA(instance *inst,ProcState *proc){  sti(inst,proc,(int)0);}/* functions to store destination processor for WriteSend */void fnRWSD(instance *inst,ProcState *proc){  /*  send_dest[proc->proc_id] = inst->rs1vali; */}void fnSTBA(instance *inst,ProcState *proc){  sti(inst,proc,(char)0);}void fnSTHA(instance *inst,ProcState *proc){  sti(inst,proc,(short)0);}void fnSTXA(instance *inst,ProcState *proc){  sti(inst,proc,(unsigned)0);}#define fnSTFA  fnSTF#define fnSTDFA fnSTDF#define fnSTQFA fnSTQFvoid fnLDSTUB(instance *inst, ProcState *proc){  char *pa = GetMap(inst, proc);  unsigned char *ptr = (unsigned char *)pa;  if (ptr)    {      unsigned char result = *ptr;      inst->rdvali = result;      *ptr = 0xff;    }  else    inst->exception_code = BUSERR;}void fnSWAP(instance *inst, ProcState *proc){  char *pa=GetMap(inst,proc);  int *ptr = (int *)pa;  if (ptr)    {      int result = endian_swap(*ptr);      inst->rdvali=result;      *ptr = endian_swap(inst->rs1vali);    }  else    inst->exception_code = BUSERR;}#define fnLDSTUBA fnLDSTUB#define fnSWAPA fnSWAPvoid fnLDFSR(instance *inst, ProcState *proc){  ldi(inst, proc, (unsigned)0);  inst->exception_code = SERIALIZE;  /* load value from memory, but also serialize it. If it turns out to be     a limbo, then let the limbo override the serialize */}void fnLDXFSR(instance *inst, ProcState *proc){  char *pa = GetMap(inst, proc);  unsigned *ptr = (unsigned *)pa;  if (ptr)    {      inst->rdvalipair.a = endian_swap(*ptr);      ptr++;      inst->rdvalipair.b = endian_swap(*ptr);      inst->exception_code = SERIALIZE;      /* load value from memory, but also serialize it. If it turns out to be	 a limbo, then let the limbo override the serialize */    }  else    inst->exception_code = BUSERR;}void fnSTFSR(instance *inst, ProcState *proc){  sti(inst, proc, (unsigned)0);}void fnSTXFSR(instance *inst, ProcState *proc){  char *pa = GetMap(inst, proc);  unsigned *ptr = (unsigned *)pa;  *ptr = endian_swap(inst->rs1valipair.a);  ptr++;  *ptr = endian_swap(inst->rs1valipair.b);}void fnPREFETCH(instance *, ProcState *){}void fnCASA(instance *inst, ProcState *proc){  char *pa = GetMap(inst,proc);  int *ptr = (int *)pa;  if (ptr)    {      int result = endian_swap(*ptr);      inst->rdvali=result;      if (result == inst->rs1vali)           // put the old dest value	*ptr = endian_swap(inst->rsccvali);  // into the memory location    }  else    inst->exception_code = BUSERR;}#define fnPREFETCHA fnPREFETCH/*void fnPREFETCHA(instance *inst, ProcState *proc){}*/#define fnCASXA fnCASA/*void fnCASXA(instance *inst, ProcState *proc){}*/void fnFLUSH(instance *, ProcState *){}void fnTADDcc(instance *inst, ProcState *){  inst->exception_code = ILLEGAL; /* not currently supported */}void fnTSUBcc(instance *inst, ProcState *){  inst->exception_code = ILLEGAL; /* not currently supported */}void fnTADDccTV(instance *inst, ProcState *){  inst->exception_code = ILLEGAL; /* not currently supported */}void fnTSUBccTV(instance *inst, ProcState *){  inst->exception_code = ILLEGAL; /* not currently supported */}void FuncTableSetup(){  instr_func[iRESERVED]      = fnRESERVED;  instr_func[iILLTRAP]       = fnILLTRAP;  instr_func[iCALL]          = fnCALL;  instr_func[iJMPL]          = fnJMPL;  instr_func[iRETURN]        = fnRETURN;  instr_func[iTcc]           = fnTcc;  instr_func[iDONERETRY]     = fnDONERETRY;  instr_func[iBPcc]          = fnBPcc;  instr_func[iBicc]          = fnBicc;  instr_func[iBPr]           = fnBPr;  instr_func[iFBPfcc]        = fnFBPfcc;  instr_func[iFBfcc]         = fnFBfcc;    instr_func[iSETHI]         = fnSETHI;  instr_func[iADD]           = fnADD;  instr_func[iAND]           = fnAND;  instr_func[iOR]            = fnOR;  instr_func[iXOR]           = fnXOR;  instr_func[iSUB]           = fnSUB;  instr_func[iANDN]          = fnANDN;  instr_func[iORN]           = fnORN;  instr_func[iXNOR]          = fnXNOR;  instr_func[iADDC]          = fnADDC;    instr_func[iMULX]          = fnMULX;  instr_func[iUMUL]          = fnUMUL;  instr_func[iSMUL]          = fnSMUL;  instr_func[iUDIVX]         = fnUDIVX;  instr_func[iUDIV]          = fnUDIV;  instr_func[iSDIV]          = fnSDIV;    instr_func[iSUBC]          = fnSUBC;  instr_func[iADDcc]         = fnADDcc;  instr_func[iANDcc]         = fnANDcc;  instr_func[iORcc]          = fnORcc;  instr_func[iXORcc]         = fnXORcc;    instr_func[iSUBcc]         = fnSUBcc;  instr_func[iANDNcc]        = fnANDNcc;  instr_func[iORNcc]         = fnORNcc;  instr_func[iXNORcc]        = fnXNORcc;  instr_func[iADDCcc]        = fnADDCcc;    instr_func[iUMULcc]        = fnUMULcc;  instr_func[iSMULcc]        = fnSMULcc;  instr_func[iUDIVcc]        = fnUDIVcc;  instr_func[iSDIVcc]        = fnSDIVcc;    instr_func[iSUBCcc]        = fnSUBCcc;  instr_func[iTADDcc]        = fnTADDcc;  instr_func[iTSUBcc]        = fnTSUBcc;  instr_func[iTADDccTV]      = fnTADDccTV;  instr_func[iTSUBccTV]      = fnTSUBccTV;  instr_func[iMULScc]        = fnMULScc;  instr_func[iSLL]           = fnSLL;  instr_func[iSRL]           = fnSRL;  instr_func[iSRA]           = fnSRA;  instr_func[iarithSPECIAL1] = fnarithSPECIAL1;    instr_func[iRDPR]          = fnRDPR;  instr_func[iMOVcc]         = fnMOVcc;  instr_func[iSDIVX]         = fnSDIVX;  instr_func[iPOPC]          = fnPOPC;  instr_func[iMOVR]          = fnMOVR;  instr_func[iarithSPECIAL2] = fnarithSPECIAL2;    instr_func[iSAVRESTD]     = fnSAVRESTD;  instr_func[iWRPR]         = fnWRPR;  instr_func[iIMPDEP1]      = fnIMPDEP1;  instr_func[iIMPDEP2]      = fnIMPDEP2;  instr_func[iSAVE]         = fnSAVE;  instr_func[iRESTORE]      = fnRESTORE;    instr_func[iFMOVs]        = fnFMOVs;  instr_func[iFMOVd]        = fnFMOVd;  instr_func[iFMOVq]        = fnFMOVq;  instr_func[iFNEGs]        = fnFNEGs;  instr_func[iFNEGd]        = fnFNEGd;  instr_func[iFNEGq]        = fnFNEGq;  instr_func[iFABSs]        = fnFABSs;  instr_func[iFABSd]        = fnFABSd;  instr_func[iFABSq]        = fnFABSq;  instr_func[iFSQRTs]       = fnFSQRTs;    instr_func[iFSQRTd]       = fnFSQRTd;  instr_func[iFSQRTq]       = fnFSQRTq;  instr_func[iFADDs]        = fnFADDs;  instr_func[iFADDd]        = fnFADDd;  instr_func[iFADDq]        = fnFADDq;  instr_func[iFSUBs]        = fnFSUBs;  instr_func[iFSUBd]        = fnFSUBd;  instr_func[iFSUBq]        = fnFSUBq;    instr_func[iFMULs]        = fnFMULs;  instr_func[iFMULd]        = fnFMULd;  instr_func[iFMULq]        = fnFMULq;  instr_func[iFDIVs]        = fnFDIVs;  instr_func[iFDIVd]        = fnFDIVd;  instr_func[iFDIVq]        = fnFDIVq;  instr_func[iFsMULd]       = fnFsMULd;  instr_func[iFdMULq]       = fnFdMULq;    instr_func[iFsTOx]        = fnFsTOx;  instr_func[iFdTOx]        = fnFdTOx;  instr_func[iFqTOx]        = fnFqTOx;  instr_func[iFxTOs]        = fnFxTOs;  instr_func[iFxTOd]        = fnFxTOd;  instr_func[iFxToq]        = fnFxToq;  instr_func[iFiTOs]        = fnFiTOs;  instr_func[iFdTOs]        = fnFdTOs;    instr_func[iFqTOs]        = fnFqTOs;  instr_func[iFiTOd]        = fnFiTOd;  instr_func[iFsTOd]        = fnFsTOd;  instr_func[iFqTOd]        = fnFqTOd;  instr_func[iFiTOq]        = fnFiTOq;  instr_func[iFsTOq]        = fnFsTOq;  instr_func[iFdTOq]        = fnFdTOq;  instr_func[iFsTOi]        = fnFsTOi;    instr_func[iFdTOi]        = fnFdTOi;  instr_func[iFqTOi]        = fnFqTOi;  instr_func[iFMOVs0]       = fnFMOVs0;  instr_func[iFMOVd0]       = fnFMOVd0;  instr_func[iFMOVq0]       = fnFMOVq0;  instr_func[iFMOVs1]       = fnFMOVs0;  instr_func[iFMOVd1]       = fnFMOVd0;  instr_func[iFMOVq1]       = fnFMOVq0;    instr_func[iFMOVs2]       = fnFMOVs0;  instr_func[iFMOVd2]       = fnFMOVd0;  instr_func[iFMOVq2]       = fnFMOVq0;  instr_func[iFMOVs3]       = fnFMOVs0;  instr_func[iFMOVd3]       = fnFMOVd0;  instr_func[iFMOVq3]       = fnFMOVq0;  instr_func[iFMOVsi]       = fnFMOVs0;    instr_func[iFMOVdi]       = fnFMOVd0;  instr_func[iFMOVqi]       = fnFMOVq0;  instr_func[iFMOVsx]       = fnFMOVs0;  instr_func[iFMOVdx]       = fnFMOVd0;  instr_func[iFMOVqx]       = fnFMOVq0;  instr_func[iFCMPs]        = fnFCMPs;  instr_func[iFCMPd]        = fnFCMPd;  instr_func[iFCMPq]        = fnFCMPq;    instr_func[iFCMPEs]       = fnFCMPEs;  instr_func[iFCMPEd]       = fnFCMPEd;  instr_func[iFCMPEq]       = fnFCMPEq;  instr_func[iFMOVRsZ]      = fnFMOVRs;  instr_func[iFMOVRdZ]      = fnFMOVRd;  instr_func[iFMOVRqZ]      = fnFMOVRq;  instr_func[iFMOVRsLEZ]    = fnFMOVRs;    instr_func[iFMOVRdLEZ]    = fnFMOVRd;  instr_func[iFMOVRqLEZ]    = fnFMOVRq;  instr_func[iFMOVRsLZ]     = fnFMOVRs;  instr_func[iFMOVRdLZ]     = fnFMOVRd;  instr_func[iFMOVRqLZ]     = fnFMOVRq;  instr_func[iFMOVRsNZ]     = fnFMOVRs;    instr_func[iFMOVRdNZ]     = fnFMOVRd;  instr_func[iFMOVRqNZ]     = fnFMOVRq;  instr_func[iFMOVRsGZ]     = fnFMOVRs;  instr_func[iFMOVRdGZ]     = fnFMOVRd;  instr_func[iFMOVRqGZ]     = fnFMOVRq;  instr_func[iFMOVRsGEZ]    = fnFMOVRs;    instr_func[iFMOVRdGEZ]    = fnFMOVRd;  instr_func[iFMOVRqGEZ]    = fnFMOVRq;  instr_func[iLDUW]         = fnLDUW;  instr_func[iLDUB]         = fnLDUB;  instr_func[iLDUH]         = fnLDUH;  instr_func[iLDD]          = fnLDD;  instr_func[iSTW]          = fnSTW;  instr_func[iSTB]          = fnSTB;  instr_func[iSTH]          = fnSTH;    instr_func[iSTD]          = fnSTD;  instr_func[iLDSW]         = fnLDSW;  instr_func[iLDSB]         = fnLDSB;  instr_func[iLDSH]         = fnLDSH;  instr_func[iLDX]          = fnLDX;  instr_func[iLDSTUB]       = fnLDSTUB;  instr_func[iSTX]          = fnSTX;  instr_func[iSWAP]         = fnSWAP;  instr_func[iLDUWA]        = fnLDUWA;  instr_func[iLDUBA]        = fnLDUBA;    instr_func[iLDUHA]        = fnLDUHA;  instr_func[iLDDA]         = fnLDDA;  instr_func[iSTWA]         = fnSTWA;  instr_func[iSTBA]         = fnSTBA;  instr_func[iSTHA]         = fnSTHA;  instr_func[iSTDA]         = fnSTDA;  instr_func[iLDSWA]        = fnLDSWA;  instr_func[iLDSBA]        = fnLDSBA;  instr_func[iLDSHA]        = fnLDSHA;     instr_func[iLDXA]         = fnLDXA;  instr_func[iLDSTUBA]      = fnLDSTUBA;  instr_func[iSTXA]         = fnSTXA;  instr_func[iSWAPA]        = fnSWAPA;  instr_func[iLDF]          = fnLDF;  instr_func[iLDFSR]        = fnLDFSR;  instr_func[iLDXFSR]       = fnLDXFSR;  instr_func[iLDQF]         = fnLDQF;  instr_func[iLDDF]         = fnLDDF;  instr_func[iSTF]          = fnSTF;    instr_func[iSTFSR]        = fnSTFSR;  instr_func[iSTXFSR]       = fnSTXFSR;  instr_func[iSTQF]         = fnSTQF;  instr_func[iSTDF]         = fnSTDF;  instr_func[iPREFETCH]     = fnPREFETCH;  instr_func[iLDFA]         = fnLDFA;  instr_func[iLDQFA]        = fnLDQFA;  instr_func[iLDDFA]        = fnLDDFA;  instr_func[iSTF

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -