Problem with unsigned long long on ultrasparc
Brad Lucier
lucier@math.purdue.edu
Thu Aug 20 16:55:00 GMT 1998
> Two things, -1 is an int not a long long (although does GCC promote it
> to a long long in this case?),
Yes, it does seem to promote it; I printed out the two values
as unsigned long longs in order to check this.
> secondarily setting cpu type to
> ultrasparc is an error on Solaris-2.5, perhaps you meant
> "-mtune=ultrasparc". "-mcpu=ultrasparc" turns on the V9 instructions
> in the compiler which won't work correctly in all cases on Solaris-2.5
> since it is not providing a 64-bit userland environment for the cpu.
It is important to me to use 32 double-precision floating-point registers
for some of my codes; does -mtume=ultrasparc provide this?
>
> "-mtune=ultrasparc" on the other hand turns on scheduling and cost
> parameters independent of the instruction ISA being used.
>
> Later,
> David S. Miller
> davem@dm.cobaltmicro.com
>
The bottom line for me is that egcs-1.0.3a provides this functionality
and the current egcs-1.1 does not. I consider this a new problem, i.e.,
a bug, not a feature, or at least a change. I'd like somebody to
look at the assembly code that's generated to see if it's correct.
If it is, I'll crawl back into my hole and wait until Sun comes out
with a version of Solaris that's truly 64-bit..
For informational purposes, I'm including the assembly language output
for this routine from egcs-1.0.3a and the 19980816 snapshot of egcs.
I forgot to mention in my first message that I built egcs with
--haifa-enabled in both cases.
Brad Lucier lucier@math.purdue.edu
.file "testlong.c"
! GNU C version egcs-2.90.29 980515 (egcs-1.0.3 release) (sparc-sun-solaris2.5.1) compiled by GNU C version egcs-2.90.29 980515 (egcs-1.0.3 release).
! options passed: -mcpu=ultrasparc -O1
! options enabled: -fdefer-pop -fomit-frame-pointer -fthread-jumps
! -fpeephole -ffunction-cse -finline -fkeep-static-consts
! -fpcc-struct-return -fdelayed-branch -fsched-interblock -fsched-spec
! -fcommon -fverbose-asm -fgnu-linker -falias-check -fargument-alias
! -mepilogue -mapp-regs -mcpu=ultrasparc
gcc2_compiled.:
.section ".rodata"
.align 8
.LLC0:
.asciz "%ull\n"
.align 8
.LLC1:
.asciz "Problem\n"
.align 8
.LLC2:
.asciz "OK\n"
.section ".text"
.align 32
.global main
.type main,#function
.proc 04
main:
!#PROLOGUE# 0
save %sp,-192,%sp
!#PROLOGUE# 1
mov -1,%o0
mov -1,%o1
std %o0,[%fp-96]
sethi %hi(.LLC0),%l0
mov -1,%o1
mov -1,%o2
call printf,0
or %l0,%lo(.LLC0),%o0
or %l0,%lo(.LLC0),%o0
sethi %hi(0),%o2
sethi %hi(-2147483648),%o1
call printf,0
or %o2,%lo(0),%o2
ld [%fp-96],%o1
sethi %hi(2147483647),%o0
or %o0,%lo(2147483647),%o0
cmp %o1,%o0
bgu %icc,.LL2
sethi %hi(.LLC1),%o0
b .LL5
or %o0,%lo(.LLC1),%o0
.LL2:
sethi %hi(.LLC2),%o0
or %o0,%lo(.LLC2),%o0
.LL5:
call printf,0
nop
ret
restore
.LLfe1:
.size main,.LLfe1-main
.ident "GCC: (GNU) egcs-2.90.29 980515 (egcs-1.0.3 release)"
with the 19980816 egcs snapshot:
.file "testlong.c"
gcc2_compiled.:
.section ".rodata"
.align 8
.LLC0:
.asciz "%ull\n"
.align 8
.LLC1:
.asciz "Problem\n"
.align 8
.LLC2:
.asciz "OK\n"
.section ".text"
.align 32
.global main
.type main,#function
.proc 04
main:
!#PROLOGUE# 0
save %sp,-192,%sp
!#PROLOGUE# 1
mov -1,%o0
mov -1,%o1
st %o0,[%fp-96]
st %o1,[%fp-92]
sethi %hi(.LLC0),%l0
mov -1,%o1
mov -1,%o2
call printf,0
or %l0,%lo(.LLC0),%o0
sethi %hi(-2147483648),%o1
mov 0,%o2
call printf,0
or %l0,%lo(.LLC0),%o0
ld [%fp-96],%o2
ld [%fp-92],%o3
sethi %hi(2147483647),%o0
or %o0,%lo(2147483647),%o0
mov -1,%o1
sllx %o2,32,%o4
sllx %o0,32,%o5
or %o3,%o4,%o4
or %o1,%o5,%o5
cmp %o4,%o5
bgu %xcc,.LL2
sethi %hi(.LLC1),%o0
b .LL4
or %o0,%lo(.LLC1),%o0
.LL2:
sethi %hi(.LLC2),%o0
or %o0,%lo(.LLC2),%o0
.LL4:
call printf,0
nop
return %i7+8
nop
.LLfe1:
.size main,.LLfe1-main
.ident "GCC: (GNU) egcs-2.91.54 19980816 (gcc2 ss-980609 experimental)"
More information about the Gcc-bugs
mailing list