[LLVMdev] The question of sext instruction implementation

Michael.Kang blackfin.kang at gmail.com
Tue Jul 13 04:20:27 PDT 2010


I saw the description in llvm documenattion for sext is as the following :

-- sext (CST to TYPE)
    Sign extend a constant to another type. The bit size of CST must
be smaller or equal to the bit size of TYPE. Both types must be
integers.

But in the code of llvm-2.6, the judge condition just allow smaller to
the bit size of TYPE as the following :

  case Instruction::SExt:
    return SrcTy->isIntOrIntVector() &&
           DstTy->isIntOrIntVector()&& SrcBitSize < DstBitSize;

So I feel confused the difference about the documentation and implementation.

Thanks
MK
----------------------------------------
www.skyeye.org



More information about the llvm-dev mailing list