16 字节数据类型如何存储在 64 位机器上 [英] How is a 16 byte data type stored on a 64 bit machine
问题描述
我一直看到我们可以使用像 unsigned long long 这样的扩展数据类型,它消耗 16 字节的内存,即 sizeof(一个 unsigned long long 变量)在我的 64 位机器上得到 16,我理解最大可能的数据类型受系统架构的限制,即在我的 64 位机器上为 8 个字节,我只是想知道如何在 CPU 指令集只有 64 位长的机器上处理这种数据类型.请帮忙.谢谢
I have been seeing that we could use extended data types like unsigned long long which consume 16 bytes of memory, i.e. sizeof(an unsigned long long variable) results in 16 on my 64 bit machine, I understand that largest possible data type is restricted by the architecture of the system, i.e. to 8 bytes on my 64 bit machine, I just wanted to know how is this data type handled on a machine whose CPU instruction set is only 64 bit long. Please help. Thanks
推荐答案
编译器将其分解为两个相邻的 64 位变量,并使用进位标志确保它们在以下情况下被视为一个大数做算术.
The compiler breaks it up into two 64-bit variables adjacent to each other, and uses the carry flag to make sure that they are treated as one big number when doing arithmetic.
这篇关于16 字节数据类型如何存储在 64 位机器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!