* Compiling 64 bit code
@ 1997-06-12 21:06 Kelvin Lunsford
0 siblings, 0 replies; 9+ messages in thread
From: Kelvin Lunsford @ 1997-06-12 21:06 UTC (permalink / raw)
Does anybody out there know of a C compiler (DEC/GCC/NT) for the Alpha
processor which will let you set the default int size to 64 bits. This is for an
embedded application, the resulting binaries would not be running under an
operating system.
Kelvin Lunsford, kelvin@qantel.com
Principal Engineer
Qantel Technologies, Inc.
begin 600 WINMAIL.DAT
M>)\^(C,5`0:0" `$```````!``$``0>0!@`(````Y 0```````#H``$-@ 0`
M`@````(``@`!!) &`!P!```!````# ````,``# #````"P`/#@`````"`?\/
M`0```$4`````````@2L?I+ZC$!F=;@#=`0]4`@````!A>' M;&ES=$!R961H
M870N8V]M`%--5% `87AP+6QI<W1 <F5D:&%T+F-O;0`````>``(P`0````4`
M``!33510`````!X``S !````% ```&%X<"UL:7-T0')E9&AA="YC;VT``P`5
M# $````#`/X/!@```!X``3 !````%@```"=A>' M;&ES=$!R961H870N8V]M
M)P````(!"S !````&0```%--5% Z05A0+4Q)4U1 4D5$2$%4+D-/30`````#
M```Y``````L`0#H!`````@'V#P$````$`````````Y<R`0B !P`8````25!-
M+DUI8W)O<V]F="!-86EL+DYO=&4`,0@!!( !`!8```!#;VUP:6QI;F<@-C0@
M8FET(&-O9&4`1@<!!8 #``X```#-!P8`# `.``8`,@`$`# !`2" `P`.````
MS0<&``P`#0`X`",`! !2`0$)@ $`(0```#-".3(V,T8T,4-%,T0P,3$X.41$
M,# V,#A#-SE%1#DW`"@'`0.0!@! `P``$@````L`(P`!`````P`F```````+
M`"D```````,`-@``````0 `Y`."DAHMT=[P!'@!P``$````6````0V]M<&EL
M:6YG(#8T(&)I="!C;V1E`````@%Q``$````6`````;QW=(N&]&.2/.,<$=")
MW0!@C'GMEP``'@`># $````%````4TU44 `````>`!\,`0```!(```!K96QV
M:6Y <6%N=&5L+F-O;0````,`!A#6.]1X`P`'$ X!```>``@0`0```&4```!$
M3T5304Y90D]$64]55%1(15)%2TY/5T]&04-#3TU024Q%4BA$14,O1T-#+TY4
M*49/4E1(14%,4$A!4%)/0T534T]25TA)0TA724Q,3$5464]54T545$A%1$5&
M055,5$E.5%-)``````(!"1 !````RP$``,<!``!Y`@``3%I&=>A_.3C_``H!
M#P(5`J@%ZP*#`% "\@D"`&-H"L!S970R-P8`!L,"@S(#Q0(`<')"<1'B<W1E
M;0*#,W<"Y <3`H!]"H (SPG9._$6#S(U-0* "H$-L0M@X&YG,3 S%% +"A11
MQ0OR8P! ($1O!Y$`<&)Y!N!D>2 (8 5 =()H!)!E(&MN;P?@1&]F&S @0R %
MH&T&< ,0!) @*$1%0P@O1T,=X$Y4*2#/`A %P!P!%+!L<!& "H4I$U!O8P>0
M<P6Q=VA^:1%P(% #$ ,@'7 %0'D="& @$;$>LPVQ875L+P5 "X %0 "0>AQ
M=&\`(#8T(&)I='/P+B @5"!P!" D$1Z"MP!P"H43X&()@ VP9!LP1G +4""
M871I`B L6QZS%A!S(E$+@&<C<6[7"L (D 0@=PA@;"6P''#G!4 E8";0=6X#
M`"=1*/!S!($DJ&]P!) F,2=1<PT3LRX*A0J%2V5L=JD+@"!,*/!S'H%D)H R
M:RQ30'$`<!/0;"[+'2$*A5 %$&YC!2 '0%P@11D0"X )X'(*A5'W+=,CX 60
M:!QP%: OD >0?2: 22\`*U89S1_!$]!C%P5 "H45,0`T@ `#`! 0``````,`
M$1 !````0 `',(#_@AUS=[P!0 `(,(#_@AUS=[P!'@`]``$````!````````
#`/+4
`
end
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Compiling 64 bit code
@ 1997-06-13 2:26 Jim Paradis
0 siblings, 0 replies; 9+ messages in thread
From: Jim Paradis @ 1997-06-13 2:26 UTC (permalink / raw)
Kelvin Lunsford wrote:
>
> Does anybody out there know of a C compiler (DEC/GCC/NT) for the
> Alpha processor which will let you set the default int size to 64
> bits. This is for an embedded application, the resulting binaries
> would not be running under an operating system.
How about:
% gcc -Dint=long "-Dunsigned=unsigned long"
This works even in cases of "unsigned int" and "unsigned long"
because on Linux/Alpha GCC sizeof(long)==sizeof(long long)==8.
This is the only solution I can think of. The default programming
model for both DEC C and gcc on Alpha is sizeof(int)==4 and
sizeof(long)==8. There's no easy way to change this (hell it was
a major feat back in the early days of my 32-bit Linux/Alpha port
to convince gcc to generate code where sizeof(void *)==4)
Does this help?
--
Jim Paradis jrp@jrp.tiac.net
http://www.tiac.net/users/jrp/index.html
"It's not procrastination, it's my new Just-In-Time Workload Management
System!"
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Compiling 64 bit code
[not found] <33A0AFE4.3973144C@jrp.tiac.net>
@ 1997-06-13 3:54 ` Michal Jaegermann
0 siblings, 0 replies; 9+ messages in thread
From: Michal Jaegermann @ 1997-06-13 3:54 UTC (permalink / raw)
Jim Paradis wrote:
> Kelvin Lunsford wrote:
> >
> > Does anybody out there know of a C compiler (DEC/GCC/NT) for the
> > Alpha processor which will let you set the default int size to 64
> > bits. This is for an embedded application, the resulting binaries
> > would not be running under an operating system.
>
> How about:
>
> % gcc -Dint=long "-Dunsigned=unsigned long"
This would convert 'unsigned int' into 'unsigned long long'
(or we would recurse on unsigned? but this is easily avoidable)
not something you likely would want to see. You can probably
control a code you write to avoid such surprises but headers
will be a fun.
Also all libraries would have to be likely recompiled from
scratch or every second function call would be a challenge. :-)
Michal
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: Compiling 64 bit code
@ 1997-06-13 19:58 Kelvin Lunsford
0 siblings, 0 replies; 9+ messages in thread
From: Kelvin Lunsford @ 1997-06-13 19:58 UTC (permalink / raw)
>Kelvin Lunsford wrote:
>>
> >Does anybody out there know of a C compiler (DEC/GCC/NT) for the
>>Alpha processor which will let you set the default int size to 64
> >bits. This is for an embedded application, the resulting binaries
> >would not be running under an operating system.
>
>How about:
>
> % gcc -Dint=long "-Dunsigned=unsigned long"
>
Wouldn't this convert an "unsigned char" to "unsigned long char"?
I assume this has about the same effect as typedef's.
What I'm looking for is a compiler that will use 64 bit integral promotion
when expressions are evaluated. The Alpha is a native 64 bit machine
and the C language is supposed to have an int size which is optimized
to the target machine so that the most efficient code can be generated.
Unfortunately too much C code has been written which uses 32 bit
int's, so rather that fix the C programs the Alpha compilers were made to
generate extra code which does all of the conversions and testing to make
the int's look like they are 32 bits. I think it is great that a
compatibility mode exists so that older programs can be supported, but
it's not a compatibility mode, IT'S THE ONLY MODE.
Kelvin Lunsford, kelvin@qantel.com
Principal Engineer
Qantel Technologies, Inc.
begin 600 WINMAIL.DAT
M>)\^(B83`0:0" `$```````!``$``0>0!@`(````Y 0```````#H``$-@ 0`
M`@````(``@`!!) &`!P!```!````# ````,``# #````"P`/#@`````"`?\/
M`0```$4`````````@2L?I+ZC$!F=;@#=`0]4`@````!A>' M;&ES=$!R961H
M870N8V]M`%--5% `87AP+6QI<W1 <F5D:&%T+F-O;0`````>``(P`0````4`
M``!33510`````!X``S !````% ```&%X<"UL:7-T0')E9&AA="YC;VT``P`5
M# $````#`/X/!@```!X``3 !````%@```"=A>' M;&ES=$!R961H870N8V]M
M)P````(!"S !````&0```%--5% Z05A0+4Q)4U1 4D5$2$%4+D-/30`````#
M```Y``````L`0#H!`````@'V#P$````$`````````Y<R`0B !P`8````25!-
M+DUI8W)O<V]F="!-86EL+DYO=&4`,0@!!( !`!H```!213H@0V]M<&EL:6YG
M(#8T(&)I="!C;V1E`#<(`06 `P`.````S0<&``T`# `Z`"4`!0!7`0$@@ ,`
M#@```,T'!@`-``L`-0`L``4`6 $!"8 !`"$````P-D4X-S4X,$1%13-$,#$Q
M.#E$1# P-C X0S<Y140Y-P`Q!P$#D 8`^ 4``!(````+`",```````,`)@``
M````"P`I```````#`#8``````$ `.0!@FZ<N-'B\`1X`< `!````&@```%)%
M.B!#;VUP:6QI;F<@-C0@8FET(&-O9&4````"`7$``0```!8````!O'@T+J>
M=>@7X]X1T(G=`&",>>V7```>`!X,`0````4```!33510`````!X`'PP!````
M$@```&ME;'9I;D!Q86YT96PN8V]M`````P`&$$>();\#``<0V0,``!X`"! !
M````90```$M%3%9)3DQ53E-&3U)$5U)/5$4Z1$]%4T%.64)/1%E/55142$52
M14M.3U=/1D%#0T]-4$E,15(H1$5#+T=#0R].5"E&3U)42$5!3%!(05!23T-%
M4U-/4E=(24-(5TE,3$Q%5%D``````@$)$ $```!Z! ``=@0``$<(``!,6D9U
ML.);'O\`"@$/`A4"J 7K`H,`4 +R"0(`8V@*P'-E=#(W!@`&PP*#,@/%`@!P
M<D)Q$>)S=&5M`H,S-P+D!Q,"@S0$1A,S,2#["%4"@'T*@ C/"=D"@ J!@PVQ
M"V!N9S$P,Q10%PL*$K(,`6,-X" ^2RL:/1-0;Q/08P5 96SB=@N ($QU`( "
M$ L@]"!W'((Z"H\:C1N/')1\/B >12&P'P\@'QQG1!9O!Y$`<'D&X&1Y(!,(
M8 5 =&@$D&4@:V1N;P?@;V8E4!90(!D%H&UP`Q $D" H1"!%0R]'0R@`3E3\
M*2 =D282(<<B;PH1*8]1''9!;' 1@" <<6/%!Y!S!;%W:&D1<!W0KP,0`R G
MD 5 >0A@(!&QXRC3#;%A=6P%0 N !4 %`)!Z)F!T;R V- \AWRHO*S\<P6)I
M='/P+B @5"V !" T<2BB.P.1$^!B"8 -L!W 87"C"U MD&%T:0(@+"C3K1?0
M<R]A"X!G,]%N"L"]")!S,(\QGS*O',%W"&#^;!W )I SP3;!'6 #`#=1YQU@
M!($U`F]P!) V,3=1^G,3LRX>1SB_.<\<9SY?\S]O0'\@2":A`: EX1XX?T(O
M0S]!#T7_1P\<6 R"( `E(&=C8R M1&TOH3T78#=1(DR@'6%I=&=N"8 ]388N
M$$T1(E](OTG/2M](KQK(5SMR;LXG)@(T<06@;G8$D 5 [0.1(DX7$7(B,")5
M:$T#M58#/QY%2250!!!U!X"?5%01@"5!12(HTW-A6+%G#<$<LEE!='D]4 VQ
M)S<T$!Y%'D57$8 %0$DG\FU.D6]K-T(HHC1Q)P#O)T<F(%RA+=-U$; P43/2
M_2^290G !T LP@1@-D(>1?<M< GP'.!X$U M$391)4'I)E%E=@= =38P"8 T
M(_\F8"QT7=,WH#9 5.!?A@#!_RV 3= AQ@!P'< HXB<@&6*]8R!G)F T<3<`
M->!O$;#_9H$P0!& 9-$#D2^G+70T<>L]0#9 ;2_Q9!Y%,#$HXOT!D')G8&58
M+3!>I"CB!&#_$\!:4BV0") OL06@#; G,'\#D3P!9V!-T#UQ8U$>157:;AV1
M=!U@8S%L)< P,/DP0&UU+:$G(FY163(U8/]AL1W@,_ 3T')1+8-?400@_C,1
MX#/A'D4OH5MP-H!L@>\]<28Q7J1ML'AFE1QQ8$'>;5KA8[<G1@0@=R9"`,#O
M;E$P,6[V8=%T/7!N)"UT_F0E(RWQ)M$HXE2T8D5F<N\'D#<S,#$`P&M8PF=Q
M=(+[70,N$&E]A"7 8J)SI#02^UA05&%N?H!?T@0@"<%LT_U<H6$>12="-C$S
MX#8`6P#_;3%N46'@! `T`&QW!O \TK]V=VZ%9\,`( F -H!B)? _= 9^$CO"
M7@2"?#: 250")P7P5$A%($].M$Q9!=!/)^!;G4L<_&<V@'V '0) <0!P<)$N
MZR=!'D50!1!N;= >< ,@WD49@&6Q!) >15&,DS1 _060:":0%V".4 >0B-&-
MP L^1A;Q`)%@```#`! 0`0````,`$1 !````0 `',,"R$AXK>+P!0 `(,,"R
<$AXK>+P!'@`]``$````%````4D4Z( ````!FU `'
`
end
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Compiling 64 bit code
[not found] <9706131527.AA17307@cadosf.hlo.dec.com>
@ 1997-06-13 21:14 ` Ross A. Knepper
0 siblings, 0 replies; 9+ messages in thread
From: Ross A. Knepper @ 1997-06-13 21:14 UTC (permalink / raw)
> > > % gcc -Dint=long "-Dunsigned=unsigned long"
> >
> > This would convert 'unsigned int' into 'unsigned long long'
> > (or we would recurse on unsigned? but this is easily avoidable)
this would break unsigned char or unsigned short, however ...
i dont know if a long char is even legal :)
-ross
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Compiling 64 bit code
@ 1997-06-14 2:51 Jim Paradis
0 siblings, 0 replies; 9+ messages in thread
From: Jim Paradis @ 1997-06-14 2:51 UTC (permalink / raw)
Michal Jaegermann wrote:
> > How about:
> >
> > % gcc -Dint=long "-Dunsigned=unsigned long"
>
> This would convert 'unsigned int' into 'unsigned long long'
> (or we would recurse on unsigned? but this is easily avoidable)
> not something you likely would want to see. You can probably
> control a code you write to avoid such surprises but headers
> will be a fun.
Actually, I tried this out before posting it and it works just
fine. It does not recurse on the "unsigned" bit. While it
*does* turn "unsigned long" into "unsigned long long", that is
no problem on Alpha; "long long" is a recognized datatype in
GCC, and on Alpha it just *happens* to be exactly the same size
as "long" (in the way that "int" and "long" used to be interchangeable
on 32-bit architectures).
In short, the solution I propose above (while a bit ugly and
abhorrent to language purists) should solve the user's problem.
--
Jim Paradis jrp@jrp.tiac.net
http://www.tiac.net/users/jrp/index.html
"It's not procrastination, it's my new Just-In-Time Workload Management
System!"
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Compiling 64 bit code
@ 1997-06-14 3:12 Jim Paradis
0 siblings, 0 replies; 9+ messages in thread
From: Jim Paradis @ 1997-06-14 3:12 UTC (permalink / raw)
Ross A. Knepper wrote:
>
> > > > % gcc -Dint=long "-Dunsigned=unsigned long"
>
> this would break unsigned char or unsigned short, however ...
> i dont know if a long char is even legal :)
*ulp*. You're right.
You might be able to eliminate "-Dunsigned=unsigned long", but
then you'd miss those cases where someone uses "unsigned" as a
synonym for "unsigned int". You *could* take your chances, or
you *could* say "-Dunsigned=blurfl" to point out all the places
in the code where "unsigned" is used. Fix those to explicitly
say char/short/int/long, then recompile with just "-Dint=long"
--
Jim Paradis jrp@jrp.tiac.net
http://www.tiac.net/users/jrp/index.html
"It's not procrastination, it's my new Just-In-Time Workload Management
System!"
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Compiling 64 bit code
[not found] <01BC77F9.83016500@pengwin.qantel.com>
@ 1997-06-15 23:48 ` Thomas Pornin
0 siblings, 0 replies; 9+ messages in thread
From: Thomas Pornin @ 1997-06-15 23:48 UTC (permalink / raw)
In article <01BC77F9.83016500@pengwin.qantel.com> you write:
>What I'm looking for is a compiler that will use 64 bit integral promotion
>when expressions are evaluated. The Alpha is a native 64 bit machine
>and the C language is supposed to have an int size which is optimized
>to the target machine so that the most efficient code can be generated.
>Unfortunately too much C code has been written which uses 32 bit
>int's, so rather that fix the C programs the Alpha compilers were made to
>generate extra code which does all of the conversions and testing to make
>the int's look like they are 32 bits. I think it is great that a
>compatibility mode exists so that older programs can be supported, but
>it's not a compatibility mode, IT'S THE ONLY MODE.
Actually, I believe using 32 bits operands is better than 64 bits ones
on an alpha when only the first 32 bits are used. You may use less
opcodes to fill a register, and the memory accesses are faster (as long
as the 32 bits words are aligned on doublewords boundaries). Assembly
instructions handle well the 32 bits case.
64 bits give you speed only if your calculations really need more than
32 bits; but, in this case, you may just use "long" instead of "int"
(this must have been known during the coding, and, as 64 bits portable
types are rare in C, it is unlikely that a program from 32 bits architectures
may include algorithms for 64 bits variables).
That's why trying to replace "int" by "long" may not give, in my opinion,
any remarkable speedup. Coding again, with "long" variables, may give the
speedup wanted (but portability goes away).
--Thomas Pornin
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Compiling 64 bit code
@ 1997-06-16 4:23 Jim Paradis
0 siblings, 0 replies; 9+ messages in thread
From: Jim Paradis @ 1997-06-16 4:23 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1403 bytes --]
Thomas Pornin wrote:
Actually, I believe using 32 bits operands is better than 64 bits ones
on an alpha when only the first 32 bits are used. You may use less
opcodes to fill a register, and the memory accesses are faster (as
long
as the 32 bits words are aligned on doublewords boundaries). Assembly
instructions handle well the 32 bits case.
Not entirely true. 32-bit memory accesses take exactly the same
amount
of time as 64-bit memory accesses. The primary advantage to using
32 bits
is that you can pack twice as many of them into a cache block, thus
reducing
the number of cache misses.
On the possible downside, the LDL instruction automatically sign-extends
the 32-bit operand into the 64-bit register. This may or may
not be desired
behavior depending on what you are doing (okay for signed arithmetic,
not so
okay for pointers or mixed 32/64-bit unsigned calculations).
I believe, though,
that a ZAP instruction will multiple-issue along with an LDL, so if
it's important
that you get unsigned behavior you can do it this way with minimal
performance
penalty...
--
Jim Paradis jrp@jrp.tiac.net http://www.tiac.net/users/jrp/index.html
"It's not procrastination, it's my new Just-In-Time Workload Management System!"
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~1997-06-16 4:23 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-06-14 3:12 Compiling 64 bit code Jim Paradis
-- strict thread matches above, loose matches on Subject: below --
1997-06-16 4:23 Jim Paradis
[not found] <01BC77F9.83016500@pengwin.qantel.com>
1997-06-15 23:48 ` Thomas Pornin
1997-06-14 2:51 Jim Paradis
[not found] <9706131527.AA17307@cadosf.hlo.dec.com>
1997-06-13 21:14 ` Ross A. Knepper
1997-06-13 19:58 Kelvin Lunsford
[not found] <33A0AFE4.3973144C@jrp.tiac.net>
1997-06-13 3:54 ` Michal Jaegermann
1997-06-13 2:26 Jim Paradis
1997-06-12 21:06 Kelvin Lunsford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox