fisk 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1209) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +56 -1
  3. data/bin/build-machine.rb +2 -2
  4. data/fisk.gemspec +5 -1
  5. data/lib/fisk.rb +289 -71
  6. data/lib/fisk/basic_block.rb +162 -0
  7. data/lib/fisk/errors.rb +19 -0
  8. data/lib/fisk/instructions/adc.rb +125 -125
  9. data/lib/fisk/instructions/adcx.rb +18 -18
  10. data/lib/fisk/instructions/add.rb +125 -125
  11. data/lib/fisk/instructions/addpd.rb +9 -9
  12. data/lib/fisk/instructions/addps.rb +9 -9
  13. data/lib/fisk/instructions/addsd.rb +9 -9
  14. data/lib/fisk/instructions/addss.rb +9 -9
  15. data/lib/fisk/instructions/addsubpd.rb +9 -9
  16. data/lib/fisk/instructions/addsubps.rb +9 -9
  17. data/lib/fisk/instructions/adox.rb +18 -18
  18. data/lib/fisk/instructions/aesdec.rb +9 -9
  19. data/lib/fisk/instructions/aesdeclast.rb +9 -9
  20. data/lib/fisk/instructions/aesenc.rb +9 -9
  21. data/lib/fisk/instructions/aesenclast.rb +9 -9
  22. data/lib/fisk/instructions/aesimc.rb +9 -9
  23. data/lib/fisk/instructions/aeskeygenassist.rb +11 -11
  24. data/lib/fisk/instructions/and.rb +125 -125
  25. data/lib/fisk/instructions/andn.rb +8 -8
  26. data/lib/fisk/instructions/andnpd.rb +9 -9
  27. data/lib/fisk/instructions/andnps.rb +9 -9
  28. data/lib/fisk/instructions/andpd.rb +9 -9
  29. data/lib/fisk/instructions/andps.rb +9 -9
  30. data/lib/fisk/instructions/bextr.rb +20 -20
  31. data/lib/fisk/instructions/blcfill.rb +4 -4
  32. data/lib/fisk/instructions/blci.rb +4 -4
  33. data/lib/fisk/instructions/blcic.rb +4 -4
  34. data/lib/fisk/instructions/blcmsk.rb +4 -4
  35. data/lib/fisk/instructions/blcs.rb +4 -4
  36. data/lib/fisk/instructions/blendpd.rb +11 -11
  37. data/lib/fisk/instructions/blendps.rb +11 -11
  38. data/lib/fisk/instructions/blendvpd.rb +9 -9
  39. data/lib/fisk/instructions/blendvps.rb +9 -9
  40. data/lib/fisk/instructions/blsfill.rb +4 -4
  41. data/lib/fisk/instructions/blsi.rb +4 -4
  42. data/lib/fisk/instructions/blsic.rb +4 -4
  43. data/lib/fisk/instructions/blsmsk.rb +4 -4
  44. data/lib/fisk/instructions/blsr.rb +4 -4
  45. data/lib/fisk/instructions/bsf.rb +27 -27
  46. data/lib/fisk/instructions/bsr.rb +27 -27
  47. data/lib/fisk/instructions/bswap.rb +4 -4
  48. data/lib/fisk/instructions/bt.rb +48 -48
  49. data/lib/fisk/instructions/btc.rb +48 -48
  50. data/lib/fisk/instructions/btr.rb +48 -48
  51. data/lib/fisk/instructions/bts.rb +48 -48
  52. data/lib/fisk/instructions/bzhi.rb +8 -8
  53. data/lib/fisk/instructions/call.rb +6 -6
  54. data/lib/fisk/instructions/clflush.rb +3 -3
  55. data/lib/fisk/instructions/clflushopt.rb +3 -3
  56. data/lib/fisk/instructions/clwb.rb +3 -3
  57. data/lib/fisk/instructions/cmova.rb +27 -27
  58. data/lib/fisk/instructions/cmovae.rb +27 -27
  59. data/lib/fisk/instructions/cmovb.rb +27 -27
  60. data/lib/fisk/instructions/cmovbe.rb +27 -27
  61. data/lib/fisk/instructions/cmovc.rb +27 -27
  62. data/lib/fisk/instructions/cmove.rb +27 -27
  63. data/lib/fisk/instructions/cmovg.rb +27 -27
  64. data/lib/fisk/instructions/cmovge.rb +27 -27
  65. data/lib/fisk/instructions/cmovl.rb +27 -27
  66. data/lib/fisk/instructions/cmovle.rb +27 -27
  67. data/lib/fisk/instructions/cmovna.rb +27 -27
  68. data/lib/fisk/instructions/cmovnae.rb +27 -27
  69. data/lib/fisk/instructions/cmovnb.rb +27 -27
  70. data/lib/fisk/instructions/cmovnbe.rb +27 -27
  71. data/lib/fisk/instructions/cmovnc.rb +27 -27
  72. data/lib/fisk/instructions/cmovne.rb +27 -27
  73. data/lib/fisk/instructions/cmovng.rb +27 -27
  74. data/lib/fisk/instructions/cmovnge.rb +27 -27
  75. data/lib/fisk/instructions/cmovnl.rb +27 -27
  76. data/lib/fisk/instructions/cmovnle.rb +27 -27
  77. data/lib/fisk/instructions/cmovno.rb +27 -27
  78. data/lib/fisk/instructions/cmovnp.rb +27 -27
  79. data/lib/fisk/instructions/cmovns.rb +27 -27
  80. data/lib/fisk/instructions/cmovnz.rb +27 -27
  81. data/lib/fisk/instructions/cmovo.rb +27 -27
  82. data/lib/fisk/instructions/cmovp.rb +27 -27
  83. data/lib/fisk/instructions/cmovpe.rb +27 -27
  84. data/lib/fisk/instructions/cmovpo.rb +27 -27
  85. data/lib/fisk/instructions/cmovs.rb +27 -27
  86. data/lib/fisk/instructions/cmovz.rb +27 -27
  87. data/lib/fisk/instructions/cmp.rb +125 -125
  88. data/lib/fisk/instructions/cmppd.rb +11 -11
  89. data/lib/fisk/instructions/cmpps.rb +11 -11
  90. data/lib/fisk/instructions/cmpsd.rb +11 -11
  91. data/lib/fisk/instructions/cmpss.rb +11 -11
  92. data/lib/fisk/instructions/cmpxchg.rb +36 -36
  93. data/lib/fisk/instructions/cmpxchg16b.rb +3 -3
  94. data/lib/fisk/instructions/cmpxchg8b.rb +3 -3
  95. data/lib/fisk/instructions/comisd.rb +9 -9
  96. data/lib/fisk/instructions/comiss.rb +9 -9
  97. data/lib/fisk/instructions/crc32.rb +45 -45
  98. data/lib/fisk/instructions/cvtdq2pd.rb +9 -9
  99. data/lib/fisk/instructions/cvtdq2ps.rb +9 -9
  100. data/lib/fisk/instructions/cvtpd2dq.rb +9 -9
  101. data/lib/fisk/instructions/cvtpd2pi.rb +9 -9
  102. data/lib/fisk/instructions/cvtpd2ps.rb +9 -9
  103. data/lib/fisk/instructions/cvtpi2pd.rb +9 -9
  104. data/lib/fisk/instructions/cvtpi2ps.rb +9 -9
  105. data/lib/fisk/instructions/cvtps2dq.rb +9 -9
  106. data/lib/fisk/instructions/cvtps2pd.rb +9 -9
  107. data/lib/fisk/instructions/cvtps2pi.rb +9 -9
  108. data/lib/fisk/instructions/cvtsd2si.rb +18 -18
  109. data/lib/fisk/instructions/cvtsd2ss.rb +9 -9
  110. data/lib/fisk/instructions/cvtsi2sd.rb +18 -18
  111. data/lib/fisk/instructions/cvtsi2ss.rb +18 -18
  112. data/lib/fisk/instructions/cvtss2sd.rb +9 -9
  113. data/lib/fisk/instructions/cvtss2si.rb +18 -18
  114. data/lib/fisk/instructions/cvttpd2dq.rb +9 -9
  115. data/lib/fisk/instructions/cvttpd2pi.rb +9 -9
  116. data/lib/fisk/instructions/cvttps2dq.rb +9 -9
  117. data/lib/fisk/instructions/cvttps2pi.rb +9 -9
  118. data/lib/fisk/instructions/cvttsd2si.rb +18 -18
  119. data/lib/fisk/instructions/cvttss2si.rb +18 -18
  120. data/lib/fisk/instructions/dec.rb +20 -20
  121. data/lib/fisk/instructions/div.rb +20 -20
  122. data/lib/fisk/instructions/divpd.rb +9 -9
  123. data/lib/fisk/instructions/divps.rb +9 -9
  124. data/lib/fisk/instructions/divsd.rb +9 -9
  125. data/lib/fisk/instructions/divss.rb +9 -9
  126. data/lib/fisk/instructions/dppd.rb +11 -11
  127. data/lib/fisk/instructions/dpps.rb +11 -11
  128. data/lib/fisk/instructions/extractps.rb +11 -11
  129. data/lib/fisk/instructions/extrq.rb +8 -8
  130. data/lib/fisk/instructions/haddpd.rb +9 -9
  131. data/lib/fisk/instructions/haddps.rb +9 -9
  132. data/lib/fisk/instructions/hsubpd.rb +9 -9
  133. data/lib/fisk/instructions/hsubps.rb +9 -9
  134. data/lib/fisk/instructions/idiv.rb +20 -20
  135. data/lib/fisk/instructions/imul.rb +113 -113
  136. data/lib/fisk/instructions/inc.rb +20 -20
  137. data/lib/fisk/instructions/insertps.rb +11 -11
  138. data/lib/fisk/instructions/insertq.rb +10 -10
  139. data/lib/fisk/instructions/int.rb +1 -1
  140. data/lib/fisk/instructions/ja.rb +2 -2
  141. data/lib/fisk/instructions/jae.rb +2 -2
  142. data/lib/fisk/instructions/jb.rb +2 -2
  143. data/lib/fisk/instructions/jbe.rb +2 -2
  144. data/lib/fisk/instructions/jc.rb +2 -2
  145. data/lib/fisk/instructions/je.rb +2 -2
  146. data/lib/fisk/instructions/jecxz.rb +1 -1
  147. data/lib/fisk/instructions/jg.rb +2 -2
  148. data/lib/fisk/instructions/jge.rb +2 -2
  149. data/lib/fisk/instructions/jl.rb +2 -2
  150. data/lib/fisk/instructions/jle.rb +2 -2
  151. data/lib/fisk/instructions/jmp.rb +7 -7
  152. data/lib/fisk/instructions/jna.rb +2 -2
  153. data/lib/fisk/instructions/jnae.rb +2 -2
  154. data/lib/fisk/instructions/jnb.rb +2 -2
  155. data/lib/fisk/instructions/jnbe.rb +2 -2
  156. data/lib/fisk/instructions/jnc.rb +2 -2
  157. data/lib/fisk/instructions/jne.rb +2 -2
  158. data/lib/fisk/instructions/jng.rb +2 -2
  159. data/lib/fisk/instructions/jnge.rb +2 -2
  160. data/lib/fisk/instructions/jnl.rb +2 -2
  161. data/lib/fisk/instructions/jnle.rb +2 -2
  162. data/lib/fisk/instructions/jno.rb +2 -2
  163. data/lib/fisk/instructions/jnp.rb +2 -2
  164. data/lib/fisk/instructions/jns.rb +2 -2
  165. data/lib/fisk/instructions/jnz.rb +2 -2
  166. data/lib/fisk/instructions/jo.rb +2 -2
  167. data/lib/fisk/instructions/jp.rb +2 -2
  168. data/lib/fisk/instructions/jpe.rb +2 -2
  169. data/lib/fisk/instructions/jpo.rb +2 -2
  170. data/lib/fisk/instructions/jrcxz.rb +1 -1
  171. data/lib/fisk/instructions/js.rb +2 -2
  172. data/lib/fisk/instructions/jz.rb +2 -2
  173. data/lib/fisk/instructions/kaddb.rb +2 -2
  174. data/lib/fisk/instructions/kaddd.rb +2 -2
  175. data/lib/fisk/instructions/kaddq.rb +2 -2
  176. data/lib/fisk/instructions/kaddw.rb +2 -2
  177. data/lib/fisk/instructions/kandb.rb +2 -2
  178. data/lib/fisk/instructions/kandd.rb +2 -2
  179. data/lib/fisk/instructions/kandnb.rb +2 -2
  180. data/lib/fisk/instructions/kandnd.rb +2 -2
  181. data/lib/fisk/instructions/kandnq.rb +2 -2
  182. data/lib/fisk/instructions/kandnw.rb +2 -2
  183. data/lib/fisk/instructions/kandq.rb +2 -2
  184. data/lib/fisk/instructions/kandw.rb +2 -2
  185. data/lib/fisk/instructions/kmovb.rb +10 -10
  186. data/lib/fisk/instructions/kmovd.rb +10 -10
  187. data/lib/fisk/instructions/kmovq.rb +10 -10
  188. data/lib/fisk/instructions/kmovw.rb +10 -10
  189. data/lib/fisk/instructions/knotb.rb +2 -2
  190. data/lib/fisk/instructions/knotd.rb +2 -2
  191. data/lib/fisk/instructions/knotq.rb +2 -2
  192. data/lib/fisk/instructions/knotw.rb +2 -2
  193. data/lib/fisk/instructions/korb.rb +2 -2
  194. data/lib/fisk/instructions/kord.rb +2 -2
  195. data/lib/fisk/instructions/korq.rb +2 -2
  196. data/lib/fisk/instructions/kortestb.rb +2 -2
  197. data/lib/fisk/instructions/kortestd.rb +2 -2
  198. data/lib/fisk/instructions/kortestq.rb +2 -2
  199. data/lib/fisk/instructions/kortestw.rb +2 -2
  200. data/lib/fisk/instructions/korw.rb +2 -2
  201. data/lib/fisk/instructions/kshiftlb.rb +3 -3
  202. data/lib/fisk/instructions/kshiftld.rb +3 -3
  203. data/lib/fisk/instructions/kshiftlq.rb +3 -3
  204. data/lib/fisk/instructions/kshiftlw.rb +3 -3
  205. data/lib/fisk/instructions/kshiftrb.rb +3 -3
  206. data/lib/fisk/instructions/kshiftrd.rb +3 -3
  207. data/lib/fisk/instructions/kshiftrq.rb +3 -3
  208. data/lib/fisk/instructions/kshiftrw.rb +3 -3
  209. data/lib/fisk/instructions/ktestb.rb +2 -2
  210. data/lib/fisk/instructions/ktestd.rb +2 -2
  211. data/lib/fisk/instructions/ktestq.rb +2 -2
  212. data/lib/fisk/instructions/ktestw.rb +2 -2
  213. data/lib/fisk/instructions/kunpckbw.rb +2 -2
  214. data/lib/fisk/instructions/kunpckdq.rb +2 -2
  215. data/lib/fisk/instructions/kunpckwd.rb +2 -2
  216. data/lib/fisk/instructions/kxnorb.rb +2 -2
  217. data/lib/fisk/instructions/kxnord.rb +2 -2
  218. data/lib/fisk/instructions/kxnorq.rb +2 -2
  219. data/lib/fisk/instructions/kxnorw.rb +2 -2
  220. data/lib/fisk/instructions/kxorb.rb +2 -2
  221. data/lib/fisk/instructions/kxord.rb +2 -2
  222. data/lib/fisk/instructions/kxorq.rb +2 -2
  223. data/lib/fisk/instructions/kxorw.rb +2 -2
  224. data/lib/fisk/instructions/lddqu.rb +5 -5
  225. data/lib/fisk/instructions/ldmxcsr.rb +3 -3
  226. data/lib/fisk/instructions/lea.rb +15 -15
  227. data/lib/fisk/instructions/lzcnt.rb +27 -27
  228. data/lib/fisk/instructions/maskmovdqu.rb +4 -4
  229. data/lib/fisk/instructions/maskmovq.rb +4 -4
  230. data/lib/fisk/instructions/maxpd.rb +9 -9
  231. data/lib/fisk/instructions/maxps.rb +9 -9
  232. data/lib/fisk/instructions/maxsd.rb +9 -9
  233. data/lib/fisk/instructions/maxss.rb +9 -9
  234. data/lib/fisk/instructions/minpd.rb +9 -9
  235. data/lib/fisk/instructions/minps.rb +9 -9
  236. data/lib/fisk/instructions/minsd.rb +9 -9
  237. data/lib/fisk/instructions/minss.rb +9 -9
  238. data/lib/fisk/instructions/mov.rb +116 -116
  239. data/lib/fisk/instructions/movapd.rb +18 -18
  240. data/lib/fisk/instructions/movaps.rb +18 -18
  241. data/lib/fisk/instructions/movbe.rb +30 -30
  242. data/lib/fisk/instructions/movd.rb +36 -36
  243. data/lib/fisk/instructions/movddup.rb +9 -9
  244. data/lib/fisk/instructions/movdq2q.rb +4 -4
  245. data/lib/fisk/instructions/movdqa.rb +18 -18
  246. data/lib/fisk/instructions/movdqu.rb +18 -18
  247. data/lib/fisk/instructions/movhlps.rb +4 -4
  248. data/lib/fisk/instructions/movhpd.rb +10 -10
  249. data/lib/fisk/instructions/movhps.rb +10 -10
  250. data/lib/fisk/instructions/movlhps.rb +4 -4
  251. data/lib/fisk/instructions/movlpd.rb +10 -10
  252. data/lib/fisk/instructions/movlps.rb +10 -10
  253. data/lib/fisk/instructions/movmskpd.rb +4 -4
  254. data/lib/fisk/instructions/movmskps.rb +4 -4
  255. data/lib/fisk/instructions/movntdq.rb +5 -5
  256. data/lib/fisk/instructions/movntdqa.rb +5 -5
  257. data/lib/fisk/instructions/movnti.rb +10 -10
  258. data/lib/fisk/instructions/movntpd.rb +5 -5
  259. data/lib/fisk/instructions/movntps.rb +5 -5
  260. data/lib/fisk/instructions/movntq.rb +5 -5
  261. data/lib/fisk/instructions/movntsd.rb +5 -5
  262. data/lib/fisk/instructions/movntss.rb +5 -5
  263. data/lib/fisk/instructions/movq.rb +72 -72
  264. data/lib/fisk/instructions/movq2dq.rb +4 -4
  265. data/lib/fisk/instructions/movsd.rb +18 -18
  266. data/lib/fisk/instructions/movshdup.rb +9 -9
  267. data/lib/fisk/instructions/movsldup.rb +9 -9
  268. data/lib/fisk/instructions/movss.rb +18 -18
  269. data/lib/fisk/instructions/movsx.rb +45 -45
  270. data/lib/fisk/instructions/movsxd.rb +9 -9
  271. data/lib/fisk/instructions/movupd.rb +18 -18
  272. data/lib/fisk/instructions/movups.rb +18 -18
  273. data/lib/fisk/instructions/movzx.rb +45 -45
  274. data/lib/fisk/instructions/mpsadbw.rb +11 -11
  275. data/lib/fisk/instructions/mul.rb +20 -20
  276. data/lib/fisk/instructions/mulpd.rb +9 -9
  277. data/lib/fisk/instructions/mulps.rb +9 -9
  278. data/lib/fisk/instructions/mulsd.rb +9 -9
  279. data/lib/fisk/instructions/mulss.rb +9 -9
  280. data/lib/fisk/instructions/mulx.rb +8 -8
  281. data/lib/fisk/instructions/neg.rb +20 -20
  282. data/lib/fisk/instructions/not.rb +20 -20
  283. data/lib/fisk/instructions/or.rb +125 -125
  284. data/lib/fisk/instructions/orpd.rb +9 -9
  285. data/lib/fisk/instructions/orps.rb +9 -9
  286. data/lib/fisk/instructions/pabsb.rb +18 -18
  287. data/lib/fisk/instructions/pabsd.rb +18 -18
  288. data/lib/fisk/instructions/pabsw.rb +18 -18
  289. data/lib/fisk/instructions/packssdw.rb +18 -18
  290. data/lib/fisk/instructions/packsswb.rb +18 -18
  291. data/lib/fisk/instructions/packusdw.rb +9 -9
  292. data/lib/fisk/instructions/packuswb.rb +18 -18
  293. data/lib/fisk/instructions/paddb.rb +18 -18
  294. data/lib/fisk/instructions/paddd.rb +18 -18
  295. data/lib/fisk/instructions/paddq.rb +18 -18
  296. data/lib/fisk/instructions/paddsb.rb +18 -18
  297. data/lib/fisk/instructions/paddsw.rb +18 -18
  298. data/lib/fisk/instructions/paddusb.rb +18 -18
  299. data/lib/fisk/instructions/paddusw.rb +18 -18
  300. data/lib/fisk/instructions/paddw.rb +18 -18
  301. data/lib/fisk/instructions/palignr.rb +22 -22
  302. data/lib/fisk/instructions/pand.rb +18 -18
  303. data/lib/fisk/instructions/pandn.rb +18 -18
  304. data/lib/fisk/instructions/pavgb.rb +18 -18
  305. data/lib/fisk/instructions/pavgusb.rb +9 -9
  306. data/lib/fisk/instructions/pavgw.rb +18 -18
  307. data/lib/fisk/instructions/pblendvb.rb +9 -9
  308. data/lib/fisk/instructions/pblendw.rb +11 -11
  309. data/lib/fisk/instructions/pclmulqdq.rb +11 -11
  310. data/lib/fisk/instructions/pcmpeqb.rb +18 -18
  311. data/lib/fisk/instructions/pcmpeqd.rb +18 -18
  312. data/lib/fisk/instructions/pcmpeqq.rb +9 -9
  313. data/lib/fisk/instructions/pcmpeqw.rb +18 -18
  314. data/lib/fisk/instructions/pcmpestri.rb +11 -11
  315. data/lib/fisk/instructions/pcmpestrm.rb +11 -11
  316. data/lib/fisk/instructions/pcmpgtb.rb +18 -18
  317. data/lib/fisk/instructions/pcmpgtd.rb +18 -18
  318. data/lib/fisk/instructions/pcmpgtq.rb +9 -9
  319. data/lib/fisk/instructions/pcmpgtw.rb +18 -18
  320. data/lib/fisk/instructions/pcmpistri.rb +11 -11
  321. data/lib/fisk/instructions/pcmpistrm.rb +11 -11
  322. data/lib/fisk/instructions/pdep.rb +8 -8
  323. data/lib/fisk/instructions/pext.rb +8 -8
  324. data/lib/fisk/instructions/pextrb.rb +11 -11
  325. data/lib/fisk/instructions/pextrd.rb +11 -11
  326. data/lib/fisk/instructions/pextrq.rb +11 -11
  327. data/lib/fisk/instructions/pextrw.rb +21 -21
  328. data/lib/fisk/instructions/pf2id.rb +9 -9
  329. data/lib/fisk/instructions/pf2iw.rb +9 -9
  330. data/lib/fisk/instructions/pfacc.rb +9 -9
  331. data/lib/fisk/instructions/pfadd.rb +9 -9
  332. data/lib/fisk/instructions/pfcmpeq.rb +9 -9
  333. data/lib/fisk/instructions/pfcmpge.rb +9 -9
  334. data/lib/fisk/instructions/pfcmpgt.rb +9 -9
  335. data/lib/fisk/instructions/pfmax.rb +9 -9
  336. data/lib/fisk/instructions/pfmin.rb +9 -9
  337. data/lib/fisk/instructions/pfmul.rb +9 -9
  338. data/lib/fisk/instructions/pfnacc.rb +9 -9
  339. data/lib/fisk/instructions/pfpnacc.rb +9 -9
  340. data/lib/fisk/instructions/pfrcp.rb +9 -9
  341. data/lib/fisk/instructions/pfrcpit1.rb +9 -9
  342. data/lib/fisk/instructions/pfrcpit2.rb +9 -9
  343. data/lib/fisk/instructions/pfrsqit1.rb +9 -9
  344. data/lib/fisk/instructions/pfrsqrt.rb +9 -9
  345. data/lib/fisk/instructions/pfsub.rb +9 -9
  346. data/lib/fisk/instructions/pfsubr.rb +9 -9
  347. data/lib/fisk/instructions/phaddd.rb +18 -18
  348. data/lib/fisk/instructions/phaddsw.rb +18 -18
  349. data/lib/fisk/instructions/phaddw.rb +18 -18
  350. data/lib/fisk/instructions/phminposuw.rb +9 -9
  351. data/lib/fisk/instructions/phsubd.rb +18 -18
  352. data/lib/fisk/instructions/phsubsw.rb +18 -18
  353. data/lib/fisk/instructions/phsubw.rb +18 -18
  354. data/lib/fisk/instructions/pi2fd.rb +9 -9
  355. data/lib/fisk/instructions/pi2fw.rb +9 -9
  356. data/lib/fisk/instructions/pinsrb.rb +11 -11
  357. data/lib/fisk/instructions/pinsrd.rb +11 -11
  358. data/lib/fisk/instructions/pinsrq.rb +11 -11
  359. data/lib/fisk/instructions/pinsrw.rb +22 -22
  360. data/lib/fisk/instructions/pmaddubsw.rb +18 -18
  361. data/lib/fisk/instructions/pmaddwd.rb +18 -18
  362. data/lib/fisk/instructions/pmaxsb.rb +9 -9
  363. data/lib/fisk/instructions/pmaxsd.rb +9 -9
  364. data/lib/fisk/instructions/pmaxsw.rb +18 -18
  365. data/lib/fisk/instructions/pmaxub.rb +18 -18
  366. data/lib/fisk/instructions/pmaxud.rb +9 -9
  367. data/lib/fisk/instructions/pmaxuw.rb +9 -9
  368. data/lib/fisk/instructions/pminsb.rb +9 -9
  369. data/lib/fisk/instructions/pminsd.rb +9 -9
  370. data/lib/fisk/instructions/pminsw.rb +18 -18
  371. data/lib/fisk/instructions/pminub.rb +18 -18
  372. data/lib/fisk/instructions/pminud.rb +9 -9
  373. data/lib/fisk/instructions/pminuw.rb +9 -9
  374. data/lib/fisk/instructions/pmovmskb.rb +8 -8
  375. data/lib/fisk/instructions/pmovsxbd.rb +9 -9
  376. data/lib/fisk/instructions/pmovsxbq.rb +9 -9
  377. data/lib/fisk/instructions/pmovsxbw.rb +9 -9
  378. data/lib/fisk/instructions/pmovsxdq.rb +9 -9
  379. data/lib/fisk/instructions/pmovsxwd.rb +9 -9
  380. data/lib/fisk/instructions/pmovsxwq.rb +9 -9
  381. data/lib/fisk/instructions/pmovzxbd.rb +9 -9
  382. data/lib/fisk/instructions/pmovzxbq.rb +9 -9
  383. data/lib/fisk/instructions/pmovzxbw.rb +9 -9
  384. data/lib/fisk/instructions/pmovzxdq.rb +9 -9
  385. data/lib/fisk/instructions/pmovzxwd.rb +9 -9
  386. data/lib/fisk/instructions/pmovzxwq.rb +9 -9
  387. data/lib/fisk/instructions/pmuldq.rb +9 -9
  388. data/lib/fisk/instructions/pmulhrsw.rb +18 -18
  389. data/lib/fisk/instructions/pmulhrw.rb +9 -9
  390. data/lib/fisk/instructions/pmulhuw.rb +18 -18
  391. data/lib/fisk/instructions/pmulhw.rb +18 -18
  392. data/lib/fisk/instructions/pmulld.rb +9 -9
  393. data/lib/fisk/instructions/pmullw.rb +18 -18
  394. data/lib/fisk/instructions/pmuludq.rb +18 -18
  395. data/lib/fisk/instructions/pop.rb +14 -14
  396. data/lib/fisk/instructions/popcnt.rb +27 -27
  397. data/lib/fisk/instructions/por.rb +18 -18
  398. data/lib/fisk/instructions/prefetch.rb +3 -3
  399. data/lib/fisk/instructions/prefetchnta.rb +3 -3
  400. data/lib/fisk/instructions/prefetcht0.rb +3 -3
  401. data/lib/fisk/instructions/prefetcht1.rb +3 -3
  402. data/lib/fisk/instructions/prefetcht2.rb +3 -3
  403. data/lib/fisk/instructions/prefetchw.rb +3 -3
  404. data/lib/fisk/instructions/prefetchwt1.rb +3 -3
  405. data/lib/fisk/instructions/psadbw.rb +18 -18
  406. data/lib/fisk/instructions/pshufb.rb +18 -18
  407. data/lib/fisk/instructions/pshufd.rb +11 -11
  408. data/lib/fisk/instructions/pshufhw.rb +11 -11
  409. data/lib/fisk/instructions/pshuflw.rb +11 -11
  410. data/lib/fisk/instructions/pshufw.rb +11 -11
  411. data/lib/fisk/instructions/psignb.rb +18 -18
  412. data/lib/fisk/instructions/psignd.rb +18 -18
  413. data/lib/fisk/instructions/psignw.rb +18 -18
  414. data/lib/fisk/instructions/pslld.rb +24 -24
  415. data/lib/fisk/instructions/pslldq.rb +3 -3
  416. data/lib/fisk/instructions/psllq.rb +24 -24
  417. data/lib/fisk/instructions/psllw.rb +24 -24
  418. data/lib/fisk/instructions/psrad.rb +24 -24
  419. data/lib/fisk/instructions/psraw.rb +24 -24
  420. data/lib/fisk/instructions/psrld.rb +24 -24
  421. data/lib/fisk/instructions/psrldq.rb +3 -3
  422. data/lib/fisk/instructions/psrlq.rb +24 -24
  423. data/lib/fisk/instructions/psrlw.rb +24 -24
  424. data/lib/fisk/instructions/psubb.rb +18 -18
  425. data/lib/fisk/instructions/psubd.rb +18 -18
  426. data/lib/fisk/instructions/psubq.rb +18 -18
  427. data/lib/fisk/instructions/psubsb.rb +18 -18
  428. data/lib/fisk/instructions/psubsw.rb +18 -18
  429. data/lib/fisk/instructions/psubusb.rb +18 -18
  430. data/lib/fisk/instructions/psubusw.rb +18 -18
  431. data/lib/fisk/instructions/psubw.rb +18 -18
  432. data/lib/fisk/instructions/pswapd.rb +9 -9
  433. data/lib/fisk/instructions/ptest.rb +9 -9
  434. data/lib/fisk/instructions/punpckhbw.rb +18 -18
  435. data/lib/fisk/instructions/punpckhdq.rb +18 -18
  436. data/lib/fisk/instructions/punpckhqdq.rb +9 -9
  437. data/lib/fisk/instructions/punpckhwd.rb +18 -18
  438. data/lib/fisk/instructions/punpcklbw.rb +18 -18
  439. data/lib/fisk/instructions/punpckldq.rb +18 -18
  440. data/lib/fisk/instructions/punpcklqdq.rb +9 -9
  441. data/lib/fisk/instructions/punpcklwd.rb +18 -18
  442. data/lib/fisk/instructions/push.rb +16 -16
  443. data/lib/fisk/instructions/pxor.rb +18 -18
  444. data/lib/fisk/instructions/rcl.rb +68 -68
  445. data/lib/fisk/instructions/rcpps.rb +9 -9
  446. data/lib/fisk/instructions/rcpss.rb +9 -9
  447. data/lib/fisk/instructions/rcr.rb +68 -68
  448. data/lib/fisk/instructions/rdrand.rb +6 -6
  449. data/lib/fisk/instructions/rdseed.rb +6 -6
  450. data/lib/fisk/instructions/ret.rb +1 -1
  451. data/lib/fisk/instructions/rol.rb +68 -68
  452. data/lib/fisk/instructions/ror.rb +68 -68
  453. data/lib/fisk/instructions/rorx.rb +12 -12
  454. data/lib/fisk/instructions/roundpd.rb +11 -11
  455. data/lib/fisk/instructions/roundps.rb +11 -11
  456. data/lib/fisk/instructions/roundsd.rb +11 -11
  457. data/lib/fisk/instructions/roundss.rb +11 -11
  458. data/lib/fisk/instructions/rsqrtps.rb +9 -9
  459. data/lib/fisk/instructions/rsqrtss.rb +9 -9
  460. data/lib/fisk/instructions/sal.rb +68 -68
  461. data/lib/fisk/instructions/sar.rb +68 -68
  462. data/lib/fisk/instructions/sarx.rb +8 -8
  463. data/lib/fisk/instructions/sbb.rb +125 -125
  464. data/lib/fisk/instructions/seta.rb +5 -5
  465. data/lib/fisk/instructions/setae.rb +5 -5
  466. data/lib/fisk/instructions/setb.rb +5 -5
  467. data/lib/fisk/instructions/setbe.rb +5 -5
  468. data/lib/fisk/instructions/setc.rb +5 -5
  469. data/lib/fisk/instructions/sete.rb +5 -5
  470. data/lib/fisk/instructions/setg.rb +5 -5
  471. data/lib/fisk/instructions/setge.rb +5 -5
  472. data/lib/fisk/instructions/setl.rb +5 -5
  473. data/lib/fisk/instructions/setle.rb +5 -5
  474. data/lib/fisk/instructions/setna.rb +5 -5
  475. data/lib/fisk/instructions/setnae.rb +5 -5
  476. data/lib/fisk/instructions/setnb.rb +5 -5
  477. data/lib/fisk/instructions/setnbe.rb +5 -5
  478. data/lib/fisk/instructions/setnc.rb +5 -5
  479. data/lib/fisk/instructions/setne.rb +5 -5
  480. data/lib/fisk/instructions/setng.rb +5 -5
  481. data/lib/fisk/instructions/setnge.rb +5 -5
  482. data/lib/fisk/instructions/setnl.rb +5 -5
  483. data/lib/fisk/instructions/setnle.rb +5 -5
  484. data/lib/fisk/instructions/setno.rb +5 -5
  485. data/lib/fisk/instructions/setnp.rb +5 -5
  486. data/lib/fisk/instructions/setns.rb +5 -5
  487. data/lib/fisk/instructions/setnz.rb +5 -5
  488. data/lib/fisk/instructions/seto.rb +5 -5
  489. data/lib/fisk/instructions/setp.rb +5 -5
  490. data/lib/fisk/instructions/setpe.rb +5 -5
  491. data/lib/fisk/instructions/setpo.rb +5 -5
  492. data/lib/fisk/instructions/sets.rb +5 -5
  493. data/lib/fisk/instructions/setz.rb +5 -5
  494. data/lib/fisk/instructions/sha1msg1.rb +9 -9
  495. data/lib/fisk/instructions/sha1msg2.rb +9 -9
  496. data/lib/fisk/instructions/sha1nexte.rb +9 -9
  497. data/lib/fisk/instructions/sha1rnds4.rb +11 -11
  498. data/lib/fisk/instructions/sha256msg1.rb +9 -9
  499. data/lib/fisk/instructions/sha256msg2.rb +9 -9
  500. data/lib/fisk/instructions/sha256rnds2.rb +9 -9
  501. data/lib/fisk/instructions/shl.rb +68 -68
  502. data/lib/fisk/instructions/shld.rb +60 -60
  503. data/lib/fisk/instructions/shlx.rb +8 -8
  504. data/lib/fisk/instructions/shr.rb +68 -68
  505. data/lib/fisk/instructions/shrd.rb +60 -60
  506. data/lib/fisk/instructions/shrx.rb +8 -8
  507. data/lib/fisk/instructions/shufpd.rb +11 -11
  508. data/lib/fisk/instructions/shufps.rb +11 -11
  509. data/lib/fisk/instructions/sqrtpd.rb +9 -9
  510. data/lib/fisk/instructions/sqrtps.rb +9 -9
  511. data/lib/fisk/instructions/sqrtsd.rb +9 -9
  512. data/lib/fisk/instructions/sqrtss.rb +9 -9
  513. data/lib/fisk/instructions/stmxcsr.rb +3 -3
  514. data/lib/fisk/instructions/sub.rb +125 -125
  515. data/lib/fisk/instructions/subpd.rb +9 -9
  516. data/lib/fisk/instructions/subps.rb +9 -9
  517. data/lib/fisk/instructions/subsd.rb +9 -9
  518. data/lib/fisk/instructions/subss.rb +9 -9
  519. data/lib/fisk/instructions/t1mskc.rb +4 -4
  520. data/lib/fisk/instructions/test.rb +68 -68
  521. data/lib/fisk/instructions/tzcnt.rb +27 -27
  522. data/lib/fisk/instructions/tzmsk.rb +4 -4
  523. data/lib/fisk/instructions/ucomisd.rb +9 -9
  524. data/lib/fisk/instructions/ucomiss.rb +9 -9
  525. data/lib/fisk/instructions/unpckhpd.rb +9 -9
  526. data/lib/fisk/instructions/unpckhps.rb +9 -9
  527. data/lib/fisk/instructions/unpcklpd.rb +9 -9
  528. data/lib/fisk/instructions/unpcklps.rb +9 -9
  529. data/lib/fisk/instructions/vaddpd.rb +20 -20
  530. data/lib/fisk/instructions/vaddps.rb +20 -20
  531. data/lib/fisk/instructions/vaddsd.rb +8 -8
  532. data/lib/fisk/instructions/vaddss.rb +8 -8
  533. data/lib/fisk/instructions/vaddsubpd.rb +8 -8
  534. data/lib/fisk/instructions/vaddsubps.rb +8 -8
  535. data/lib/fisk/instructions/vaesdec.rb +4 -4
  536. data/lib/fisk/instructions/vaesdeclast.rb +4 -4
  537. data/lib/fisk/instructions/vaesenc.rb +4 -4
  538. data/lib/fisk/instructions/vaesenclast.rb +4 -4
  539. data/lib/fisk/instructions/vaesimc.rb +4 -4
  540. data/lib/fisk/instructions/vaeskeygenassist.rb +6 -6
  541. data/lib/fisk/instructions/valignd.rb +18 -18
  542. data/lib/fisk/instructions/valignq.rb +18 -18
  543. data/lib/fisk/instructions/vandnpd.rb +20 -20
  544. data/lib/fisk/instructions/vandnps.rb +20 -20
  545. data/lib/fisk/instructions/vandpd.rb +20 -20
  546. data/lib/fisk/instructions/vandps.rb +20 -20
  547. data/lib/fisk/instructions/vblendmpd.rb +12 -12
  548. data/lib/fisk/instructions/vblendmps.rb +12 -12
  549. data/lib/fisk/instructions/vblendpd.rb +12 -12
  550. data/lib/fisk/instructions/vblendps.rb +12 -12
  551. data/lib/fisk/instructions/vblendvpd.rb +8 -8
  552. data/lib/fisk/instructions/vblendvps.rb +8 -8
  553. data/lib/fisk/instructions/vbroadcastf128.rb +2 -2
  554. data/lib/fisk/instructions/vbroadcastf32x2.rb +8 -8
  555. data/lib/fisk/instructions/vbroadcastf32x4.rb +4 -4
  556. data/lib/fisk/instructions/vbroadcastf32x8.rb +2 -2
  557. data/lib/fisk/instructions/vbroadcastf64x2.rb +4 -4
  558. data/lib/fisk/instructions/vbroadcastf64x4.rb +2 -2
  559. data/lib/fisk/instructions/vbroadcasti128.rb +2 -2
  560. data/lib/fisk/instructions/vbroadcasti32x2.rb +12 -12
  561. data/lib/fisk/instructions/vbroadcasti32x4.rb +4 -4
  562. data/lib/fisk/instructions/vbroadcasti32x8.rb +2 -2
  563. data/lib/fisk/instructions/vbroadcasti64x2.rb +4 -4
  564. data/lib/fisk/instructions/vbroadcasti64x4.rb +2 -2
  565. data/lib/fisk/instructions/vbroadcastsd.rb +12 -12
  566. data/lib/fisk/instructions/vbroadcastss.rb +16 -16
  567. data/lib/fisk/instructions/vcmppd.rb +30 -30
  568. data/lib/fisk/instructions/vcmpps.rb +30 -30
  569. data/lib/fisk/instructions/vcmpsd.rb +12 -12
  570. data/lib/fisk/instructions/vcmpss.rb +12 -12
  571. data/lib/fisk/instructions/vcomisd.rb +8 -8
  572. data/lib/fisk/instructions/vcomiss.rb +8 -8
  573. data/lib/fisk/instructions/vcompresspd.rb +12 -12
  574. data/lib/fisk/instructions/vcompressps.rb +12 -12
  575. data/lib/fisk/instructions/vcvtdq2pd.rb +20 -20
  576. data/lib/fisk/instructions/vcvtdq2ps.rb +20 -20
  577. data/lib/fisk/instructions/vcvtpd2dq.rb +20 -20
  578. data/lib/fisk/instructions/vcvtpd2ps.rb +20 -20
  579. data/lib/fisk/instructions/vcvtpd2qq.rb +12 -12
  580. data/lib/fisk/instructions/vcvtpd2udq.rb +12 -12
  581. data/lib/fisk/instructions/vcvtpd2uqq.rb +12 -12
  582. data/lib/fisk/instructions/vcvtph2ps.rb +20 -20
  583. data/lib/fisk/instructions/vcvtps2dq.rb +20 -20
  584. data/lib/fisk/instructions/vcvtps2pd.rb +20 -20
  585. data/lib/fisk/instructions/vcvtps2ph.rb +30 -30
  586. data/lib/fisk/instructions/vcvtps2qq.rb +12 -12
  587. data/lib/fisk/instructions/vcvtps2udq.rb +12 -12
  588. data/lib/fisk/instructions/vcvtps2uqq.rb +12 -12
  589. data/lib/fisk/instructions/vcvtqq2pd.rb +12 -12
  590. data/lib/fisk/instructions/vcvtqq2ps.rb +12 -12
  591. data/lib/fisk/instructions/vcvtsd2si.rb +16 -16
  592. data/lib/fisk/instructions/vcvtsd2ss.rb +8 -8
  593. data/lib/fisk/instructions/vcvtsd2usi.rb +8 -8
  594. data/lib/fisk/instructions/vcvtsi2sd.rb +16 -16
  595. data/lib/fisk/instructions/vcvtsi2ss.rb +16 -16
  596. data/lib/fisk/instructions/vcvtss2sd.rb +8 -8
  597. data/lib/fisk/instructions/vcvtss2si.rb +16 -16
  598. data/lib/fisk/instructions/vcvtss2usi.rb +8 -8
  599. data/lib/fisk/instructions/vcvttpd2dq.rb +20 -20
  600. data/lib/fisk/instructions/vcvttpd2qq.rb +12 -12
  601. data/lib/fisk/instructions/vcvttpd2udq.rb +12 -12
  602. data/lib/fisk/instructions/vcvttpd2uqq.rb +12 -12
  603. data/lib/fisk/instructions/vcvttps2dq.rb +20 -20
  604. data/lib/fisk/instructions/vcvttps2qq.rb +12 -12
  605. data/lib/fisk/instructions/vcvttps2udq.rb +12 -12
  606. data/lib/fisk/instructions/vcvttps2uqq.rb +12 -12
  607. data/lib/fisk/instructions/vcvttsd2si.rb +16 -16
  608. data/lib/fisk/instructions/vcvttsd2usi.rb +8 -8
  609. data/lib/fisk/instructions/vcvttss2si.rb +16 -16
  610. data/lib/fisk/instructions/vcvttss2usi.rb +8 -8
  611. data/lib/fisk/instructions/vcvtudq2pd.rb +12 -12
  612. data/lib/fisk/instructions/vcvtudq2ps.rb +12 -12
  613. data/lib/fisk/instructions/vcvtuqq2pd.rb +12 -12
  614. data/lib/fisk/instructions/vcvtuqq2ps.rb +12 -12
  615. data/lib/fisk/instructions/vcvtusi2sd.rb +8 -8
  616. data/lib/fisk/instructions/vcvtusi2ss.rb +8 -8
  617. data/lib/fisk/instructions/vdbpsadbw.rb +18 -18
  618. data/lib/fisk/instructions/vdivpd.rb +20 -20
  619. data/lib/fisk/instructions/vdivps.rb +20 -20
  620. data/lib/fisk/instructions/vdivsd.rb +8 -8
  621. data/lib/fisk/instructions/vdivss.rb +8 -8
  622. data/lib/fisk/instructions/vdppd.rb +6 -6
  623. data/lib/fisk/instructions/vdpps.rb +12 -12
  624. data/lib/fisk/instructions/vexp2pd.rb +4 -4
  625. data/lib/fisk/instructions/vexp2ps.rb +4 -4
  626. data/lib/fisk/instructions/vexpandpd.rb +12 -12
  627. data/lib/fisk/instructions/vexpandps.rb +12 -12
  628. data/lib/fisk/instructions/vextractf128.rb +6 -6
  629. data/lib/fisk/instructions/vextractf32x4.rb +12 -12
  630. data/lib/fisk/instructions/vextractf32x8.rb +6 -6
  631. data/lib/fisk/instructions/vextractf64x2.rb +12 -12
  632. data/lib/fisk/instructions/vextractf64x4.rb +6 -6
  633. data/lib/fisk/instructions/vextracti128.rb +6 -6
  634. data/lib/fisk/instructions/vextracti32x4.rb +12 -12
  635. data/lib/fisk/instructions/vextracti32x8.rb +6 -6
  636. data/lib/fisk/instructions/vextracti64x2.rb +12 -12
  637. data/lib/fisk/instructions/vextracti64x4.rb +6 -6
  638. data/lib/fisk/instructions/vextractps.rb +12 -12
  639. data/lib/fisk/instructions/vfixupimmpd.rb +18 -18
  640. data/lib/fisk/instructions/vfixupimmps.rb +18 -18
  641. data/lib/fisk/instructions/vfixupimmsd.rb +6 -6
  642. data/lib/fisk/instructions/vfixupimmss.rb +6 -6
  643. data/lib/fisk/instructions/vfmadd132pd.rb +20 -20
  644. data/lib/fisk/instructions/vfmadd132ps.rb +20 -20
  645. data/lib/fisk/instructions/vfmadd132sd.rb +8 -8
  646. data/lib/fisk/instructions/vfmadd132ss.rb +8 -8
  647. data/lib/fisk/instructions/vfmadd213pd.rb +20 -20
  648. data/lib/fisk/instructions/vfmadd213ps.rb +20 -20
  649. data/lib/fisk/instructions/vfmadd213sd.rb +8 -8
  650. data/lib/fisk/instructions/vfmadd213ss.rb +8 -8
  651. data/lib/fisk/instructions/vfmadd231pd.rb +20 -20
  652. data/lib/fisk/instructions/vfmadd231ps.rb +20 -20
  653. data/lib/fisk/instructions/vfmadd231sd.rb +8 -8
  654. data/lib/fisk/instructions/vfmadd231ss.rb +8 -8
  655. data/lib/fisk/instructions/vfmaddpd.rb +16 -16
  656. data/lib/fisk/instructions/vfmaddps.rb +16 -16
  657. data/lib/fisk/instructions/vfmaddsd.rb +8 -8
  658. data/lib/fisk/instructions/vfmaddss.rb +8 -8
  659. data/lib/fisk/instructions/vfmaddsub132pd.rb +20 -20
  660. data/lib/fisk/instructions/vfmaddsub132ps.rb +20 -20
  661. data/lib/fisk/instructions/vfmaddsub213pd.rb +20 -20
  662. data/lib/fisk/instructions/vfmaddsub213ps.rb +20 -20
  663. data/lib/fisk/instructions/vfmaddsub231pd.rb +20 -20
  664. data/lib/fisk/instructions/vfmaddsub231ps.rb +20 -20
  665. data/lib/fisk/instructions/vfmaddsubpd.rb +16 -16
  666. data/lib/fisk/instructions/vfmaddsubps.rb +16 -16
  667. data/lib/fisk/instructions/vfmsub132pd.rb +20 -20
  668. data/lib/fisk/instructions/vfmsub132ps.rb +20 -20
  669. data/lib/fisk/instructions/vfmsub132sd.rb +8 -8
  670. data/lib/fisk/instructions/vfmsub132ss.rb +8 -8
  671. data/lib/fisk/instructions/vfmsub213pd.rb +20 -20
  672. data/lib/fisk/instructions/vfmsub213ps.rb +20 -20
  673. data/lib/fisk/instructions/vfmsub213sd.rb +8 -8
  674. data/lib/fisk/instructions/vfmsub213ss.rb +8 -8
  675. data/lib/fisk/instructions/vfmsub231pd.rb +20 -20
  676. data/lib/fisk/instructions/vfmsub231ps.rb +20 -20
  677. data/lib/fisk/instructions/vfmsub231sd.rb +8 -8
  678. data/lib/fisk/instructions/vfmsub231ss.rb +8 -8
  679. data/lib/fisk/instructions/vfmsubadd132pd.rb +20 -20
  680. data/lib/fisk/instructions/vfmsubadd132ps.rb +20 -20
  681. data/lib/fisk/instructions/vfmsubadd213pd.rb +20 -20
  682. data/lib/fisk/instructions/vfmsubadd213ps.rb +20 -20
  683. data/lib/fisk/instructions/vfmsubadd231pd.rb +20 -20
  684. data/lib/fisk/instructions/vfmsubadd231ps.rb +20 -20
  685. data/lib/fisk/instructions/vfmsubaddpd.rb +16 -16
  686. data/lib/fisk/instructions/vfmsubaddps.rb +16 -16
  687. data/lib/fisk/instructions/vfmsubpd.rb +16 -16
  688. data/lib/fisk/instructions/vfmsubps.rb +16 -16
  689. data/lib/fisk/instructions/vfmsubsd.rb +8 -8
  690. data/lib/fisk/instructions/vfmsubss.rb +8 -8
  691. data/lib/fisk/instructions/vfnmadd132pd.rb +20 -20
  692. data/lib/fisk/instructions/vfnmadd132ps.rb +20 -20
  693. data/lib/fisk/instructions/vfnmadd132sd.rb +8 -8
  694. data/lib/fisk/instructions/vfnmadd132ss.rb +8 -8
  695. data/lib/fisk/instructions/vfnmadd213pd.rb +20 -20
  696. data/lib/fisk/instructions/vfnmadd213ps.rb +20 -20
  697. data/lib/fisk/instructions/vfnmadd213sd.rb +8 -8
  698. data/lib/fisk/instructions/vfnmadd213ss.rb +8 -8
  699. data/lib/fisk/instructions/vfnmadd231pd.rb +20 -20
  700. data/lib/fisk/instructions/vfnmadd231ps.rb +20 -20
  701. data/lib/fisk/instructions/vfnmadd231sd.rb +8 -8
  702. data/lib/fisk/instructions/vfnmadd231ss.rb +8 -8
  703. data/lib/fisk/instructions/vfnmaddpd.rb +16 -16
  704. data/lib/fisk/instructions/vfnmaddps.rb +16 -16
  705. data/lib/fisk/instructions/vfnmaddsd.rb +8 -8
  706. data/lib/fisk/instructions/vfnmaddss.rb +8 -8
  707. data/lib/fisk/instructions/vfnmsub132pd.rb +20 -20
  708. data/lib/fisk/instructions/vfnmsub132ps.rb +20 -20
  709. data/lib/fisk/instructions/vfnmsub132sd.rb +8 -8
  710. data/lib/fisk/instructions/vfnmsub132ss.rb +8 -8
  711. data/lib/fisk/instructions/vfnmsub213pd.rb +20 -20
  712. data/lib/fisk/instructions/vfnmsub213ps.rb +20 -20
  713. data/lib/fisk/instructions/vfnmsub213sd.rb +8 -8
  714. data/lib/fisk/instructions/vfnmsub213ss.rb +8 -8
  715. data/lib/fisk/instructions/vfnmsub231pd.rb +20 -20
  716. data/lib/fisk/instructions/vfnmsub231ps.rb +20 -20
  717. data/lib/fisk/instructions/vfnmsub231sd.rb +8 -8
  718. data/lib/fisk/instructions/vfnmsub231ss.rb +8 -8
  719. data/lib/fisk/instructions/vfnmsubpd.rb +16 -16
  720. data/lib/fisk/instructions/vfnmsubps.rb +16 -16
  721. data/lib/fisk/instructions/vfnmsubsd.rb +8 -8
  722. data/lib/fisk/instructions/vfnmsubss.rb +8 -8
  723. data/lib/fisk/instructions/vfpclasspd.rb +18 -18
  724. data/lib/fisk/instructions/vfpclassps.rb +18 -18
  725. data/lib/fisk/instructions/vfpclasssd.rb +6 -6
  726. data/lib/fisk/instructions/vfpclassss.rb +6 -6
  727. data/lib/fisk/instructions/vfrczpd.rb +8 -8
  728. data/lib/fisk/instructions/vfrczps.rb +8 -8
  729. data/lib/fisk/instructions/vfrczsd.rb +4 -4
  730. data/lib/fisk/instructions/vfrczss.rb +4 -4
  731. data/lib/fisk/instructions/vgatherdpd.rb +10 -10
  732. data/lib/fisk/instructions/vgatherdps.rb +10 -10
  733. data/lib/fisk/instructions/vgatherpf0dpd.rb +1 -1
  734. data/lib/fisk/instructions/vgatherpf0dps.rb +1 -1
  735. data/lib/fisk/instructions/vgatherpf0qpd.rb +1 -1
  736. data/lib/fisk/instructions/vgatherpf0qps.rb +1 -1
  737. data/lib/fisk/instructions/vgatherpf1dpd.rb +1 -1
  738. data/lib/fisk/instructions/vgatherpf1dps.rb +1 -1
  739. data/lib/fisk/instructions/vgatherpf1qpd.rb +1 -1
  740. data/lib/fisk/instructions/vgatherpf1qps.rb +1 -1
  741. data/lib/fisk/instructions/vgatherqpd.rb +10 -10
  742. data/lib/fisk/instructions/vgatherqps.rb +10 -10
  743. data/lib/fisk/instructions/vgetexppd.rb +12 -12
  744. data/lib/fisk/instructions/vgetexpps.rb +12 -12
  745. data/lib/fisk/instructions/vgetexpsd.rb +4 -4
  746. data/lib/fisk/instructions/vgetexpss.rb +4 -4
  747. data/lib/fisk/instructions/vgetmantpd.rb +18 -18
  748. data/lib/fisk/instructions/vgetmantps.rb +18 -18
  749. data/lib/fisk/instructions/vgetmantsd.rb +6 -6
  750. data/lib/fisk/instructions/vgetmantss.rb +6 -6
  751. data/lib/fisk/instructions/vhaddpd.rb +8 -8
  752. data/lib/fisk/instructions/vhaddps.rb +8 -8
  753. data/lib/fisk/instructions/vhsubpd.rb +8 -8
  754. data/lib/fisk/instructions/vhsubps.rb +8 -8
  755. data/lib/fisk/instructions/vinsertf128.rb +6 -6
  756. data/lib/fisk/instructions/vinsertf32x4.rb +12 -12
  757. data/lib/fisk/instructions/vinsertf32x8.rb +6 -6
  758. data/lib/fisk/instructions/vinsertf64x2.rb +12 -12
  759. data/lib/fisk/instructions/vinsertf64x4.rb +6 -6
  760. data/lib/fisk/instructions/vinserti128.rb +6 -6
  761. data/lib/fisk/instructions/vinserti32x4.rb +12 -12
  762. data/lib/fisk/instructions/vinserti32x8.rb +6 -6
  763. data/lib/fisk/instructions/vinserti64x2.rb +12 -12
  764. data/lib/fisk/instructions/vinserti64x4.rb +6 -6
  765. data/lib/fisk/instructions/vinsertps.rb +12 -12
  766. data/lib/fisk/instructions/vlddqu.rb +4 -4
  767. data/lib/fisk/instructions/vldmxcsr.rb +1 -1
  768. data/lib/fisk/instructions/vmaskmovdqu.rb +2 -2
  769. data/lib/fisk/instructions/vmaskmovpd.rb +8 -8
  770. data/lib/fisk/instructions/vmaskmovps.rb +8 -8
  771. data/lib/fisk/instructions/vmaxpd.rb +20 -20
  772. data/lib/fisk/instructions/vmaxps.rb +20 -20
  773. data/lib/fisk/instructions/vmaxsd.rb +8 -8
  774. data/lib/fisk/instructions/vmaxss.rb +8 -8
  775. data/lib/fisk/instructions/vminpd.rb +20 -20
  776. data/lib/fisk/instructions/vminps.rb +20 -20
  777. data/lib/fisk/instructions/vminsd.rb +8 -8
  778. data/lib/fisk/instructions/vminss.rb +8 -8
  779. data/lib/fisk/instructions/vmovapd.rb +40 -40
  780. data/lib/fisk/instructions/vmovaps.rb +40 -40
  781. data/lib/fisk/instructions/vmovd.rb +16 -16
  782. data/lib/fisk/instructions/vmovddup.rb +20 -20
  783. data/lib/fisk/instructions/vmovdqa.rb +16 -16
  784. data/lib/fisk/instructions/vmovdqa32.rb +24 -24
  785. data/lib/fisk/instructions/vmovdqa64.rb +24 -24
  786. data/lib/fisk/instructions/vmovdqu.rb +16 -16
  787. data/lib/fisk/instructions/vmovdqu16.rb +24 -24
  788. data/lib/fisk/instructions/vmovdqu32.rb +24 -24
  789. data/lib/fisk/instructions/vmovdqu64.rb +24 -24
  790. data/lib/fisk/instructions/vmovdqu8.rb +24 -24
  791. data/lib/fisk/instructions/vmovhlps.rb +4 -4
  792. data/lib/fisk/instructions/vmovhpd.rb +8 -8
  793. data/lib/fisk/instructions/vmovhps.rb +8 -8
  794. data/lib/fisk/instructions/vmovlhps.rb +4 -4
  795. data/lib/fisk/instructions/vmovlpd.rb +8 -8
  796. data/lib/fisk/instructions/vmovlps.rb +8 -8
  797. data/lib/fisk/instructions/vmovmskpd.rb +4 -4
  798. data/lib/fisk/instructions/vmovmskps.rb +4 -4
  799. data/lib/fisk/instructions/vmovntdq.rb +10 -10
  800. data/lib/fisk/instructions/vmovntdqa.rb +10 -10
  801. data/lib/fisk/instructions/vmovntpd.rb +10 -10
  802. data/lib/fisk/instructions/vmovntps.rb +10 -10
  803. data/lib/fisk/instructions/vmovq.rb +32 -32
  804. data/lib/fisk/instructions/vmovsd.rb +16 -16
  805. data/lib/fisk/instructions/vmovshdup.rb +20 -20
  806. data/lib/fisk/instructions/vmovsldup.rb +20 -20
  807. data/lib/fisk/instructions/vmovss.rb +16 -16
  808. data/lib/fisk/instructions/vmovupd.rb +40 -40
  809. data/lib/fisk/instructions/vmovups.rb +40 -40
  810. data/lib/fisk/instructions/vmpsadbw.rb +12 -12
  811. data/lib/fisk/instructions/vmulpd.rb +20 -20
  812. data/lib/fisk/instructions/vmulps.rb +20 -20
  813. data/lib/fisk/instructions/vmulsd.rb +8 -8
  814. data/lib/fisk/instructions/vmulss.rb +8 -8
  815. data/lib/fisk/instructions/vorpd.rb +20 -20
  816. data/lib/fisk/instructions/vorps.rb +20 -20
  817. data/lib/fisk/instructions/vpabsb.rb +20 -20
  818. data/lib/fisk/instructions/vpabsd.rb +20 -20
  819. data/lib/fisk/instructions/vpabsq.rb +12 -12
  820. data/lib/fisk/instructions/vpabsw.rb +20 -20
  821. data/lib/fisk/instructions/vpackssdw.rb +20 -20
  822. data/lib/fisk/instructions/vpacksswb.rb +20 -20
  823. data/lib/fisk/instructions/vpackusdw.rb +20 -20
  824. data/lib/fisk/instructions/vpackuswb.rb +20 -20
  825. data/lib/fisk/instructions/vpaddb.rb +20 -20
  826. data/lib/fisk/instructions/vpaddd.rb +20 -20
  827. data/lib/fisk/instructions/vpaddq.rb +20 -20
  828. data/lib/fisk/instructions/vpaddsb.rb +20 -20
  829. data/lib/fisk/instructions/vpaddsw.rb +20 -20
  830. data/lib/fisk/instructions/vpaddusb.rb +20 -20
  831. data/lib/fisk/instructions/vpaddusw.rb +20 -20
  832. data/lib/fisk/instructions/vpaddw.rb +20 -20
  833. data/lib/fisk/instructions/vpalignr.rb +30 -30
  834. data/lib/fisk/instructions/vpand.rb +8 -8
  835. data/lib/fisk/instructions/vpandd.rb +12 -12
  836. data/lib/fisk/instructions/vpandn.rb +8 -8
  837. data/lib/fisk/instructions/vpandnd.rb +12 -12
  838. data/lib/fisk/instructions/vpandnq.rb +12 -12
  839. data/lib/fisk/instructions/vpandq.rb +12 -12
  840. data/lib/fisk/instructions/vpavgb.rb +20 -20
  841. data/lib/fisk/instructions/vpavgw.rb +20 -20
  842. data/lib/fisk/instructions/vpblendd.rb +12 -12
  843. data/lib/fisk/instructions/vpblendmb.rb +12 -12
  844. data/lib/fisk/instructions/vpblendmd.rb +12 -12
  845. data/lib/fisk/instructions/vpblendmq.rb +12 -12
  846. data/lib/fisk/instructions/vpblendmw.rb +12 -12
  847. data/lib/fisk/instructions/vpblendvb.rb +8 -8
  848. data/lib/fisk/instructions/vpblendw.rb +12 -12
  849. data/lib/fisk/instructions/vpbroadcastb.rb +26 -26
  850. data/lib/fisk/instructions/vpbroadcastd.rb +26 -26
  851. data/lib/fisk/instructions/vpbroadcastmb2q.rb +6 -6
  852. data/lib/fisk/instructions/vpbroadcastmw2d.rb +6 -6
  853. data/lib/fisk/instructions/vpbroadcastq.rb +26 -26
  854. data/lib/fisk/instructions/vpbroadcastw.rb +26 -26
  855. data/lib/fisk/instructions/vpclmulqdq.rb +6 -6
  856. data/lib/fisk/instructions/vpcmov.rb +16 -16
  857. data/lib/fisk/instructions/vpcmpb.rb +18 -18
  858. data/lib/fisk/instructions/vpcmpd.rb +18 -18
  859. data/lib/fisk/instructions/vpcmpeqb.rb +20 -20
  860. data/lib/fisk/instructions/vpcmpeqd.rb +20 -20
  861. data/lib/fisk/instructions/vpcmpeqq.rb +20 -20
  862. data/lib/fisk/instructions/vpcmpeqw.rb +20 -20
  863. data/lib/fisk/instructions/vpcmpestri.rb +6 -6
  864. data/lib/fisk/instructions/vpcmpestrm.rb +6 -6
  865. data/lib/fisk/instructions/vpcmpgtb.rb +20 -20
  866. data/lib/fisk/instructions/vpcmpgtd.rb +20 -20
  867. data/lib/fisk/instructions/vpcmpgtq.rb +20 -20
  868. data/lib/fisk/instructions/vpcmpgtw.rb +20 -20
  869. data/lib/fisk/instructions/vpcmpistri.rb +6 -6
  870. data/lib/fisk/instructions/vpcmpistrm.rb +6 -6
  871. data/lib/fisk/instructions/vpcmpq.rb +18 -18
  872. data/lib/fisk/instructions/vpcmpub.rb +18 -18
  873. data/lib/fisk/instructions/vpcmpud.rb +18 -18
  874. data/lib/fisk/instructions/vpcmpuq.rb +18 -18
  875. data/lib/fisk/instructions/vpcmpuw.rb +18 -18
  876. data/lib/fisk/instructions/vpcmpw.rb +18 -18
  877. data/lib/fisk/instructions/vpcomb.rb +6 -6
  878. data/lib/fisk/instructions/vpcomd.rb +6 -6
  879. data/lib/fisk/instructions/vpcompressd.rb +12 -12
  880. data/lib/fisk/instructions/vpcompressq.rb +12 -12
  881. data/lib/fisk/instructions/vpcomq.rb +6 -6
  882. data/lib/fisk/instructions/vpcomub.rb +6 -6
  883. data/lib/fisk/instructions/vpcomud.rb +6 -6
  884. data/lib/fisk/instructions/vpcomuq.rb +6 -6
  885. data/lib/fisk/instructions/vpcomuw.rb +6 -6
  886. data/lib/fisk/instructions/vpcomw.rb +6 -6
  887. data/lib/fisk/instructions/vpconflictd.rb +12 -12
  888. data/lib/fisk/instructions/vpconflictq.rb +12 -12
  889. data/lib/fisk/instructions/vperm2f128.rb +6 -6
  890. data/lib/fisk/instructions/vperm2i128.rb +6 -6
  891. data/lib/fisk/instructions/vpermb.rb +12 -12
  892. data/lib/fisk/instructions/vpermd.rb +12 -12
  893. data/lib/fisk/instructions/vpermi2b.rb +12 -12
  894. data/lib/fisk/instructions/vpermi2d.rb +12 -12
  895. data/lib/fisk/instructions/vpermi2pd.rb +12 -12
  896. data/lib/fisk/instructions/vpermi2ps.rb +12 -12
  897. data/lib/fisk/instructions/vpermi2q.rb +12 -12
  898. data/lib/fisk/instructions/vpermi2w.rb +12 -12
  899. data/lib/fisk/instructions/vpermil2pd.rb +16 -16
  900. data/lib/fisk/instructions/vpermil2ps.rb +16 -16
  901. data/lib/fisk/instructions/vpermilpd.rb +50 -50
  902. data/lib/fisk/instructions/vpermilps.rb +50 -50
  903. data/lib/fisk/instructions/vpermpd.rb +26 -26
  904. data/lib/fisk/instructions/vpermps.rb +12 -12
  905. data/lib/fisk/instructions/vpermq.rb +26 -26
  906. data/lib/fisk/instructions/vpermt2b.rb +12 -12
  907. data/lib/fisk/instructions/vpermt2d.rb +12 -12
  908. data/lib/fisk/instructions/vpermt2pd.rb +12 -12
  909. data/lib/fisk/instructions/vpermt2ps.rb +12 -12
  910. data/lib/fisk/instructions/vpermt2q.rb +12 -12
  911. data/lib/fisk/instructions/vpermt2w.rb +12 -12
  912. data/lib/fisk/instructions/vpermw.rb +12 -12
  913. data/lib/fisk/instructions/vpexpandd.rb +12 -12
  914. data/lib/fisk/instructions/vpexpandq.rb +12 -12
  915. data/lib/fisk/instructions/vpextrb.rb +12 -12
  916. data/lib/fisk/instructions/vpextrd.rb +12 -12
  917. data/lib/fisk/instructions/vpextrq.rb +12 -12
  918. data/lib/fisk/instructions/vpextrw.rb +18 -18
  919. data/lib/fisk/instructions/vpgatherdd.rb +10 -10
  920. data/lib/fisk/instructions/vpgatherdq.rb +10 -10
  921. data/lib/fisk/instructions/vpgatherqd.rb +10 -10
  922. data/lib/fisk/instructions/vpgatherqq.rb +10 -10
  923. data/lib/fisk/instructions/vphaddbd.rb +4 -4
  924. data/lib/fisk/instructions/vphaddbq.rb +4 -4
  925. data/lib/fisk/instructions/vphaddbw.rb +4 -4
  926. data/lib/fisk/instructions/vphaddd.rb +8 -8
  927. data/lib/fisk/instructions/vphadddq.rb +4 -4
  928. data/lib/fisk/instructions/vphaddsw.rb +8 -8
  929. data/lib/fisk/instructions/vphaddubd.rb +4 -4
  930. data/lib/fisk/instructions/vphaddubq.rb +4 -4
  931. data/lib/fisk/instructions/vphaddubw.rb +4 -4
  932. data/lib/fisk/instructions/vphaddudq.rb +4 -4
  933. data/lib/fisk/instructions/vphadduwd.rb +4 -4
  934. data/lib/fisk/instructions/vphadduwq.rb +4 -4
  935. data/lib/fisk/instructions/vphaddw.rb +8 -8
  936. data/lib/fisk/instructions/vphaddwd.rb +4 -4
  937. data/lib/fisk/instructions/vphaddwq.rb +4 -4
  938. data/lib/fisk/instructions/vphminposuw.rb +4 -4
  939. data/lib/fisk/instructions/vphsubbw.rb +4 -4
  940. data/lib/fisk/instructions/vphsubd.rb +8 -8
  941. data/lib/fisk/instructions/vphsubdq.rb +4 -4
  942. data/lib/fisk/instructions/vphsubsw.rb +8 -8
  943. data/lib/fisk/instructions/vphsubw.rb +8 -8
  944. data/lib/fisk/instructions/vphsubwd.rb +4 -4
  945. data/lib/fisk/instructions/vpinsrb.rb +12 -12
  946. data/lib/fisk/instructions/vpinsrd.rb +12 -12
  947. data/lib/fisk/instructions/vpinsrq.rb +12 -12
  948. data/lib/fisk/instructions/vpinsrw.rb +12 -12
  949. data/lib/fisk/instructions/vplzcntd.rb +12 -12
  950. data/lib/fisk/instructions/vplzcntq.rb +12 -12
  951. data/lib/fisk/instructions/vpmacsdd.rb +4 -4
  952. data/lib/fisk/instructions/vpmacsdqh.rb +4 -4
  953. data/lib/fisk/instructions/vpmacsdql.rb +4 -4
  954. data/lib/fisk/instructions/vpmacssdd.rb +4 -4
  955. data/lib/fisk/instructions/vpmacssdqh.rb +4 -4
  956. data/lib/fisk/instructions/vpmacssdql.rb +4 -4
  957. data/lib/fisk/instructions/vpmacsswd.rb +4 -4
  958. data/lib/fisk/instructions/vpmacssww.rb +4 -4
  959. data/lib/fisk/instructions/vpmacswd.rb +4 -4
  960. data/lib/fisk/instructions/vpmacsww.rb +4 -4
  961. data/lib/fisk/instructions/vpmadcsswd.rb +4 -4
  962. data/lib/fisk/instructions/vpmadcswd.rb +4 -4
  963. data/lib/fisk/instructions/vpmadd52huq.rb +12 -12
  964. data/lib/fisk/instructions/vpmadd52luq.rb +12 -12
  965. data/lib/fisk/instructions/vpmaddubsw.rb +20 -20
  966. data/lib/fisk/instructions/vpmaddwd.rb +20 -20
  967. data/lib/fisk/instructions/vpmaskmovd.rb +8 -8
  968. data/lib/fisk/instructions/vpmaskmovq.rb +8 -8
  969. data/lib/fisk/instructions/vpmaxsb.rb +20 -20
  970. data/lib/fisk/instructions/vpmaxsd.rb +20 -20
  971. data/lib/fisk/instructions/vpmaxsq.rb +12 -12
  972. data/lib/fisk/instructions/vpmaxsw.rb +20 -20
  973. data/lib/fisk/instructions/vpmaxub.rb +20 -20
  974. data/lib/fisk/instructions/vpmaxud.rb +20 -20
  975. data/lib/fisk/instructions/vpmaxuq.rb +12 -12
  976. data/lib/fisk/instructions/vpmaxuw.rb +20 -20
  977. data/lib/fisk/instructions/vpminsb.rb +20 -20
  978. data/lib/fisk/instructions/vpminsd.rb +20 -20
  979. data/lib/fisk/instructions/vpminsq.rb +12 -12
  980. data/lib/fisk/instructions/vpminsw.rb +20 -20
  981. data/lib/fisk/instructions/vpminub.rb +20 -20
  982. data/lib/fisk/instructions/vpminud.rb +20 -20
  983. data/lib/fisk/instructions/vpminuq.rb +12 -12
  984. data/lib/fisk/instructions/vpminuw.rb +20 -20
  985. data/lib/fisk/instructions/vpmovb2m.rb +6 -6
  986. data/lib/fisk/instructions/vpmovd2m.rb +6 -6
  987. data/lib/fisk/instructions/vpmovdb.rb +12 -12
  988. data/lib/fisk/instructions/vpmovdw.rb +12 -12
  989. data/lib/fisk/instructions/vpmovm2b.rb +6 -6
  990. data/lib/fisk/instructions/vpmovm2d.rb +6 -6
  991. data/lib/fisk/instructions/vpmovm2q.rb +6 -6
  992. data/lib/fisk/instructions/vpmovm2w.rb +6 -6
  993. data/lib/fisk/instructions/vpmovmskb.rb +4 -4
  994. data/lib/fisk/instructions/vpmovq2m.rb +6 -6
  995. data/lib/fisk/instructions/vpmovqb.rb +12 -12
  996. data/lib/fisk/instructions/vpmovqd.rb +12 -12
  997. data/lib/fisk/instructions/vpmovqw.rb +12 -12
  998. data/lib/fisk/instructions/vpmovsdb.rb +12 -12
  999. data/lib/fisk/instructions/vpmovsdw.rb +12 -12
  1000. data/lib/fisk/instructions/vpmovsqb.rb +12 -12
  1001. data/lib/fisk/instructions/vpmovsqd.rb +12 -12
  1002. data/lib/fisk/instructions/vpmovsqw.rb +12 -12
  1003. data/lib/fisk/instructions/vpmovswb.rb +12 -12
  1004. data/lib/fisk/instructions/vpmovsxbd.rb +20 -20
  1005. data/lib/fisk/instructions/vpmovsxbq.rb +20 -20
  1006. data/lib/fisk/instructions/vpmovsxbw.rb +20 -20
  1007. data/lib/fisk/instructions/vpmovsxdq.rb +20 -20
  1008. data/lib/fisk/instructions/vpmovsxwd.rb +20 -20
  1009. data/lib/fisk/instructions/vpmovsxwq.rb +20 -20
  1010. data/lib/fisk/instructions/vpmovusdb.rb +12 -12
  1011. data/lib/fisk/instructions/vpmovusdw.rb +12 -12
  1012. data/lib/fisk/instructions/vpmovusqb.rb +12 -12
  1013. data/lib/fisk/instructions/vpmovusqd.rb +12 -12
  1014. data/lib/fisk/instructions/vpmovusqw.rb +12 -12
  1015. data/lib/fisk/instructions/vpmovuswb.rb +12 -12
  1016. data/lib/fisk/instructions/vpmovw2m.rb +6 -6
  1017. data/lib/fisk/instructions/vpmovwb.rb +12 -12
  1018. data/lib/fisk/instructions/vpmovzxbd.rb +20 -20
  1019. data/lib/fisk/instructions/vpmovzxbq.rb +20 -20
  1020. data/lib/fisk/instructions/vpmovzxbw.rb +20 -20
  1021. data/lib/fisk/instructions/vpmovzxdq.rb +20 -20
  1022. data/lib/fisk/instructions/vpmovzxwd.rb +20 -20
  1023. data/lib/fisk/instructions/vpmovzxwq.rb +20 -20
  1024. data/lib/fisk/instructions/vpmuldq.rb +20 -20
  1025. data/lib/fisk/instructions/vpmulhrsw.rb +20 -20
  1026. data/lib/fisk/instructions/vpmulhuw.rb +20 -20
  1027. data/lib/fisk/instructions/vpmulhw.rb +20 -20
  1028. data/lib/fisk/instructions/vpmulld.rb +20 -20
  1029. data/lib/fisk/instructions/vpmullq.rb +12 -12
  1030. data/lib/fisk/instructions/vpmullw.rb +20 -20
  1031. data/lib/fisk/instructions/vpmultishiftqb.rb +12 -12
  1032. data/lib/fisk/instructions/vpmuludq.rb +20 -20
  1033. data/lib/fisk/instructions/vpopcntd.rb +4 -4
  1034. data/lib/fisk/instructions/vpopcntq.rb +4 -4
  1035. data/lib/fisk/instructions/vpor.rb +8 -8
  1036. data/lib/fisk/instructions/vpord.rb +12 -12
  1037. data/lib/fisk/instructions/vporq.rb +12 -12
  1038. data/lib/fisk/instructions/vpperm.rb +8 -8
  1039. data/lib/fisk/instructions/vprold.rb +12 -12
  1040. data/lib/fisk/instructions/vprolq.rb +12 -12
  1041. data/lib/fisk/instructions/vprolvd.rb +12 -12
  1042. data/lib/fisk/instructions/vprolvq.rb +12 -12
  1043. data/lib/fisk/instructions/vprord.rb +12 -12
  1044. data/lib/fisk/instructions/vprorq.rb +12 -12
  1045. data/lib/fisk/instructions/vprorvd.rb +12 -12
  1046. data/lib/fisk/instructions/vprorvq.rb +12 -12
  1047. data/lib/fisk/instructions/vprotb.rb +14 -14
  1048. data/lib/fisk/instructions/vprotd.rb +14 -14
  1049. data/lib/fisk/instructions/vprotq.rb +14 -14
  1050. data/lib/fisk/instructions/vprotw.rb +14 -14
  1051. data/lib/fisk/instructions/vpsadbw.rb +20 -20
  1052. data/lib/fisk/instructions/vpscatterdd.rb +6 -6
  1053. data/lib/fisk/instructions/vpscatterdq.rb +6 -6
  1054. data/lib/fisk/instructions/vpscatterqd.rb +6 -6
  1055. data/lib/fisk/instructions/vpscatterqq.rb +6 -6
  1056. data/lib/fisk/instructions/vpshab.rb +8 -8
  1057. data/lib/fisk/instructions/vpshad.rb +8 -8
  1058. data/lib/fisk/instructions/vpshaq.rb +8 -8
  1059. data/lib/fisk/instructions/vpshaw.rb +8 -8
  1060. data/lib/fisk/instructions/vpshlb.rb +8 -8
  1061. data/lib/fisk/instructions/vpshld.rb +8 -8
  1062. data/lib/fisk/instructions/vpshlq.rb +8 -8
  1063. data/lib/fisk/instructions/vpshlw.rb +8 -8
  1064. data/lib/fisk/instructions/vpshufb.rb +20 -20
  1065. data/lib/fisk/instructions/vpshufd.rb +30 -30
  1066. data/lib/fisk/instructions/vpshufhw.rb +30 -30
  1067. data/lib/fisk/instructions/vpshuflw.rb +30 -30
  1068. data/lib/fisk/instructions/vpsignb.rb +8 -8
  1069. data/lib/fisk/instructions/vpsignd.rb +8 -8
  1070. data/lib/fisk/instructions/vpsignw.rb +8 -8
  1071. data/lib/fisk/instructions/vpslld.rb +36 -36
  1072. data/lib/fisk/instructions/vpslldq.rb +16 -16
  1073. data/lib/fisk/instructions/vpsllq.rb +36 -36
  1074. data/lib/fisk/instructions/vpsllvd.rb +20 -20
  1075. data/lib/fisk/instructions/vpsllvq.rb +20 -20
  1076. data/lib/fisk/instructions/vpsllvw.rb +12 -12
  1077. data/lib/fisk/instructions/vpsllw.rb +36 -36
  1078. data/lib/fisk/instructions/vpsrad.rb +36 -36
  1079. data/lib/fisk/instructions/vpsraq.rb +24 -24
  1080. data/lib/fisk/instructions/vpsravd.rb +20 -20
  1081. data/lib/fisk/instructions/vpsravq.rb +12 -12
  1082. data/lib/fisk/instructions/vpsravw.rb +12 -12
  1083. data/lib/fisk/instructions/vpsraw.rb +36 -36
  1084. data/lib/fisk/instructions/vpsrld.rb +36 -36
  1085. data/lib/fisk/instructions/vpsrldq.rb +16 -16
  1086. data/lib/fisk/instructions/vpsrlq.rb +36 -36
  1087. data/lib/fisk/instructions/vpsrlvd.rb +20 -20
  1088. data/lib/fisk/instructions/vpsrlvq.rb +20 -20
  1089. data/lib/fisk/instructions/vpsrlvw.rb +12 -12
  1090. data/lib/fisk/instructions/vpsrlw.rb +36 -36
  1091. data/lib/fisk/instructions/vpsubb.rb +20 -20
  1092. data/lib/fisk/instructions/vpsubd.rb +20 -20
  1093. data/lib/fisk/instructions/vpsubq.rb +20 -20
  1094. data/lib/fisk/instructions/vpsubsb.rb +20 -20
  1095. data/lib/fisk/instructions/vpsubsw.rb +20 -20
  1096. data/lib/fisk/instructions/vpsubusb.rb +20 -20
  1097. data/lib/fisk/instructions/vpsubusw.rb +20 -20
  1098. data/lib/fisk/instructions/vpsubw.rb +20 -20
  1099. data/lib/fisk/instructions/vpternlogd.rb +18 -18
  1100. data/lib/fisk/instructions/vpternlogq.rb +18 -18
  1101. data/lib/fisk/instructions/vptest.rb +8 -8
  1102. data/lib/fisk/instructions/vptestmb.rb +12 -12
  1103. data/lib/fisk/instructions/vptestmd.rb +12 -12
  1104. data/lib/fisk/instructions/vptestmq.rb +12 -12
  1105. data/lib/fisk/instructions/vptestmw.rb +12 -12
  1106. data/lib/fisk/instructions/vptestnmb.rb +12 -12
  1107. data/lib/fisk/instructions/vptestnmd.rb +12 -12
  1108. data/lib/fisk/instructions/vptestnmq.rb +12 -12
  1109. data/lib/fisk/instructions/vptestnmw.rb +12 -12
  1110. data/lib/fisk/instructions/vpunpckhbw.rb +20 -20
  1111. data/lib/fisk/instructions/vpunpckhdq.rb +20 -20
  1112. data/lib/fisk/instructions/vpunpckhqdq.rb +20 -20
  1113. data/lib/fisk/instructions/vpunpckhwd.rb +20 -20
  1114. data/lib/fisk/instructions/vpunpcklbw.rb +20 -20
  1115. data/lib/fisk/instructions/vpunpckldq.rb +20 -20
  1116. data/lib/fisk/instructions/vpunpcklqdq.rb +20 -20
  1117. data/lib/fisk/instructions/vpunpcklwd.rb +20 -20
  1118. data/lib/fisk/instructions/vpxor.rb +8 -8
  1119. data/lib/fisk/instructions/vpxord.rb +12 -12
  1120. data/lib/fisk/instructions/vpxorq.rb +12 -12
  1121. data/lib/fisk/instructions/vrangepd.rb +18 -18
  1122. data/lib/fisk/instructions/vrangeps.rb +18 -18
  1123. data/lib/fisk/instructions/vrangesd.rb +6 -6
  1124. data/lib/fisk/instructions/vrangess.rb +6 -6
  1125. data/lib/fisk/instructions/vrcp14pd.rb +12 -12
  1126. data/lib/fisk/instructions/vrcp14ps.rb +12 -12
  1127. data/lib/fisk/instructions/vrcp14sd.rb +4 -4
  1128. data/lib/fisk/instructions/vrcp14ss.rb +4 -4
  1129. data/lib/fisk/instructions/vrcp28pd.rb +4 -4
  1130. data/lib/fisk/instructions/vrcp28ps.rb +4 -4
  1131. data/lib/fisk/instructions/vrcp28sd.rb +4 -4
  1132. data/lib/fisk/instructions/vrcp28ss.rb +4 -4
  1133. data/lib/fisk/instructions/vrcpps.rb +8 -8
  1134. data/lib/fisk/instructions/vrcpss.rb +4 -4
  1135. data/lib/fisk/instructions/vreducepd.rb +18 -18
  1136. data/lib/fisk/instructions/vreduceps.rb +18 -18
  1137. data/lib/fisk/instructions/vreducesd.rb +6 -6
  1138. data/lib/fisk/instructions/vreducess.rb +6 -6
  1139. data/lib/fisk/instructions/vrndscalepd.rb +18 -18
  1140. data/lib/fisk/instructions/vrndscaleps.rb +18 -18
  1141. data/lib/fisk/instructions/vrndscalesd.rb +6 -6
  1142. data/lib/fisk/instructions/vrndscaless.rb +6 -6
  1143. data/lib/fisk/instructions/vroundpd.rb +12 -12
  1144. data/lib/fisk/instructions/vroundps.rb +12 -12
  1145. data/lib/fisk/instructions/vroundsd.rb +6 -6
  1146. data/lib/fisk/instructions/vroundss.rb +6 -6
  1147. data/lib/fisk/instructions/vrsqrt14pd.rb +12 -12
  1148. data/lib/fisk/instructions/vrsqrt14ps.rb +12 -12
  1149. data/lib/fisk/instructions/vrsqrt14sd.rb +4 -4
  1150. data/lib/fisk/instructions/vrsqrt14ss.rb +4 -4
  1151. data/lib/fisk/instructions/vrsqrt28pd.rb +4 -4
  1152. data/lib/fisk/instructions/vrsqrt28ps.rb +4 -4
  1153. data/lib/fisk/instructions/vrsqrt28sd.rb +4 -4
  1154. data/lib/fisk/instructions/vrsqrt28ss.rb +4 -4
  1155. data/lib/fisk/instructions/vrsqrtps.rb +8 -8
  1156. data/lib/fisk/instructions/vrsqrtss.rb +4 -4
  1157. data/lib/fisk/instructions/vscalefpd.rb +12 -12
  1158. data/lib/fisk/instructions/vscalefps.rb +12 -12
  1159. data/lib/fisk/instructions/vscalefsd.rb +4 -4
  1160. data/lib/fisk/instructions/vscalefss.rb +4 -4
  1161. data/lib/fisk/instructions/vscatterdpd.rb +6 -6
  1162. data/lib/fisk/instructions/vscatterdps.rb +6 -6
  1163. data/lib/fisk/instructions/vscatterpf0dpd.rb +1 -1
  1164. data/lib/fisk/instructions/vscatterpf0dps.rb +1 -1
  1165. data/lib/fisk/instructions/vscatterpf0qpd.rb +1 -1
  1166. data/lib/fisk/instructions/vscatterpf0qps.rb +1 -1
  1167. data/lib/fisk/instructions/vscatterpf1dpd.rb +1 -1
  1168. data/lib/fisk/instructions/vscatterpf1dps.rb +1 -1
  1169. data/lib/fisk/instructions/vscatterpf1qpd.rb +1 -1
  1170. data/lib/fisk/instructions/vscatterpf1qps.rb +1 -1
  1171. data/lib/fisk/instructions/vscatterqpd.rb +6 -6
  1172. data/lib/fisk/instructions/vscatterqps.rb +6 -6
  1173. data/lib/fisk/instructions/vshuff32x4.rb +12 -12
  1174. data/lib/fisk/instructions/vshuff64x2.rb +12 -12
  1175. data/lib/fisk/instructions/vshufi32x4.rb +12 -12
  1176. data/lib/fisk/instructions/vshufi64x2.rb +12 -12
  1177. data/lib/fisk/instructions/vshufpd.rb +30 -30
  1178. data/lib/fisk/instructions/vshufps.rb +30 -30
  1179. data/lib/fisk/instructions/vsqrtpd.rb +20 -20
  1180. data/lib/fisk/instructions/vsqrtps.rb +20 -20
  1181. data/lib/fisk/instructions/vsqrtsd.rb +8 -8
  1182. data/lib/fisk/instructions/vsqrtss.rb +8 -8
  1183. data/lib/fisk/instructions/vstmxcsr.rb +1 -1
  1184. data/lib/fisk/instructions/vsubpd.rb +20 -20
  1185. data/lib/fisk/instructions/vsubps.rb +20 -20
  1186. data/lib/fisk/instructions/vsubsd.rb +8 -8
  1187. data/lib/fisk/instructions/vsubss.rb +8 -8
  1188. data/lib/fisk/instructions/vtestpd.rb +8 -8
  1189. data/lib/fisk/instructions/vtestps.rb +8 -8
  1190. data/lib/fisk/instructions/vucomisd.rb +8 -8
  1191. data/lib/fisk/instructions/vucomiss.rb +8 -8
  1192. data/lib/fisk/instructions/vunpckhpd.rb +20 -20
  1193. data/lib/fisk/instructions/vunpckhps.rb +20 -20
  1194. data/lib/fisk/instructions/vunpcklpd.rb +20 -20
  1195. data/lib/fisk/instructions/vunpcklps.rb +20 -20
  1196. data/lib/fisk/instructions/vxorpd.rb +20 -20
  1197. data/lib/fisk/instructions/vxorps.rb +20 -20
  1198. data/lib/fisk/instructions/xadd.rb +36 -36
  1199. data/lib/fisk/instructions/xchg.rb +84 -84
  1200. data/lib/fisk/instructions/xor.rb +125 -125
  1201. data/lib/fisk/instructions/xorpd.rb +9 -9
  1202. data/lib/fisk/instructions/xorps.rb +9 -9
  1203. data/lib/fisk/version.rb +3 -0
  1204. data/test/helper.rb +5 -0
  1205. data/test/test_cfg.rb +246 -0
  1206. data/test/test_fisk.rb +108 -6
  1207. data/test/test_register_allocation.rb +201 -0
  1208. data/test/test_run_fisk.rb +6 -6
  1209. metadata +9 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0809155eef95d321b2e39b2c3a801f5ed987f74e409ba40285a30f530964c558'
