Re: Pentium4 new registers (John Dallman)
21 Oct 2001 21:24:45 -0400

          From comp.compilers

Related articles
Pentium4 new registers (jacob navia) (2001-10-20)
Re: Pentium4 new registers (2001-10-21)
| List of all articles for this month |

From: (John Dallman)
Newsgroups: comp.compilers
Date: 21 Oct 2001 21:24:45 -0400
Organization: By appointment only
References: 01-10-106
Keywords: architecture
Posted-Date: 21 Oct 2001 21:24:45 EDT (jacob navia) wrote:

> I am the developer of the lcc-win32 compiler and I am adding support
> for the new pentium 4 registers (8 128bit registers)

Good luck, Caruthers!

> Does Microsoft MSVC use those regs? Which calling conventions do they
> use?

VC6 doesn't use them at all; the beta of VC7 that's in Visual
Studio.NET beta 2 has no flags for P4 code generation, so I assume it
can't use them either.

> How does intel's icc use those regs? (If anyone from intel reads this
> newgroup I would be happy to know how they do it :-)

I've done a bit of debugging of code compiled with Intel's icl.exe on
Windows NT. As far as I could see, it used the extra registers only as
scratch floating point registers, but one can't be sure that's all it
can do.

Using them for parameter passing has the problem that you may well be
calling older code that doesn't know about them, so the preservation
problem is moot. This could be changed for static functions if you
were using inter-procedural optimisation, but I wouldn't be keen to
risk it personally.

It didn't try to do all FP work in these registers, but was happy to
use them for operations which they could do better (eg, C cast of
float/double to int/long). It seemed to use a mixture of classic x87
registers and P4 registers for ordinary floating point arithmetic, but
the rules it was using to decide which weren't immediately obvious.

Two important caveats: there are no instructions to move floating
point data between old and new floating point registers, and if you
use a mixture of register types, the precision setting of the x87
registers becomes highly significant. If you stay with the defaults
(53-bit mantissa), the results seem to be compatible between the two
register sets.

John Dallman
                    "C++ - the FORTRAN of the early 21st century."

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.