sparse-llvm op_cast should support casting floating type values to integer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

While investigating an assertion failure when compiling minilua I
found that op_cast implementation in sparse-llvm doesn't handle the
scenario where the input is a floating point number. I think the
following change is needed:

 switch (LLVMGetTypeKind(LLVMTypeOf(src))) {
  case LLVMPointerTypeKind:
   op = LLVMPtrToInt;
   break;
  case LLVMIntegerTypeKind:
   width = LLVMGetIntTypeWidth(LLVMTypeOf(src));
   if (insn->size < width)
    op = LLVMTrunc;
   else if (insn->size == width)
    op = LLVMBitCast;
   break;
  case LLVMFloatTypeKind:
  case LLVMDoubleTypeKind:
   op = LLVMFPToSI;
   break;

Thanks and Regards
Dibyendu
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux