From: Chris Lattner
When converting to i1, the conversion is done as a comparison against -zero. If the value was zero, the i1 result will be false. -If the value was non-zero, the i1 result will be true.
-%X = fptoui double 123.0 to i32 ; yields i32:123 - %Y = fptoui float 1.0E+300 to i1 ; yields i1:true + %Y = fptoui float 1.0E+300 to i1 ; yields undefined:1 %X = fptoui float 1.04E+17 to i8 ; yields undefined:1@@ -3162,14 +3158,10 @@ must also be an integer type. towards zero) signed integer value. If the value cannot fit in ty2, the results are undefined. -
When converting to i1, the conversion is done as a comparison against -zero. If the value was zero, the i1 result will be false. -If the value was non-zero, the i1 result will be true.
-%X = fptosi double -123.0 to i32 ; yields i32:-123 - %Y = fptosi float 1.0E-247 to i1 ; yields i1:true + %Y = fptosi float 1.0E-247 to i1 ; yields undefined:1 %X = fptosi float 1.04E+17 to i8 ; yields undefined:1