Commit d3ff40fb authored by Russ Cox's avatar Russ Cox

cmd/internal/obj/x86: fix doubled REX byte in POPCNT, others

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/18849Reviewed-by: 's avatarRob Pike <r@golang.org>
parent f844b0be
...@@ -3189,12 +3189,10 @@ func doasm(ctxt *obj.Link, p *obj.Prog) { ...@@ -3189,12 +3189,10 @@ func doasm(ctxt *obj.Link, p *obj.Prog) {
ctxt.Andptr[0] = Pm ctxt.Andptr[0] = Pm
ctxt.Andptr = ctxt.Andptr[1:] 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[0] = Pe
ctxt.Andptr = ctxt.Andptr[1:] ctxt.Andptr = ctxt.Andptr[1:]
ctxt.Andptr[0] = Pw
ctxt.Andptr = ctxt.Andptr[1:]
ctxt.Andptr[0] = Pm ctxt.Andptr[0] = Pm
ctxt.Andptr = ctxt.Andptr[1:] ctxt.Andptr = ctxt.Andptr[1:]
...@@ -3206,12 +3204,10 @@ func doasm(ctxt *obj.Link, p *obj.Prog) { ...@@ -3206,12 +3204,10 @@ func doasm(ctxt *obj.Link, p *obj.Prog) {
ctxt.Andptr[0] = Pm ctxt.Andptr[0] = Pm
ctxt.Andptr = ctxt.Andptr[1:] 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[0] = Pf3
ctxt.Andptr = ctxt.Andptr[1:] ctxt.Andptr = ctxt.Andptr[1:]
ctxt.Andptr[0] = Pw
ctxt.Andptr = ctxt.Andptr[1:]
ctxt.Andptr[0] = Pm ctxt.Andptr[0] = Pm
ctxt.Andptr = ctxt.Andptr[1:] ctxt.Andptr = ctxt.Andptr[1:]
......
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