The Output Type of FPToUIOp and FPToSIOp

Hi

I noticed that FPToUIOp::areCastCompatible requires that the output type isSignlessInteger, FPToSIOp the same. This is kind of confusing. What is a “signless integer” and why are signed integer and unsigned integer not allowed for FPToUIOp and FPToSIOp?

Thanks

It seems that these two functions should be implemented like this:

bool FPToUIOp::areCastCompatible(Type a, Type b) {
  if (a.isa<FloatType>() && b.isUnsignedInteger())
    return true;
  return areVectorCastSimpleCompatible(a, b, areCastCompatible);
}

bool FPToSIOp::areCastCompatible(Type a, Type b) {
  if (a.isa<FloatType>() && b.isSignedInteger())
    return true;
  return areVectorCastSimpleCompatible(a, b, areCastCompatible);
}

Looking forward to replies :wink:

Have you see What are Signless Integers? ?