Skip to content

Commit

Permalink
Added fmax* and fmin*
Browse files Browse the repository at this point in the history
  • Loading branch information
bwlodarcz committed Nov 10, 2023
1 parent 4e030ae commit b685987
Show file tree
Hide file tree
Showing 5 changed files with 2,029 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/SPIRV/SPIRVWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4088,16 +4088,28 @@ SPIRVValue *LLVMToSPIRVBase::transIntrinsicInst(IntrinsicInst *II,
case Intrinsic::vector_reduce_smax:
case Intrinsic::vector_reduce_smin:
case Intrinsic::vector_reduce_umax:
case Intrinsic::vector_reduce_umin: {
case Intrinsic::vector_reduce_umin:
case Intrinsic::vector_reduce_fmax:
case Intrinsic::vector_reduce_fmin:
case Intrinsic::vector_reduce_fmaximum:
case Intrinsic::vector_reduce_fminimum: {
Op Op;
if (IID == Intrinsic::vector_reduce_smax) {
Op = OpSGreaterThan;
} else if (IID == Intrinsic::vector_reduce_smin) {
Op = OpSLessThan;
} else if (IID == Intrinsic::vector_reduce_umax) {
Op = OpUGreaterThan;
} else {
} else if (IID == Intrinsic::vector_reduce_umin) {
Op = OpULessThan;
} else if (IID == Intrinsic::vector_reduce_fmax) {
Op = OpFOrdGreaterThan;
} else if (IID == Intrinsic::vector_reduce_fmin) {
Op = OpFOrdLessThan;
} else if (IID == Intrinsic::vector_reduce_fmaximum) {
Op = OpFUnordGreaterThan;
} else {
Op = OpFUnordLessThan;
}
VectorType *VT = cast<VectorType>(II->getArgOperand(0)->getType());
SPIRVValue *SV = transValue(II->getArgOperand(0), BB);
Expand Down
Loading

0 comments on commit b685987

Please sign in to comment.