[M3devel] Alpha is 32bits!

Jay K jay.krell at cornell.edu
Wed Apr 21 10:56:29 CEST 2010


I believe registers are always 64bits, pointers are sign extended, memory is sure to be allocated in the top/bottom 2GB.
The two types of functions can call each other, and 32bit pointers can be passed to functions expecting 64bit pointers.
It looks like gcc supports alpha-dec-vms => 32bit and alpha64-dec-vms => 64bits.
I'm going to introduce ALPHA32_VMS and ALPHA64_VMS but probably work more on the first initially.

 - Jay

----------------------------------------
> To: jay.krell at cornell.edu
> Date: Wed, 21 Apr 2010 01:10:22 -0700
> From: mika at async.async.caltech.edu
> CC: m3devel at elegosoft.com
> Subject: Re: [M3devel] Alpha is 32bits!
>
>
>
> I remember that DEC cc had options on OSF/1 to use memory in such a
> way that you could guarantee the first 4 GB you touched were sign-extended
> 32-bit numbers (so the upper doubleword was 0xffffffff or 0x00000000 always)
> for some sort of compatibility.
>
> But Alpha doesn't have hardware instructions to do memory references with
> 32-bit pointers as far as I remember. I have the architecture reference
> here to look in...
>
> Mika
>
> Jay K writes:
>>
>>Huh. I found that OpenVMS on Alpha is a hybrid 32bit/64bit system.
>>
>>The default pointer size is 32 bits. You can change it to 64 bits with comp=
>>iler command line option.
>>I guess this is for greater compatibility with VAX.
>>There are two of many functions. Some are missing in 64 bits.
>>size_t is always 32 bits!
>>
>>http://www.openvms.compaq.com/doc/72final/6467/6467pro_contents.html
>>esp. http://www.openvms.compaq.com/doc/72final/6467/6467pro_006.html#64_bit=
>>_obtaining_long_ptrs_sec
>>
>>and newer similar: http://www.openvms.compaq.com/doc/83final/5763/5763pro_0=
>>07.html#the_64_bit_sec
>>
>>WALLIS> type jmpbuf.c
>>
>>#include 
>>
>>#include 
>>
>>#include 
>>
>>
>>
>>#define SIZE(x) ((unsigned)sizeof(x))
>>
>>
>>
>>int main()
>>
>>{
>>
>>=A0 printf("%u %u %u %u %u\n"=2C
>>
>>=A0=A0=A0 SIZE(int)=2C
>>
>>=A0=A0=A0 SIZE(long)=2C
>>
>>=A0=A0=A0 SIZE(void*)=2C
>>
>>=A0=A0=A0 SIZE(size_t)=2C
>>
>>=A0=A0=A0 SIZE(jmp_buf))=3B
>>
>>=A0 return 0=3B
>>
>>}
>>
>>
>>
>>WALLIS> cc jmpbuf.c
>>
>>WALLIS> link jmpbuf.obj
>>
>>WALLIS> run jmpbuf
>>
>>4 4 4 4 544
>>
>>
>>
>>WALLIS> cc /pointer_size=3D64 jmpbuf.c
>>
>>WALLIS> link jmpbuf.obj
>>
>>WALLIS> run jmpbuf
>>
>>4 4 8 4 544
>>
>>
>>
>>I still haven't found the actual header files!
>>
>>
>>So I'm going to work toward ALPHA32_VMS for now.
>>I can try ALPHA64_VMS later.
>>Assuming m3cg offers -m32 and -m64 to handle this. :)
>>
>>=A0- Jay
>> =
 		 	   		  


More information about the M3devel mailing list