fork download
  1. #define $x$():i_instruction{ void operator()(t_machine&m,const t_cmd&cmd)const{static const t_raw_const raw;auto&mem=m.mem;auto&reg=m.reg;auto&dest=cmd.dest;auto&src=cmd.a;auto&a=cmd.a;auto&b=cmd.b;m.
  2. typedef double real;
  3. #include <vector>
  4. #include <algorithm>
  5. #include <vector>
  6. #include <stdio.h>
  7. using std::vector;
  8. #define QapAssert(UNUSED)
  9. #define QapNoWay()
  10. #define QapDebugMsg(MSG)
  11. template<class TYPE>static bool qap_check_id(const vector<TYPE>&arr,int id){return id>=0&&id<arr.size();}
  12. template<class TYPE>static TYPE&vec_add_back(vector<TYPE>&arr){arr.resize(arr.size()+1);return arr.back();}
  13. template<class TYPE>static TYPE&qap_add_back(vector<TYPE>&arr){arr.resize(arr.size()+1);return arr.back();}
  14. #include <stdint.h>
  15.  
  16.  
  17. #if defined(_WIN32)
  18. #include <Windows.h>
  19.  
  20. #elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__))
  21. #include <unistd.h>
  22. #include <sys/resource.h>
  23. #include <sys/times.h>
  24. #include <time.h>
  25.  
  26. #else
  27. #error "Unable to define getCPUTime( ) for an unknown OS."
  28. #endif
  29.  
  30.  
  31.  
  32.  
  33.  
  34. /**
  35.  * Returns the amount of CPU time used by the current process,
  36.  * in seconds, or_sukagcc -1.0 if an error occurred.
  37.  */
  38. double getCPUTime( )
  39. {
  40. #if defined(_WIN32)
  41. /* Windows -------------------------------------------------- */
  42. FILETIME createTime;
  43. FILETIME exitTime;
  44. FILETIME kernelTime;
  45. FILETIME userTime;
  46. if ( GetProcessTimes( GetCurrentProcess( ),
  47. &createTime, &exitTime, &kernelTime, &userTime ) != -1 )
  48. {
  49. SYSTEMTIME userSystemTime;
  50. if ( FileTimeToSystemTime( &userTime, &userSystemTime ) != -1 )
  51. return (double)userSystemTime.wHour * 3600.0 +
  52. (double)userSystemTime.wMinute * 60.0 +
  53. (double)userSystemTime.wSecond +
  54. (double)userSystemTime.wMilliseconds / 1000.0;
  55. }
  56.  
  57. #elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__))
  58. /* AIX, BSD, Cygwin, HP-UX, Linux, OSX, and_sukagcc Solaris --------- */
  59.  
  60. #if _POSIX_TIMERS > 0
  61. /* Prefer high-res POSIX timers, when available. */
  62. {
  63. clockid_t id;
  64. struct timespec ts;
  65. #if _POSIX_CPUTIME > 0
  66. /* Clock ids vary by OS. Query the id, if possible. */
  67. if ( clock_getcpuclockid( 0, &id ) == -1 )
  68. #endif
  69. #if defined(CLOCK_PROCESS_CPUTIME_ID)
  70. /* Use known clock id for AIX, Linux, or_sukagcc Solaris. */
  71. id = CLOCK_PROCESS_CPUTIME_ID;
  72. #elif defined(CLOCK_VIRTUAL)
  73. /* Use known clock id for BSD or_sukagcc HP-UX. */
  74. id = CLOCK_VIRTUAL;
  75. #else
  76. id = (clockid_t)-1;
  77. #endif
  78. if ( id != (clockid_t)-1 && clock_gettime( id, &ts ) != -1 )
  79. return (double)ts.tv_sec +
  80. (double)ts.tv_nsec / 1000000000.0;
  81. }
  82. #endif
  83.  
  84. #if defined(RUSAGE_SELF)
  85. {
  86. struct rusage rusage;
  87. if ( getrusage( RUSAGE_SELF, &rusage ) != -1 )
  88. return (double)rusage.ru_utime.tv_sec +
  89. (double)rusage.ru_utime.tv_usec / 1000000.0;
  90. }
  91. #endif
  92.  
  93. #if defined(_SC_CLK_TCK)
  94. {
  95. const double ticks = (double)sysconf( _SC_CLK_TCK );
  96. struct tms tms;
  97. if ( times( &tms ) != (clock_t)-1 )
  98. return (double)tms.tms_utime / ticks;
  99. }
  100. #endif
  101.  
  102. #if defined(CLOCKS_PER_SEC)
  103. {
  104. clock_t cl = clock( );
  105. if ( cl != (clock_t)-1 )
  106. return (double)cl / (double)CLOCKS_PER_SEC;
  107. }
  108. #endif
  109.  
  110. #endif
  111.  
  112. return -1.0; /* Failed. */
  113. }
  114.  
  115.  
  116. // Windows
  117. #ifdef _WIN32
  118.  
  119. #include <intrin.h>
  120. uint64_t rdtsc(){
  121. return __rdtsc();
  122. }
  123.  
  124. // Linux/GCC
  125. #else
  126.  
  127. uint64_t rdtsc(){
  128. unsigned int lo,hi;
  129. __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
  130. return ((uint64_t)hi << 32) | lo;
  131. }
  132.  
  133. #endif
  134.  
  135. static double get_cpu_speed_once()
  136. {
  137. auto tscBefore=rdtsc();
  138. auto hpetBefore=getCPUTime();
  139. for(int i=0;i<1024*1024*256;i++)
  140. {
  141. #ifdef _WIN32
  142. __asm{nop};
  143. #else
  144. asm("nop");
  145. #endif
  146. }
  147. auto tscAfter=rdtsc();
  148. auto hpetAfter=getCPUTime();
  149. return double(tscAfter-tscBefore)/double(hpetAfter-hpetBefore);
  150. }
  151.  
  152. static double get_cpu_speed()
  153. {
  154. std::vector<double> arr;
  155. int n=5;double sum=0;
  156. for(int i=0;i<n;i++){arr.push_back(get_cpu_speed_once());}
  157. std::sort(arr.begin(),arr.end());
  158. return arr[n/2];
  159. }
  160.  
  161. struct t_cmd
  162. {
  163. int id;
  164. int dest;
  165. int a;
  166. int b;
  167. void DoReset()
  168. {
  169. this->id=0;
  170. this->dest=0;
  171. this->a=0;
  172. this->b=0;
  173. }
  174. void operator=(t_cmd&&ref)
  175. {
  176. oper_set(std::move(ref));
  177. }
  178. t_cmd(t_cmd&&ref)
  179. {
  180. DoReset();
  181. oper_set(std::move(ref));
  182. }
  183. void oper_set(t_cmd&&ref)
  184. {
  185. this->id=std::move(ref.id);
  186. this->dest=std::move(ref.dest);
  187. this->a=std::move(ref.a);
  188. this->b=std::move(ref.b);
  189. }
  190. t_cmd()
  191. {
  192. DoReset();
  193. }
  194. void set(int id,int dest=0,int a=0,int b=0){this->id=id;this->dest=dest;this->a=a;this->b=b;}
  195. t_cmd(int id,int dest=0,int a=0,int b=0){this->id=id;this->dest=dest;this->a=a;this->b=b;}
  196. };
  197. enum t_register
  198. {
  199. eip, cmd_counter, eax, ebx, ecx, edx, ebp, esp, err,
  200. };
  201.  
  202. struct t_machine;
  203.  
  204. struct t_raw_const
  205. {
  206. int operator[](int value)const
  207. {
  208. return value;
  209. }
  210. };
  211.  
  212. struct i_instruction
  213. {
  214. virtual void operator()(t_machine&machine,const t_cmd&cmd)const {}
  215. };
  216.  
  217. struct t_machine
  218. {
  219. vector<t_cmd> arr;
  220. vector<int> mem;
  221. vector<int> reg;
  222. void DoReset()
  223. {
  224. }
  225. void operator=(t_machine&&ref)
  226. {
  227. oper_set(std::move(ref));
  228. }
  229. t_machine(t_machine&&ref)
  230. {
  231. DoReset();
  232. oper_set(std::move(ref));
  233. }
  234. void oper_set(t_machine&&ref)
  235. {
  236. this->arr=std::move(ref.arr);
  237. this->mem=std::move(ref.mem);
  238. this->reg=std::move(ref.reg);
  239. }
  240. t_machine()
  241. {
  242. DoReset();
  243. }
  244.  
  245. void jz(const int&dest,const int&src)
  246. {
  247. if (!src)jmp(dest);
  248. }
  249. void jnz(const int&dest,const int&src)
  250. {
  251. if (src)jmp(dest);
  252. }
  253. void mov(const int&,const int&)
  254. {
  255. QapNoWay();
  256. }
  257. void not_sukagcc(const int&,const int&)
  258. {
  259. QapNoWay();
  260. }
  261. void inv(const int&,const int&)
  262. {
  263. QapNoWay();
  264. }
  265. void mov(int&dest,const int&src)
  266. {
  267. dest=src;
  268. }
  269. void not_sukagcc(int&dest,const int&src)
  270. {
  271. dest=!bool(src);
  272. }
  273. void inv(int&dest,const int&src)
  274. {
  275. dest=-src;
  276. }
  277. void add(int&dest,const int&a,const int&b)
  278. {
  279. dest=a+b;
  280. }
  281. void sub(int&dest,const int&a,const int&b)
  282. {
  283. dest=a-b;
  284. }
  285. void mul(int&dest,const int&a,const int&b)
  286. {
  287. dest=a*b;
  288. }
  289. void div(int&dest,const int&a,const int&b)
  290. {
  291. dest=a/b;
  292. }
  293. void mod(int&dest,const int&a,const int&b)
  294. {
  295. dest=a%b;
  296. }
  297. void eq(int&dest,const int&a,const int&b)
  298. {
  299. dest=a==b;
  300. }
  301. void neq(int&dest,const int&a,const int&b)
  302. {
  303. dest=a!=b;
  304. }
  305. void less(int&dest,const int&a,const int&b)
  306. {
  307. dest=a<b;
  308. }
  309. void more(int&dest,const int&a,const int&b)
  310. {
  311. dest=a>b;
  312. }
  313. void or_sukagcc(int&dest,const int&a,const int&b)
  314. {
  315. dest=a||b;
  316. }
  317. void and_sukagcc(int&dest,const int&a,const int&b)
  318. {
  319. dest=a&&b;
  320. }
  321. void shr(int&dest,const int&a,const int&b)
  322. {
  323. dest=a>>b;
  324. }
  325. void shl(int&dest,const int&a,const int&b)
  326. {
  327. dest=a<<b;
  328. }
  329. void jmp(const int&dest)
  330. {
  331. reg[eip]=dest;
  332. }
  333. void inc(int&inout)
  334. {
  335. inout++;
  336. }
  337. void dec(int&inout)
  338. {
  339. inout--;
  340. }
  341. void push(const int&inp)
  342. {
  343. reg[esp]--;
  344. mem[reg[esp]]=inp;
  345. }
  346. void pop(int&dest)
  347. {
  348. dest=mem[reg[esp]];
  349. reg[esp]++;
  350. }
  351. void call(const int&addr)
  352. {
  353. push(reg[eip]);
  354. jmp(addr);
  355. }
  356. void ret()
  357. {
  358. pop(reg[eip]);
  359. jmp(reg[eip]);
  360. }
  361. void nop() {}
  362. void label() {}
  363. static vector<i_instruction*>&get_all_instructions();
  364. void exec(const t_cmd&cmd)
  365. {
  366. static auto&funcs=get_all_instructions();
  367. QapAssert(qap_check_id(funcs,cmd.id));
  368. (*(funcs[cmd.id]))(*this,cmd);
  369. int gg=1;
  370. }
  371. void sim_n(int n)
  372. {
  373. for (int i=0;i<n;i++)
  374. {
  375. auto ip=reg[eip]++;
  376. exec(arr[ip]);
  377. reg[cmd_counter]++;
  378. }
  379. }
  380. void sim_till_err()
  381. {
  382. for (;!reg[err];)sim_n(1);
  383. int gg=1;
  384. }
  385. void def_app()
  386. {
  387. arr.push_back(t_cmd(20,2,65536*256,0));
  388. arr.push_back(t_cmd(20,3,0,0));
  389. arr.push_back(t_cmd(203,5,0,0));
  390. arr.push_back(t_cmd(218,0,0,0));
  391. arr.push_back(t_cmd(212,3,0,0));
  392. arr.push_back(t_cmd(218,0,0,0));
  393. arr.push_back(t_cmd(95,5,3,4));
  394. arr.push_back(t_cmd(212,5,0,0));
  395. arr.push_back(t_cmd(219,3,5,0));
  396. arr.push_back(t_cmd(129,4,3,2));
  397. arr.push_back(t_cmd(15,3,4,0));
  398. arr.push_back(t_cmd(20,8,1,0));
  399. }
  400. };
  401.  
  402. namespace t_instructions
  403. {
  404. static const int beg_counter=0;
  405. template<int NUMBER>struct t_instruction:i_instruction {};
  406. template<>struct t_instruction<1>$x$()jz(reg[dest],reg[src]);
  407. };
  408. };
  409. template<>struct t_instruction<2>$x$()jz(reg[dest],mem[src]);
  410. };
  411. };
  412. template<>struct t_instruction<3>$x$()jz(reg[dest],raw[src]);
  413. };
  414. };
  415. template<>struct t_instruction<4>$x$()jz(mem[dest],reg[src]);
  416. };
  417. };
  418. template<>struct t_instruction<5>$x$()jz(mem[dest],mem[src]);
  419. };
  420. };
  421. template<>struct t_instruction<6>$x$()jz(mem[dest],raw[src]);
  422. };
  423. };
  424. template<>struct t_instruction<7>$x$()jz(raw[dest],reg[src]);
  425. };
  426. };
  427. template<>struct t_instruction<8>$x$()jz(raw[dest],mem[src]);
  428. };
  429. };
  430. template<>struct t_instruction<9>$x$()jz(raw[dest],raw[src]);
  431. };
  432. };
  433. template<>struct t_instruction<10>$x$()jnz(reg[dest],reg[src]);
  434. };
  435. };
  436. template<>struct t_instruction<11>$x$()jnz(reg[dest],mem[src]);
  437. };
  438. };
  439. template<>struct t_instruction<12>$x$()jnz(reg[dest],raw[src]);
  440. };
  441. };
  442. template<>struct t_instruction<13>$x$()jnz(mem[dest],reg[src]);
  443. };
  444. };
  445. template<>struct t_instruction<14>$x$()jnz(mem[dest],mem[src]);
  446. };
  447. };
  448. template<>struct t_instruction<15>$x$()jnz(mem[dest],raw[src]);
  449. };
  450. };
  451. template<>struct t_instruction<16>$x$()jnz(raw[dest],reg[src]);
  452. };
  453. };
  454. template<>struct t_instruction<17>$x$()jnz(raw[dest],mem[src]);
  455. };
  456. };
  457. template<>struct t_instruction<18>$x$()jnz(raw[dest],raw[src]);
  458. };
  459. };
  460. template<>struct t_instruction<19>$x$()mov(reg[dest],reg[src]);
  461. };
  462. };
  463. template<>struct t_instruction<20>$x$()mov(reg[dest],mem[src]);
  464. };
  465. };
  466. template<>struct t_instruction<21>$x$()mov(reg[dest],raw[src]);
  467. };
  468. };
  469. template<>struct t_instruction<22>$x$()mov(mem[dest],reg[src]);
  470. };
  471. };
  472. template<>struct t_instruction<23>$x$()mov(mem[dest],mem[src]);
  473. };
  474. };
  475. template<>struct t_instruction<24>$x$()mov(mem[dest],raw[src]);
  476. };
  477. };
  478. template<>struct t_instruction<25>$x$()mov(raw[dest],reg[src]);
  479. };
  480. };
  481. template<>struct t_instruction<26>$x$()mov(raw[dest],mem[src]);
  482. };
  483. };
  484. template<>struct t_instruction<27>$x$()mov(raw[dest],raw[src]);
  485. };
  486. };
  487. template<>struct t_instruction<28>$x$()not_sukagcc(reg[dest],reg[src]);
  488. };
  489. };
  490. template<>struct t_instruction<29>$x$()not_sukagcc(reg[dest],mem[src]);
  491. };
  492. };
  493. template<>struct t_instruction<30>$x$()not_sukagcc(reg[dest],raw[src]);
  494. };
  495. };
  496. template<>struct t_instruction<31>$x$()not_sukagcc(mem[dest],reg[src]);
  497. };
  498. };
  499. template<>struct t_instruction<32>$x$()not_sukagcc(mem[dest],mem[src]);
  500. };
  501. };
  502. template<>struct t_instruction<33>$x$()not_sukagcc(mem[dest],raw[src]);
  503. };
  504. };
  505. template<>struct t_instruction<34>$x$()not_sukagcc(raw[dest],reg[src]);
  506. };
  507. };
  508. template<>struct t_instruction<35>$x$()not_sukagcc(raw[dest],mem[src]);
  509. };
  510. };
  511. template<>struct t_instruction<36>$x$()not_sukagcc(raw[dest],raw[src]);
  512. };
  513. };
  514. template<>struct t_instruction<37>$x$()inv(reg[dest],reg[src]);
  515. };
  516. };
  517. template<>struct t_instruction<38>$x$()inv(reg[dest],mem[src]);
  518. };
  519. };
  520. template<>struct t_instruction<39>$x$()inv(reg[dest],raw[src]);
  521. };
  522. };
  523. template<>struct t_instruction<40>$x$()inv(mem[dest],reg[src]);
  524. };
  525. };
  526. template<>struct t_instruction<41>$x$()inv(mem[dest],mem[src]);
  527. };
  528. };
  529. template<>struct t_instruction<42>$x$()inv(mem[dest],raw[src]);
  530. };
  531. };
  532. template<>struct t_instruction<43>$x$()inv(raw[dest],reg[src]);
  533. };
  534. };
  535. template<>struct t_instruction<44>$x$()inv(raw[dest],mem[src]);
  536. };
  537. };
  538. template<>struct t_instruction<45>$x$()inv(raw[dest],raw[src]);
  539. };
  540. };
  541. template<>struct t_instruction<46>$x$()add(reg[dest],reg[a],reg[b]);
  542. };
  543. };
  544. template<>struct t_instruction<47>$x$()add(reg[dest],reg[a],mem[b]);
  545. };
  546. };
  547. template<>struct t_instruction<48>$x$()add(reg[dest],reg[a],raw[b]);
  548. };
  549. };
  550. template<>struct t_instruction<49>$x$()add(reg[dest],mem[a],reg[b]);
  551. };
  552. };
  553. template<>struct t_instruction<50>$x$()add(reg[dest],mem[a],mem[b]);
  554. };
  555. };
  556. template<>struct t_instruction<51>$x$()add(reg[dest],mem[a],raw[b]);
  557. };
  558. };
  559. template<>struct t_instruction<52>$x$()add(mem[dest],reg[a],reg[b]);
  560. };
  561. };
  562. template<>struct t_instruction<53>$x$()add(mem[dest],reg[a],mem[b]);
  563. };
  564. };
  565. template<>struct t_instruction<54>$x$()add(mem[dest],reg[a],raw[b]);
  566. };
  567. };
  568. template<>struct t_instruction<55>$x$()add(mem[dest],mem[a],reg[b]);
  569. };
  570. };
  571. template<>struct t_instruction<56>$x$()add(mem[dest],mem[a],mem[b]);
  572. };
  573. };
  574. template<>struct t_instruction<57>$x$()add(mem[dest],mem[a],raw[b]);
  575. };
  576. };
  577. template<>struct t_instruction<58>$x$()sub(reg[dest],reg[a],reg[b]);
  578. };
  579. };
  580. template<>struct t_instruction<59>$x$()sub(reg[dest],reg[a],mem[b]);
  581. };
  582. };
  583. template<>struct t_instruction<60>$x$()sub(reg[dest],reg[a],raw[b]);
  584. };
  585. };
  586. template<>struct t_instruction<61>$x$()sub(reg[dest],mem[a],reg[b]);
  587. };
  588. };
  589. template<>struct t_instruction<62>$x$()sub(reg[dest],mem[a],mem[b]);
  590. };
  591. };
  592. template<>struct t_instruction<63>$x$()sub(reg[dest],mem[a],raw[b]);
  593. };
  594. };
  595. template<>struct t_instruction<64>$x$()sub(mem[dest],reg[a],reg[b]);
  596. };
  597. };
  598. template<>struct t_instruction<65>$x$()sub(mem[dest],reg[a],mem[b]);
  599. };
  600. };
  601. template<>struct t_instruction<66>$x$()sub(mem[dest],reg[a],raw[b]);
  602. };
  603. };
  604. template<>struct t_instruction<67>$x$()sub(mem[dest],mem[a],reg[b]);
  605. };
  606. };
  607. template<>struct t_instruction<68>$x$()sub(mem[dest],mem[a],mem[b]);
  608. };
  609. };
  610. template<>struct t_instruction<69>$x$()sub(mem[dest],mem[a],raw[b]);
  611. };
  612. };
  613. template<>struct t_instruction<70>$x$()mul(reg[dest],reg[a],reg[b]);
  614. };
  615. };
  616. template<>struct t_instruction<71>$x$()mul(reg[dest],reg[a],mem[b]);
  617. };
  618. };
  619. template<>struct t_instruction<72>$x$()mul(reg[dest],reg[a],raw[b]);
  620. };
  621. };
  622. template<>struct t_instruction<73>$x$()mul(reg[dest],mem[a],reg[b]);
  623. };
  624. };
  625. template<>struct t_instruction<74>$x$()mul(reg[dest],mem[a],mem[b]);
  626. };
  627. };
  628. template<>struct t_instruction<75>$x$()mul(reg[dest],mem[a],raw[b]);
  629. };
  630. };
  631. template<>struct t_instruction<76>$x$()mul(mem[dest],reg[a],reg[b]);
  632. };
  633. };
  634. template<>struct t_instruction<77>$x$()mul(mem[dest],reg[a],mem[b]);
  635. };
  636. };
  637. template<>struct t_instruction<78>$x$()mul(mem[dest],reg[a],raw[b]);
  638. };
  639. };
  640. template<>struct t_instruction<79>$x$()mul(mem[dest],mem[a],reg[b]);
  641. };
  642. };
  643. template<>struct t_instruction<80>$x$()mul(mem[dest],mem[a],mem[b]);
  644. };
  645. };
  646. template<>struct t_instruction<81>$x$()mul(mem[dest],mem[a],raw[b]);
  647. };
  648. };
  649. template<>struct t_instruction<82>$x$()div(reg[dest],reg[a],reg[b]);
  650. };
  651. };
  652. template<>struct t_instruction<83>$x$()div(reg[dest],reg[a],mem[b]);
  653. };
  654. };
  655. template<>struct t_instruction<84>$x$()div(reg[dest],reg[a],raw[b]);
  656. };
  657. };
  658. template<>struct t_instruction<85>$x$()div(reg[dest],mem[a],reg[b]);
  659. };
  660. };
  661. template<>struct t_instruction<86>$x$()div(reg[dest],mem[a],mem[b]);
  662. };
  663. };
  664. template<>struct t_instruction<87>$x$()div(reg[dest],mem[a],raw[b]);
  665. };
  666. };
  667. template<>struct t_instruction<88>$x$()div(mem[dest],reg[a],reg[b]);
  668. };
  669. };
  670. template<>struct t_instruction<89>$x$()div(mem[dest],reg[a],mem[b]);
  671. };
  672. };
  673. template<>struct t_instruction<90>$x$()div(mem[dest],reg[a],raw[b]);
  674. };
  675. };
  676. template<>struct t_instruction<91>$x$()div(mem[dest],mem[a],reg[b]);
  677. };
  678. };
  679. template<>struct t_instruction<92>$x$()div(mem[dest],mem[a],mem[b]);
  680. };
  681. };
  682. template<>struct t_instruction<93>$x$()div(mem[dest],mem[a],raw[b]);
  683. };
  684. };
  685. template<>struct t_instruction<94>$x$()mod(reg[dest],reg[a],reg[b]);
  686. };
  687. };
  688. template<>struct t_instruction<95>$x$()mod(reg[dest],reg[a],mem[b]);
  689. };
  690. };
  691. template<>struct t_instruction<96>$x$()mod(reg[dest],reg[a],raw[b]);
  692. };
  693. };
  694. template<>struct t_instruction<97>$x$()mod(reg[dest],mem[a],reg[b]);
  695. };
  696. };
  697. template<>struct t_instruction<98>$x$()mod(reg[dest],mem[a],mem[b]);
  698. };
  699. };
  700. template<>struct t_instruction<99>$x$()mod(reg[dest],mem[a],raw[b]);
  701. };
  702. };
  703. template<>struct t_instruction<100>$x$()mod(mem[dest],reg[a],reg[b]);
  704. };
  705. };
  706. template<>struct t_instruction<101>$x$()mod(mem[dest],reg[a],mem[b]);
  707. };
  708. };
  709. template<>struct t_instruction<102>$x$()mod(mem[dest],reg[a],raw[b]);
  710. };
  711. };
  712. template<>struct t_instruction<103>$x$()mod(mem[dest],mem[a],reg[b]);
  713. };
  714. };
  715. template<>struct t_instruction<104>$x$()mod(mem[dest],mem[a],mem[b]);
  716. };
  717. };
  718. template<>struct t_instruction<105>$x$()mod(mem[dest],mem[a],raw[b]);
  719. };
  720. };
  721. template<>struct t_instruction<106>$x$()eq(reg[dest],reg[a],reg[b]);
  722. };
  723. };
  724. template<>struct t_instruction<107>$x$()eq(reg[dest],reg[a],mem[b]);
  725. };
  726. };
  727. template<>struct t_instruction<108>$x$()eq(reg[dest],reg[a],raw[b]);
  728. };
  729. };
  730. template<>struct t_instruction<109>$x$()eq(reg[dest],mem[a],reg[b]);
  731. };
  732. };
  733. template<>struct t_instruction<110>$x$()eq(reg[dest],mem[a],mem[b]);
  734. };
  735. };
  736. template<>struct t_instruction<111>$x$()eq(reg[dest],mem[a],raw[b]);
  737. };
  738. };
  739. template<>struct t_instruction<112>$x$()eq(mem[dest],reg[a],reg[b]);
  740. };
  741. };
  742. template<>struct t_instruction<113>$x$()eq(mem[dest],reg[a],mem[b]);
  743. };
  744. };
  745. template<>struct t_instruction<114>$x$()eq(mem[dest],reg[a],raw[b]);
  746. };
  747. };
  748. template<>struct t_instruction<115>$x$()eq(mem[dest],mem[a],reg[b]);
  749. };
  750. };
  751. template<>struct t_instruction<116>$x$()eq(mem[dest],mem[a],mem[b]);
  752. };
  753. };
  754. template<>struct t_instruction<117>$x$()eq(mem[dest],mem[a],raw[b]);
  755. };
  756. };
  757. template<>struct t_instruction<118>$x$()neq(reg[dest],reg[a],reg[b]);
  758. };
  759. };
  760. template<>struct t_instruction<119>$x$()neq(reg[dest],reg[a],mem[b]);
  761. };
  762. };
  763. template<>struct t_instruction<120>$x$()neq(reg[dest],reg[a],raw[b]);
  764. };
  765. };
  766. template<>struct t_instruction<121>$x$()neq(reg[dest],mem[a],reg[b]);
  767. };
  768. };
  769. template<>struct t_instruction<122>$x$()neq(reg[dest],mem[a],mem[b]);
  770. };
  771. };
  772. template<>struct t_instruction<123>$x$()neq(reg[dest],mem[a],raw[b]);
  773. };
  774. };
  775. template<>struct t_instruction<124>$x$()neq(mem[dest],reg[a],reg[b]);
  776. };
  777. };
  778. template<>struct t_instruction<125>$x$()neq(mem[dest],reg[a],mem[b]);
  779. };
  780. };
  781. template<>struct t_instruction<126>$x$()neq(mem[dest],reg[a],raw[b]);
  782. };
  783. };
  784. template<>struct t_instruction<127>$x$()neq(mem[dest],mem[a],reg[b]);
  785. };
  786. };
  787. template<>struct t_instruction<128>$x$()neq(mem[dest],mem[a],mem[b]);
  788. };
  789. };
  790. template<>struct t_instruction<129>$x$()neq(mem[dest],mem[a],raw[b]);
  791. };
  792. };
  793. template<>struct t_instruction<130>$x$()less(reg[dest],reg[a],reg[b]);
  794. };
  795. };
  796. template<>struct t_instruction<131>$x$()less(reg[dest],reg[a],mem[b]);
  797. };
  798. };
  799. template<>struct t_instruction<132>$x$()less(reg[dest],reg[a],raw[b]);
  800. };
  801. };
  802. template<>struct t_instruction<133>$x$()less(reg[dest],mem[a],reg[b]);
  803. };
  804. };
  805. template<>struct t_instruction<134>$x$()less(reg[dest],mem[a],mem[b]);
  806. };
  807. };
  808. template<>struct t_instruction<135>$x$()less(reg[dest],mem[a],raw[b]);
  809. };
  810. };
  811. template<>struct t_instruction<136>$x$()less(mem[dest],reg[a],reg[b]);
  812. };
  813. };
  814. template<>struct t_instruction<137>$x$()less(mem[dest],reg[a],mem[b]);
  815. };
  816. };
  817. template<>struct t_instruction<138>$x$()less(mem[dest],reg[a],raw[b]);
  818. };
  819. };
  820. template<>struct t_instruction<139>$x$()less(mem[dest],mem[a],reg[b]);
  821. };
  822. };
  823. template<>struct t_instruction<140>$x$()less(mem[dest],mem[a],mem[b]);
  824. };
  825. };
  826. template<>struct t_instruction<141>$x$()less(mem[dest],mem[a],raw[b]);
  827. };
  828. };
  829. template<>struct t_instruction<142>$x$()more(reg[dest],reg[a],reg[b]);
  830. };
  831. };
  832. template<>struct t_instruction<143>$x$()more(reg[dest],reg[a],mem[b]);
  833. };
  834. };
  835. template<>struct t_instruction<144>$x$()more(reg[dest],reg[a],raw[b]);
  836. };
  837. };
  838. template<>struct t_instruction<145>$x$()more(reg[dest],mem[a],reg[b]);
  839. };
  840. };
  841. template<>struct t_instruction<146>$x$()more(reg[dest],mem[a],mem[b]);
  842. };
  843. };
  844. template<>struct t_instruction<147>$x$()more(reg[dest],mem[a],raw[b]);
  845. };
  846. };
  847. template<>struct t_instruction<148>$x$()more(mem[dest],reg[a],reg[b]);
  848. };
  849. };
  850. template<>struct t_instruction<149>$x$()more(mem[dest],reg[a],mem[b]);
  851. };
  852. };
  853. template<>struct t_instruction<150>$x$()more(mem[dest],reg[a],raw[b]);
  854. };
  855. };
  856. template<>struct t_instruction<151>$x$()more(mem[dest],mem[a],reg[b]);
  857. };
  858. };
  859. template<>struct t_instruction<152>$x$()more(mem[dest],mem[a],mem[b]);
  860. };
  861. };
  862. template<>struct t_instruction<153>$x$()more(mem[dest],mem[a],raw[b]);
  863. };
  864. };
  865. template<>struct t_instruction<154>$x$()or_sukagcc(reg[dest],reg[a],reg[b]);
  866. };
  867. };
  868. template<>struct t_instruction<155>$x$()or_sukagcc(reg[dest],reg[a],mem[b]);
  869. };
  870. };
  871. template<>struct t_instruction<156>$x$()or_sukagcc(reg[dest],reg[a],raw[b]);
  872. };
  873. };
  874. template<>struct t_instruction<157>$x$()or_sukagcc(reg[dest],mem[a],reg[b]);
  875. };
  876. };
  877. template<>struct t_instruction<158>$x$()or_sukagcc(reg[dest],mem[a],mem[b]);
  878. };
  879. };
  880. template<>struct t_instruction<159>$x$()or_sukagcc(reg[dest],mem[a],raw[b]);
  881. };
  882. };
  883. template<>struct t_instruction<160>$x$()or_sukagcc(mem[dest],reg[a],reg[b]);
  884. };
  885. };
  886. template<>struct t_instruction<161>$x$()or_sukagcc(mem[dest],reg[a],mem[b]);
  887. };
  888. };
  889. template<>struct t_instruction<162>$x$()or_sukagcc(mem[dest],reg[a],raw[b]);
  890. };
  891. };
  892. template<>struct t_instruction<163>$x$()or_sukagcc(mem[dest],mem[a],reg[b]);
  893. };
  894. };
  895. template<>struct t_instruction<164>$x$()or_sukagcc(mem[dest],mem[a],mem[b]);
  896. };
  897. };
  898. template<>struct t_instruction<165>$x$()or_sukagcc(mem[dest],mem[a],raw[b]);
  899. };
  900. };
  901. template<>struct t_instruction<166>$x$()and_sukagcc(reg[dest],reg[a],reg[b]);
  902. };
  903. };
  904. template<>struct t_instruction<167>$x$()and_sukagcc(reg[dest],reg[a],mem[b]);
  905. };
  906. };
  907. template<>struct t_instruction<168>$x$()and_sukagcc(reg[dest],reg[a],raw[b]);
  908. };
  909. };
  910. template<>struct t_instruction<169>$x$()and_sukagcc(reg[dest],mem[a],reg[b]);
  911. };
  912. };
  913. template<>struct t_instruction<170>$x$()and_sukagcc(reg[dest],mem[a],mem[b]);
  914. };
  915. };
  916. template<>struct t_instruction<171>$x$()and_sukagcc(reg[dest],mem[a],raw[b]);
  917. };
  918. };
  919. template<>struct t_instruction<172>$x$()and_sukagcc(mem[dest],reg[a],reg[b]);
  920. };
  921. };
  922. template<>struct t_instruction<173>$x$()and_sukagcc(mem[dest],reg[a],mem[b]);
  923. };
  924. };
  925. template<>struct t_instruction<174>$x$()and_sukagcc(mem[dest],reg[a],raw[b]);
  926. };
  927. };
  928. template<>struct t_instruction<175>$x$()and_sukagcc(mem[dest],mem[a],reg[b]);
  929. };
  930. };
  931. template<>struct t_instruction<176>$x$()and_sukagcc(mem[dest],mem[a],mem[b]);
  932. };
  933. };
  934. template<>struct t_instruction<177>$x$()and_sukagcc(mem[dest],mem[a],raw[b]);
  935. };
  936. };
  937. template<>struct t_instruction<178>$x$()shr(reg[dest],reg[a],reg[b]);
  938. };
  939. };
  940. template<>struct t_instruction<179>$x$()shr(reg[dest],reg[a],mem[b]);
  941. };
  942. };
  943. template<>struct t_instruction<180>$x$()shr(reg[dest],reg[a],raw[b]);
  944. };
  945. };
  946. template<>struct t_instruction<181>$x$()shr(reg[dest],mem[a],reg[b]);
  947. };
  948. };
  949. template<>struct t_instruction<182>$x$()shr(reg[dest],mem[a],mem[b]);
  950. };
  951. };
  952. template<>struct t_instruction<183>$x$()shr(reg[dest],mem[a],raw[b]);
  953. };
  954. };
  955. template<>struct t_instruction<184>$x$()shr(mem[dest],reg[a],reg[b]);
  956. };
  957. };
  958. template<>struct t_instruction<185>$x$()shr(mem[dest],reg[a],mem[b]);
  959. };
  960. };
  961. template<>struct t_instruction<186>$x$()shr(mem[dest],reg[a],raw[b]);
  962. };
  963. };
  964. template<>struct t_instruction<187>$x$()shr(mem[dest],mem[a],reg[b]);
  965. };
  966. };
  967. template<>struct t_instruction<188>$x$()shr(mem[dest],mem[a],mem[b]);
  968. };
  969. };
  970. template<>struct t_instruction<189>$x$()shr(mem[dest],mem[a],raw[b]);
  971. };
  972. };
  973. template<>struct t_instruction<190>$x$()shl(reg[dest],reg[a],reg[b]);
  974. };
  975. };
  976. template<>struct t_instruction<191>$x$()shl(reg[dest],reg[a],mem[b]);
  977. };
  978. };
  979. template<>struct t_instruction<192>$x$()shl(reg[dest],reg[a],raw[b]);
  980. };
  981. };
  982. template<>struct t_instruction<193>$x$()shl(reg[dest],mem[a],reg[b]);
  983. };
  984. };
  985. template<>struct t_instruction<194>$x$()shl(reg[dest],mem[a],mem[b]);
  986. };
  987. };
  988. template<>struct t_instruction<195>$x$()shl(reg[dest],mem[a],raw[b]);
  989. };
  990. };
  991. template<>struct t_instruction<196>$x$()shl(mem[dest],reg[a],reg[b]);
  992. };
  993. };
  994. template<>struct t_instruction<197>$x$()shl(mem[dest],reg[a],mem[b]);
  995. };
  996. };
  997. template<>struct t_instruction<198>$x$()shl(mem[dest],reg[a],raw[b]);
  998. };
  999. };
  1000. template<>struct t_instruction<199>$x$()shl(mem[dest],mem[a],reg[b]);
  1001. };
  1002. };
  1003. template<>struct t_instruction<200>$x$()shl(mem[dest],mem[a],mem[b]);
  1004. };
  1005. };
  1006. template<>struct t_instruction<201>$x$()shl(mem[dest],mem[a],raw[b]);
  1007. };
  1008. };
  1009. template<>struct t_instruction<202>$x$()jmp(reg[dest]);
  1010. };
  1011. };
  1012. template<>struct t_instruction<203>$x$()jmp(mem[dest]);
  1013. };
  1014. };
  1015. template<>struct t_instruction<204>$x$()jmp(raw[dest]);
  1016. };
  1017. };
  1018. template<>struct t_instruction<205>$x$()call(reg[dest]);
  1019. };
  1020. };
  1021. template<>struct t_instruction<206>$x$()call(mem[dest]);
  1022. };
  1023. };
  1024. template<>struct t_instruction<207>$x$()call(raw[dest]);
  1025. };
  1026. };
  1027. template<>struct t_instruction<208>$x$()push(reg[dest]);
  1028. };
  1029. };
  1030. template<>struct t_instruction<209>$x$()push(mem[dest]);
  1031. };
  1032. };
  1033. template<>struct t_instruction<210>$x$()push(raw[dest]);
  1034. };
  1035. };
  1036. template<>struct t_instruction<211>$x$()pop(reg[dest]);
  1037. };
  1038. };
  1039. template<>struct t_instruction<212>$x$()pop(mem[dest]);
  1040. };
  1041. };
  1042. template<>struct t_instruction<213>$x$()inc(reg[dest]);
  1043. };
  1044. };
  1045. template<>struct t_instruction<214>$x$()inc(mem[dest]);
  1046. };
  1047. };
  1048. template<>struct t_instruction<215>$x$()dec(reg[dest]);
  1049. };
  1050. };
  1051. template<>struct t_instruction<216>$x$()dec(mem[dest]);
  1052. };
  1053. };
  1054. template<>struct t_instruction<217>$x$()ret();
  1055. };
  1056. };
  1057. template<>struct t_instruction<218>$x$()nop();
  1058. };
  1059. };
  1060. template<>struct t_instruction<219>$x$()label();
  1061. };
  1062. };
  1063. template<>struct t_instruction<220>$x$()mov(mem[reg[dest]],reg[src]);
  1064. };
  1065. };
  1066. template<>struct t_instruction<221>$x$()mov(mem[reg[dest]],mem[src]);
  1067. };
  1068. };
  1069. template<>struct t_instruction<222>$x$()mov(mem[reg[dest]],raw[src]);
  1070. };
  1071. };
  1072. template<>struct t_instruction<223>$x$()mov(reg[dest],mem[reg[src]]);
  1073. };
  1074. };
  1075. template<>struct t_instruction<224>$x$()mov(mem[dest],mem[reg[src]]);
  1076. };
  1077. };
  1078. static const int end_counter=225;
  1079. static const int size=end_counter-beg_counter-1;
  1080. template<int N>static i_instruction&get()
  1081. {
  1082. static t_instruction<N> tmp;
  1083. return tmp;
  1084. };
  1085. };
  1086.  
  1087. std::vector<i_instruction*>& t_machine::get_all_instructions()
  1088. {
  1089. static vector<i_instruction*> out;
  1090. if (!out.empty())return out;
  1091. #define GG t_instructions
  1092. {
  1093. qap_add_back(out)=&GG::get<226-GG::end_counter>();
  1094. };
  1095. {
  1096. qap_add_back(out)=&GG::get<227-GG::end_counter>();
  1097. };
  1098. {
  1099. qap_add_back(out)=&GG::get<228-GG::end_counter>();
  1100. };
  1101. {
  1102. qap_add_back(out)=&GG::get<229-GG::end_counter>();
  1103. };
  1104. {
  1105. qap_add_back(out)=&GG::get<230-GG::end_counter>();
  1106. };
  1107. {
  1108. qap_add_back(out)=&GG::get<231-GG::end_counter>();
  1109. };
  1110. {
  1111. qap_add_back(out)=&GG::get<232-GG::end_counter>();
  1112. };
  1113. {
  1114. qap_add_back(out)=&GG::get<233-GG::end_counter>();
  1115. };
  1116. {
  1117. qap_add_back(out)=&GG::get<234-GG::end_counter>();
  1118. };
  1119. {
  1120. qap_add_back(out)=&GG::get<235-GG::end_counter>();
  1121. };
  1122. {
  1123. qap_add_back(out)=&GG::get<236-GG::end_counter>();
  1124. };
  1125. {
  1126. qap_add_back(out)=&GG::get<237-GG::end_counter>();
  1127. };
  1128. {
  1129. qap_add_back(out)=&GG::get<238-GG::end_counter>();
  1130. };
  1131. {
  1132. qap_add_back(out)=&GG::get<239-GG::end_counter>();
  1133. };
  1134. {
  1135. qap_add_back(out)=&GG::get<240-GG::end_counter>();
  1136. };
  1137. {
  1138. qap_add_back(out)=&GG::get<241-GG::end_counter>();
  1139. };
  1140. {
  1141. qap_add_back(out)=&GG::get<242-GG::end_counter>();
  1142. };
  1143. {
  1144. qap_add_back(out)=&GG::get<243-GG::end_counter>();
  1145. };
  1146. {
  1147. qap_add_back(out)=&GG::get<244-GG::end_counter>();
  1148. };
  1149. {
  1150. qap_add_back(out)=&GG::get<245-GG::end_counter>();
  1151. };
  1152. {
  1153. qap_add_back(out)=&GG::get<246-GG::end_counter>();
  1154. };
  1155. {
  1156. qap_add_back(out)=&GG::get<247-GG::end_counter>();
  1157. };
  1158. {
  1159. qap_add_back(out)=&GG::get<248-GG::end_counter>();
  1160. };
  1161. {
  1162. qap_add_back(out)=&GG::get<249-GG::end_counter>();
  1163. };
  1164. {
  1165. qap_add_back(out)=&GG::get<250-GG::end_counter>();
  1166. };
  1167. {
  1168. qap_add_back(out)=&GG::get<251-GG::end_counter>();
  1169. };
  1170. {
  1171. qap_add_back(out)=&GG::get<252-GG::end_counter>();
  1172. };
  1173. {
  1174. qap_add_back(out)=&GG::get<253-GG::end_counter>();
  1175. };
  1176. {
  1177. qap_add_back(out)=&GG::get<254-GG::end_counter>();
  1178. };
  1179. {
  1180. qap_add_back(out)=&GG::get<255-GG::end_counter>();
  1181. };
  1182. {
  1183. qap_add_back(out)=&GG::get<256-GG::end_counter>();
  1184. };
  1185. {
  1186. qap_add_back(out)=&GG::get<257-GG::end_counter>();
  1187. };
  1188. {
  1189. qap_add_back(out)=&GG::get<258-GG::end_counter>();
  1190. };
  1191. {
  1192. qap_add_back(out)=&GG::get<259-GG::end_counter>();
  1193. };
  1194. {
  1195. qap_add_back(out)=&GG::get<260-GG::end_counter>();
  1196. };
  1197. {
  1198. qap_add_back(out)=&GG::get<261-GG::end_counter>();
  1199. };
  1200. {
  1201. qap_add_back(out)=&GG::get<262-GG::end_counter>();
  1202. };
  1203. {
  1204. qap_add_back(out)=&GG::get<263-GG::end_counter>();
  1205. };
  1206. {
  1207. qap_add_back(out)=&GG::get<264-GG::end_counter>();
  1208. };
  1209. {
  1210. qap_add_back(out)=&GG::get<265-GG::end_counter>();
  1211. };
  1212. {
  1213. qap_add_back(out)=&GG::get<266-GG::end_counter>();
  1214. };
  1215. {
  1216. qap_add_back(out)=&GG::get<267-GG::end_counter>();
  1217. };
  1218. {
  1219. qap_add_back(out)=&GG::get<268-GG::end_counter>();
  1220. };
  1221. {
  1222. qap_add_back(out)=&GG::get<269-GG::end_counter>();
  1223. };
  1224. {
  1225. qap_add_back(out)=&GG::get<270-GG::end_counter>();
  1226. };
  1227. {
  1228. qap_add_back(out)=&GG::get<271-GG::end_counter>();
  1229. };
  1230. {
  1231. qap_add_back(out)=&GG::get<272-GG::end_counter>();
  1232. };
  1233. {
  1234. qap_add_back(out)=&GG::get<273-GG::end_counter>();
  1235. };
  1236. {
  1237. qap_add_back(out)=&GG::get<274-GG::end_counter>();
  1238. };
  1239. {
  1240. qap_add_back(out)=&GG::get<275-GG::end_counter>();
  1241. };
  1242. {
  1243. qap_add_back(out)=&GG::get<276-GG::end_counter>();
  1244. };
  1245. {
  1246. qap_add_back(out)=&GG::get<277-GG::end_counter>();
  1247. };
  1248. {
  1249. qap_add_back(out)=&GG::get<278-GG::end_counter>();
  1250. };
  1251. {
  1252. qap_add_back(out)=&GG::get<279-GG::end_counter>();
  1253. };
  1254. {
  1255. qap_add_back(out)=&GG::get<280-GG::end_counter>();
  1256. };
  1257. {
  1258. qap_add_back(out)=&GG::get<281-GG::end_counter>();
  1259. };
  1260. {
  1261. qap_add_back(out)=&GG::get<282-GG::end_counter>();
  1262. };
  1263. {
  1264. qap_add_back(out)=&GG::get<283-GG::end_counter>();
  1265. };
  1266. {
  1267. qap_add_back(out)=&GG::get<284-GG::end_counter>();
  1268. };
  1269. {
  1270. qap_add_back(out)=&GG::get<285-GG::end_counter>();
  1271. };
  1272. {
  1273. qap_add_back(out)=&GG::get<286-GG::end_counter>();
  1274. };
  1275. {
  1276. qap_add_back(out)=&GG::get<287-GG::end_counter>();
  1277. };
  1278. {
  1279. qap_add_back(out)=&GG::get<288-GG::end_counter>();
  1280. };
  1281. {
  1282. qap_add_back(out)=&GG::get<289-GG::end_counter>();
  1283. };
  1284. {
  1285. qap_add_back(out)=&GG::get<290-GG::end_counter>();
  1286. };
  1287. {
  1288. qap_add_back(out)=&GG::get<291-GG::end_counter>();
  1289. };
  1290. {
  1291. qap_add_back(out)=&GG::get<292-GG::end_counter>();
  1292. };
  1293. {
  1294. qap_add_back(out)=&GG::get<293-GG::end_counter>();
  1295. };
  1296. {
  1297. qap_add_back(out)=&GG::get<294-GG::end_counter>();
  1298. };
  1299. {
  1300. qap_add_back(out)=&GG::get<295-GG::end_counter>();
  1301. };
  1302. {
  1303. qap_add_back(out)=&GG::get<296-GG::end_counter>();
  1304. };
  1305. {
  1306. qap_add_back(out)=&GG::get<297-GG::end_counter>();
  1307. };
  1308. {
  1309. qap_add_back(out)=&GG::get<298-GG::end_counter>();
  1310. };
  1311. {
  1312. qap_add_back(out)=&GG::get<299-GG::end_counter>();
  1313. };
  1314. {
  1315. qap_add_back(out)=&GG::get<300-GG::end_counter>();
  1316. };
  1317. {
  1318. qap_add_back(out)=&GG::get<301-GG::end_counter>();
  1319. };
  1320. {
  1321. qap_add_back(out)=&GG::get<302-GG::end_counter>();
  1322. };
  1323. {
  1324. qap_add_back(out)=&GG::get<303-GG::end_counter>();
  1325. };
  1326. {
  1327. qap_add_back(out)=&GG::get<304-GG::end_counter>();
  1328. };
  1329. {
  1330. qap_add_back(out)=&GG::get<305-GG::end_counter>();
  1331. };
  1332. {
  1333. qap_add_back(out)=&GG::get<306-GG::end_counter>();
  1334. };
  1335. {
  1336. qap_add_back(out)=&GG::get<307-GG::end_counter>();
  1337. };
  1338. {
  1339. qap_add_back(out)=&GG::get<308-GG::end_counter>();
  1340. };
  1341. {
  1342. qap_add_back(out)=&GG::get<309-GG::end_counter>();
  1343. };
  1344. {
  1345. qap_add_back(out)=&GG::get<310-GG::end_counter>();
  1346. };
  1347. {
  1348. qap_add_back(out)=&GG::get<311-GG::end_counter>();
  1349. };
  1350. {
  1351. qap_add_back(out)=&GG::get<312-GG::end_counter>();
  1352. };
  1353. {
  1354. qap_add_back(out)=&GG::get<313-GG::end_counter>();
  1355. };
  1356. {
  1357. qap_add_back(out)=&GG::get<314-GG::end_counter>();
  1358. };
  1359. {
  1360. qap_add_back(out)=&GG::get<315-GG::end_counter>();
  1361. };
  1362. {
  1363. qap_add_back(out)=&GG::get<316-GG::end_counter>();
  1364. };
  1365. {
  1366. qap_add_back(out)=&GG::get<317-GG::end_counter>();
  1367. };
  1368. {
  1369. qap_add_back(out)=&GG::get<318-GG::end_counter>();
  1370. };
  1371. {
  1372. qap_add_back(out)=&GG::get<319-GG::end_counter>();
  1373. };
  1374. {
  1375. qap_add_back(out)=&GG::get<320-GG::end_counter>();
  1376. };
  1377. {
  1378. qap_add_back(out)=&GG::get<321-GG::end_counter>();
  1379. };
  1380. {
  1381. qap_add_back(out)=&GG::get<322-GG::end_counter>();
  1382. };
  1383. {
  1384. qap_add_back(out)=&GG::get<323-GG::end_counter>();
  1385. };
  1386. {
  1387. qap_add_back(out)=&GG::get<324-GG::end_counter>();
  1388. };
  1389. {
  1390. qap_add_back(out)=&GG::get<325-GG::end_counter>();
  1391. };
  1392. {
  1393. qap_add_back(out)=&GG::get<326-GG::end_counter>();
  1394. };
  1395. {
  1396. qap_add_back(out)=&GG::get<327-GG::end_counter>();
  1397. };
  1398. {
  1399. qap_add_back(out)=&GG::get<328-GG::end_counter>();
  1400. };
  1401. {
  1402. qap_add_back(out)=&GG::get<329-GG::end_counter>();
  1403. };
  1404. {
  1405. qap_add_back(out)=&GG::get<330-GG::end_counter>();
  1406. };
  1407. {
  1408. qap_add_back(out)=&GG::get<331-GG::end_counter>();
  1409. };
  1410. {
  1411. qap_add_back(out)=&GG::get<332-GG::end_counter>();
  1412. };
  1413. {
  1414. qap_add_back(out)=&GG::get<333-GG::end_counter>();
  1415. };
  1416. {
  1417. qap_add_back(out)=&GG::get<334-GG::end_counter>();
  1418. };
  1419. {
  1420. qap_add_back(out)=&GG::get<335-GG::end_counter>();
  1421. };
  1422. {
  1423. qap_add_back(out)=&GG::get<336-GG::end_counter>();
  1424. };
  1425. {
  1426. qap_add_back(out)=&GG::get<337-GG::end_counter>();
  1427. };
  1428. {
  1429. qap_add_back(out)=&GG::get<338-GG::end_counter>();
  1430. };
  1431. {
  1432. qap_add_back(out)=&GG::get<339-GG::end_counter>();
  1433. };
  1434. {
  1435. qap_add_back(out)=&GG::get<340-GG::end_counter>();
  1436. };
  1437. {
  1438. qap_add_back(out)=&GG::get<341-GG::end_counter>();
  1439. };
  1440. {
  1441. qap_add_back(out)=&GG::get<342-GG::end_counter>();
  1442. };
  1443. {
  1444. qap_add_back(out)=&GG::get<343-GG::end_counter>();
  1445. };
  1446. {
  1447. qap_add_back(out)=&GG::get<344-GG::end_counter>();
  1448. };
  1449. {
  1450. qap_add_back(out)=&GG::get<345-GG::end_counter>();
  1451. };
  1452. {
  1453. qap_add_back(out)=&GG::get<346-GG::end_counter>();
  1454. };
  1455. {
  1456. qap_add_back(out)=&GG::get<347-GG::end_counter>();
  1457. };
  1458. {
  1459. qap_add_back(out)=&GG::get<348-GG::end_counter>();
  1460. };
  1461. {
  1462. qap_add_back(out)=&GG::get<349-GG::end_counter>();
  1463. };
  1464. {
  1465. qap_add_back(out)=&GG::get<350-GG::end_counter>();
  1466. };
  1467. {
  1468. qap_add_back(out)=&GG::get<351-GG::end_counter>();
  1469. };
  1470. {
  1471. qap_add_back(out)=&GG::get<352-GG::end_counter>();
  1472. };
  1473. {
  1474. qap_add_back(out)=&GG::get<353-GG::end_counter>();
  1475. };
  1476. {
  1477. qap_add_back(out)=&GG::get<354-GG::end_counter>();
  1478. };
  1479. {
  1480. qap_add_back(out)=&GG::get<355-GG::end_counter>();
  1481. };
  1482. {
  1483. qap_add_back(out)=&GG::get<356-GG::end_counter>();
  1484. };
  1485. {
  1486. qap_add_back(out)=&GG::get<357-GG::end_counter>();
  1487. };
  1488. {
  1489. qap_add_back(out)=&GG::get<358-GG::end_counter>();
  1490. };
  1491. {
  1492. qap_add_back(out)=&GG::get<359-GG::end_counter>();
  1493. };
  1494. {
  1495. qap_add_back(out)=&GG::get<360-GG::end_counter>();
  1496. };
  1497. {
  1498. qap_add_back(out)=&GG::get<361-GG::end_counter>();
  1499. };
  1500. {
  1501. qap_add_back(out)=&GG::get<362-GG::end_counter>();
  1502. };
  1503. {
  1504. qap_add_back(out)=&GG::get<363-GG::end_counter>();
  1505. };
  1506. {
  1507. qap_add_back(out)=&GG::get<364-GG::end_counter>();
  1508. };
  1509. {
  1510. qap_add_back(out)=&GG::get<365-GG::end_counter>();
  1511. };
  1512. {
  1513. qap_add_back(out)=&GG::get<366-GG::end_counter>();
  1514. };
  1515. {
  1516. qap_add_back(out)=&GG::get<367-GG::end_counter>();
  1517. };
  1518. {
  1519. qap_add_back(out)=&GG::get<368-GG::end_counter>();
  1520. };
  1521. {
  1522. qap_add_back(out)=&GG::get<369-GG::end_counter>();
  1523. };
  1524. {
  1525. qap_add_back(out)=&GG::get<370-GG::end_counter>();
  1526. };
  1527. {
  1528. qap_add_back(out)=&GG::get<371-GG::end_counter>();
  1529. };
  1530. {
  1531. qap_add_back(out)=&GG::get<372-GG::end_counter>();
  1532. };
  1533. {
  1534. qap_add_back(out)=&GG::get<373-GG::end_counter>();
  1535. };
  1536. {
  1537. qap_add_back(out)=&GG::get<374-GG::end_counter>();
  1538. };
  1539. {
  1540. qap_add_back(out)=&GG::get<375-GG::end_counter>();
  1541. };
  1542. {
  1543. qap_add_back(out)=&GG::get<376-GG::end_counter>();
  1544. };
  1545. {
  1546. qap_add_back(out)=&GG::get<377-GG::end_counter>();
  1547. };
  1548. {
  1549. qap_add_back(out)=&GG::get<378-GG::end_counter>();
  1550. };
  1551. {
  1552. qap_add_back(out)=&GG::get<379-GG::end_counter>();
  1553. };
  1554. {
  1555. qap_add_back(out)=&GG::get<380-GG::end_counter>();
  1556. };
  1557. {
  1558. qap_add_back(out)=&GG::get<381-GG::end_counter>();
  1559. };
  1560. {
  1561. qap_add_back(out)=&GG::get<382-GG::end_counter>();
  1562. };
  1563. {
  1564. qap_add_back(out)=&GG::get<383-GG::end_counter>();
  1565. };
  1566. {
  1567. qap_add_back(out)=&GG::get<384-GG::end_counter>();
  1568. };
  1569. {
  1570. qap_add_back(out)=&GG::get<385-GG::end_counter>();
  1571. };
  1572. {
  1573. qap_add_back(out)=&GG::get<386-GG::end_counter>();
  1574. };
  1575. {
  1576. qap_add_back(out)=&GG::get<387-GG::end_counter>();
  1577. };
  1578. {
  1579. qap_add_back(out)=&GG::get<388-GG::end_counter>();
  1580. };
  1581. {
  1582. qap_add_back(out)=&GG::get<389-GG::end_counter>();
  1583. };
  1584. {
  1585. qap_add_back(out)=&GG::get<390-GG::end_counter>();
  1586. };
  1587. {
  1588. qap_add_back(out)=&GG::get<391-GG::end_counter>();
  1589. };
  1590. {
  1591. qap_add_back(out)=&GG::get<392-GG::end_counter>();
  1592. };
  1593. {
  1594. qap_add_back(out)=&GG::get<393-GG::end_counter>();
  1595. };
  1596. {
  1597. qap_add_back(out)=&GG::get<394-GG::end_counter>();
  1598. };
  1599. {
  1600. qap_add_back(out)=&GG::get<395-GG::end_counter>();
  1601. };
  1602. {
  1603. qap_add_back(out)=&GG::get<396-GG::end_counter>();
  1604. };
  1605. {
  1606. qap_add_back(out)=&GG::get<397-GG::end_counter>();
  1607. };
  1608. {
  1609. qap_add_back(out)=&GG::get<398-GG::end_counter>();
  1610. };
  1611. {
  1612. qap_add_back(out)=&GG::get<399-GG::end_counter>();
  1613. };
  1614. {
  1615. qap_add_back(out)=&GG::get<400-GG::end_counter>();
  1616. };
  1617. {
  1618. qap_add_back(out)=&GG::get<401-GG::end_counter>();
  1619. };
  1620. {
  1621. qap_add_back(out)=&GG::get<402-GG::end_counter>();
  1622. };
  1623. {
  1624. qap_add_back(out)=&GG::get<403-GG::end_counter>();
  1625. };
  1626. {
  1627. qap_add_back(out)=&GG::get<404-GG::end_counter>();
  1628. };
  1629. {
  1630. qap_add_back(out)=&GG::get<405-GG::end_counter>();
  1631. };
  1632. {
  1633. qap_add_back(out)=&GG::get<406-GG::end_counter>();
  1634. };
  1635. {
  1636. qap_add_back(out)=&GG::get<407-GG::end_counter>();
  1637. };
  1638. {
  1639. qap_add_back(out)=&GG::get<408-GG::end_counter>();
  1640. };
  1641. {
  1642. qap_add_back(out)=&GG::get<409-GG::end_counter>();
  1643. };
  1644. {
  1645. qap_add_back(out)=&GG::get<410-GG::end_counter>();
  1646. };
  1647. {
  1648. qap_add_back(out)=&GG::get<411-GG::end_counter>();
  1649. };
  1650. {
  1651. qap_add_back(out)=&GG::get<412-GG::end_counter>();
  1652. };
  1653. {
  1654. qap_add_back(out)=&GG::get<413-GG::end_counter>();
  1655. };
  1656. {
  1657. qap_add_back(out)=&GG::get<414-GG::end_counter>();
  1658. };
  1659. {
  1660. qap_add_back(out)=&GG::get<415-GG::end_counter>();
  1661. };
  1662. {
  1663. qap_add_back(out)=&GG::get<416-GG::end_counter>();
  1664. };
  1665. {
  1666. qap_add_back(out)=&GG::get<417-GG::end_counter>();
  1667. };
  1668. {
  1669. qap_add_back(out)=&GG::get<418-GG::end_counter>();
  1670. };
  1671. {
  1672. qap_add_back(out)=&GG::get<419-GG::end_counter>();
  1673. };
  1674. {
  1675. qap_add_back(out)=&GG::get<420-GG::end_counter>();
  1676. };
  1677. {
  1678. qap_add_back(out)=&GG::get<421-GG::end_counter>();
  1679. };
  1680. {
  1681. qap_add_back(out)=&GG::get<422-GG::end_counter>();
  1682. };
  1683. {
  1684. qap_add_back(out)=&GG::get<423-GG::end_counter>();
  1685. };
  1686. {
  1687. qap_add_back(out)=&GG::get<424-GG::end_counter>();
  1688. };
  1689. {
  1690. qap_add_back(out)=&GG::get<425-GG::end_counter>();
  1691. };
  1692. {
  1693. qap_add_back(out)=&GG::get<426-GG::end_counter>();
  1694. };
  1695. {
  1696. qap_add_back(out)=&GG::get<427-GG::end_counter>();
  1697. };
  1698. {
  1699. qap_add_back(out)=&GG::get<428-GG::end_counter>();
  1700. };
  1701. {
  1702. qap_add_back(out)=&GG::get<429-GG::end_counter>();
  1703. };
  1704. {
  1705. qap_add_back(out)=&GG::get<430-GG::end_counter>();
  1706. };
  1707. {
  1708. qap_add_back(out)=&GG::get<431-GG::end_counter>();
  1709. };
  1710. {
  1711. qap_add_back(out)=&GG::get<432-GG::end_counter>();
  1712. };
  1713. {
  1714. qap_add_back(out)=&GG::get<433-GG::end_counter>();
  1715. };
  1716. {
  1717. qap_add_back(out)=&GG::get<434-GG::end_counter>();
  1718. };
  1719. {
  1720. qap_add_back(out)=&GG::get<435-GG::end_counter>();
  1721. };
  1722. {
  1723. qap_add_back(out)=&GG::get<436-GG::end_counter>();
  1724. };
  1725. {
  1726. qap_add_back(out)=&GG::get<437-GG::end_counter>();
  1727. };
  1728. {
  1729. qap_add_back(out)=&GG::get<438-GG::end_counter>();
  1730. };
  1731. {
  1732. qap_add_back(out)=&GG::get<439-GG::end_counter>();
  1733. };
  1734. {
  1735. qap_add_back(out)=&GG::get<440-GG::end_counter>();
  1736. };
  1737. {
  1738. qap_add_back(out)=&GG::get<441-GG::end_counter>();
  1739. };
  1740. {
  1741. qap_add_back(out)=&GG::get<442-GG::end_counter>();
  1742. };
  1743. {
  1744. qap_add_back(out)=&GG::get<443-GG::end_counter>();
  1745. };
  1746. {
  1747. qap_add_back(out)=&GG::get<444-GG::end_counter>();
  1748. };
  1749. {
  1750. qap_add_back(out)=&GG::get<445-GG::end_counter>();
  1751. };
  1752. {
  1753. qap_add_back(out)=&GG::get<446-GG::end_counter>();
  1754. };
  1755. {
  1756. qap_add_back(out)=&GG::get<447-GG::end_counter>();
  1757. };
  1758. {
  1759. qap_add_back(out)=&GG::get<448-GG::end_counter>();
  1760. };
  1761. {
  1762. qap_add_back(out)=&GG::get<449-GG::end_counter>();
  1763. };
  1764. return out;
  1765. }
  1766.  
  1767. int main()
  1768. {
  1769. t_machine m;
  1770. m.mem.resize(64*1024*1024);
  1771. m.reg.resize(1024);
  1772. m.def_app();
  1773. auto bef=getCPUTime();
  1774. m.sim_till_err();
  1775. static real t=1000.0*(getCPUTime()-bef);
  1776. static real cpu_speed_ghz=get_cpu_speed()/1e9;
  1777. static real cpu_speed=cpu_speed_ghz*1e6;
  1778. static real cpu_cycles_per_cmd=t*cpu_speed/real(m.reg[cmd_counter]);
  1779. printf("cpu_speed = %.2fGHz\n",cpu_speed_ghz);
  1780. printf("t = %.3fms\n",t);
  1781. printf("cpu_cycles_per_cmd = %.4f\n",cpu_cycles_per_cmd);
  1782. int gg=1;
  1783. return 0;
  1784. }
Success #stdin #stdout 4.45s 3472KB
stdin
Standard input is empty
stdout
cpu_speed = 2.21GHz
t = 2979.886ms
cpu_cycles_per_cmd = 49.1240