Skip to content

Instantly share code, notes, and snippets.

@zoecarver
Created August 29, 2019 20:03
Show Gist options
  • Save zoecarver/831606521a4a62bde9df66a5da3bb78b to your computer and use it in GitHub Desktop.
Save zoecarver/831606521a4a62bde9df66a5da3bb78b to your computer and use it in GitHub Desktop.
case Builtin::BI__builtin_llroundf: {
APFloat FPVal(0.0);
APSInt IVal;
bool isExact = true;
if(!EvaluateFloat(E->getArg(0), FPVal, Info)) return false;
// I have also tried with several other rm values.
FPVal.convertToInteger(IVal, APFloat::rmNearestTiesToEven, &isExact);
return Success(IVal.getExtValue(), E);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment