MCPcopy Create free account
hub / github.com/KhronosGroup/glslang / buildConvertOp

Method buildConvertOp

glslang/MachineIndependent/Intermediate.cpp:581–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

579}
580
581bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& newOp) const
582{
583 // (bfloat16_t,fp8) <-> bool not supported
584 if (((src == EbtBFloat16 || src == EbtFloatE5M2 || src == EbtFloatE4M3) && dst == EbtBool) ||
585 ((dst == EbtBFloat16 || dst == EbtFloatE5M2 || dst == EbtFloatE4M3) && src == EbtBool)) {
586 return false;
587 }
588
589 if ((isTypeInt(dst) || isTypeFloat(dst) || dst == EbtBool) &&
590 (isTypeInt(src) || isTypeFloat(src) || src == EbtBool)) {
591 newOp = EOpConvNumeric;
592 return true;
593 }
594 return false;
595}
596
597// This is 'mechanism' here, it does any conversion told.
598// It is about basic type, not about shape.

Callers 1

constructBuiltInMethod · 0.80

Calls 2

isTypeIntFunction · 0.85
isTypeFloatFunction · 0.85

Tested by

no test coverage detected