jjzjj

integer-promotion

全部标签

c++ - SPARC : How to handle integer doubleword pairs? 的 GCC 内联汇编

据我了解,在SPARC中,32位整数存储在单个寄存器中,64位整数存储在相邻的寄存器对中,偶数寄存器包含高32位,奇数寄存器包含低位32位。我需要编写一些专门的SPARC内联汇编宏(内联汇编函数也可以)来处理64位整数双字对,但我不知道如何进行通用引用(使用GCC扩展内联汇编)到我的内联汇编中这对的两半。虽然我的汇编宏比下面显示的MULTIPLY()宏稍微复杂一点,但乘法示例(如果有效)将演示如何处理64位双字对的两半。谁能告诉我如何修复我的MULTIPLY()宏?以防万一,我在...bash-2.03$uname-aSunOS[...]5.8Generic_117350-39sun4

c++ - Microsoft Integer Literal Extensions——记录在哪里?

我在Windows安装的标准stdint.h头文件中遇到了一些整数文字。文字具有以下形式的后缀:i8、ui8、i16、ui16、i32、ui32、i64、ui64。我以前遇到过i64形式的后缀,但从未遇到过任何其他形式的后缀。我很好奇这些扩展的记录位置。我花了一些时间查看Microsoft文档和其他文档,但找不到它们。这完全是出于好奇。我很清楚后缀是什么意思。如果有人有指向该文档的链接,如果您分享引用资料,我将不胜感激。提前致谢! 最佳答案 如果这些源自Microsoft的内在文字后缀由于弃用或其他原因而被删除,那么您可以通过C++

c++ - 海湾合作委员会 4.1.2 : error: integer constant is too large for ‘long’ type

我编译了一段关于散列函数的代码并得到了错误:整数常量对于‘long’类型来说太大了。我用谷歌搜索了一下,它说要添加后缀“ULL”,但我确实有ULL作为后缀。这个后缀只有gcc4.4.1支持,我机器上只有gcc4.1.2,不允许安装新的编译器。有什么方法可以更改代码以解决问题吗?谢谢,-托尼unsignedlonglonghash(stringk){//FNVhashunsignedlonglongx=14695981039346656037ULL;for(unsignedinty=0;y 最佳答案 1099511628211对于(3

已解决java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.String异常的

已解决java.lang.ClassCastException:classjava.lang.Integercannotbecasttoclassjava.lang.String异常的正确解决方法,亲测有效!!!文章目录报错问题解决思路解决方法交流报错问题java.lang.ClassCastException:classjava.lang.Integercannotbecasttoclassjava.lang.String解决思路java.lang.ClassCastException:classjava.lang.Integercannotbecasttoclassjava.lang.St

c++ - C++中的整数提升和整数转换有什么区别

C++标准的第4.5节(整数提升)讨论了将整数类型转换为具有更高级别的类型的具体情况。C++标准的第4.7节(整数转换)以(项目符号4.7.1)开头:Anrvalueofanintegertypecanbeconvertedtoanrvalueofanotherintegertype.Anrvalueofanenumerationtypecanbeconvertedtoanrvalueofanintegertype.据我了解,4.5中描述的转换(可能除了项目符号4.5.3(枚举))可以单独使用4.7部分中的技术来执行:4.5.1和4.5.2完全包含在4.7中。1;4.5.4包含在4.7

c++ - 了解 2^31 和 -2^31 整数提升

#includeintmain(){printf("sizeof(int):%zu\n",sizeof(int));printf("%d\n",2147483648u>-2147483648);printf("%d\n",((unsignedint)2147483648u)>((int)-2147483648));printf("%d\n",2147483648u!=-2147483648);printf("%d\n",((unsignedint)2147483648u)!=((int)-2147483648));return0;}这段代码在C和C++中的输出,在cygwin64和带有

c++ - 根据 value_type 调用适当的构造函数 : integer or float

我有一个函数,它使用均匀分布将最小值和最大值之间的随机值填充到容器中。#include#include#include#includetemplatevoiduniform_random(TContainer&container,consttypenameTContainer::value_typemin,consttypenameTContainer::value_typemax){std::random_devicerd;std::mt19937gen(rd());//Belowlinedoesnotworkwithintegerscontainerstd::uniform_rea

c++ - 整数提升、有符号/无符号和 printf

我正在浏览C++IntegerOverflowandPromotion,试图复制它,最后得到了这个:#include#includeusingnamespacestd;intmain(){inti=-15;unsignedintj=10;coutcout和第二个printf一样,都打印了4294967291。第一个printf,但是,打印-5。现在,我的猜测是printf只是将4294967291的无符号值解释为有符号值,以-5结尾(这适合看到4294967291的2的补码是11...11011),但我不是100%相信我没有忽略任何东西。那么,我是对的还是这里发生了其他事情?

c++ - libpng 错误 : PNG unsigned integer out of range

当尝试从内存中读取PNG时,我遇到了这个奇怪的错误:libpngerror::PNGunsignedintegeroutofrange这个错误是由引起的png_read_info(png_ptr,info_ptr);它使用以下处理程序:staticvoidReadDataFromBuffer(png_structppng_ptr,png_bytepoutBytes,png_size_tbyteCountToRead){PNGDataPtrdataptr=(PNGDataPtr)png_get_io_ptr(png_ptr);png_uint_32i;coutlenpdataptr->l

c++ - 2 个重载具有相似的转换 - 内置运算符 integer[pointer-to-object]

我有以下类(class):classDictionaryRef{public:operatorbool()const;std::stringconst&operator[](std::stringconst&name)const;//...};然后我尝试使用它:DictionaryRefref=...;ref["asdf"];//error输出提示两个重载,但只列出一个:1>...:errorC2666:'DictionaryRef::operator[]':2overloadshavesimilarconversions1>...:couldbe'conststd::string&D