type evexBits … // newEVEXBits creates evexBits object from enc bytes at z position. func newEVEXBits(z int, enc *opBytes) evexBits { … } // P returns EVEX.pp value. func (evex evexBits) P() byte { … } // L returns EVEX.L'L value. func (evex evexBits) L() byte { … } // M returns EVEX.mm value. func (evex evexBits) M() byte { … } // W returns EVEX.W value. func (evex evexBits) W() byte { … } // BroadcastEnabled reports whether BCST suffix is permitted. func (evex evexBits) BroadcastEnabled() bool { … } // ZeroingEnabled reports whether Z suffix is permitted. func (evex evexBits) ZeroingEnabled() bool { … } // RoundingEnabled reports whether RN_SAE, RZ_SAE, RD_SAE and RU_SAE suffixes // are permitted. func (evex evexBits) RoundingEnabled() bool { … } // SaeEnabled reports whether SAE suffix is permitted. func (evex evexBits) SaeEnabled() bool { … } // DispMultiplier returns displacement multiplier that is calculated // based on tuple type, EVEX.W and input size. // If embedded broadcast is used, bcst should be true. func (evex evexBits) DispMultiplier(bcst bool) int32 { … } const evexW … const evexWIG … const evexW0 … const evexW1 … const evexM … const evex0F … const evex0F38 … const evex0F3A … const evexL … const evexLIG … const evex128 … const evex256 … const evex512 … const evexP … const evex66 … const evexF3 … const evexF2 … const evexN … const evexN1 … const evexN2 … const evexN4 … const evexN8 … const evexN16 … const evexN32 … const evexN64 … const evexN128 … const evexBcst … const evexBcstN4 … const evexBcstN8 … const evexZeroing … const evexZeroingEnabled … const evexRounding … const evexRoundingEnabled … const evexSae … const evexSaeEnabled … // compressedDisp8 calculates EVEX compressed displacement, if applicable. func compressedDisp8(disp, elemSize int32) (disp8 byte, ok bool) { … } // evexZcase reports whether given Z-case belongs to EVEX group. func evexZcase(zcase uint8) bool { … } type evexSuffix … const rcRNSAE … const rcRDSAE … const rcRUSAE … const rcRZSAE … const rcUnset … // newEVEXSuffix returns proper zero value for evexSuffix. func newEVEXSuffix() evexSuffix { … } var evexSuffixMap … func init() { … } // toDisp8 tries to convert disp to proper 8-bit displacement value. func toDisp8(disp int32, p *obj.Prog, asmbuf *AsmBuf) (disp8 byte, ok bool) { … } // EncodeRegisterRange packs [reg0-reg1] list into 64-bit value that // is intended to be stored inside obj.Addr.Offset with TYPE_REGLIST. func EncodeRegisterRange(reg0, reg1 int16) int64 { … } // decodeRegisterRange unpacks [reg0-reg1] list from 64-bit value created by EncodeRegisterRange. func decodeRegisterRange(list int64) (reg0, reg1 int) { … } // ParseSuffix handles the special suffix for the 386/AMD64. // Suffix bits are stored into p.Scond. // // Leading "." in cond is ignored. func ParseSuffix(p *obj.Prog, cond string) error { … } // inferSuffixError returns non-nil error that describes what could be // the cause of suffix parse failure. // // At the point this function is executed there is already assembly error, // so we can burn some clocks to construct good error message. // // Reported issues: // - duplicated suffixes // - illegal rounding/SAE+broadcast combinations // - unknown suffixes // - misplaced suffix (e.g. wrong Z suffix position) func inferSuffixError(cond string) error { … } var opSuffixTable … type opSuffix … const badOpSuffix … // newOpSuffix returns opSuffix object that matches suffixes string. // // If no matching suffix is found, special "invalid" suffix is returned. // Use IsValid method to check against this case. func newOpSuffix(suffixes string) opSuffix { … } // IsValid reports whether suffix is valid. // Empty suffixes are valid. func (suffix opSuffix) IsValid() bool { … } // String returns suffix printed representation. // // It matches the string that was used to create suffix with NewX86Suffix() // for valid suffixes. // For all invalid suffixes, special marker is returned. func (suffix opSuffix) String() string { … }