x86-64: fix handling of PUSH/POP of segment register
authorJan Beulich <jbeulich@suse.com>
Fri, 20 Sep 2019 08:18:15 +0000 (10:18 +0200)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 4 Oct 2019 15:05:27 +0000 (08:05 -0700)
commit20057c8c5e67ffdfb1a7b6a4ef3d337ea27663d1
tree91281a2576cedf71f9c5b3288f50e8d83c3c04c8
parentd4768b8e5db07dbdbd859a0ad6e3db43dccf678c
x86-64: fix handling of PUSH/POP of segment register

Commit 21df382b91 ("x86: fold SReg{2,3}") went too far: Folding 64-bit
PUSH/POP templates into non-64-bit ones isn't correct, due to the
different operand widths, and hence suffixes permitted. Restore the
separate templates.

Add tests of PUSH/POP with q suffix and %fs/%gs operands to the
testsuite. While doing so also add PUSHF/POPF ones _without_ suffix.

(cherry picked from commit 3f9aad111cea2f25877d0a6b404956769c14faee)
gas/ChangeLog
gas/config/tc-i386.c
gas/testsuite/gas/i386/x86-64-opcode.d
gas/testsuite/gas/i386/x86-64-opcode.s
opcodes/ChangeLog
opcodes/i386-opc.tbl
opcodes/i386-tbl.h