cmd/7g: add ARM64 Go compiler, based on 9g
No peep optimizer yet.
Change-Id: Ifa5f993cd6ac5e34783c0df41faf772fbce96ae2
Reviewed-on: https://go-review.googlesource.com/7049
Reviewed-by: Russ Cox <rsc@golang.org>
diff --git a/src/cmd/internal/gc/gsubr.go b/src/cmd/internal/gc/gsubr.go
index b8417d9..0994966 100644
--- a/src/cmd/internal/gc/gsubr.go
+++ b/src/cmd/internal/gc/gsubr.go
@@ -80,7 +80,7 @@
p := Prog(as)
p.To.Type = obj.TYPE_BRANCH
p.To.U.Branch = nil
- if as != obj.AJMP && likely != 0 && Thearch.Thechar != '9' {
+ if as != obj.AJMP && likely != 0 && Thearch.Thechar != '9' && Thearch.Thechar != '7' {
p.From.Type = obj.TYPE_CONST
p.From.Offset = int64(bool2int(likely > 0))
}
@@ -423,7 +423,7 @@
case OADDR:
a = Naddr(n.Left)
a.Etype = uint8(Tptr)
- if Thearch.Thechar != '5' && Thearch.Thechar != '9' { // TODO(rsc): Do this even for arm, ppc64.
+ if Thearch.Thechar != '5' && Thearch.Thechar != '7' && Thearch.Thechar != '9' { // TODO(rsc): Do this even for arm, ppc64.
a.Width = int64(Widthptr)
}
if a.Type != obj.TYPE_MEM {
@@ -461,7 +461,7 @@
break // len(nil)
}
a.Etype = Simtype[TUINT]
- if Thearch.Thechar == '9' {
+ if Thearch.Thechar == '7' || Thearch.Thechar == '9' {
a.Etype = Simtype[TINT]
}
a.Offset += int64(Array_nel)
@@ -477,7 +477,7 @@
break // cap(nil)
}
a.Etype = Simtype[TUINT]
- if Thearch.Thechar == '9' {
+ if Thearch.Thechar == '7' || Thearch.Thechar == '9' {
a.Etype = Simtype[TINT]
}
a.Offset += int64(Array_cap)
@@ -560,7 +560,7 @@
if Thearch.Thechar == '5' {
n.Xoffset += 4
}
- if Thearch.Thechar == '9' {
+ if Thearch.Thechar == '7' || Thearch.Thechar == '9' {
n.Xoffset += 8
}
diff --git a/src/cmd/internal/gc/pgen.go b/src/cmd/internal/gc/pgen.go
index 0623904..6735c7d 100644
--- a/src/cmd/internal/gc/pgen.go
+++ b/src/cmd/internal/gc/pgen.go
@@ -277,7 +277,7 @@
if haspointers(n.Type) {
stkptrsize = Stksize
}
- if Thearch.Thechar == '5' || Thearch.Thechar == '9' {
+ if Thearch.Thechar == '5' || Thearch.Thechar == '7' || Thearch.Thechar == '9' {
Stksize = Rnd(Stksize, int64(Widthptr))
}
if Stksize >= 1<<31 {
@@ -333,7 +333,7 @@
Fatal("bad checknil")
}
- if ((Thearch.Thechar == '5' || Thearch.Thechar == '9') && n.Op != OREGISTER) || n.Addable == 0 || n.Op == OLITERAL {
+ if ((Thearch.Thechar == '5' || Thearch.Thechar == '7' || Thearch.Thechar == '9') && n.Op != OREGISTER) || n.Addable == 0 || n.Op == OLITERAL {
var reg Node
Thearch.Regalloc(®, Types[Tptr], n)
Thearch.Cgen(n, ®)
diff --git a/src/cmd/internal/gc/reg.go b/src/cmd/internal/gc/reg.go
index 41200ba..8d10d42 100644
--- a/src/cmd/internal/gc/reg.go
+++ b/src/cmd/internal/gc/reg.go
@@ -154,7 +154,7 @@
p1.As = int16(Thearch.Optoas(OAS, Types[uint8(v.etype)]))
// TODO(rsc): Remove special case here.
- if (Thearch.Thechar == '9' || Thearch.Thechar == '5') && v.etype == TBOOL {
+ if (Thearch.Thechar == '5' || Thearch.Thechar == '7' || Thearch.Thechar == '9') && v.etype == TBOOL {
p1.As = int16(Thearch.Optoas(OAS, Types[TUINT8]))
}
p1.From.Type = obj.TYPE_REG
@@ -209,7 +209,7 @@
// TODO(rsc): Remove special case here.
case obj.TYPE_ADDR:
var bit Bits
- if Thearch.Thechar == '9' || Thearch.Thechar == '5' {
+ if Thearch.Thechar == '5' || Thearch.Thechar == '7' || Thearch.Thechar == '9' {
goto memcase
}
a.Type = obj.TYPE_MEM
diff --git a/src/cmd/internal/gc/walk.go b/src/cmd/internal/gc/walk.go
index e4abc28..4aecd54 100644
--- a/src/cmd/internal/gc/walk.go
+++ b/src/cmd/internal/gc/walk.go
@@ -3625,7 +3625,7 @@
}
func walkrotate(np **Node) {
- if Thearch.Thechar == '9' {
+ if Thearch.Thechar == '7' || Thearch.Thechar == '9' {
return
}
@@ -3757,7 +3757,7 @@
// if >= 0, nr is 1<<pow // 1 if nr is negative.
// TODO(minux)
- if Thearch.Thechar == '9' {
+ if Thearch.Thechar == '7' || Thearch.Thechar == '9' {
return
}