Displaying 3 results from an estimated 3 matches for "masked_add_32".
Did you mean:
masked_add_1
2013 Feb 26
1
[LLVMdev] passing vector of booleans to functions
Hi Duncan,
thanks for the hint. I tried both variants:
define <4 x float> @masked_add_1(<4 x i1> signext %mask, <4 x float> %a, <4 x
float> %b)
define <4 x float> @masked_add_32(<4 x i32> %mask, <4 x float> %a, <4 x float> %b)
Unfortunately, this will raise an assertion:
Wrong types for attribute: zeroext signext noalias nocapture sret byval nest
Should I file a bug report?
--
Roland
On Tuesday 26 February 2013 10:02:22 Duncan Sands wrote:
> Hi R...
2013 Feb 26
2
[LLVMdev] passing vector of booleans to functions
...'m unhappy with the pssld. Apparently,
LLVM uses a <4 x i32> to hold the <4 x i1> while the LSB holds the mask
bit. But blendvps expects the MSB as mask bit and therefore the shift.
OK, let's try better. This time, I will directly use <4 x i32>:
define <4 x float> @masked_add_32(<4 x i32> %mask, <4 x float> %a, <4 x float> %b)
{
entry:
%add = fadd <4 x float> %a, %b
%trunc = trunc <4 x i32> %mask to <4 x i1>
%sel = select <4 x i1> %trunc, <4 x float> %add, <4 x float> %a
ret <4 x float> %sel
}
But damn,...
2013 Feb 26
0
[LLVMdev] passing vector of booleans to functions
Hi Roland,
> define <4 x float> @masked_add_1(<4 x i1> %mask, <4 x float> %a, <4 x float>
%b) {
> entry:
> %add = fadd <4 x float> %a, %b
> %sel = select <4 x i1> %mask, <4 x float> %add, <4 x float> %a
> ret <4 x float> %sel
> }
>
> I will get:
>
> addps %xmm1, %xmm2
> pslld $31, %xmm0
>