| 1 | package opcodesextra |
| 2 | |
| 3 | import "github.com/mmcloughlin/avo/internal/inst" |
| 4 | |
| 5 | // Reference: https://github.com/golang/go/blob/go1.19.3/src/cmd/internal/obj/x86/avx_optabs.go#L376-L383 |
| 6 | // |
| 7 | // var _yvexpandpd = []ytab{ |
| 8 | // {zcase: Zevex_rm_v_r, zoffset: 0, args: argList{YxmEvex, YxrEvex}}, |
| 9 | // {zcase: Zevex_rm_k_r, zoffset: 3, args: argList{YxmEvex, Yknot0, YxrEvex}}, |
| 10 | // {zcase: Zevex_rm_v_r, zoffset: 0, args: argList{YymEvex, YyrEvex}}, |
| 11 | // {zcase: Zevex_rm_k_r, zoffset: 3, args: argList{YymEvex, Yknot0, YyrEvex}}, |
| 12 | // {zcase: Zevex_rm_v_r, zoffset: 0, args: argList{Yzm, Yzr}}, |
| 13 | // {zcase: Zevex_rm_k_r, zoffset: 3, args: argList{Yzm, Yknot0, Yzr}}, |
| 14 | // } |
| 15 | func _yvexpandpd(isa, bcst string) inst.Forms { |
| 16 | return inst.Forms{ |
| 17 | // EVEX.128.66.0F38.W0 62 /r VPEXPANDB xmm1{k1}{z}, m128 A V/V AVX512_VBMI2 AVX512VL |
| 18 | { |
| 19 | ISA: []string{isa, "AVX512VL"}, |
| 20 | Operands: []inst.Operand{ |
| 21 | {Type: "m128" + bcst, Action: inst.R}, |
| 22 | {Type: "xmm{k}{z}", Action: inst.W}, |
| 23 | }, |
| 24 | EncodingType: inst.EncodingTypeEVEX, |
| 25 | }, |
| 26 | // EVEX.128.66.0F38.W0 62 /r VPEXPANDB xmm1{k1}{z}, xmm2 B V/V AVX512_VBMI2 AVX512VL |
| 27 | { |
| 28 | ISA: []string{isa, "AVX512VL"}, |
| 29 | Operands: []inst.Operand{ |
| 30 | {Type: "xmm", Action: inst.R}, |
| 31 | {Type: "xmm{k}{z}", Action: inst.W}, |
| 32 | }, |
| 33 | EncodingType: inst.EncodingTypeEVEX, |
| 34 | }, |
| 35 | // EVEX.256.66.0F38.W0 62 /r VPEXPANDB ymm1{k1}{z}, m256 A V/V AVX512_VBMI2 AVX512VL |
| 36 | { |
| 37 | ISA: []string{isa, "AVX512VL"}, |
| 38 | Operands: []inst.Operand{ |
| 39 | {Type: "m256" + bcst, Action: inst.R}, |
| 40 | {Type: "ymm{k}{z}", Action: inst.W}, |
| 41 | }, |
| 42 | EncodingType: inst.EncodingTypeEVEX, |
| 43 | }, |
| 44 | // EVEX.256.66.0F38.W0 62 /r VPEXPANDB ymm1{k1}{z}, ymm2 B V/V AVX512_VBMI2 AVX512VL |
| 45 | { |
| 46 | ISA: []string{isa, "AVX512VL"}, |
| 47 | Operands: []inst.Operand{ |
| 48 | {Type: "ymm", Action: inst.R}, |
| 49 | {Type: "ymm{k}{z}", Action: inst.W}, |
| 50 | }, |
| 51 | EncodingType: inst.EncodingTypeEVEX, |
| 52 | }, |
| 53 | // EVEX.512.66.0F38.W0 62 /r VPEXPANDB zmm1{k1}{z}, m512 A V/V AVX512_VBMI2 |
| 54 | { |
| 55 | ISA: []string{isa}, |
| 56 | Operands: []inst.Operand{ |
| 57 | {Type: "m512" + bcst, Action: inst.R}, |
| 58 | {Type: "zmm{k}{z}", Action: inst.W}, |
| 59 | }, |
| 60 | EncodingType: inst.EncodingTypeEVEX, |
| 61 | }, |
| 62 | // EVEX.512.66.0F38.W0 62 /r VPEXPANDB zmm1{k1}{z}, zmm2 B V/V AVX512_VBMI2 |
| 63 | { |
| 64 | ISA: []string{isa}, |
| 65 | Operands: []inst.Operand{ |
| 66 | {Type: "zmm", Action: inst.R}, |
| 67 | {Type: "zmm{k}{z}", Action: inst.W}, |
| 68 | }, |
| 69 | EncodingType: inst.EncodingTypeEVEX, |
| 70 | }, |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | // _yvblendmpd family of forms shared by various instruction sets, for example |
| 75 | // the VBMI2 VPSH{L,R}DV{W,D,Q} instructions and VNNI. |
| 76 | // |
| 77 | // Reference: https://github.com/golang/go/blob/go1.19.3/src/cmd/internal/obj/x86/avx_optabs.go#L148-L155 |
| 78 | // |
| 79 | // var _yvblendmpd = []ytab{ |
| 80 | // {zcase: Zevex_rm_v_r, zoffset: 0, args: argList{YxmEvex, YxrEvex, YxrEvex}}, |
| 81 | // {zcase: Zevex_rm_v_k_r, zoffset: 3, args: argList{YxmEvex, YxrEvex, Yknot0, YxrEvex}}, |
| 82 | // {zcase: Zevex_rm_v_r, zoffset: 0, args: argList{YymEvex, YyrEvex, YyrEvex}}, |
| 83 | // {zcase: Zevex_rm_v_k_r, zoffset: 3, args: argList{YymEvex, YyrEvex, Yknot0, YyrEvex}}, |
| 84 | // {zcase: Zevex_rm_v_r, zoffset: 0, args: argList{Yzm, Yzr, Yzr}}, |
| 85 | // {zcase: Zevex_rm_v_k_r, zoffset: 3, args: argList{Yzm, Yzr, Yknot0, Yzr}}, |
| 86 | // } |
| 87 | func _yvblendmpd(isa, bcst string) inst.Forms { |
| 88 | return inst.Forms{ |
| 89 | // EVEX.128.66.0F38.W1 70 /r VPSHLDVW xmm1{k1}{z}, xmm2, xmm3/m128 A V/V AVX512_VBMI2 AVX512VL |
| 90 | // EVEX.128.66.0F38.W0 71 /r VPSHLDVD xmm1{k1}{z}, xmm2, xmm3/m128/m32bcst B V/V AVX512_VBMI2 AVX512VL |
| 91 | // EVEX.128.66.0F38.W1 71 /r VPSHLDVQ xmm1{k1}{z}, xmm2, xmm3/m128/m64bcst B V/V AVX512_VBMI2 AVX512VL |
| 92 | { |
| 93 | ISA: []string{isa, "AVX512VL"}, |
| 94 | Operands: []inst.Operand{ |
| 95 | {Type: "xmm", Action: inst.R}, |
| 96 | {Type: "xmm", Action: inst.R}, |
| 97 | {Type: "xmm{k}{z}", Action: inst.RW}, |
| 98 | }, |
| 99 | EncodingType: inst.EncodingTypeEVEX, |
| 100 | }, |
| 101 | { |
| 102 | ISA: []string{isa, "AVX512VL"}, |
| 103 | Operands: []inst.Operand{ |
| 104 | {Type: "m128" + bcst, Action: inst.R}, |
| 105 | {Type: "xmm", Action: inst.R}, |
| 106 | {Type: "xmm{k}{z}", Action: inst.RW}, |
| 107 | }, |
| 108 | EncodingType: inst.EncodingTypeEVEX, |
| 109 | }, |
| 110 | // EVEX.256.66.0F38.W1 70 /r VPSHLDVW ymm1{k1}{z}, ymm2, ymm3/m256 A V/V AVX512_VBMI2 AVX512VL |
| 111 | // EVEX.256.66.0F38.W0 71 /r VPSHLDVD ymm1{k1}{z}, ymm2, ymm3/m256/m32bcst B V/V AVX512_VBMI2 AVX512VL |
| 112 | // EVEX.256.66.0F38.W1 71 /r VPSHLDVQ ymm1{k1}{z}, ymm2, ymm3/m256/m64bcst B V/V AVX512_VBMI2 AVX512VL |
| 113 | { |
| 114 | ISA: []string{isa, "AVX512VL"}, |
| 115 | Operands: []inst.Operand{ |
| 116 | {Type: "ymm", Action: inst.R}, |
| 117 | {Type: "ymm", Action: inst.R}, |
| 118 | {Type: "ymm{k}{z}", Action: inst.RW}, |
| 119 | }, |
| 120 | EncodingType: inst.EncodingTypeEVEX, |
| 121 | }, |
| 122 | { |
| 123 | ISA: []string{isa, "AVX512VL"}, |
| 124 | Operands: []inst.Operand{ |
| 125 | {Type: "m256" + bcst, Action: inst.R}, |
| 126 | {Type: "ymm", Action: inst.R}, |
| 127 | {Type: "ymm{k}{z}", Action: inst.RW}, |
| 128 | }, |
| 129 | EncodingType: inst.EncodingTypeEVEX, |
| 130 | }, |
| 131 | // EVEX.512.66.0F38.W1 70 /r VPSHLDVW zmm1{k1}{z}, zmm2, zmm3/m512 A V/V AVX512_VBMI2 |
| 132 | // EVEX.512.66.0F38.W0 71 /r VPSHLDVD zmm1{k1}{z}, zmm2, zmm3/m512/m32bcst B V/V AVX512_VBMI2 |
| 133 | // EVEX.512.66.0F38.W1 71 /r VPSHLDVQ zmm1{k1}{z}, zmm2, zmm3/m512/m64bcst B V/V AVX512_VBMI2 |
| 134 | { |
| 135 | ISA: []string{isa}, |
| 136 | Operands: []inst.Operand{ |
| 137 | {Type: "zmm", Action: inst.R}, |
| 138 | {Type: "zmm", Action: inst.R}, |
| 139 | {Type: "zmm{k}{z}", Action: inst.RW}, |
| 140 | }, |
| 141 | EncodingType: inst.EncodingTypeEVEX, |
| 142 | }, |
| 143 | { |
| 144 | ISA: []string{isa}, |
| 145 | Operands: []inst.Operand{ |
| 146 | {Type: "m512" + bcst, Action: inst.R}, |
| 147 | {Type: "zmm", Action: inst.R}, |
| 148 | {Type: "zmm{k}{z}", Action: inst.RW}, |
| 149 | }, |
| 150 | EncodingType: inst.EncodingTypeEVEX, |
| 151 | }, |
| 152 | } |
| 153 | } |