x86: Expand Broadcast to 3 bits
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 25 Jul 2018 22:28:07 +0000 (15:28 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 25 Jul 2018 22:28:24 +0000 (15:28 -0700)
commit4a1b91eabbe77f4d906a0895121d76a0653c3cf3
tree675d4da6c17c95157f9a312626af39ac098b27d6
parent506f5c41cab71dbc3e562ba367d2dc6b355b64a6
x86: Expand Broadcast to 3 bits

Expand Broadcast to 3 bits so that the number of bytes to broadcast
can be computed as 1 << (Broadcast - 1).  Use it to simplify x86
assembler.

gas/

* config/tc-i386.c (Broadcast_Operation): Add bytes.
(build_evex_prefix): Use i.broadcast->bytes.
(match_broadcast_size): New function.
(check_VecOperands): Use the broadcast field to compute the
number of bytes to broadcast directly.  Set i.broadcast->bytes.
Use match_broadcast_size.

opcodes/

* i386-gen.c (adjust_broadcast_modifier): New function.
(process_i386_opcode_modifier): Add an argument for operands.
Adjust the Broadcast value based on operands.
(output_i386_opcode): Pass operand_types to
process_i386_opcode_modifier.
(process_i386_opcodes): Pass NULL as operands to
process_i386_opcode_modifier.
* i386-opc.h (BYTE_BROADCAST): New.
(WORD_BROADCAST): Likewise.
(DWORD_BROADCAST): Likewise.
(QWORD_BROADCAST): Likewise.
(i386_opcode_modifier): Expand broadcast to 3 bits.
* i386-tbl.h: Regenerated.
gas/ChangeLog
gas/config/tc-i386.c
opcodes/ChangeLog
opcodes/i386-gen.c
opcodes/i386-opc.h
opcodes/i386-tbl.h