[v2] libgo: Add support for sh

Message ID b8f608b2-c8e7-19a7-624a-c694ec48e9a6@physik.fu-berlin.de
State New
Headers show
Series
  • [v2] libgo: Add support for sh
Related show

Commit Message

John Paul Adrian Glaubitz Dec. 17, 2017, 12:38 p.m.
Hello!

This is the second version of my patch to add support for SuperH
in libgo. The changes over my first patch in [1] are:

 * account for little- and big-endian targets
 * account for sh3- and sh4-specific parameters

I have not added support for SH-1 and SH-2 targets for now as
most Linux distributions with SH support usually target sh3 and
sh4 only.

I have already signed the Google CLA in the past when I contributed
a small patch to Kubernetes.

Thanks,
Adrian

> [1] https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01111.html


-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

Comments

Ian Lance Taylor Jan. 10, 2018, 2:25 p.m. | #1
On Sun, Dec 17, 2017 at 4:38 AM, John Paul Adrian Glaubitz
<glaubitz@physik.fu-berlin.de> wrote:
>

> This is the second version of my patch to add support for SuperH

> in libgo. The changes over my first patch in [1] are:

>

>  * account for little- and big-endian targets

>  * account for sh3- and sh4-specific parameters

>

> I have not added support for SH-1 and SH-2 targets for now as

> most Linux distributions with SH support usually target sh3 and

> sh4 only.

>

> I have already signed the Google CLA in the past when I contributed

> a small patch to Kubernetes.


Thanks.  I finally took a look at this.  I don't know much about SH,
but I don't think we want to add each SH variant as a separate GOARCH
value.  As you can see from the list you modified in
ibgo/go/go/build/syslist.go, the difference between GOARCH values is
essentially the calling convention.  There are many different kinds of
x86 processors, but since the only calling convention difference is
between 32-bit and 64-bit, the list has only 386 and amd64.  Similarly
it seems to me we should have only sh and shbe in the list for SH
processors.

Ian
John Paul Adrian Glaubitz Jan. 10, 2018, 2:30 p.m. | #2
On 01/10/2018 03:25 PM, Ian Lance Taylor wrote:
> Thanks.  I finally took a look at this.  I don't know much about SH,

> but I don't think we want to add each SH variant as a separate GOARCH

> value.  As you can see from the list you modified in

> ibgo/go/go/build/syslist.go, the difference between GOARCH values is

> essentially the calling convention.  There are many different kinds of

> x86 processors, but since the only calling convention difference is

> between 32-bit and 64-bit, the list has only 386 and amd64.  Similarly

> it seems to me we should have only sh and shbe in the list for SH

> processors.


My reasoning is that gcc itself differentiates between those different
SH targets, i.e. there is a sh3, a sh4 target and the big-endian variants
of these targets. There aren't different x86_64 targets in gcc though.

Furthermore, as you can see, sh3 and sh4 also have different cacheline
sizes, for example:

> https://go-review.googlesource.com/c/gofrontend/+/84555/1/libgo/configure.ac


In total, we have four different SH targets.

Adrian

