mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-02 22:32:08 +00:00
add another overflow idiom
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121854 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
08859ffa63
commit
9448184b99
@ -93,6 +93,14 @@ when it would be better to generate:
|
||||
addq %rdi, %rbx
|
||||
jno LBB0_2
|
||||
|
||||
Apparently some version of GCC knows this. Here is a multiply idiom:
|
||||
|
||||
unsigned int mul(unsigned int a,unsigned int b) {
|
||||
if ((unsigned long long)a*b>0xffffffff)
|
||||
exit(0);
|
||||
return a*b;
|
||||
}
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
||||
Get the C front-end to expand hypot(x,y) -> llvm.sqrt(x*x+y*y) when errno and
|
||||
|
Loading…
x
Reference in New Issue
Block a user