From 7e72d384d66f48a78289edc6a7d1dc6ab878f990 Mon Sep 17 00:00:00 2001 From: Wayne Zuo Date: Mon, 17 Oct 2022 17:38:50 +0800 Subject: [PATCH] internal/abi, internal/buildcfg: always enable register ABI on riscv64 In Go 1.19, we develop register ABI for riscv64, enabled by default as a GOEXPERIMENT. We can turn it on all the time in Go 1.20. Change-Id: Ie8e2ac8b8bd3ebddb0dc6d58a5599547fb440e03 Reviewed-on: https://go-review.googlesource.com/c/go/+/443555 Run-TryBot: Wayne Zuo Reviewed-by: Bryan Mills TryBot-Result: Gopher Robot Reviewed-by: Cherry Mui --- src/internal/abi/abi_generic.go | 2 +- src/internal/abi/abi_riscv64.go | 2 -- src/internal/buildcfg/exp.go | 4 +--- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/internal/abi/abi_generic.go b/src/internal/abi/abi_generic.go index d5803e70d2b..76ef2e28986 100644 --- a/src/internal/abi/abi_generic.go +++ b/src/internal/abi/abi_generic.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.regabiargs && !amd64 && !arm64 && !ppc64 && !ppc64le +//go:build !goexperiment.regabiargs && !amd64 && !arm64 && !ppc64 && !ppc64le && !riscv64 package abi diff --git a/src/internal/abi/abi_riscv64.go b/src/internal/abi/abi_riscv64.go index 16568205773..2bcd9d6db21 100644 --- a/src/internal/abi/abi_riscv64.go +++ b/src/internal/abi/abi_riscv64.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build goexperiment.regabiargs - package abi const ( diff --git a/src/internal/buildcfg/exp.go b/src/internal/buildcfg/exp.go index 8531aac9080..71f8f5648d4 100644 --- a/src/internal/buildcfg/exp.go +++ b/src/internal/buildcfg/exp.go @@ -62,11 +62,9 @@ func ParseGOEXPERIMENT(goos, goarch, goexp string) (*ExperimentFlags, error) { // always on. var regabiSupported, regabiAlwaysOn bool switch goarch { - case "amd64", "arm64", "ppc64le", "ppc64": + case "amd64", "arm64", "ppc64le", "ppc64", "riscv64": regabiAlwaysOn = true regabiSupported = true - case "riscv64": - regabiSupported = true } baseline := goexperiment.Flags{