-- 
  .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
   `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
Oleg Endo Jan. 10, 2018, 2:30 p.m. | #3
On Wed, 2018-01-10 at 06:25 -0800, Ian Lance Taylor wrote:

> Thanks.  I finally took a look at this.  I don't know much about SH,

> but I don't think we want to add each SH variant as a separate GOARCH

> value.  As you can see from the list you modified in

> ibgo/go/go/build/syslist.go, the difference between GOARCH values is

> essentially the calling convention.  There are many different kinds of

> x86 processors, but since the only calling convention difference is

> between 32-bit and 64-bit, the list has only 386 and amd64.  Similarly

> it seems to me we should have only sh and shbe in the list for SH

> processors.


On SH the calling convention depends on the processor features which
are available/used.  For example there is a "no-fpu" mode which uses
software fp and passes all fp values in gp regs, while the "normal"
mode is to pass fp values in fp regs.  Some of the CPU variants like
SH2 imply "no-fpu".

Cheers,
Oleg
Ian Lance Taylor Jan. 10, 2018, 2:40 p.m. | #4
On Wed, Jan 10, 2018 at 6:30 AM, John Paul Adrian Glaubitz
<glaubitz@physik.fu-berlin.de> wrote:
> On 01/10/2018 03:25 PM, Ian Lance Taylor wrote:

>>

>> Thanks.  I finally took a look at this.  I don't know much about SH,

>> but I don't think we want to add each SH variant as a separate GOARCH

>> value.  As you can see from the list you modified in

>> ibgo/go/go/build/syslist.go, the difference between GOARCH values is

>> essentially the calling convention.  There are many different kinds of

>> x86 processors, but since the only calling convention difference is

>> between 32-bit and 64-bit, the list has only 386 and amd64.  Similarly

>> it seems to me we should have only sh and shbe in the list for SH

>> processors.

>

>

> My reasoning is that gcc itself differentiates between those different

> SH targets, i.e. there is a sh3, a sh4 target and the big-endian variants

> of these targets. There aren't different x86_64 targets in gcc though.

>

> Furthermore, as you can see, sh3 and sh4 also have different cacheline

> sizes, for example:

>

>>

>> https://go-review.googlesource.com/c/gofrontend/+/84555/1/libgo/configure.ac

>

>

> In total, we have four different SH targets.


The main purpose of a GOARCH value is to specify build targets, which
are the +build lines seen in files like
libgo/go/internal/syscall/unix/getrandom_linux_mipsx.go.  They also
appear in file names.  It seems to me unlikely that it will ever be
necessary to distinguish SH3 and SH4 when choosing which files to
build.

In the past we've started off with too many GOARCH values for a
specific processor, and backed off later.  I'd prefer to do it the
other way around now: start off with a few possible, and add more if
really required.

The fact that GCC supports multiple SH configurations is an
interesting point, but that is also true of, say, MIPS, but we're not
replicating all the MIPS choices in the GOARCH list.

Ian
John Paul Adrian Glaubitz Jan. 10, 2018, 2:44 p.m. | #5
On 01/10/2018 03:40 PM, Ian Lance Taylor wrote:
> The main purpose of a GOARCH value is to specify build targets, which

> are the +build lines seen in files like

> libgo/go/internal/syscall/unix/getrandom_linux_mipsx.go.  They also

> appear in file names.  It seems to me unlikely that it will ever be

> necessary to distinguish SH3 and SH4 when choosing which files to

> build.


What about Oleg's comment on the issue?

Adrian

-- 
  .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
   `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
Ian Lance Taylor Jan. 10, 2018, 2:51 p.m. | #6
On Wed, Jan 10, 2018 at 6:30 AM, Oleg Endo <oleg.endo@t-online.de> wrote:
> On Wed, 2018-01-10 at 06:25 -0800, Ian Lance Taylor wrote:

>>

>> Thanks.  I finally took a look at this.  I don't know much about SH,

>> but I don't think we want to add each SH variant as a separate GOARCH

>> value.  As you can see from the list you modified in

>> ibgo/go/go/build/syslist.go, the difference between GOARCH values is

>> essentially the calling convention.  There are many different kinds of

>> x86 processors, but since the only calling convention difference is

>> between 32-bit and 64-bit, the list has only 386 and amd64.  Similarly

>> it seems to me we should have only sh and shbe in the list for SH

>> processors.

>

> On SH the calling convention depends on the processor features which

> are available/used.  For example there is a "no-fpu" mode which uses

> software fp and passes all fp values in gp regs, while the "normal"

> mode is to pass fp values in fp regs.  Some of the CPU variants like

> SH2 imply "no-fpu".


I suppose I shouldn't have said calling convention, as that cuts too
finely.  There are similar issues with MIPS and even x86 has softfloat
variants.  Those options are selectable via command line options in
GCC, and in the gc toolchain they are selected using environment
variables (GO386, GOARM, etc.).

Ian
John Paul Adrian Glaubitz Jan. 10, 2018, 3:05 p.m. | #7
On 01/10/2018 03:51 PM, Ian Lance Taylor wrote:
> I suppose I shouldn't have said calling convention, as that cuts too

> finely.  There are similar issues with MIPS and even x86 has softfloat

> variants.  Those options are selectable via command line options in

> GCC, and in the gc toolchain they are selected using environment

> variables (GO386, GOARM, etc.).

Ok, so basically we should end up having only two GOARCHes for SH,
being "sh" and "shbe", correct?

If, yes, I can rebase my patch, make the requested changes and resubmit
it to Gerrit.

Adrian

