Skip to content

Commit 3b279e1

Browse files
DmitryBushevvmaksimo
authored andcommitted
Translate OpOrdered and OpUnordered to fcmp instructions
Instead of translating this instructions to OCL builtin calls, use core llvm fcmp instructions for better code preservation during translation. fixed tests separated fcmp test from OCL builtins Original commit: KhronosGroup/SPIRV-LLVM-Translator@a10c012
1 parent 19a9dfe commit 3b279e1

File tree

4 files changed

+400
-9
lines changed

4 files changed

+400
-9
lines changed

llvm-spirv/lib/SPIRV/SPIRVReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ SPIRVToLLVM::transValue(const std::vector<SPIRVValue *> &BV, Function *F,
600600

601601
bool SPIRVToLLVM::isSPIRVCmpInstTransToLLVMInst(SPIRVInstruction *BI) const {
602602
auto OC = BI->getOpCode();
603-
return isCmpOpCode(OC) && !(OC >= OpLessOrGreater && OC <= OpUnordered);
603+
return isCmpOpCode(OC) && OC != OpLessOrGreater;
604604
}
605605

606606
void SPIRVToLLVM::setName(llvm::Value *V, SPIRVValue *BV) {

0 commit comments

Comments
 (0)