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

Re: Showstopper in g77 in prerelease on Linux-Alpha


In article <4496.931501897@upchuck.cygnus.com>,
Jeffrey A Law  <law@cygnus.com> wrote:
>
>Compiling for an ev56 we get the following sequence for the conversion from
>FP to an int type:
>
>0x120001194 <MAIN__+148>:       cvttq/c $f10,$f10
>0x120001198 <MAIN__+152>:       sts     $f10,68(sp)
>0x12000119c <MAIN__+156>:       nop
>0x1200011a0 <MAIN__+160>:       ldl     t0,68(sp)

Apart from the size problem, which Richard already pointed out (doing a
32-bit store of a 64-bit quantity from a FP register doesn't work), I
wonder about the added "nop".

I know that the alpha architecture handbooks at some point claimed that
a nop like the above was needed to avoid a stall, but I also remember
that actually tsting it out showed that the documentation was wrong, and
that without the nop it can be forwarded from the write buffer instead
of going through the cache.

I still haven't received my new alpha (and I no longer touch single-CPU
machines), but I _think_ the code you want is

	cvttq/c $f10,$f10
	stt	$f10,72(sp)
	ldl	t0,72(sp)

(obviously it now needs an 8-byte allocation on the stack too). No nop,
and a 64-bit FP store. The no nop thing needs timing testing, as it
might depend on the particular chip version.

		Linus


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