mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 00:55:49 +03:00
Adapt LDC to dropped floating-point comparison operators
This commit is contained in:
parent
57dae495d2
commit
05839a784f
2 changed files with 0 additions and 40 deletions
|
@ -1470,33 +1470,17 @@ void tokToICmpPred(TOK op, bool isUnsigned, llvm::ICmpInst::Predicate *outPred,
|
||||||
llvm::Value **outConst) {
|
llvm::Value **outConst) {
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case TOKlt:
|
case TOKlt:
|
||||||
case TOKul:
|
|
||||||
*outPred = isUnsigned ? llvm::ICmpInst::ICMP_ULT : llvm::ICmpInst::ICMP_SLT;
|
*outPred = isUnsigned ? llvm::ICmpInst::ICMP_ULT : llvm::ICmpInst::ICMP_SLT;
|
||||||
break;
|
break;
|
||||||
case TOKle:
|
case TOKle:
|
||||||
case TOKule:
|
|
||||||
*outPred = isUnsigned ? llvm::ICmpInst::ICMP_ULE : llvm::ICmpInst::ICMP_SLE;
|
*outPred = isUnsigned ? llvm::ICmpInst::ICMP_ULE : llvm::ICmpInst::ICMP_SLE;
|
||||||
break;
|
break;
|
||||||
case TOKgt:
|
case TOKgt:
|
||||||
case TOKug:
|
|
||||||
*outPred = isUnsigned ? llvm::ICmpInst::ICMP_UGT : llvm::ICmpInst::ICMP_SGT;
|
*outPred = isUnsigned ? llvm::ICmpInst::ICMP_UGT : llvm::ICmpInst::ICMP_SGT;
|
||||||
break;
|
break;
|
||||||
case TOKge:
|
case TOKge:
|
||||||
case TOKuge:
|
|
||||||
*outPred = isUnsigned ? llvm::ICmpInst::ICMP_UGE : llvm::ICmpInst::ICMP_SGE;
|
*outPred = isUnsigned ? llvm::ICmpInst::ICMP_UGE : llvm::ICmpInst::ICMP_SGE;
|
||||||
break;
|
break;
|
||||||
case TOKue:
|
|
||||||
*outPred = llvm::ICmpInst::ICMP_EQ;
|
|
||||||
break;
|
|
||||||
case TOKlg:
|
|
||||||
*outPred = llvm::ICmpInst::ICMP_NE;
|
|
||||||
break;
|
|
||||||
case TOKleg:
|
|
||||||
*outConst = LLConstantInt::getTrue(gIR->context());
|
|
||||||
break;
|
|
||||||
case TOKunord:
|
|
||||||
*outConst = LLConstantInt::getFalse(gIR->context());
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
llvm_unreachable("Invalid comparison operation");
|
llvm_unreachable("Invalid comparison operation");
|
||||||
}
|
}
|
||||||
|
|
24
gen/toir.cpp
24
gen/toir.cpp
|
@ -1241,30 +1241,6 @@ public:
|
||||||
case TOKge:
|
case TOKge:
|
||||||
cmpop = llvm::FCmpInst::FCMP_OGE;
|
cmpop = llvm::FCmpInst::FCMP_OGE;
|
||||||
break;
|
break;
|
||||||
case TOKunord:
|
|
||||||
cmpop = llvm::FCmpInst::FCMP_UNO;
|
|
||||||
break;
|
|
||||||
case TOKule:
|
|
||||||
cmpop = llvm::FCmpInst::FCMP_ULE;
|
|
||||||
break;
|
|
||||||
case TOKul:
|
|
||||||
cmpop = llvm::FCmpInst::FCMP_ULT;
|
|
||||||
break;
|
|
||||||
case TOKuge:
|
|
||||||
cmpop = llvm::FCmpInst::FCMP_UGE;
|
|
||||||
break;
|
|
||||||
case TOKug:
|
|
||||||
cmpop = llvm::FCmpInst::FCMP_UGT;
|
|
||||||
break;
|
|
||||||
case TOKue:
|
|
||||||
cmpop = llvm::FCmpInst::FCMP_UEQ;
|
|
||||||
break;
|
|
||||||
case TOKlg:
|
|
||||||
cmpop = llvm::FCmpInst::FCMP_ONE;
|
|
||||||
break;
|
|
||||||
case TOKleg:
|
|
||||||
cmpop = llvm::FCmpInst::FCMP_ORD;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
llvm_unreachable("Unsupported floating point comparison operator.");
|
llvm_unreachable("Unsupported floating point comparison operator.");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue