public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Float commands for 64bit data
@ 2006-12-07 13:34 Fabian Cenedese
  2006-12-11  8:13 ` Fabian Cenedese
  2006-12-12 17:40 ` Rask Ingemann Lambertsen
  0 siblings, 2 replies; 8+ messages in thread
From: Fabian Cenedese @ 2006-12-07 13:34 UTC (permalink / raw)
  To: gcc-help

Hi

Is there a flag to tell gcc NOT to use float assembler commands
for 64bit data? We have problems that the generated code contains
float commands while the target (partially) has no float support.

To make it clear: This is not about the soft-float library which would
emulate float commands. We don't want gcc to even generate
those unless it really is about float operations.

Here's one example (for PPC603), but there also are others:

inline uint64 GetSystemTicks()
{
	union {
		uint64 s;
		struct {
			uint32 high;
			uint32 low;
		} m;
	} result;

	uint32 tmp=0;
	asm volatile (
		"mftbu 	%0" "\n\t"
		"mftb 	%1" "\n\t"
		"mftbu	%2" "\n\t"
		"cmpw	%3,%4" "\n\t"
		"beq	0f" "\n\t"
		"mftbu 	%0" "\n\t"
		"mftb 	%1" "\n\t"
	"0:"	 
		: "=r" (result.m.high), "=r" (result.m.low), "=r" (tmp)
		: "0" (result.m.high), "2" (tmp));

	return result.s;
}

...(snip)...
	mr 0,10			 # tmp120,
	stw 0,8(31)		 # result.m.high, tmp120
	stw 9,12(31)		 # result.m.low, tmp121
	stw 11,16(31)		 # tmp, tmp122
->	lfd 0,8(31)		 # result.s, result.s
->	stfd 0,24(31)		 #, result.s
	lwz 9,24(31)		 #, <result>
	lwz 10,28(31)		 #, <result>
	mr 3,9			 # <result>, <result>
	mr 4,10			 # <result>, <result>
	lwz 11,0(1)		 #,
	lwz 31,-4(11)		 #,
	mr 1,11			 #,
	blr			 #

The float commands are simply used for moving 64 bit of data around.
That may be faster than 2x32 but not working here. I'm interested in
workarounds for various gcc versions (2.95, 3.4, 4.x).

Thanks

bye   Fabi


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-12-12 17:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-07 13:34 Float commands for 64bit data Fabian Cenedese
2006-12-11  8:13 ` Fabian Cenedese
2006-12-11  9:58   ` Andrew Haley
2006-12-11 11:23     ` Fabian Cenedese
2006-12-11 11:58       ` Andrew Haley
2006-12-11 12:04         ` Andrew Haley
2006-12-11 12:18         ` Fabian Cenedese
2006-12-12 17:40 ` Rask Ingemann Lambertsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).