Displaying 1 result from an estimated 1 matches for "kk16".
Did you mean:
kk1
2012 Oct 08
3
[LLVMdev] Multiply i8 operands promotes to i32
...ot possible, how can I detect when lowering that it is
actually a MUL_I8 or MUL_I16 in order to do the correct lowering?
Thanks in advance,
Pedro
P.S: I add C code and corresponding LLVM code.
C code:
void
(const u_int16_t in_data, u_int16_t* out)
{
u_int8_t kk = in_data&0xFF;
u_int16_t kk16 = kk * kk;
*out = kk16;
}
LLVM:
%1 = load i8* %kk, align 1
%conv2 = zext i8 %1 to i32
%2 = load i8* %kk, align 1
%conv3 = zext i8 %2 to i32
%mul = mul nsw i32 %conv2, %conv3
%conv4 = trunc i32 %mul to i16
store i16 %conv4, i16* %kk16, align 2
--
Pedro Malagón - Profesor ayudante...