Commit 7f033933 authored by Vladimir Stefanovic's avatar Vladimir Stefanovic Committed by Brad Fitzpatrick

cmd/compile/internal/gc: add support for GOARCH=mips{,le}

Change-Id: Ida4cd647525abce3441bfcb9fdee059344fe717f
Reviewed-on: https://go-review.googlesource.com/31477
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
parent 87f4e36c
...@@ -279,7 +279,7 @@ func (s *ssaExport) AllocFrame(f *ssa.Func) { ...@@ -279,7 +279,7 @@ func (s *ssaExport) AllocFrame(f *ssa.Func) {
if haspointers(n.Type) { if haspointers(n.Type) {
stkptrsize = Stksize stkptrsize = Stksize
} }
if Thearch.LinkArch.InFamily(sys.MIPS64, sys.ARM, sys.ARM64, sys.PPC64, sys.S390X) { if Thearch.LinkArch.InFamily(sys.MIPS, sys.MIPS64, sys.ARM, sys.ARM64, sys.PPC64, sys.S390X) {
Stksize = Rnd(Stksize, int64(Widthptr)) Stksize = Rnd(Stksize, int64(Widthptr))
} }
if Stksize >= 1<<31 { if Stksize >= 1<<31 {
......
This diff is collapsed.
...@@ -686,7 +686,7 @@ opswitch: ...@@ -686,7 +686,7 @@ opswitch:
if n.Left.Op == ONAME && n.Left.Sym.Name == "Sqrt" && if n.Left.Op == ONAME && n.Left.Sym.Name == "Sqrt" &&
(n.Left.Sym.Pkg.Path == "math" || n.Left.Sym.Pkg == localpkg && myimportpath == "math") { (n.Left.Sym.Pkg.Path == "math" || n.Left.Sym.Pkg == localpkg && myimportpath == "math") {
if Thearch.LinkArch.InFamily(sys.AMD64, sys.ARM, sys.ARM64, sys.PPC64, sys.S390X) { if Thearch.LinkArch.InFamily(sys.AMD64, sys.ARM, sys.ARM64, sys.MIPS, sys.PPC64, sys.S390X) {
n.Op = OSQRT n.Op = OSQRT
n.Left = n.List.First() n.Left = n.List.First()
n.List.Set(nil) n.List.Set(nil)
...@@ -1018,7 +1018,7 @@ opswitch: ...@@ -1018,7 +1018,7 @@ opswitch:
n = walkexpr(n, init) n = walkexpr(n, init)
case OCONV, OCONVNOP: case OCONV, OCONVNOP:
if Thearch.LinkArch.Family == sys.ARM { if Thearch.LinkArch.Family == sys.ARM || Thearch.LinkArch.Family == sys.MIPS {
if n.Left.Type.IsFloat() { if n.Left.Type.IsFloat() {
if n.Type.Etype == TINT64 { if n.Type.Etype == TINT64 {
n = mkcall("float64toint64", n.Type, init, conv(n.Left, Types[TFLOAT64])) n = mkcall("float64toint64", n.Type, init, conv(n.Left, Types[TFLOAT64]))
...@@ -3277,7 +3277,7 @@ func samecheap(a *Node, b *Node) bool { ...@@ -3277,7 +3277,7 @@ func samecheap(a *Node, b *Node) bool {
// The result of walkrotate MUST be assigned back to n, e.g. // The result of walkrotate MUST be assigned back to n, e.g.
// n.Left = walkrotate(n.Left) // n.Left = walkrotate(n.Left)
func walkrotate(n *Node) *Node { func walkrotate(n *Node) *Node {
if Thearch.LinkArch.InFamily(sys.MIPS64, sys.PPC64) { if Thearch.LinkArch.InFamily(sys.MIPS, sys.MIPS64, sys.PPC64) {
return n return n
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment