From cdb853c5311b2e580f955a1b0fbf39de710b690c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 26 Apr 2006 06:35:46 +0000 Subject: [PATCH] * x86id.c (yasm_x86__finalize_insn): Don't check for explicit 64-bit effective address size in GAS mode. Doing this breaks movabs. * gas-movabs.asm: Test this. svn path=/trunk/yasm/; revision=1512 --- modules/arch/x86/tests/gas64/Makefile.inc | 3 + modules/arch/x86/tests/gas64/gas-movabs.asm | 4 + .../arch/x86/tests/gas64/gas-movabs.errwarn | 0 modules/arch/x86/tests/gas64/gas-movabs.hex | 672 ++++++++++++++++++ modules/arch/x86/x86id.c | 4 +- 5 files changed, 681 insertions(+), 2 deletions(-) create mode 100644 modules/arch/x86/tests/gas64/gas-movabs.asm create mode 100644 modules/arch/x86/tests/gas64/gas-movabs.errwarn create mode 100644 modules/arch/x86/tests/gas64/gas-movabs.hex diff --git a/modules/arch/x86/tests/gas64/Makefile.inc b/modules/arch/x86/tests/gas64/Makefile.inc index f8a1f87e..d92a4715 100644 --- a/modules/arch/x86/tests/gas64/Makefile.inc +++ b/modules/arch/x86/tests/gas64/Makefile.inc @@ -18,6 +18,9 @@ EXTRA_DIST += modules/arch/x86/tests/gas64/gas-inout.hex EXTRA_DIST += modules/arch/x86/tests/gas64/gas-moreinsn.asm EXTRA_DIST += modules/arch/x86/tests/gas64/gas-moreinsn.errwarn EXTRA_DIST += modules/arch/x86/tests/gas64/gas-moreinsn.hex +EXTRA_DIST += modules/arch/x86/tests/gas64/gas-movabs.asm +EXTRA_DIST += modules/arch/x86/tests/gas64/gas-movabs.errwarn +EXTRA_DIST += modules/arch/x86/tests/gas64/gas-movabs.hex EXTRA_DIST += modules/arch/x86/tests/gas64/gas-movdq64.asm EXTRA_DIST += modules/arch/x86/tests/gas64/gas-movdq64.errwarn EXTRA_DIST += modules/arch/x86/tests/gas64/gas-movdq64.hex diff --git a/modules/arch/x86/tests/gas64/gas-movabs.asm b/modules/arch/x86/tests/gas64/gas-movabs.asm new file mode 100644 index 00000000..d4d9a1a9 --- /dev/null +++ b/modules/arch/x86/tests/gas64/gas-movabs.asm @@ -0,0 +1,4 @@ +.comm _CONE, 4, 16 + +movabsl %eax,(_CONE) +movabsl (_CONE), %eax diff --git a/modules/arch/x86/tests/gas64/gas-movabs.errwarn b/modules/arch/x86/tests/gas64/gas-movabs.errwarn new file mode 100644 index 00000000..e69de29b diff --git a/modules/arch/x86/tests/gas64/gas-movabs.hex b/modules/arch/x86/tests/gas64/gas-movabs.hex new file mode 100644 index 00000000..05c97a31 --- /dev/null +++ b/modules/arch/x86/tests/gas64/gas-movabs.hex @@ -0,0 +1,672 @@ +7f +45 +4c +46 +02 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +3e +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +20 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +00 +00 +40 +00 +06 +00 +01 +00 +a3 +00 +00 +00 +00 +00 +00 +00 +00 +a1 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0a +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +72 +65 +6c +61 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +2d +00 +5f +43 +4f +4e +45 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +10 +00 +f2 +ff +10 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +22 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +84 +00 +00 +00 +00 +00 +00 +00 +2c +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +12 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b0 +00 +00 +00 +00 +00 +00 +00 +09 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +1a +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +bc +00 +00 +00 +00 +00 +00 +00 +60 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +03 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +00 +00 +00 +00 +12 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +54 +00 +00 +00 +00 +00 +00 +00 +30 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index e85b8c11..4679da74 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -2543,8 +2543,8 @@ yasm_x86__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, if (mismatch) break; - /* Check for 64-bit effective address size */ - if (op->type == YASM_INSN__OPERAND_MEMORY) { + /* Check for 64-bit effective address size in NASM mode */ + if (suffix == 0 && op->type == YASM_INSN__OPERAND_MEMORY) { if ((info->operands[i] & OPEAS_MASK) == OPEAS_64) { if (op->data.ea->disp_len != 8) mismatch = 1; -- 2.40.0