void decode(unsigned int b){ flush = 0; for_B = 0; for_ex = 0; for_id = 0; func = b%64; int b1,b2,b3,b4; b1 = (int)(Pow(2,11)+0.01); b2 = (int)(Pow(2,16)+0.01); b3 = (int)(Pow(2,21)+0.01); b4 = (int)(Pow(2,26)+0.01); op = b/b4; imm = b%b2; shamt = (b%b1)/64; rs = (b%b4)/b3; rt = (b%b3)/b2; rd = (b%b2)/b1; if(b == 0){ ID = "NOP"; }else if(b == -1){ ID = "HALT"; }else if(op == 0){ idtype = 'R'; Rtype(b); }else if(op == 0x02 || op == 0x03){ idtype = 'J'; Jtype(b); }else{ Itype(b); } }
bool CHtmlHandler::DataHandler(CString op,CString scmd) { bool brefresh=true; if (op.Compare("init") == 0) { if(g_RGroup.sDataLst.IsEmpty()) { //try to import the test result first CString Rtype(SCHEME_LIST);//find the result type if(SJFindFirstMatchByTxt(m_gPath+"\\Data\\temp.htm",Rtype)) //extract the result if(SJExtractTxtByMark(m_gPath+"\\Data\\"+Rtype+".htm",m_gPath+"\\Data\\temp.htm",MDB_PATTERN,DataCallBack_Extract)){ SqlDelete(PathQuery(CLSMDB,IDDATA),"测试结果",g_RGroup.sRegSel); SqlAdd(PathQuery(CLSMDB,IDDATA),"测试结果",g_RGroup.sRegSel); } //set the corresponding Data Setting g_RGroup.sDataLst = SqlNames(PathQuery(CLSMDB,IDDATA),"*",g_RGroup.sRegSel); } scmd = (g_RGroup.sDataSel.IsEmpty())?TEXT("测试结果"):g_RGroup.sDataSel;//set the initial dataset if (g_RGroup.sDataLst.Find(scmd,0) < 0) scmd = g_RGroup.sDataLst.Left(g_RGroup.sDataLst.Find(',',0)); if(g_RGroup.sJhSel1.IsEmpty()) JhHandler("init","");//initial setting of jh op = _T("select"); } if(op.Compare("add") == 0) { SqlSelect(PathQuery(CLSMDB,IDDATA),g_RGroup.sDataSel,g_RGroup.sRegSel); g_RGroup.sDataSel = SqlAdd(PathQuery(CLSMDB,IDDATA),scmd,g_RGroup.sRegSel); g_RGroup.sDataLst = SqlNames(PathQuery(CLSMDB,IDDATA),"*",g_RGroup.sRegSel); } if(op.Compare("delete") == 0) { g_RGroup.sDataSel = SqlDelete(PathQuery(CLSMDB,IDDATA),scmd,g_RGroup.sRegSel); g_RGroup.sDataLst = SqlNames(PathQuery(CLSMDB,IDDATA),"*",g_RGroup.sRegSel); } if(op.Compare("select") == 0) { g_RGroup.sDataSel = SqlSelect(PathQuery(CLSMDB,IDDATA),scmd,g_RGroup.sRegSel); } if(op.Compare("check") == 0) { SqlSelect(PathQuery(CLSMDB,IDDATA),g_RGroup.sDataSel,g_RGroup.sRegSel); SqlSelect(PathQuery(CLSMDB,IDJH),g_RGroup.sJhSel1,PathQuery(CLSGROUP,IDJH)); this->DataIntegrateForCheck(g_msTemp,ZINDEX_MAX,true); } g_msTemp.SetAt("datalst",g_RGroup.sDataLst); g_msTemp.SetAt("datasz",g_RGroup.sDataSel); g_msTemp.SetAt("jhsz",g_RGroup.sJhSel1); g_msTemp.SetAt("curview","datahtm"); g_msTemp.SetAt("curhtm","datahtm"); if(brefresh) SJReplaceTxtByMark(m_gPath+PathQuery(CLSJS,IDDATA),m_gPath+DATA_FORM,MDB_PATTERN,CallBack_Replace); return brefresh; }
/** * Decoration function */ virtual Rtype decorate(Args... args) { Rtype out; auto w_start = std::chrono::high_resolution_clock::now(); auto c_start = std::clock(); for (int i = 0; i < m_repeat; ++i) out = Decorator<Rtype(Args...)>::doCall(args...); auto c_end = std::clock(); auto w_end = std::chrono::high_resolution_clock::now(); m_wall = std::chrono::duration<float, std::milli>(w_end-w_start).count() / float(m_repeat); m_cpu = (c_end - c_start) / float(m_repeat) * 1000. / CLOCKS_PER_SEC; return out; };