style: modernize to splitseq, cut, min, maps.copy and range-over-int
This commit is contained in:
+6
-6
@@ -603,12 +603,12 @@ func (s evexSuffix) evexOnly() bool {
|
||||
// broadcast together with rounding/SAE.
|
||||
func parseEvexSuffix(mnem string) (string, evexSuffix, error) {
|
||||
sfx := evexSuffix{rounding: -1}
|
||||
i := strings.IndexByte(mnem, '.')
|
||||
if i < 0 {
|
||||
before, after, ok := strings.Cut(mnem, ".")
|
||||
if !ok {
|
||||
return mnem, sfx, nil
|
||||
}
|
||||
base := mnem[:i]
|
||||
parts := strings.Split(mnem[i+1:], ".")
|
||||
base := before
|
||||
parts := strings.Split(after, ".")
|
||||
seen := map[string]bool{}
|
||||
for j, p := range parts {
|
||||
if seen[p] {
|
||||
@@ -618,7 +618,7 @@ func parseEvexSuffix(mnem string) (string, evexSuffix, error) {
|
||||
switch p {
|
||||
case "Z":
|
||||
if j != len(parts)-1 {
|
||||
return "", sfx, fmt.Errorf("the .Z suffix must come last in %q", mnem[i+1:])
|
||||
return "", sfx, fmt.Errorf("the .Z suffix must come last in %q", after)
|
||||
}
|
||||
sfx.zeroing = true
|
||||
case "SAE":
|
||||
@@ -638,7 +638,7 @@ func parseEvexSuffix(mnem string) (string, evexSuffix, error) {
|
||||
}
|
||||
}
|
||||
if sfx.bcst && (sfx.sae || sfx.rounding >= 0) {
|
||||
return "", sfx, fmt.Errorf("cannot combine .BCST with rounding or SAE in %q", mnem[i+1:])
|
||||
return "", sfx, fmt.Errorf("cannot combine .BCST with rounding or SAE in %q", after)
|
||||
}
|
||||
return base, sfx, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user