-- 
  .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
   `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
Ian Lance Taylor Jan. 10, 2018, 3:22 p.m. | #8
On Wed, Jan 10, 2018 at 7:05 AM, John Paul Adrian Glaubitz
<glaubitz@physik.fu-berlin.de> wrote:
> On 01/10/2018 03:51 PM, Ian Lance Taylor wrote:

>>

>> I suppose I shouldn't have said calling convention, as that cuts too

>> finely.  There are similar issues with MIPS and even x86 has softfloat

>> variants.  Those options are selectable via command line options in

>> GCC, and in the gc toolchain they are selected using environment

>> variables (GO386, GOARM, etc.).

>

> Ok, so basically we should end up having only two GOARCHes for SH,

> being "sh" and "shbe", correct?


Yes, I would like to start there.

> If, yes, I can rebase my patch, make the requested changes and resubmit

> it to Gerrit.


Thanks!

Ian
John Paul Adrian Glaubitz Jan. 10, 2018, 3:41 p.m. | #9
On 01/10/2018 04:22 PM, Ian Lance Taylor wrote:
>> Ok, so basically we should end up having only two GOARCHes for SH,

>> being "sh" and "shbe", correct?

> 

> Yes, I would like to start there.

> 

>> If, yes, I can rebase my patch, make the requested changes and resubmit

>> it to Gerrit.

> 

> Thanks!

Done: https://go-review.googlesource.com/c/gofrontend/+/84555

-- 
  .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
   `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

Patch

From ce83430f1a8d34f005f46208e4c8ab22ad00c879 Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Sat, 16 Dec 2017 10:05:20 +0100
Subject: [PATCH] 2017-12-17  John Paul Adrian Glaubitz
 <glaubitz@physik.fu-berlin.de>

	PR go/83308
	* libgo/configure.ac: Add support for sh3, sh3be, sh4, sh4be.
	* libgo/go/go/build/syslist.go: Add sh3, sh3be, sh4, sh4be to goarchList.
	* libgo/go/cmd/cgo/main.go: Enable build on sh3, sh3be, sh4, sh4be.
	* libgo/go/runtime/hash32.go: Likewise.
	* libgo/go/runtime/lfstack_32bit.go: Likewise.
	* libgo/go/runtime/unaligned2.go: Likewise.
	* libgo/go/syscall/endian_big.go: Enable build on sh3be, sh4be.
	* libgo/go/syscall/endian_little.go: Enable build on sh3, sh4.
	* libgo/match.sh: Add architecture matching for sh3, sh3be, sh4, sh4be.
	* libgo/testsuite/gotest: Likewise.
---
 ChangeLog                         | 14 ++++++++++++++
 libgo/configure.ac                | 34 ++++++++++++++++++++++++++++++++--
 libgo/go/cmd/cgo/main.go          |  8 ++++++++
 libgo/go/go/build/syslist.go      |  2 +-
 libgo/go/runtime/hash32.go        |  2 +-
 libgo/go/runtime/lfstack_32bit.go |  2 +-
 libgo/go/runtime/unaligned2.go    |  2 +-
 libgo/go/syscall/endian_big.go    |  2 +-
 libgo/go/syscall/endian_little.go |  2 +-
 libgo/match.sh                    |  4 ++--
 libgo/testsuite/gotest            |  4 ++--
 11 files changed, 64 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 275a340f6a8..18c3cfe0743 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@ 
+2017-12-17  John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+
+	PR go/83308
+	* libgo/configure.ac: Add support for sh3, sh3be, sh4, sh4be.
+	* libgo/go/go/build/syslist.go: Add sh3, sh3be, sh4, sh4be to goarchList.
+	* libgo/go/cmd/cgo/main.go: Enable build on sh3, sh3be, sh4, sh4be.
+	* libgo/go/runtime/hash32.go: Likewise.
+	* libgo/go/runtime/lfstack_32bit.go: Likewise.
+	* libgo/go/runtime/unaligned2.go: Likewise.
+	* libgo/go/syscall/endian_big.go: Enable build on sh3be, sh4be.
+	* libgo/go/syscall/endian_little.go: Enable build on sh3, sh4.
+	* libgo/match.sh: Add architecture matching for sh3, sh3be, sh4, sh4be.
+	* libgo/testsuite/gotest: Likewise.
+
 2017-12-12  Stafford Horne  <shorne@gmail.com>
 
 	* configure.ac: Remove logic adding gdb to noconfigsdirs for or1k.
diff --git a/libgo/configure.ac b/libgo/configure.ac
index 7b0c629653f..63cd857c23f 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -208,10 +208,10 @@  AC_SUBST(USE_DEJAGNU)
 # supported by the gofrontend and all architectures supported by the
 # gc toolchain.
 # N.B. Keep in sync with gcc/testsuite/go.test/go-test.exp (go-set-goarch).
