edA-qa mort-ora-y
2013-May-01 15:03 UTC
[LLVMdev] are non-byte-multiple integers treated as exact?
If I create an integer size which is not a native size on the target platform is it nonetheless treated as though it were that size? That is, do all the basic operations (add, mul, shift, etc.) do the proper treatment to ensure it behaves as an exactly sized integer value? I'm looking at the native assembly output of several examples and it does appear that some limited handling is done. For example shifting will artificially wrap the shift amount, but it does not alter the resulting value. The "nsw" flag also doesn't change the final assembly, so I assume the poison value is strictly an optimizer thing (saying it shouldn't assume the value is well defined). -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Sign: Please digitally sign your emails. Encrypt: I'm also happy to receive encrypted mail. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 261 bytes Desc: OpenPGP digital signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130501/3c2c36be/attachment.sig>
Duncan Sands
2013-May-01 20:12 UTC
[LLVMdev] are non-byte-multiple integers treated as exact?
On 01/05/13 17:03, edA-qa mort-ora-y wrote:> If I create an integer size which is not a native size on the target > platform is it nonetheless treated as though it were that size? That is, > do all the basic operations (add, mul, shift, etc.) do the proper > treatment to ensure it behaves as an exactly sized integer value?Yes. Ciao, Duncan.> > I'm looking at the native assembly output of several examples and it > does appear that some limited handling is done. For example shifting > will artificially wrap the shift amount, but it does not alter the > resulting value. > > The "nsw" flag also doesn't change the final assembly, so I assume the > poison value is strictly an optimizer thing (saying it shouldn't assume > the value is well defined). > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >