diff options
author | David Chase <drchase@google.com> | 2016-08-10 11:44:57 -0700 |
---|---|---|
committer | David Chase <drchase@google.com> | 2016-08-15 14:47:49 +0000 |
commit | d08010f94e06e5d5b6d01c248ba2a976b75d95a2 (patch) | |
tree | df74490d9fecdccb5f75f7786ffa19f892cdb5ed /src/cmd/internal/obj/ppc64/asm9.go | |
parent | d99cee79b98dfb6c1cd8e64c96845ee29aa28b4c (diff) | |
download | go-dev.ssa.tar.gz go-dev.ssa.zip |
[dev.ssa] cmd/compile: PPC64, FP to/from int conversions.dev.ssa
Passes ssa_test.
Requires a few new instructions and some scratchpad
memory to move data between G and F registers.
Also fixed comparisons to be correct in case of NaN.
Added missing instructions for run.bash.
Removed some FP registers that are apparently "reserved"
(but that are also apparently also unused except for a
gratuitous multiplication by two when y = x+x would work
just as well).
Currently failing stack splits.
Updates #16010.
Change-Id: I73b161bfff54445d72bd7b813b1479f89fc72602
Reviewed-on: https://go-review.googlesource.com/26813
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/internal/obj/ppc64/asm9.go')
-rw-r--r-- | src/cmd/internal/obj/ppc64/asm9.go | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/cmd/internal/obj/ppc64/asm9.go b/src/cmd/internal/obj/ppc64/asm9.go index 5366809d2f..52cae12333 100644 --- a/src/cmd/internal/obj/ppc64/asm9.go +++ b/src/cmd/internal/obj/ppc64/asm9.go @@ -53,7 +53,7 @@ type Optab struct { a2 uint8 a3 uint8 a4 uint8 - type_ int8 + type_ int8 // cases in asmout below. E.g., 44 = st r,(ra+rb); 45 = ld (ra+rb), r size int8 param int16 } @@ -310,6 +310,12 @@ var optab = []Optab{ {AFMOVD, C_FREG, C_NONE, C_NONE, C_LAUTO, 35, 8, REGSP}, {AFMOVD, C_FREG, C_NONE, C_NONE, C_LOREG, 35, 8, REGZERO}, {AFMOVD, C_FREG, C_NONE, C_NONE, C_ADDR, 74, 8, 0}, + {AFMOVSX, C_ZOREG, C_REG, C_NONE, C_FREG, 45, 4, 0}, + {AFMOVSX, C_ZOREG, C_NONE, C_NONE, C_FREG, 45, 4, 0}, + {AFMOVSX, C_FREG, C_REG, C_NONE, C_ZOREG, 44, 4, 0}, + {AFMOVSX, C_FREG, C_NONE, C_NONE, C_ZOREG, 44, 4, 0}, + {AFMOVSZ, C_ZOREG, C_REG, C_NONE, C_FREG, 45, 4, 0}, + {AFMOVSZ, C_ZOREG, C_NONE, C_NONE, C_FREG, 45, 4, 0}, {ASYNC, C_NONE, C_NONE, C_NONE, C_NONE, 46, 4, 0}, {AWORD, C_LCON, C_NONE, C_NONE, C_NONE, 40, 4, 0}, {ADWORD, C_LCON, C_NONE, C_NONE, C_NONE, 31, 8, 0}, @@ -920,7 +926,7 @@ func buildop(ctxt *obj.Link) { switch r { default: ctxt.Diag("unknown op in build: %v", obj.Aconv(r)) - log.Fatalf("bad code") + log.Fatalf("instruction missing from switch in asm9.go:buildop: %v", obj.Aconv(r)) case ADCBF: /* unary indexed: op (b+a); op (b) */ opset(ADCBI, r0) @@ -1265,6 +1271,8 @@ func buildop(ctxt *obj.Link) { case AADD, AANDCC, /* and. Rb,Rs,Ra; andi. $uimm,Rs,Ra; andis. $uimm,Rs,Ra */ + AFMOVSX, + AFMOVSZ, ALSW, AMOVW, /* load/store/move word with sign extension; special 32-bit move; move 32-bit literals */ @@ -3238,6 +3246,10 @@ func oploadx(ctxt *obj.Link, a obj.As) uint32 { return OPVCC(31, 535, 0, 0) /* lfsx */ case AFMOVSU: return OPVCC(31, 567, 0, 0) /* lfsux */ + case AFMOVSX: + return OPVCC(31, 855, 0, 0) /* lfiwax - power6, isa 2.05 */ + case AFMOVSZ: + return OPVCC(31, 887, 0, 0) /* lfiwzx - power7, isa 2.06 */ case AMOVH: return OPVCC(31, 343, 0, 0) /* lhax */ case AMOVHU: @@ -3332,6 +3344,8 @@ func opstorex(ctxt *obj.Link, a obj.As) uint32 { return OPVCC(31, 663, 0, 0) /* stfsx */ case AFMOVSU: return OPVCC(31, 695, 0, 0) /* stfsux */ + case AFMOVSX: + return OPVCC(31, 983, 0, 0) /* stfiwx */ case AMOVHZ, AMOVH: return OPVCC(31, 407, 0, 0) /* sthx */ |