]> granicus.if.org Git - yasm/commit
Change some optimization settings so that imm8 optimizations actually get
authorPeter Johnson <peter@tortall.net>
Mon, 7 Nov 2005 05:12:22 +0000 (05:12 -0000)
committerPeter Johnson <peter@tortall.net>
Mon, 7 Nov 2005 05:12:22 +0000 (05:12 -0000)
commitaa3e6ff9b9cd0c785e44490acab453eb3b3581c0
tree011fc3b8a060767ae50b63774abf825ca8b63233
parent9996855928d96c04bd4af42ffa3578d95b760c9c
Change some optimization settings so that imm8 optimizations actually get
triggered for more cases and optimize from 64-bit down to 32-bit for 64-bit
mov instructions.  This change means that mov reg64, constant will be
auto-sized up to 64 bits, but mov reg64, expr/symbol will default to 32 bits.
You must use mov reg64, qword expr/symbol if you need 64 bits, or in GAS
mode use movabsq expr/symbol, reg64.

This makes the generated code smaller and default most usages into 32-bit
relocations appropriate for ELF64 and Win64.  Right now, 32-bit unsigned
relocs are generated instead of 32-bit signed; this will need to be fixed.

* x86arch.h (x86_insn.postop): Add X86_POSTOP_SIGNEXT_IMM32.
* x86bc.c (x86_bc_insn_resolve): Implement.
* x86id.re (OPAP_SImm32Avail): New flag.
(MOD_Op2AddSp): New modifier to encode spare directly into 2nd opcode byte.
(arith_insn): Use MOD_Op2AddSp and add forced-size override forms.
(mov_insn): Use OPAP_SImm32Avail and add forced-size override form.
(yasm_x86__finalize_insn): Implement new flag and modifier.

Fix up testcases for changes.

svn path=/trunk/yasm/; revision=1314
22 files changed:
modules/arch/x86/tests/Makefile.inc
modules/arch/x86/tests/addbyte.asm
modules/arch/x86/tests/addbyte.errwarn
modules/arch/x86/tests/addbyte.hex
modules/arch/x86/tests/arithsmall.asm [new file with mode: 0644]
modules/arch/x86/tests/arithsmall.errwarn [new file with mode: 0644]
modules/arch/x86/tests/arithsmall.hex [new file with mode: 0644]
modules/arch/x86/tests/nomem64.asm
modules/arch/x86/tests/nomem64.errwarn
modules/arch/x86/tests/nomem64.hex
modules/arch/x86/x86arch.h
modules/arch/x86/x86bc.c
modules/arch/x86/x86id.re
modules/objfmts/bin/tests/bigorg.asm
modules/objfmts/bin/tests/bigorg.errwarn
modules/objfmts/bin/tests/bigorg.hex
modules/objfmts/coff/tests/x86id.hex
modules/objfmts/elf/tests/elf-x86id.hex
modules/objfmts/elf/tests/elfglobal.hex
modules/objfmts/elf/tests/gas64/elf_gas64_reloc.hex
modules/objfmts/win64/tests/win64-dataref.asm
modules/objfmts/xdf/tests/xdflong.asm