4
- data.tar.gz: 0b44765ae9dd4d4611c9db1af5a49bbe8659ce4dba3e6a7ac8887e17ebdb6e4a
3
+ metadata.gz: 42d5818c354d7ee2347266ca997e314615a23f832687a30dc05578a2e92b6310
4
+ data.tar.gz: '06428fa873eed75d9ee07bdedd1fa848a51dfaa826dd38ce661c6b267509e3a8'
5
5
  SHA512:
6
- metadata.gz: 1835a32e1579e07b1a7cf101a85ea94dee3471cb2c5c64e66a385a59807b8c049e1218c8b8152d7aa562757d585d3d7700b435b5791fd42ddaccabf99a403973
7
- data.tar.gz: 90a32029797fb6f0a101fcfc81e3352e69294ac2bd02a48f9f3e077dde900b4d3a917e413b4f65be599cdf3a0fd4f3b0a5419a043774d16292eae9821aaa6e82
6
+ metadata.gz: 5ccbb718f81f5856f19dfca980a3f7d39e7a96cdc8dcd43922fb7e90e89d16d87d20cb07ccc54cf09809a9c3020504ab3ea8742bad65b77edc83cf94015c5794
7
+ data.tar.gz: 8e9182cb31c8d29dd260e35d607a525536a5964cacc814898a2ac696ec3f8f2b9671f982a698c8b725e380eb7bff54c07f1a84c6bbc25540ab7bfcd0388ca8e6
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Fisk - A Pure Ruby Assembler
2
2
 
