Hacker News new | ask | show | jobs
by dreamcompiler 2763 days ago
I thought at first this was because integer squaring is potentially faster than general integer multiplication and the compiler wasn't seeing the square operation in the second case, but that's not the explanation here.
1 comments

There isn’t an integer square opcode on any major processor architecture though, right?
Not that I know of. It's not really worth it for short integers (64 bits or less). But it's helpful with bignums.