cpu: add support for detecting cpu features on loong64

Except for lasx, all other features have been implemented
in the Go mainline.

Change-Id: I61a09396ed23d17991b641a1265e952585cb5636
Reviewed-on: https://go-review.googlesource.com/c/sys/+/655355
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
This commit is contained in:
Guoqi Chen
2025-03-11 18:36:47 -07:00
committed by abner chenc
parent f2ce62c21a
commit b8f7da6c5a
6 changed files with 93 additions and 1 deletions
+8
View File
@@ -87,6 +87,14 @@ func TestARM64minimalFeatures(t *testing.T) {
}
}
func TestLOONG64Initialized(t *testing.T) {
if runtime.GOARCH == "loong64" {
if !cpu.Initialized {
t.Fatal("Initialized expected true, got false")
}
}
}
func TestMIPS64Initialized(t *testing.T) {
if runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" {
if !cpu.Initialized {