Skip to content

Commit

Permalink
[doc] update setDefaultEncoding
Browse files Browse the repository at this point in the history
  • Loading branch information
herumi committed Oct 14, 2024
1 parent 220ca76 commit 46238d9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions doc/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ vfpclassps k5{k3}, [rax+64]{1to4}, 5 --> vfpclassps(k5|k3, yword_b [rax+64],
```

## Selecting AVX512-VNNI, AVX-VNNI, AVX-VNNI-INT8 etc.
Some mnemonics have two types of encodings: VEX and EVEX.
Some mnemonics have some types of encodings: VEX, EVEX, AVX10.2.
The functions for these mnemonics include an optional parameter as the last argument to specify the encoding.
The default behavior depends on the order in which the instruction was introduced (whether VEX or EVEX came first),
and can be specified using setDefaultEncoding.
Expand All @@ -124,19 +124,20 @@ vpdpbusd(xm0, xm1, xm2); // VEX
vmpsadbw(xm1, xm3, xm15, 3); // default encoding: VEX (AVX-VNNI)
vmpsadbw(xm1, xm3, xm15, 3, VexEncoding); // same as the above
vmpsadbw(xm1, xm3, xm15, 3, EvexEncoding); // EVEX (AVX10.2)
setDefaultEncoding(VexEncoding, EvexEncoding); // use 2nd argument.
vmpsadbw(xm1, xm3, xm15, 3); // EVEX
setDefaultEncoding(VexEncoding, AVX10p2Encoding); // use 2nd argument.
vmpsadbw(xm1, xm3, xm15, 3); // EVEX (AVX10.2)
```

- `setDefaultEncoding(PreferredEncoding vnniEnc = EvexEncoding, PreferredEncoding avx10Enc = VexEncoding)`
Control the default encoding of mnemonics with `Xbyak::PreferredEncoding` param.

param|vnniEnc|avx10Enc
-|-|-
EvexEncoding|AVX512-VNNI|AVX10.2
VexEncoding|AVX-VNNI|AVX-VNNI-INT8
EvexEncoding|AVX512-VNNI|-
AVX10p2Encoding|-|AVX10.2
default|EvexEncoding|VexEncoding
mnemonic|vpdpbusd, vpdpbusds, vpdpwssd, vpdpwssds|vmpsadbw, vpdpbssd, vpdpbssds, vpdpbsud, vpdpbsuds, vpdpbuud, vpdpbuuds, vpdpwsud vpdpwsuds vpdpwusd vpdpwusds vpdpwuud, vpdpwuuds
mnemonic|vpdpbusd, vpdpbusds, vpdpwssd, vpdpwssds|vmpsadbw, vpdpbssd, vpdpbssds, vpdpbsud, vpdpbsuds, vpdpbuud, vpdpbuuds, vpdpwsud vpdpwsuds vpdpwusd vpdpwusds vpdpwuud, vpdpwuuds, vmovd, vmovw

### Remark
* `k1`, ..., `k7` are opmask registers.
Expand Down

0 comments on commit 46238d9

Please sign in to comment.