diff options
| author | Russ Cox <rsc@golang.org> | 2015-03-16 15:54:44 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2015-03-20 04:47:08 +0000 |
| commit | 532ccae1547580e572cf5cd0f687f4508ceeddb9 (patch) | |
| tree | 0bf2149cc9ed14425e7cc6f83dd597372597aad2 /src/cmd/internal/obj/arm/obj5.go | |
| parent | 631d6a33bf2889c5c648555ab993687a48f9c287 (diff) | |
| download | go-532ccae1547580e572cf5cd0f687f4508ceeddb9.tar.xz | |
cmd/internal/obj: replace Addr.U struct {...} with Val interface{}
An interface{} is more in the spirit of the original union.
By my calculations, on 64-bit systems this reduces
Addr from 120 to 80 bytes, and Prog from 592 to 424 bytes.
Change-Id: I0d7b0981513c2a3c94c9ac76bb4f8816485b5a3c
Reviewed-on: https://go-review.googlesource.com/7744
Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/cmd/internal/obj/arm/obj5.go')
| -rw-r--r-- | src/cmd/internal/obj/arm/obj5.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/internal/obj/arm/obj5.go b/src/cmd/internal/obj/arm/obj5.go index 1f59c621c5..6b6e46b6a6 100644 --- a/src/cmd/internal/obj/arm/obj5.go +++ b/src/cmd/internal/obj/arm/obj5.go @@ -107,8 +107,8 @@ func progedit(ctxt *obj.Link, p *obj.Prog) { // Rewrite float constants to values stored in memory. switch p.As { case AMOVF: - if p.From.Type == obj.TYPE_FCONST && chipfloat5(ctxt, p.From.U.Dval) < 0 && (chipzero5(ctxt, p.From.U.Dval) < 0 || p.Scond&C_SCOND != C_SCOND_NONE) { - f32 := float32(p.From.U.Dval) + if p.From.Type == obj.TYPE_FCONST && chipfloat5(ctxt, p.From.Val.(float64)) < 0 && (chipzero5(ctxt, p.From.Val.(float64)) < 0 || p.Scond&C_SCOND != C_SCOND_NONE) { + f32 := float32(p.From.Val.(float64)) i32 := math.Float32bits(f32) literal := fmt.Sprintf("$f32.%08x", i32) s := obj.Linklookup(ctxt, literal, 0) @@ -125,8 +125,8 @@ func progedit(ctxt *obj.Link, p *obj.Prog) { } case AMOVD: - if p.From.Type == obj.TYPE_FCONST && chipfloat5(ctxt, p.From.U.Dval) < 0 && (chipzero5(ctxt, p.From.U.Dval) < 0 || p.Scond&C_SCOND != C_SCOND_NONE) { - i64 := math.Float64bits(p.From.U.Dval) + if p.From.Type == obj.TYPE_FCONST && chipfloat5(ctxt, p.From.Val.(float64)) < 0 && (chipzero5(ctxt, p.From.Val.(float64)) < 0 || p.Scond&C_SCOND != C_SCOND_NONE) { + i64 := math.Float64bits(p.From.Val.(float64)) literal := fmt.Sprintf("$f64.%016x", i64) s := obj.Linklookup(ctxt, literal, 0) if s.Type == 0 { @@ -201,7 +201,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) { autoffset = 0 } cursym.Locals = autoffset - cursym.Args = p.To.U.Argsize + cursym.Args = p.To.Val.(int32) if ctxt.Debugzerostack != 0 { if autoffset != 0 && p.From3.Offset&obj.NOSPLIT == 0 { |