3
+ Tired of writing Ruby in Ruby? Now you can write assembly in Ruby with Fisk!
4
+
3
5
  This is a pure Ruby x86-64 assembler (I guess). I'm not 100% sure if it counts
4
6
  as pure Ruby because it just reads an XML file and metaprograms most of it.
5
7
  Anyway, you can use it to write assembly in Ruby, then have it assembled.
@@ -24,7 +26,60 @@ binary = fisk.asm do
24
26
  end
25
27
  ```
26
28
 
27
- Though, it's not very fun to assemble something unless you can execute it. So
29
+ Fisk uses Intel assembly syntax, so the first operand is the *destination*, and
30
+ the second operand is the source. So for example `mov rax, imm8(1)` means "put
31
+ an immediate that is 8 bits wide with the value of 1 in the RAX register".
32
+
33
+ ## Sizes and Memory Operands
34
+
35
+ In order to select the right x86 instruction to emit, Fisk needs to know the
36
+ types of the operands. Register types are already implied, but things like
37
+ immediates and memory operands need to be specified.
38
+
39
+ Below are a few examples.
40
+
41
+ Putting a 32 bit immediate in the RAX register:
42
+
43
+ ```ruby
44
+ mov rax, imm32(0xFFF)
45
+ ```
46
+
47
+ Dereferencing the value in RAX and storing the value in the RAX register:
48
+
49
+ ```ruby
50
+ mov rax, m64(rax)
51
+ ```
52
+
53
+ Dereferencing the value 8 bytes away RAX and storing the value in the R9 register:
54
+
55
+ ```ruby
56
+ mov r9, m64(rax, 8)
57
+ ```
58
+
59
+ ## Register Allocation
60
+
61
+ Fisk supports simple register assignment. You can make temporary registers,
62
+ then have Fisk assign registers for you. For example:
63
+
64
+ ```ruby
65
+ fisk = Fisk.new
66
+
67
+ # Make some temporary registers
68
+ reg1 = fisk.register("temp1")
69
+ reg2 = fisk.register("temp2")
70
+
71
+ # XOR the two virtual registers
72
+ fisk.xor reg1, reg2
73
+
74
+ # Ask Fisk to assign registers from the pool of registers passed in
75
+ fisk.assign_registers([fisk.r9, fisk.r10])
76
+ ```
77
+
78
+ Currently, Fisk won't spill registers for you, it just raises an exception.
79
+
80
+ ## Executing Assembly
81
+
82
+ Now, it's not very fun to assemble something unless you can execute it. So
28
83
  here is an example of how to execute the above assembly. This assembly code
29
84
  will send an interrupt and tell the debugger to stop. So let's write the
30
85
  machine code to some executable memory, and call it from a Ruby program that we
data/bin/build-machine.rb CHANGED
@@ -8,7 +8,7 @@ def parse_rex v
8
8
  when /^(\d+)$/
9
9
  v
10
10
  when /^#(\d+)$/
11
- "(operands[#{$1.to_i}].value >> 3)"
11
+ "operands[#{$1.to_i}].rex_value"
12
12
  else
13
13
  raise NotImplementedError, v
14
14
  end
@@ -23,7 +23,7 @@ def parse_operand_value v
23
23
  when /^(\d+)$/
24
24
  v
25
25
  when /^#(\d+)$/
26
- "operands[#{$1.to_i}].value"
26
+ "operands[#{$1.to_i}].op_value"
27
27
  else
28
28
  raise NotImplementedError, v
29
29
  end
data/fisk.gemspec CHANGED
@@ -1,6 +1,10 @@
1
+ $: << File.expand_path("lib")
2
+
3
+ require "fisk/version"
4
+
1
5
  Gem::Specification.new do |s|
2
6
  s.name = "fisk"
3
- s.version = "2.0.0"
7
+ s.version = Fisk::VERSION
4
8
  s.summary = "Write assembly in Ruby!"
5
9
  s.description = "Tired of writing Ruby in Ruby? Now you can write assembly in Ruby!"
6
10
  s.authors = ["Aaron Patterson"]
data/lib/fisk.rb CHANGED
@@ -1,32 +1,85 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "stringio"
4
+ require "set"
5
+
4
6
  require "fisk/instructions"
7
+ require "fisk/basic_block"
8
+ require "fisk/errors"
9
+ require "fisk/version"
5
10
 
6
11
  class Fisk
7
- class Operand < Struct.new(:value)
8
- def type; value; end
12
+ class Operand
9
13
  def works? type; self.type == type; end
10
14
  def unknown_label?; false; end
15
+ def register?; false; end
16
+ def temp_register?; false; end
11
17
  def extended_register?; false; end
12
18
  def m64?; false; end
19
+
20
+ def rex_value
21
+ value >> 3
22
+ end
23
+
24
+ def op_value
25
+ value
26
+ end
27
+ end
28
+
29
+ class ValueOperand < Operand
30
+ attr_reader :value
31
+ alias :type :value
32
+
33
+ def initialize value
34
+ @value = value
35
+ end
13
36
  end
14
37
 
15
38
  module Registers
16
39
  class Register < Operand
17
- attr_reader :name, :type
40
+ attr_reader :name, :type, :value
18
41
 
19
42
  def initialize name, type, value
20
43
  @name = name
21
44
  @type = type
22
- super(value)
45
+ @value = value
23
46
  end
24
47
 
25
48
  def works? type
26
49
  type == self.name || type == self.type
27
50
  end
28
51
 
29
- def extended_register?; value > 7; end
52
+ def op_value
53
+ value & 0x7
54
+ end
55
+
56
+ def extended_register?; @value > 7; end
57
+ end
58
+
59
+ class Temp < Operand
60
+ attr_reader :name, :type
61
+ attr_accessor :register, :start_point, :end_point
62
+
63
+ def initialize name, type
64
+ @name = name
65
+ @type = type
66
+ @start_point = nil
67
+ @end_point = nil
68
+ end
69
+
70
+ def temp_register?; true; end
71
+
72
+ def extended_register?
73
+ @register.extended_register?
74
+ end
75
+
76
+ def rex_value
77
+ @register.rex_value
78
+ end
79
+
80
+ def value
81
+ @register.value
82
+ end
30
83
  end
31
84
 
32
85
  EAX = Register.new "eax", "r32", 0
@@ -50,6 +103,12 @@ class Fisk
50
103
  i += 8
51
104
  const_set "R#{i}", Register.new("r#{i}", "r64", i)
52
105
  end
106
+
107
+ # List of *caller* saved registers for the C calling convention
108
+ CALLER_SAVED = [ RDI, RSI, RDX, RCX, R8, R9, R10, R11 ]
109
+
110
+ # List of *callee* saved registers for the C calling convention
111
+ CALLEE_SAVED = [ RBX, RSP, RBP, R12, R13, R14, R15 ]
53
112
  end
54
113
 
55
114
 
@@ -57,11 +116,14 @@ class Fisk
57
116
  attr_reader :displacement
58
117
 
59
118
  def initialize register, displacement
60
- super(register.value)
61
119
  @register = register
62
120
  @displacement = displacement
63
121
  end
64
122
 
123
+ def value
124
+ @register.value
125
+ end
126
+
65
127
  def type
66
128
  "m64"
67
129
  end
@@ -73,62 +135,50 @@ class Fisk
73
135
  M64.new x, displacement
74
136
  end
75
137
 
76
- class Imm8 < Operand
77
- def type
78
- "imm8"
79
- end
80
- end
81
-
82
- class Imm32 < Operand
83
- def type
84
- "imm32"
85
- end
86
- end
138
+ # Define all immediate value methods of different sizes
139
+ [8, 16, 32, 64].each do |size|
140
+ class_eval <<~eostr, __FILE__, __LINE__ + 1
141
+ class Imm#{size} < ValueOperand
142
+ def type
143
+ "imm#{size}"
144
+ end
145
+ end
87
146
 
88
- class Imm64 < Operand
89
- def type
90
- "imm64"
91
- end
147
+ def imm#{size} val; Imm#{size}.new(val.to_i); end
148
+ eostr
92
149
  end
93
150
 
94
- class Rel8 < Operand
151
+ class Rel8 < ValueOperand
95
152
  def type
96
153
  "rel8"
97
154
  end
98
155
  end
99
156
 
100
- class Rel32 < Operand
157
+ class Rel32 < ValueOperand
101
158
  def type
102
159
  "rel32"
103
160
  end
104
161
  end
105
162
 
106
- class MOffs64 < Operand
163
+ class MOffs64 < ValueOperand
107
164
  def type
108
165
  "moffs64"
109
166
  end
110
167
  end
111
168
 
112
- class Lit < Operand
169
+ class Lit < ValueOperand
113
170
  def type
114
171
  value.to_s
115
172
  end
116
173
  end
117
174
 
118
- attr_reader :position
119
-
120
- def initialize
121
- @instructions = []
122
- @labels = {}
123
- @position = 0
124
- end
125
-
126
175
  class UnknownLabel < Struct.new(:name)
127
176
  def works? type
128
177
  type == "rel32"
129
178
  end
130
179
 
131
180
  def unknown_label?; true; end
181
+ def temp_register?; false; end
132
182
 
133
183
  def value
134
184
  label = assembler.label_for(name)
@@ -138,19 +188,8 @@ class Fisk
138
188
 
139
189
  class Label < Struct.new(:name)
140
190
  def label?; true; end
141
- end
142
-
143
- def label name
144
- UnknownLabel.new(name)
145
- end
146
-
147
- def make_label name
148
- @instructions << Label.new(name)
149
- end
150
-
151
- Registers.constants.grep(/^[A-Z0-9]*$/).each do |const|
152
- val = Registers.const_get const
153
- define_method(const.downcase) { val }
191
+ def jump?; false; end
192
+ def has_temp_registers?; false; end
154
193
  end
155
194
 
156
195
  class Instruction
@@ -160,6 +199,18 @@ class Fisk
160
199
  @operands = operands
161
200
  end
162
201
 
202
+ def jump?
203
+ false
204
+ end
205
+
206
+ def has_temp_registers?
207
+ @operands.any?(&:temp_register?)
208
+ end
209
+
210
+ def temp_registers
211
+ @operands.find_all(&:temp_register?)
212
+ end
213
+
163
214
  def encodings
164
215
  @form.encodings
165
216
  end
@@ -185,6 +236,16 @@ class Fisk
185
236
  @saved_pos = nil
186
237
  end
187
238
 
239
+ def jump?
240
+ true
241
+ end
242
+
243
+ def target
244
+ @operand.name
245
+ end
246
+
247
+ def has_temp_registers?; false; end
248
+
188
249
  def encode buffer, labels
189
250
  # Estimate by using a rel32 offset
190
251
  form = find_form "rel32"
@@ -228,22 +289,147 @@ class Fisk
228
289
  end
229
290
  end
230
291
 
292
+ def initialize
293
+ @instructions = []
294
+ @labels = {}
295
+ # A set of temp registers recorded as we see them (not at allocation time)
296
+ @temp_registers = Set.new
297
+ yield self if block_given?
298
+ end
299
+
300
+ # Mark a temporary register as "done being used" at this point in the
301
+ # instructions. Using the register after passing the register to this
302
+ # method results in undefined behavior.
303
+ def release_register reg
304
+ if reg.end_point
305
+ raise Errors::AlreadyReleasedError, "register #{reg.name} already released at #{reg.end_point}"
306
+ end
307
+
308
+ reg.end_point = (@instructions.length - 1)
309
+ end
310
+
311
+ # Releases all registers that haven't already been released
312
+ def release_all_registers
313
+ @temp_registers.each do |reg|
314
+ next if reg.end_point
315
+ release_register reg
316
+ end
317
+ end
318
+
319
+ # Return a list of basic blocks for the instructions
320
+ def basic_blocks
321
+ cfg.blocks
322
+ end
323
+
324
+ # Return a cfg for these instructions. The CFG includes connected basic
325
+ # blocks as well as any temporary registers
326
+ def cfg
327
+ CFG.build @instructions
328
+ end
329
+
330
+ # Create a label to be used with jump instructions. For example:
331
+ #
332
+ # fisk.jmp(fisk.label(:foo))
333
+ # fisk.int(lit(3))
334
+ # fisk.put_label(:foo)
335
+ #
336
+ def label name
337
+ UnknownLabel.new(name)
338
+ end
339
+
340
+ # Insert a label named +name+ at the current position in the instructions.
341
+ def put_label name
342
+ @instructions << Label.new(name)
343
+ self
344
+ end
345
+ alias :make_label :put_label
346
+
347
+ # Allocate and return a new register. These registers will be replaced with
348
+ # real registers when `assign_registers` is called.
349
+ def register name = "temp"
350
+ Registers::Temp.new name, "r64"
351
+ end
352
+
353
+ # Assign registers to any temporary registers. Only registers in +list+
354
+ # will be used when selecting register assignments
355
+ def assign_registers list, local: false
356
+ temp_registers = @temp_registers
357
+
358
+ # This mutates the temp registers, setting their end_point based on
359
+ # the CFG
360
+ self.cfg unless local
361
+
362
+ temp_registers.each do |reg|
363
+ unless reg.end_point
364
+ raise Errors::UnreleasedRegisterError, "Register #{reg.name} hasn't been released"
365
+ end
366
+ end
367
+
368
+ temp_registers = temp_registers.sort_by(&:start_point)
369
+
370
+ active = []
371
+ free_registers = list.reverse
372
+ register_count = list.length
373
+
374
+ temp_registers.each do |temp_reg|
375
+ # expire old intervals
376
+ active, dead = active.sort_by(&:end_point).partition do |j|
377
+ j.end_point >= temp_reg.start_point
378
+ end
379
+
380
+ # Add unused registers back to the free register list
381
+ dead.each { |tr| free_registers << tr.register }
382
+
383
+ if active.length == register_count
384
+ raise NotImplementedError, "Register spilled"
385
+ end
386
+
387
+ temp_reg.register = free_registers.pop
388
+ active << temp_reg
389
+ end
390
+ end
391
+
392
+ Registers.constants.grep(/^[A-Z0-9]*$/).each do |const|
393
+ val = Registers.const_get const
394
+ define_method(const.downcase) { val }
395
+ end
396
+
231
397
  include Fisk::Instructions::DSLMethods
232
398
 
233
399
  def moffs64 val
234
400
  MOffs64.new val
235
401
  end
236
402
 
237
- def imm8 val
238
- Imm8.new val
239
- end
240
-
241
- def imm32 val
242
- Imm32.new val
403
+ # Create a signed immediate value of the right width
404
+ def imm val
405
+ if val >= -0x7F - 1 && val <= 0x7F
406
+ imm8 val
407
+ elsif val >= -0x7FFF - 1 && val <= 0x7FFF
408
+ imm16 val
409
+ elsif val >= -0x7FFFFFFF - 1 && val <= 0x7FFFFFFF
410
+ imm32 val
411
+ elsif val >= -0x7FFFFFFFFFFFFFFF - 1 && val <= 0x7FFFFFFFFFFFFFFF
412
+ imm64 val
413
+ else
414
+ raise ArgumentError, "#{val} is larger than a 64 bit int"
415
+ end
243
416
  end
244
417
 
245
- def imm64 val
246
- Imm64.new val
418
+ # Create an unsigned immediate value of the right width
419
+ def uimm val
420
+ if val < 0
421
+ raise ArgumentError, "#{val} is negative"
422
+ elsif val <= 0xFF
423
+ imm8 val
424
+ elsif val <= 0xFFFF
425
+ imm16 val
426
+ elsif val <= 0xFFFFFFFF
427
+ imm32 val
428
+ elsif val <= 0xFFFFFFFFFFFFFFFF
429
+ imm64 val
430
+ else
431
+ raise ArgumentError, "#{val} is too large for a 64 bit int"
432
+ end
247
433
  end
248
434
 
249
435
  def rel8 val
@@ -255,26 +441,34 @@ class Fisk
255
441
  end
256
442
 
257
443
  def lit val
258
- # to_s because we're getting the value from JSON as a string
259
444
  Lit.new val
260
445
  end
261
446
 
447
+ # Instance eval's a given block and writes encoded instructions to +buf+.
448
+ # For example:
449
+ #
450
+ # fisk = Fisk.new
451
+ # fisk.asm do
452
+ # mov r9, imm64(32)
453
+ # end
454
+ #
262
455
  def asm buf = StringIO.new(''.b), &block
263
- @position = 0
264
456
  instance_eval(&block)
265
- write_to_buffer buf
457
+ write_to buf
266
458
  buf
267
459
  end
268
460
 
461
+ # Encodes all instructions and returns a binary string with the encoded
462
+ # instructions.
269
463
  def to_binary
270
464
  io = StringIO.new ''.b
271
- write_to_buffer io
465
+ write_to io
272
466
  io.string
273
467
  end
274
468
 
275
- private
276
-
277
- def write_to_buffer buffer
469
+ # Encode all instructions and write them to +buffer+. +buffer+ should be an
470
+ # IO object.
471
+ def write_to buffer
278
472
  labels = {}
279
473
  unresolved = []
280
474
  @instructions.each do |insn|
@@ -294,6 +488,8 @@ class Fisk
294
488
  insn.encode buffer, labels
295
489
  end
296
490
  buffer.seek pos, IO::SEEK_SET
491
+
492
+ buffer
297
493
  end
298
494
 
299
495
  def gen_with_insn insns, params
@@ -307,20 +503,42 @@ class Fisk
307
503
  end
308
504
  end
309
505
 
310
- raise NotImplementedError, "couldn't find instruction #{name}" if forms.length == 0
506
+ if forms.length == 0
507
+ valid_forms = insns.forms.map { |form|
508
+ " #{insns.name} #{form.operands.map(&:type).join(", ")}"
509
+ }.join "\n"
510
+ msg = <<~eostr
511
+ Couldn't find instruction #{insns.name} #{params.map(&:type).join(", ")}
512
+ Valid forms:
513
+ #{valid_forms}
514
+ eostr
515
+ raise NotImplementedError, msg
516
+ end
517
+
518
+ form = forms.first
311
519
 
312
520
  insn = nil
313
521
 
314
- form = forms.first
522
+ params.each do |param|
523
+ if param.unknown_label?
524
+ if params.length > 1
525
+ raise ArgumentError, "labels only work with single param jump instructions"
526
+ end
527
+ insn = UnresolvedInstruction.new(insns, form, params.first)
528
+ end
529
+
530
+ if param.temp_register?
531
+ if param.end_point
532
+ raise Errors::UseAfterInvalidationError, "Register #{param.name} used after release"
533
+ end
534
+ @temp_registers << param
535
+
536
+ param.start_point ||= @instructions.length
537
+ end
538
+ end
539
+
540
+ insn ||= Instruction.new(insns, form, params)
315
541
 
316
- insn = if params.any?(&:unknown_label?)
317
- if params.length > 1
318
- raise ArgumentError, "labels only work with single param jump instructions"
319
- end
320
- UnresolvedInstruction.new(insns, form, params.first)
321
- else
322
- Instruction.new(insns, form, params)
323
- end
324
542
  @instructions << insn
325
543
 
326
544
  self