32位处理器上64位大小的数据类型 [英] data type of size 64 bits on a 32 bit processor

查看:101
本文介绍了32位处理器上64位大小的数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在使用gcc编译器来处理32位powerpc处理器。当我看到
看无符号long long的大小时,它会显示8个字节。我想知道,我们如何才能在32位
处理器上拥有64位数据类型?我的编译器有问题吗?


感谢您的帮助...

解决方案

< blockquote> ju**********@yahoo.co.in 写道:





我正在使用gcc编译器来处理32位powerpc处理器。当我看到
看无符号long long的大小时,它会显示8个字节。我想知道,我们如何才能在32位
处理器上拥有64位数据类型?我的编译器有问题吗?



编译器通过将较短的原生数据耦合在一起来实现更广泛的类型

类型。您如何看待C在8位计算的

天内起步?




As在C99中:


多长且未签名对应的无符号长多是C99中新的
类型。一个长的长变量至少有64位。


有一个长的双倍,96位也存在于32位机器上


其实xx-bit架构与变量

大小没什么关系(当然它是int,只要内存是

地址),因为当将变量存储在寄存器中你可以使用比b更多的b $ b。我不是硬件方面的专家,但据我所知,

其实我们有一个长寄存器可以模拟较小的硬件。如果我们需要我们可以使用64位甚至更大的寄存器来存储数据。


ju ********** @ yahoo.co.in 写道:


我正在使用gcc编译器来处理32位powerpc处理器。当我看到
看无符号long long的大小时,它会显示8个字节。我想知道,我们如何才能在32位
处理器上拥有64位数据类型?



一次两个字。


我的编译器有问题吗?



不是这方面的。


-

Chris" electric hedgehog" Dollin

这是国王当天说的第一个非常聪明的东西。

/爱丽丝梦游仙境/


Hi,

I am using a gcc compiler for a 32 bit powerpc processor. When I
look at the size of unsigned long long, it displays 8 bytes. I was
wondering, how we can have a data type of 64 bits on a 32 bit
processor ? Is there some problem with my compiler ?

thanks for any help ...

解决方案

ju**********@yahoo.co.in wrote:

Hi,

I am using a gcc compiler for a 32 bit powerpc processor. When I
look at the size of unsigned long long, it displays 8 bytes. I was
wondering, how we can have a data type of 64 bits on a 32 bit
processor ? Is there some problem with my compiler ?

Compilers implement wider types by coupling together shorter native data
types where necessary. How do you think C got off the ground in the
days of 8-bit computing?



As in C99:

long long and its unsigned counterpart unsigned long long are new
types in C99. A long long variable shall have at least 64 bits.

there is a long double with 96bits that also exists on 32bit machines

in fact the xx-bit architecture does very little to do with variable
sizes ( of course it is ment to be that int is as long as the memory
address), because when storing variable in registers u can use more
than one. I am not a specialist in hardware but as i understand in
fact we have one long register that emulates smaller ones. And if wee
need we can emuleate a 64-bit or even lager register to store data in.


ju**********@yahoo.co.in wrote:

I am using a gcc compiler for a 32 bit powerpc processor. When I
look at the size of unsigned long long, it displays 8 bytes. I was
wondering, how we can have a data type of 64 bits on a 32 bit
processor ?

Two words at a time.

Is there some problem with my compiler ?

Not in this respect.

--
Chris "electric hedgehog" Dollin
"It was the first really clever thing the King had said that day."
/Alice in Wonderland/


这篇关于32位处理器上64位大小的数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