Skip to content

Commit

Permalink
cmd/compile/internal: fix test error on loong64
Browse files Browse the repository at this point in the history
For TestLogOpt test case, add loong64 support to test the host
architecture and os.

The Ctz64 is not intrinsified on loong64 for TestIntendedInlining.

Contributors to the loong64 port are:
  Weining Lu <[email protected]>
  Lei Wang <[email protected]>
  Lingqin Gong <[email protected]>
  Xiaolin Zhao <[email protected]>
  Meidan Li <[email protected]>
  Xiaojuan Zhai <[email protected]>
  Qiyuan Pu <[email protected]>
  Guoqi Chen <[email protected]>

This port has been updated to Go 1.15.6:
  https://github.com/loongson/go

Updates golang#46229

Change-Id: I42280e89a337dbfde55a01a134820f8ae94f6b47
Reviewed-on: https://go-review.googlesource.com/c/go/+/400237
Reviewed-by: David Chase <[email protected]>
Auto-Submit: Ian Lance Taylor <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
Run-TryBot: Ian Lance Taylor <[email protected]>
  • Loading branch information
XiaodongLoong authored and Ian Lance Taylor committed May 13, 2022
1 parent 9e9e2a8 commit 845a95b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/logopt/logopt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func s15a8(x *[15]int64) [15]int64 {
arches := []string{runtime.GOARCH}
goos0 := runtime.GOOS
if runtime.GOARCH == "amd64" { // Test many things with "linux" (wasm will get "js")
arches = []string{"arm", "arm64", "386", "amd64", "mips", "mips64", "ppc64le", "riscv64", "s390x", "wasm"}
arches = []string{"arm", "arm64", "386", "amd64", "mips", "mips64", "loong64", "ppc64le", "riscv64", "s390x", "wasm"}
goos0 = "linux"
}

Expand Down
4 changes: 2 additions & 2 deletions src/cmd/compile/internal/test/inl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ func TestIntendedInlining(t *testing.T) {
},
}

if runtime.GOARCH != "386" && runtime.GOARCH != "mips64" && runtime.GOARCH != "mips64le" && runtime.GOARCH != "riscv64" {
if runtime.GOARCH != "386" && runtime.GOARCH != "loong64" && runtime.GOARCH != "mips64" && runtime.GOARCH != "mips64le" && runtime.GOARCH != "riscv64" {
// nextFreeFast calls sys.Ctz64, which on 386 is implemented in asm and is not inlinable.
// We currently don't have midstack inlining so nextFreeFast is also not inlinable on 386.
// On mips64x and riscv64, Ctz64 is not intrinsified and causes nextFreeFast too expensive
// On loong64, mips64x and riscv64, Ctz64 is not intrinsified and causes nextFreeFast too expensive
// to inline (Issue 22239).
want["runtime"] = append(want["runtime"], "nextFreeFast")
}
Expand Down

0 comments on commit 845a95b

Please sign in to comment.