* Alpha/Linux Numerics Please...
@ 2000-02-27 5:00 reg
2000-02-28 5:00 ` Andrei A. Dergatchev
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: reg @ 2000-02-27 5:00 UTC (permalink / raw)
I understood this once, but cant find my notes.
Could someone verify or correct the following.
Pointing to me where it is discussed would be even better...
This has to do with porting some codes that run on the Sun and Linux/Intel
to Linux/Alpha. It should be relatively simple (for these codes) but never is.
---
Sun's and most other 'real' machines (those that dont run Windows)
are BIGENDIAN.
PC's are LITTLEENDIAN.
The ALPHA can be set to be either, but when running LINUX is LITTLEENDIAN.
----
OK, Fortran, be it DEC(Compaq) Fortran or g77
The choice in Fortran is to make everything look like the Sun/PC (ignoring
endian problems), viz
integer 4bytes
real 4bytes
double 8bytes
That is these DONT double on the Alpha.
---
As far as I can tell, there is nothing like the sun '-r8' switch on either
the fort (Dec/Compaq Fortran) or g77 compilers to default to 64 bit floats,
and 128bit doubles.
---
I am assuming that the C model has
int 4bytes
long 8bytes
pointer 8bytes
float 4bytes
double 8bytes
These can be found with a sizeof () so should be ok.
---
I SUSPECT that there is a way to get to 128bit (16byte) 'long double'
arithmetic in both C and Fortran, but the simple guess of 'long double'
with gcc still produced an 8 bit size.
Any thoughts here?
--
Reg.Clemens
reg@dwf.com
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Alpha/Linux Numerics Please...
2000-02-27 5:00 Alpha/Linux Numerics Please reg
@ 2000-02-28 5:00 ` Andrei A. Dergatchev
2000-02-28 5:00 ` Joern Amundsen
2000-03-02 5:00 ` Ryan C. Price
2 siblings, 0 replies; 7+ messages in thread
From: Andrei A. Dergatchev @ 2000-02-28 5:00 UTC (permalink / raw)
Hi,
[...]
>As far as I can tell, there is nothing like the sun '-r8' switch on either
>the fort (Dec/Compaq Fortran) or g77 compilers to default to 64 bit floats,
>and 128bit doubles.
Nothing like that for g77 for sure.
>
>---
>
>I am assuming that the C model has
>
> int 4bytes
> long 8bytes
> pointer 8bytes
> float 4bytes
> double 8bytes
>
>These can be found with a sizeof () so should be ok.
>
>---
>
>I SUSPECT that there is a way to get to 128bit (16byte) 'long double'
>arithmetic in both C and Fortran, but the simple guess of 'long double'
>with gcc still produced an 8 bit size.
>Any thoughts here?
I believe the only reason why it wasn't implemented yet
is a lack of man power (for gcc/g77 for sure).
I also agree that in principle it can be done. Anyone
can just send a patch to g77 maintainers. I believe they
will happily accept it :-)
>
>--
> Reg.Clemens
> reg@dwf.com
Regards,
Andrei
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Alpha/Linux Numerics Please...
2000-02-27 5:00 Alpha/Linux Numerics Please reg
2000-02-28 5:00 ` Andrei A. Dergatchev
@ 2000-02-28 5:00 ` Joern Amundsen
2000-03-02 5:00 ` Ryan C. Price
2 siblings, 0 replies; 7+ messages in thread
From: Joern Amundsen @ 2000-02-28 5:00 UTC (permalink / raw)
reg@orion.dwf.com () writes:
>
> As far as I can tell, there is nothing like the sun '-r8' switch on either
> the fort (Dec/Compaq Fortran) or g77 compilers to default to 64 bit floats,
> and 128bit doubles.
Correct regarding g77, wrong regarding Compaq Fortran (fort). Compaq
Fortran has -r8 and -r16. g77 supports real*4 and real*8 (not
real*16), though.
> I SUSPECT that there is a way to get to 128bit (16byte) 'long double'
> arithmetic in both C and Fortran, but the simple guess of 'long double'
> with gcc still produced an 8 bit size.
> Any thoughts here?
It seems long double is nyi (defaults to double) with C, but Fortran
implements real*16 (and the -r16 switch). A simple check also verifies
that
real*16 x(2)
write(*,*) loc(x(2)) - loc(x(1))
returns 16.
>
> --
> Reg.Clemens
> reg@dwf.com
--
Joern Amundsen (Jorn.Amundsen@itea.ntnu.no)
University Administration, ITEA
Norwegian University of Science and Technology, 7491 Trondheim, Norway
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Alpha/Linux Numerics Please...
2000-02-27 5:00 Alpha/Linux Numerics Please reg
2000-02-28 5:00 ` Andrei A. Dergatchev
2000-02-28 5:00 ` Joern Amundsen
@ 2000-03-02 5:00 ` Ryan C. Price
2000-03-02 5:00 ` Timo Biesenbach
2000-03-02 5:00 ` Greg Lindahl
2 siblings, 2 replies; 7+ messages in thread
From: Ryan C. Price @ 2000-03-02 5:00 UTC (permalink / raw)
> The ALPHA can be set to be either, but when running LINUX is LITTLEENDIAN.
Not true IIRC. Alpha is Little Endian, always, same as VAX was, and several
other
DEC architectures before it ( Tru64 UNIX, VMS and Windows NT are all little
endian). The cost of a bi-endian chip is prohibitive if you have no reason
to put it in.
Perhaps you are thinking of IA64, which is (was?) going to have bi-endian
support
for the sake of HP-UX (or more correctly, PA-RISC - big endian) and for
MS-Windows (IA32 - little endian).
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Alpha/Linux Numerics Please...
2000-03-02 5:00 ` Ryan C. Price
@ 2000-03-02 5:00 ` Timo Biesenbach
2000-03-02 5:00 ` Greg Lindahl
1 sibling, 0 replies; 7+ messages in thread
From: Timo Biesenbach @ 2000-03-02 5:00 UTC (permalink / raw)
The Alpha Architecture specifies both little and big-endian adressing
for data, instructions are always little endian.
It is implementation specific wheter both types are supported or not.
See also Chapter 2.1 - 2.3 in the Alpha Architecture Handbook.
-Timo
--
+---+---+-+-+-+-+
| | |-+-+-+-+ Fraunhofer-Institut fuer Graphische Datenverarbeitung
+---+---+-+-+-+-+ Fraunhofer-Institute for Computer Graphics
| | |-+-+-+-+ Abteilung / Department : Document Imaging
+---+---+-+-+-+-+
| __ _ | Dipl.Ing. (BA) Timo Biesenbach
| ! ! _ ! \ | Rundeturmstr. 6 phone ++49 6151 155 578
| ! !__! !_/ | 64283 Darmstadt fax ++49 6151 155 299
+---------------+ Germany email timo.biesenbach@igd.fhg.de
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Alpha/Linux Numerics Please...
2000-03-02 5:00 ` Ryan C. Price
2000-03-02 5:00 ` Timo Biesenbach
@ 2000-03-02 5:00 ` Greg Lindahl
2000-03-06 5:00 ` Ryan C. Price
1 sibling, 1 reply; 7+ messages in thread
From: Greg Lindahl @ 2000-03-02 5:00 UTC (permalink / raw)
"Ryan C. Price" <pricerc@ihug.co.nz> writes:
> Not true IIRC. Alpha is Little Endian, always, same as VAX was,
The Cray T3D and T3E are both big endian Alphas.
Most modern processors are bi-endian.
-- g
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Alpha/Linux Numerics Please...
2000-03-02 5:00 ` Greg Lindahl
@ 2000-03-06 5:00 ` Ryan C. Price
0 siblings, 0 replies; 7+ messages in thread
From: Ryan C. Price @ 2000-03-06 5:00 UTC (permalink / raw)
> The Alpha Architecture specifies both little and big-endian adressing
and
> The Cray T3D and T3E are both big endian Alphas.
My error bothered me for some time, so I went back to the handbook just to
check.
Whilst Alpha is Bi-endian w.r.t. data, but not instructions, I'm sure that
IA64 was going to be fully bi-endian. I seem to recall DEC engineers
lambasting the IA64 design for it's bi-endian character and the amount of
extra chip real estate it was going to take up. Alpha's implementation is
fairly trivial, since it's only about swapping a few bits in the address.
Also, isn't the 'endian-nis' dependent on the surrounding hardware. I.e. all
DEC/Compaq Alphas built to date have been little-endian, with no way
easy/obvious to make them big-endian. The Cray's are obviously purpose built
with special supporting chipsets to enable their big-endian nature, which
Cray wanted for various reasons.
I guess what I'm trying to say is that for practical purposes, while Alpha
as an architecture/chip is bi-endian, there are no freely available Alpha
'systems' that are BI-endian, which might explain why Linux/Alpha is a
little-endian OS. Additionally, even if the types of Alphas that Linux
developers use were bi-endian, in the early stages of the porting process,
I'm sure Windows NT, Digital UNIX and even Linux/Intel were used for
'cross-compiling', which would have been made a little simpler by making
Linux/Alpha little endian.
/Ryan
"Greg Lindahl" <lindahl@rt.com> wrote in message
news:89m6nh0ta2@news1.newsguy.com...
> "Ryan C. Price" <pricerc@ihug.co.nz> writes:
>
> > Not true IIRC. Alpha is Little Endian, always, same as VAX was,
>
> The Cray T3D and T3E are both big endian Alphas.
>
> Most modern processors are bi-endian.
>
> -- g
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2000-03-06 5:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-02-27 5:00 Alpha/Linux Numerics Please reg
2000-02-28 5:00 ` Andrei A. Dergatchev
2000-02-28 5:00 ` Joern Amundsen
2000-03-02 5:00 ` Ryan C. Price
2000-03-02 5:00 ` Timo Biesenbach
2000-03-02 5:00 ` Greg Lindahl
2000-03-06 5:00 ` Ryan C. Price
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox