]> granicus.if.org Git - yasm/commit
Support standalone, segment, and REX prefixes in GAS mode.
authorPeter Johnson <peter@tortall.net>
Mon, 24 Oct 2005 04:48:37 +0000 (04:48 -0000)
committerPeter Johnson <peter@tortall.net>
Mon, 24 Oct 2005 04:48:37 +0000 (04:48 -0000)
commit4024e3b87e606030efce9acf61b55a47a45f2239
treeb74224db40295afaf598e32f3fdbecdbeebea842
parent8bfd61773e9cc1075a57f847fe3c431151ccfd67
Support standalone, segment, and REX prefixes in GAS mode.
* bytecode.c (yasm_bc_create_empty_insn): New function to create empty
instruction that can have prefixes applied to it, for standalone prefixes.
* bytecode.h (yasm_bc_create_empty_insn): Prototype.

* x86arch.h (x86_parse_insn_prefix): Add prefix types for segment registers
(X86_SEGREG) and REX bytes (X86_REX).
(yasm_x86__bc_apply_prefixes): Adjust prototype to include REX pointer (as
this isn't in the x86_common structure).
* x86bc.c (yasm_x86__bc_apply_prefixes): Support the new prefix types.

* x86id.re (x86_finalize_*): Use const x86_insn_info; all insn_infos are
const so these pointers should be as well.
(yasm_x86__finalize_insn): Handle empty instruction case by pointing to new
empty_insn info.
(empty_insn): New.
(yasm_x86__parse_check_prefix): Support GAS prefix naming, and REX and jump
hint prefixes (only in GAS mode at the moment).

* gas-bison.y: Add rules to handle segreg prefixes as well as standalone
prefixes (both segreg and others).

* gas-prefix.asm: New testcase that also hits the warning cases in
yasm_x86__bc_apply_prefixes X86_REX case.

svn path=/trunk/yasm/; revision=1292
libyasm/bytecode.c
libyasm/bytecode.h
modules/arch/x86/tests/gas64/Makefile.inc
modules/arch/x86/tests/gas64/gas-prefix.asm [new file with mode: 0644]
modules/arch/x86/tests/gas64/gas-prefix.errwarn [new file with mode: 0644]
modules/arch/x86/tests/gas64/gas-prefix.hex [new file with mode: 0644]
modules/arch/x86/x86arch.h
modules/arch/x86/x86bc.c
modules/arch/x86/x86id.re
modules/parsers/gas/gas-bison.y