mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
Temporary work around for a libcall insertion bug: If a target doesn't
support FSIN/FCOS nodes, do not lower sin/cos to them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25425 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c4e8c9f318
commit
d12b2d7b5a
@ -1070,7 +1070,9 @@ void SelectionDAGLowering::visitCall(CallInst &I) {
|
||||
} else if (Name[0] == 's' && (Name == "sin" || Name == "sinf")) {
|
||||
if (I.getNumOperands() == 2 && // Basic sanity checks.
|
||||
I.getOperand(1)->getType()->isFloatingPoint() &&
|
||||
I.getType() == I.getOperand(1)->getType()) {
|
||||
I.getType() == I.getOperand(1)->getType() &&
|
||||
TLI.isOperationLegal(ISD::FSIN,
|
||||
TLI.getValueType(I.getOperand(1)->getType()))) {
|
||||
SDOperand Tmp = getValue(I.getOperand(1));
|
||||
setValue(&I, DAG.getNode(ISD::FSIN, Tmp.getValueType(), Tmp));
|
||||
return;
|
||||
@ -1078,7 +1080,9 @@ void SelectionDAGLowering::visitCall(CallInst &I) {
|
||||
} else if (Name[0] == 'c' && (Name == "cos" || Name == "cosf")) {
|
||||
if (I.getNumOperands() == 2 && // Basic sanity checks.
|
||||
I.getOperand(1)->getType()->isFloatingPoint() &&
|
||||
I.getType() == I.getOperand(1)->getType()) {
|
||||
I.getType() == I.getOperand(1)->getType() &&
|
||||
TLI.isOperationLegal(ISD::FCOS,
|
||||
TLI.getValueType(I.getOperand(1)->getType()))) {
|
||||
SDOperand Tmp = getValue(I.getOperand(1));
|
||||
setValue(&I, DAG.getNode(ISD::FCOS, Tmp.getValueType(), Tmp));
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user