We Need Hardware Traps for Integer Overflow
blog.regehr.org
We Need Hardware Traps for Integer Overflow
1–10 of 112 posts
Re: We Need Hardware Traps for Integer Overflow
#2Re: We Need Hardware Traps for Integer Overflow
#3Re: We Need Hardware Traps for Integer Overflow
#4In case anyone has the same difficulty reading this as I did, "integer types that wrap" is supposed to refer to arithmetic modulo 2^n. I thought at first he was talking about wrapped integer types.
A google search for "wrapped integer types" gives me the Wikipedia article on Integer Overflow as its first result. The other hits seem to be related.
What else do you mean by "wrapped integer types" if not arithmetic modulo 2^n?
Re: We Need Hardware Traps for Integer Overflow
#5In case anyone has the same difficulty reading this as I did, "integer types that wrap" is supposed to refer to arithmetic modulo 2^n. I thought at first he was talking about wrapped integer types.
> wrapped integer types A google search for "wrapped integer types" gives me the Wikipedia article on Integer Overflow as its first result. The other hits seem to be related. What else do you mean by "wrapped integer types" if not arithmetic modulo 2^n?
Re: We Need Hardware Traps for Integer Overflow
#6In case anyone has the same difficulty reading this as I did, "integer types that wrap" is supposed to refer to arithmetic modulo 2^n. I thought at first he was talking about wrapped integer types.
> wrapped integer types A google search for "wrapped integer types" gives me the Wikipedia article on Integer Overflow as its first result. The other hits seem to be related. What else do you mean by "wrapped integer types" if not arithmetic modulo 2^n?
Re: We Need Hardware Traps for Integer Overflow
#7Re: We Need Hardware Traps for Integer Overflow
#8I found it weird that nobody mentioned it, but was this posted because Apple's new language Swift has integer overflow detection (with operators &+, &-, etc. operators for doing conventional C-style modulo integer math)?
[1] http://www.reddit.com/r/programming/comments/26s8iu/we_need_...
Re: We Need Hardware Traps for Integer Overflow
#9For example, detecting integer overflow on x86 and x86_64 CPUs is easy: check the overflow flag after every arithmetic operation. It would only be slightly more difficult to detect overflow for SSE (vector) operations, which would require doing some bit masking and shifting.
For a language such as Swift, building it in is simple.
Re: We Need Hardware Traps for Integer Overflow
#10In case anyone has the same difficulty reading this as I did, "integer types that wrap" is supposed to refer to arithmetic modulo 2^n. I thought at first he was talking about wrapped integer types.
> wrapped integer types A google search for "wrapped integer types" gives me the Wikipedia article on Integer Overflow as its first result. The other hits seem to be related. What else do you mean by "wrapped integer types" if not arithmetic modulo 2^n?
simcop2387 is correct that I assumed he was talking about boxing at first.