-ALLGOARCH="386 alpha amd64 amd64p32 arm armbe arm64 arm64be ia64 m68k mips mipsle mips64 mips64le mips64p32 mips64p32le ppc ppc64 ppc64le s390 s390x sparc sparc64"
+ALLGOARCH="386 alpha amd64 amd64p32 arm armbe arm64 arm64be ia64 m68k mips mipsle mips64 mips64le mips64p32 mips64p32le ppc ppc64 ppc64le s390 s390x sh3 sh3be sh4 sh4be sparc sparc64"
 
 # All known GOARCH_FAMILY values.
-ALLGOARCHFAMILY="I386 ALPHA AMD64 ARM ARM64 IA64 M68K MIPS MIPS64 PPC PPC64 S390 S390X SPARC SPARC64"
+ALLGOARCHFAMILY="I386 ALPHA AMD64 ARM ARM64 IA64 M68K MIPS MIPS64 PPC PPC64 S390 S390X SH SPARC SPARC64"
 
 GOARCH=unknown
 GOARCH_FAMILY=unknown
@@ -360,6 +360,36 @@  GOARCH_MINFRAMESIZE=8
     GOARCH_CACHELINESIZE=256
     GOARCH_PCQUANTUM=2
     ;;
+  sh3eb*-*-*)
+    GOARCH=sh3be
+    GOARCH_FAMILY=SH
+    GOARCH_BIGENDIAN=1
+    GOARCH_CACHELINESIZE=16
+    GOARCH_PCQUANTUM=2
+    GOARCH_MINFRAMESIZE=4
+    ;;
+  sh3*-*-*)
+    GOARCH=sh3
+    GOARCH_FAMILY=SH
+    GOARCH_CACHELINESIZE=16
+    GOARCH_PCQUANTUM=2
+    GOARCH_MINFRAMESIZE=4
+    ;;
+  sh4eb*-*-*)
+    GOARCH=sh4be
+    GOARCH_FAMILY=SH
+    GOARCH_BIGENDIAN=1
+    GOARCH_CACHELINESIZE=32
+    GOARCH_PCQUANTUM=2
+    GOARCH_MINFRAMESIZE=4
+    ;;
+  sh4*-*-*)
+    GOARCH=sh4
+    GOARCH_FAMILY=SH
+    GOARCH_CACHELINESIZE=32
+    GOARCH_PCQUANTUM=2
+    GOARCH_MINFRAMESIZE=4
+    ;;
   sparc*-*-*)
     AC_COMPILE_IFELSE([
 #if defined(__sparcv9) || defined(__arch64__)
diff --git a/libgo/go/cmd/cgo/main.go b/libgo/go/cmd/cgo/main.go
index c9a44fdd166..a45283e7fa0 100644
--- a/libgo/go/cmd/cgo/main.go
+++ b/libgo/go/cmd/cgo/main.go
@@ -161,6 +161,10 @@  var ptrSizeMap = map[string]int64{
 	"ppc64le":     8,
 	"s390":        4,
 	"s390x":       8,
+	"sh3":         4,
+	"sh3be":       4,
+	"sh4":         4,
+	"sh4be":       4,
 	"sparc":       4,
 	"sparc64":     8,
 }
@@ -183,6 +187,10 @@  var intSizeMap = map[string]int64{
 	"ppc64le":     8,
 	"s390":        4,
 	"s390x":       8,
+	"sh3":         4,
+	"sh3be":       4,
+	"sh4":         4,
+	"sh4be":       4,
 	"sparc":       4,
 	"sparc64":     8,
 }
diff --git a/libgo/go/go/build/syslist.go b/libgo/go/go/build/syslist.go
index 290ba9efa0c..6c916f2ea6e 100644
--- a/libgo/go/go/build/syslist.go
+++ b/libgo/go/go/build/syslist.go
@@ -5,4 +5,4 @@ 
 package build
 
 const goosList = "aix android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris windows zos "
-const goarchList = "386 amd64 amd64p32 arm armbe arm64 arm64be alpha m68k ppc64 ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc s390 s390x sparc sparc64 "
+const goarchList = "386 amd64 amd64p32 arm armbe arm64 arm64be alpha m68k ppc64 ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc s390 s390x sh3 sh3be sh4 sh4be sparc sparc64 "
diff --git a/libgo/go/runtime/hash32.go b/libgo/go/runtime/hash32.go
index dd2e657fe3f..4e0cd1085f0 100644
--- a/libgo/go/runtime/hash32.go
+++ b/libgo/go/runtime/hash32.go
@@ -6,7 +6,7 @@ 
 //   xxhash: https://code.google.com/p/xxhash/
 // cityhash: https://code.google.com/p/cityhash/
 
-// +build 386 arm armbe m68k mips mipsle ppc s390 sparc
+// +build 386 arm armbe m68k mips mipsle ppc s390 sh3 sh3be sh4 sh4be sparc
 
 package runtime
 
diff --git a/libgo/go/runtime/lfstack_32bit.go b/libgo/go/runtime/lfstack_32bit.go
index ab0edab68f5..1520cac0917 100644
--- a/libgo/go/runtime/lfstack_32bit.go
+++ b/libgo/go/runtime/lfstack_32bit.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.
 
-// +build 386 arm nacl armbe m68k mips mipsle mips64p32 mips64p32le ppc s390 sparc
+// +build 386 arm nacl armbe m68k mips mipsle mips64p32 mips64p32le ppc s390 sh3 sh3be sh4 sh4be sparc
 
 package runtime
 
diff --git a/libgo/go/runtime/unaligned2.go b/libgo/go/runtime/unaligned2.go
index a33c87acd56..34de3bb0e82 100644
--- a/libgo/go/runtime/unaligned2.go
+++ b/libgo/go/runtime/unaligned2.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.
 
-// +build arm mips mipsle mips64 mips64le armbe m68k sparc alpha ia64 mips64p32 mips64p32le sparc64
+// +build arm mips mipsle mips64 mips64le armbe m68k sparc alpha ia64 mips64p32 mips64p32le sh3 sh3be sh4 sh4be sparc64
 
 package runtime
 
diff --git a/libgo/go/syscall/endian_big.go b/libgo/go/syscall/endian_big.go
index f8ee7cfc233..58f6347423d 100644
--- a/libgo/go/syscall/endian_big.go
+++ b/libgo/go/syscall/endian_big.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.
 //
-// +build ppc64 s390x mips mips64 armbe arm64be m68k ppc mips64p32 s390 sparc sparc64
+// +build ppc64 s390x mips mips64 armbe arm64be m68k ppc mips64p32 s390 sh3be sh4be sparc sparc64
 
 package syscall
 
diff --git a/libgo/go/syscall/endian_little.go b/libgo/go/syscall/endian_little.go
index b6c9ed0f9f7..373d73f6768 100644
--- a/libgo/go/syscall/endian_little.go
+++ b/libgo/go/syscall/endian_little.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.
 //
-// +build 386 amd64 amd64p32 arm arm64 ppc64le mips64le mipsle alpha ia64 mips64p32le
+// +build 386 amd64 amd64p32 arm arm64 ppc64le mips64le mipsle alpha ia64 mips64p32le sh3 sh4
 
 package syscall
 
diff --git a/libgo/match.sh b/libgo/match.sh
index fac75eabec6..4dcf45b6a38 100755
--- a/libgo/match.sh
+++ b/libgo/match.sh
@@ -116,7 +116,7 @@  for f in $gofiles; do
 	aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows)
 	    tag1=nonmatchingtag
 	    ;;
-	386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | s390 | s390x | sparc | sparc64)
+	386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | s390 | s390x | sh3 | sh3be | sh4 | sh4be | sparc | sparc64)
 	    tag1=nonmatchingtag
 	    ;;
     esac
@@ -128,7 +128,7 @@  for f in $gofiles; do
 	aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows)
 	    tag2=nonmatchingtag
 	    ;;
-	386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | s390 | s390x | sparc | sparc64)
+	386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | s390 | s390x | sh3 | sh3be | sh4 | sh4be | sparc | sparc64)
 	    tag2=nonmatchingtag
 	    ;;
     esac
diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest
index 83f78d4d9b9..d3950bc3d9e 100755
--- a/libgo/testsuite/gotest
+++ b/libgo/testsuite/gotest
@@ -314,7 +314,7 @@  x)
 	    aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows)
 		tag1=nonmatchingtag
 		;;
-	    386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | s390 | s390x | sparc | sparc64)
+	    386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | s390 | s390x | sh3 | sh3be | sh4 | sh4be | sparc | sparc64)
 		tag1=nonmatchingtag
 		;;
 	    esac
@@ -326,7 +326,7 @@  x)
 	    aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows)
 		tag2=nonmatchingtag
 		;;
-	    386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | s390 | s390x | sparc | sparc64)
+	    386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | s390 | s390x | sh3 | sh3be | sh4 | sh4be | sparc | sparc64)
 		tag2=nonmatchingtag
 		;;
 	    esac
-- 
2.15.1