1 // Copyright 2026 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 //go:build gc
6
7 #include "textflag.h"
8
9 // Read the vector register length in bytes from the vlenb CSR.
10 // May only be called when the vector extension is present.
11 // func readVLENB() uint
12 TEXT ·readVLENB(SB), NOSPLIT|NOFRAME, $0-8
13 // Go 1.25's assembler does not recognize VLENB, so use its raw CSRR encoding.
14 // Replace WORD with CSRR VLENB, X10 once go.mod requires Go 1.27.
15 WORD $0xc2202573
16 MOV X10, ret+0(FP)
17 RET
18
View as plain text