This is the mail archive of the gcc@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]

i686 architecture behaviour in gcc


	Hi there,

	Nobody seems to know about this in gcc-help, so, there I go:

-------- Forwarded Message --------
From: David Fernandez <dfernandez@cct.co.uk>
To: gcc-help@gcc.gnu.org
Subject: i686 architecture behaviour in gcc
Date: Tue, 21 Feb 2006 17:08:32 +0000

	Hi there,

	Can anyone explain why has been chosen that -march=i686 makes the
compiler change the normal behaviour, and zero-expand unsigned short
parameters into 32-bit registers by all means?

	E.g.

	void __attribute(( regparm(2) )) myoutl( d, p )
	{
	    asm("    outl    %0,(%w1)    \n"
		:
		: "a" (d), "d" (p)           );
	}

assembled with

	gcc -Os -fomit-frame-pointer -march=i586 ...

gives us

	outl    %eax,(%dx)
	ret

but changing "-march=i686" gives us

	movzwl  %dx,%edx
	outl    %eax,(%dx)
	ret

	Is it a bug, or had any developer a good reason to do so?

David


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