mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-12 18:33:22 +00:00
Constant fold sqrtf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28853 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
dfc0375ec3
commit
5cff2677a6
@ -76,7 +76,8 @@ llvm::canConstantFoldCallTo(Function *F) {
|
||||
case 'p':
|
||||
return Name == "pow";
|
||||
case 's':
|
||||
return Name == "sin" || Name == "sinh" || Name == "sqrt";
|
||||
return Name == "sin" || Name == "sinh" ||
|
||||
Name == "sqrt" || Name == "sqrtf";
|
||||
case 't':
|
||||
return Name == "tan" || Name == "tanh";
|
||||
default:
|
||||
@ -150,6 +151,8 @@ llvm::ConstantFoldCall(Function *F, const std::vector<Constant*> &Operands) {
|
||||
return ConstantFP::get(Ty, sinh(V));
|
||||
else if (Name == "sqrt" && V >= 0)
|
||||
return ConstantFP::get(Ty, sqrt(V));
|
||||
else if (Name == "sqrtf" && V >= 0)
|
||||
return ConstantFP::get(Ty, sqrt((float)V));
|
||||
break;
|
||||
case 't':
|
||||
if (Name == "tan")
|
||||
|
Loading…
x
Reference in New Issue
Block a user