Hi, All
Can gatekeeper help review this fix?
This bug is about unsupported intrinsic, more detailed info please refer to
https://bugs.open64.net/show_bug.cgi?id=602.
The failure is due to unsupported intrinsic for _mm_extract_pi16.
The fix is to add an entry for GSBI_IX86_BUILTIN_VEC_EXT_V4HI, and assign
the correspond operator according to the second arg.
Following is the fix:
Index: osprey/wgen/wgen_expr.cxx
===================================================================
--- osprey/wgen/wgen_expr.cxx (revision 3320)
+++ osprey/wgen/wgen_expr.cxx (working copy)
@@ -3967,7 +3967,29 @@
case GSBI_IX86_BUILTIN_VEC_EXT_V4SI:
*iopc = INTRN_VEC_EXT_V2SI;
break;
- case GSBI_IX86_BUILTIN_VEC_EXT_V2DI:
+ case GSBI_IX86_BUILTIN_VEC_EXT_V4HI:
+ //fix bug602, add intrinsic for _mm_extract_pi16
+ if (WN_operator(arg1) != OPR_INTCONST)
+ Fail_FmtAssertion ("selector must be an integer constant in the range
0..3");
+ switch (WN_const_val(arg1)){
+ case 0:
+ *iopc = INTRN_PEXTRW0;
+ break;
+ case 1:
+ *iopc = INTRN_PEXTRW1;
+ break;
+ case 2:
+ *iopc = INTRN_PEXTRW2;
+ break;
+ case 3:
+ *iopc = INTRN_PEXTRW3;
+ break;
+ default:
+ Fail_FmtAssertion ("selector must be an integer constant in the
range 0..3" );
+ }
+ break;
+
+ case GSBI_IX86_BUILTIN_VEC_EXT_V2DI:
*iopc = INTRN_VEC_EXT_V2SI;
break;
case GSBI_IX86_BUILTIN_VEC_EXT_V2DF:
@@ -9294,7 +9316,18 @@
for (i = 0, list = gs_tree_operand (exp, 1);
list;
i++, list = gs_tree_chain (list)) {
- arg_wn = WGEN_Expand_Expr (gs_tree_value (list));
+ //fix bug602, if intrinsic equals _mm_extract_pi16,
+ //the second param is fixed to const 0,1,2,3, so
+ //there is no need to generate the second arg node.
+ if (i ==1 && (iopc == INTRN_PEXTRW0 ||
+ iopc == INTRN_PEXTRW1 ||
+ iopc == INTRN_PEXTRW2 ||
+ iopc == INTRN_PEXTRW3)) {
+ num_args = 1;
+ break;
+ }
+ arg_wn = WGEN_Expand_Expr (gs_tree_value (list));
+
#ifdef KEY // bug 11286
if (i == 1 && TARGET_64BIT &&
(gs_decl_function_code(func) == GSBI_BUILT_IN_POWI ||
Best Regards,
Zhu Qing
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel