]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj/x86: fix doubled REX byte in POPCNT, others
authorRuss Cox <rsc@golang.org>
Fri, 22 Jan 2016 20:50:01 +0000 (15:50 -0500)
committerRuss Cox <rsc@golang.org>
Sun, 24 Jan 2016 05:01:32 +0000 (05:01 +0000)
Tests for this and many other instructions are in a separate followup CL.

For #14068.

Change-Id: I6955315996a34d7fb79369b9d9a0119d11745e85
Reviewed-on: https://go-review.googlesource.com/18849
Reviewed-by: Rob Pike <r@golang.org>
src/cmd/internal/obj/x86/asm6.go

index 41386ef6e0f804f76e002f9f3b563ef251b90211..f67dfa94495c40a6cdc4f4ee53576cb05e6b8136 100644 (file)
@@ -3189,12 +3189,10 @@ func doasm(ctxt *obj.Link, p *obj.Prog) {
                                ctxt.Andptr[0] = Pm
                                ctxt.Andptr = ctxt.Andptr[1:]
 
-                       case Pq3: /* 16 bit escape, Rex.w, and opcode escape */
+                       case Pq3: /* 16 bit escape and opcode escape + REX.W */
+                               ctxt.Rexflag |= Pw
                                ctxt.Andptr[0] = Pe
                                ctxt.Andptr = ctxt.Andptr[1:]
-
-                               ctxt.Andptr[0] = Pw
-                               ctxt.Andptr = ctxt.Andptr[1:]
                                ctxt.Andptr[0] = Pm
                                ctxt.Andptr = ctxt.Andptr[1:]
 
@@ -3206,12 +3204,10 @@ func doasm(ctxt *obj.Link, p *obj.Prog) {
                                ctxt.Andptr[0] = Pm
                                ctxt.Andptr = ctxt.Andptr[1:]
 
-                       case Pfw: /* first escape, Rex.w, and second escape */
+                       case Pfw: /* xmm opcode escape + REX.W */
+                               ctxt.Rexflag |= Pw
                                ctxt.Andptr[0] = Pf3
                                ctxt.Andptr = ctxt.Andptr[1:]
-
-                               ctxt.Andptr[0] = Pw
-                               ctxt.Andptr = ctxt.Andptr[1:]
                                ctxt.Andptr[0] = Pm
                                ctxt.Andptr = ctxt.Andptr[1:]