feat(arch): add the amd64 fp16 packed conversion family

Assisted-by: GLM 5.3
This commit is contained in:
petrbalvin committed 2026-10-07 13:51:48 +02:00
1 parent fb6d01a7d0
commit 8de1b371da
4 files changed
+659 -34

No files matched your search

+22 -2
View File
@@ -444,6 +444,18 @@ const (
// half-width companion of the source, equal at 128 bits: VCVTNEPS2BF16
// Y6, Z5. Operands: src, dest.
ExtFormAmdVec2Half
// ExtFormAmdVec2Wide is the two-vector form whose source is the half-width
// companion of the destination, equal at 128 bits: VCVTPH2DQ Z6, Y5, where
// L'L names the destination. Operands: src, dest.
ExtFormAmdVec2Wide
// ExtFormAmdVec2Quarter is the two-vector form whose source is the
// quarter-width companion of the destination, the XMM class at every
// length: VCVTPH2QQ Z6, X5. Operands: src, dest.
ExtFormAmdVec2Quarter
// ExtFormAmdVec2ToQuarter is the two-vector form whose destination is the
// quarter-width companion of the source, the XMM class at every length:
// VCVTQQ2PH X6, Z5. Operands: src, dest.
ExtFormAmdVec2ToQuarter
// ExtFormAmdMask2 is the form with an opmask destination and two vector
// sources: VP2INTERSECTD K0, Z2, Z1. Operands: src1, src2, dest.
ExtFormAmdMask2
@@ -668,7 +680,8 @@ func (f ExtForm) Arity() int {
return 2
case ExtFormAmdVec3, ExtFormAmdMask2, ExtFormAmdVecGprVec:
return 3
case ExtFormAmdVec2, ExtFormAmdVec2Half, ExtFormAmdGprVec, ExtFormAmdVecGpr:
case ExtFormAmdVec2, ExtFormAmdVec2Half, ExtFormAmdVec2Wide, ExtFormAmdVec2Quarter,
ExtFormAmdVec2ToQuarter, ExtFormAmdGprVec, ExtFormAmdVecGpr:
return 2
case ExtFormAmdVec3Imm, ExtFormAmdMask2Imm:
return 4
@@ -777,6 +790,12 @@ func (f ExtForm) String() string {
return "two vectors"
case ExtFormAmdVec2Half:
return "two vectors, half-width destination"
case ExtFormAmdVec2Wide:
return "two vectors, half-width source"
case ExtFormAmdVec2Quarter:
return "two vectors, quarter-width source"
case ExtFormAmdVec2ToQuarter:
return "two vectors, quarter-width destination"
case ExtFormAmdMask2:
return "two vectors into an opmask"
case ExtFormAmdVecGprVec:
@@ -1037,7 +1056,8 @@ func (in ExtInstr) Encode(ops []ExtOperand) ([]byte, error) {
return in.encodeSignedImmediate(ops)
case ExtFormAmdVec3, ExtFormAmdVec2, ExtFormAmdVec2Half, ExtFormAmdMask2,
ExtFormAmdVecGprVec, ExtFormAmdGprVec, ExtFormAmdVecGpr,
ExtFormAmdVec3Imm, ExtFormAmdMask2Imm, ExtFormAmdMemVec, ExtFormAmdVecMem:
ExtFormAmdVec3Imm, ExtFormAmdMask2Imm, ExtFormAmdMemVec, ExtFormAmdVecMem,
ExtFormAmdVec2Wide, ExtFormAmdVec2Quarter, ExtFormAmdVec2ToQuarter:
return in.encodeAmd64(ops)
case ExtFormPredicateLogical, ExtFormPredicateSelect:
return in.encodePredicateLogical(ops)