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 #include "textflag.h"
6
7 // Read the vector register length in bytes from the vlenb CSR.
8 // May only be called when the vector extension is present.
9 // func readVLENB() uint
10 TEXT ·readVLENB(SB), NOSPLIT|NOFRAME, $0-8
11 CSRR VLENB, X10
12 MOV X10, ret+0(FP)
13 RET
14
15 // func getGORISCV64level() int32
16 TEXT ·getGORISCV64level(SB), NOSPLIT|NOFRAME, $0-4
17 #ifdef GORISCV64_rva20u64
18 MOV $20, X10
19 #endif
20 #ifdef GORISCV64_rva22u64
21 MOV $22, X10
22 #endif
23 #ifdef GORISCV64_rva23u64
24 MOV $23, X10
25 #endif
26 MOVW X10, ret+0(FP)
27 RET
28
View as plain text