golang/go · error

invalid arrangement in ARM64 register list

Error message

invalid arrangement in ARM64 register list

What it means

The Go assembler's ARM64RegisterArrangement returns this error when the arrangement string (the suffix after the register, e.g., .B16, .S2) does not match any known arrangement (arm64.go:270-272). The function recognizes a fixed set: B8, B16, H4, H8, S2, S4, D1, D2, B, H, S, D, Q. Any other suffix falls through to the default branch and is rejected, because no Q/size encoding exists for it.

Source

Thrown at src/cmd/asm/internal/arch/arm64.go:271

		curSize = 3
		curQ = 1
	case "B":
		curSize = 1
		curQ = 2
	case "H":
		curSize = 2
		curQ = 2
	case "S":
		curSize = 3
		curQ = 2
	case "D":
		curSize = 1
		curQ = 3
	case "Q":
		curSize = 2
		curQ = 3
	default:
		return 0, errors.New("invalid arrangement in ARM64 register list")
	}
	return (int64(prefix) << 32) | (int64(curQ) & 3 << 30) | (int64(curSize&3) << 10), nil
}

View on GitHub (pinned to b6b368adc5)

Solutions

  1. Use one of the recognized arrangements: B8, B16, H4, H8, S2, S4, D1, D2, B, H, S, D, Q.
  2. Match the arrangement to the register type — NEON (V) arrangements are B8/B16/H4/H8/S2/S4/D1/D2; the bare B/H/S/D/Q forms apply to specific instruction classes.
  3. Consult the Go assembler's ARM64 tests or the ARM ARM for the exact suffix the instruction expects.
  4. If you intended a different element width, re-check the instruction mnemonic and its permitted arrangements.

Example fix

; before — invalid arrangement 'W8'
VADD V0.W8, V1.W8, V2.W8

; after — use a recognized arrangement
VADD V0.S4, V1.S4, V2.S4
Defensive patterns

Strategy: validation

Validate before calling

// Validate the arrangement suffix against the recognized set.
var validArrangements = map[string]bool{
    "B8": true, "B16": true, "H4": true, "H8": true,
    "S2": true, "S4": true, "D1": true, "D2": true,
    "B": true, "H": true, "S": true, "D": true, "Q": true,
}
func validArrangement(arng string) bool { return validArrangements[arng] }

Prevention

When it happens

Trigger: Triggered when the arrangement suffix on a V/Z/P register is misspelled or unrecognized (arm64.go:230-271). For example, `V0.W8` (W8 is not a valid arrangement), `V0.B32` (B32 only valid on Z, not V), or a completely spurious suffix like `V0.X4`.

Common situations: Using an arrangement valid for SVE (Z) on a NEON (V) register, e.g., `V0.Q` where Q is reserved for specific forms. Typos in the suffix (e.g., 'B61' instead of 'B16'). Copying arrangement syntax from a different toolchain (GNU as uses different suffix conventions in some cases).

Related errors


AI-assisted analysis of golang/go@b6b368adc5 (2026-08-12). Data as JSON: /api/errors/27babc4a220d9ed6. Report an issue: GitHub.