This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR target/39590: inline asm %z on amd64 says "ll" instead of "q"


On Wed, Apr 1, 2009 at 9:08 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:

> Gcc generates "movll" for asm statement with "mov%z1" on a DImode memory.
> The problem is "%z" was never updated for 64bit. We can't generate 'q'
> for "%z" due to "fild%z1\t%1" in i386.md. Not all x86-64 assemblers
> support "fildq".  This patch checks if assembler supports fildq and
> generates fildq/movq when it works.  OK for trunk?

I think that we should move special fild/fist handling out of 'z' into
new 'Z' operand modifier. This simplifies code a lot, and enables all
sorts of special fild/fist handling to be handled in one place without
overloading (otherwise undocumented!) 'z' modifier too much.

Attached patch also introduces autodetection of fildq/fistpq support
and cleans up relevant part of the source.

2009-04-22  Uros Bizjak  <ubizjak@gmail.com>
	    H.J. Lu  <hongjiu.lu@intel.com>

	PR target/39590
	* configure.ac (HAVE_AS_IX86_FILDQ): On x86 targets check whether
	the configured assembler supports fildq and fistpq mnemonics.
	(HAVE_AS_IX86_FILDS): Rename from HAVE_GAS_FILDS_FISTS.
	* configure: Regenerated.
	* config.in: Ditto.

	* config/i386/i386.c (print_operand): Handle 'Z'.
	['z']: Remove handling of special fild/fist suffixes.
	(output_fix_trunc): Use '%Z' to output suffix of fist{,p,tp} insn.
	* config/i386/i386.md (*floathi<mode>2_i387): Use '%Z' to output
	suffix of fild insn.
	* config/i386/gas.h (GAS_MNEMONICS): Remove.

Patch was bootstrapped and regression tested on i686-pc-linux-gnu with
binutils 2.19.

Uros.

Attachment: p.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]