<div dir="ltr">You should add a tescase for emitting the clean (but unoptimized) IR from a use of the intrinsic. You can find other test cases like test/CodeGen/xop-builtin.c that you could base this off of...</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Oct 1, 2013 at 2:36 AM, Matthias Kretz <span dir="ltr"><<a href="mailto:kretz@kde.org" target="_blank">kretz@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Testcase:<br>
<br>
<br>
__m128 cvt0() { return _mm_cvtepi32_ps(_mm_set1_epi32(2)); }<br>
__m128 cvt0(__m128i x) { return _mm_cvtepi32_ps(x); }<br>
<br>
compiles to IR:<br>
<br>
<br>
define <4 x float> @_Z4cvt0v() #0 {<br>
entry:<br>
ret <4 x float> <float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00><br>
}<br>
<br>
define <4 x float> @_Z4cvt0Dv2_x(<2 x i64> %x) #0 {<br>
entry:<br>
%0 = bitcast <2 x i64> %x to <4 x i32><br>
%conv.i = sitofp <4 x i32> %0 to <4 x float><br>
ret <4 x float> %conv.i<br>
}<br>
<br>
and x86:<br>
<br>
<br>
0000000000000000 <cvt0()>:<br>
0:· c5 f8 28 05 00 00 00 00 · vmovaps 0x0(%rip),%xmm0 # 8 <cvt0()+0x8>· 4: R_X86_64_PC32· .LCPI0_0-0x4<br>
8:· c3 · retq<br>
<br>
0000000000000010 <cvt0(long long __vector(2))>:<br>
10:· c5 f8 5b c0 · vcvtdq2ps %xmm0,%xmm0<br>
14:· c3 · retq<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D1792" target="_blank">http://llvm-reviews.chandlerc.com/D1792</a><br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>