fix strict-aliasing violation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45324 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2007-12-22 22:45:38 +00:00
parent 2ceb2cfa8e
commit d3ada751c3

View File

@ -143,9 +143,7 @@ namespace {
{
MVT::ValueType vt = FPN->getValueType(0);
if (vt == MVT::f32) {
const APFloat &apf = FPN->getValueAPF();
float fval = apf.convertToFloat();
int val = *((int *) &fval);
int val = FloatToBits(FPN->getValueAPF().convertToFloat());
int sval = (int) ((val << 16) >> 16);
Imm = (short) val;
return val == sval;