NASM 2.06rc8
[nasm/avx512.git] / misc / genfma.pl
blob8f849c272175d9023ecc0fb922b1273e431187c6
1 #!/usr/bin/perl
2 %packed_insns = (
3 'vfmadd' => 0x98,
4 'vfmaddsub' => 0x96,
5 'vfmsubadd' => 0x97,
6 'vfmsub' => 0x9a,
7 'vfnmadd' => 0x9c,
8 'vfnmsub' => 0x9e
9 );
11 %scalar_insns = (
12 'vfmadd' => 0x99,
13 'vfmsub' => 0x9b,
14 'vfnmadd' => 0x9d,
15 'vfnmsub' => 0x9f
18 foreach $pi ( sort(keys(%packed_insns)) ) {
19 $op = $packed_insns{$pi};
20 foreach $order ('132', '213', '231') {
21 $xorder = substr($order,1,1).substr($order,0,1).substr($order,2,1);
22 foreach $o ($order, $xorder) {
23 for ($w = 0; $w < 2; $w++) {
24 $suf = $w ? 'pd' : 'ps';
25 for ($l = 128; $l <= 256; $l <<= 1) {
26 $sx = ($l == 256) ? 'SY' : 'SO';
27 $mm = ($l == 256) ? 'ymm' : 'xmm';
28 printf "%-15s %-31s %-8s%-39s %s\n",
29 "\U${pi}${o}${suf}",
30 "${mm}reg,${mm}reg,${mm}rm",
31 "[rvm:",
32 sprintf("vex.dds.%d.66.0f38.w%d %02x /r]",
33 $l, $w, $op),
34 "FMA,FUTURE,${sx}";
35 printf "%-15s %-31s %-8s%-39s %s\n",
36 "\U${pi}${o}${suf}",
37 "${mm}reg,${mm}rm",
38 "[r+vm:",
39 sprintf("vex.dds.%d.66.0f38.w%d %02x /r]",
40 $l, $w, $op),
41 "FMA,FUTURE,${sx}";
45 $op += 0x10;
49 foreach $si ( sort(keys(%scalar_insns)) ) {
50 $op = $scalar_insns{$si};
51 foreach $order ('132', '213', '231') {
52 $xorder = substr($order,1,1).substr($order,0,1).substr($order,2,1);
53 foreach $o ($order, $xorder) {
54 for ($w = 0; $w < 2; $w++) {
55 $suf = $w ? 'sd' : 'ss';
56 $sx = $w ? 'SQ' : 'SD';
57 $l = 128;
58 $mm = 'xmm';
59 printf "%-15s %-31s %-8s%-39s %s\n",
60 "\U${si}${o}${suf}",
61 "${mm}reg,${mm}reg,${mm}rm",
62 '[rvm:',
63 sprintf("vex.dds.%d.66.0f38.w%d %02x /r]",
64 $l, $w, $op),
65 "FMA,FUTURE,${sx}";
66 printf "%-15s %-31s %-8s%-39s %s\n",
67 "\U${si}${o}${suf}",
68 "${mm}reg,${mm}rm",
69 '[r+vm:',
70 sprintf("vex.dds.%d.66.0f38.w%d %02x /r]",
71 $l, $w, $op),
72 "FMA,FUTURE,${sx}";
75 $op += 0x10;