This patch looks fine to me.
2010/10/26 Chen, Rui (Roger, TSG-GDCC-SH) <rui.c...@hp.com>
> Hi,
>
>
>
> Could gatekeeper help to review this fix? It’s for bug 608 (
> https://bugs.open64.net/show_bug.cgi?id=608). With this patch, open64
> supports vector “/” and “~” operation.
>
>
>
> Attached the test case and patch. You can compile it using “opencc
> simd-2.c” to reproduce the problem.
>
>
>
> Index: osprey/be/cg/x8664/expand.cxx
>
> ===================================================================
>
> --- osprey/be/cg/x8664/expand.cxx (revision 3380)
>
> +++ osprey/be/cg/x8664/expand.cxx (working copy)
>
> @@ -2267,10 +2267,21 @@
>
>
>
> void Expand_Binary_Complement (TN *dest, TN *src, TYPE_ID mtype, OPS *ops)
>
> {
>
> - if( OP_NEED_PAIR(mtype) )
>
> - Expand_Split_UOP( OPR_BNOT, mtype, dest, src, ops );
>
> - else
>
> - Build_OP( MTYPE_is_size_double(mtype) ? TOP_not64 : TOP_not32, dest,
> src, ops );
>
> + if (MTYPE_is_vector(mtype)) {
>
> + TCON then = Host_To_Targ(Mtype_vector_elemtype(mtype), -1);
>
> + TCON now = Create_Simd_Const(mtype, then);
>
> + ST *sym = New_Const_Sym(Enter_tcon(now), Be_Type_Tbl(TCON_ty(now)));
>
> + Allocate_Object(sym);
>
> + TN *sym_tn = Gen_Symbol_TN(sym, 0, 0);
>
> + TN *result_tn = Build_TN_Of_Mtype(mtype);
>
> + Exp_Load(mtype, mtype, result_tn, TN_var(sym_tn), TN_offset(sym_tn),
> ops, 0);
>
> + Build_OP(TOP_xorps, dest, src, result_tn, ops);
>
> + } else {
>
> + if( OP_NEED_PAIR(mtype) )
>
> + Expand_Split_UOP( OPR_BNOT, mtype, dest, src, ops );
>
> + else
>
> + Build_OP( MTYPE_is_size_double(mtype) ? TOP_not64 : TOP_not32, dest,
> src, ops );
>
> + }
>
> }
>
>
>
> void Expand_Binary_And (TN *dest, TN *src1, TN *src2, TYPE_ID mtype, OPS
> *ops)
>
> Index: osprey/be/vho/vho_lower.cxx
>
> ===================================================================
>
> --- osprey/be/vho/vho_lower.cxx (revision 3380)
>
> +++ osprey/be/vho/vho_lower.cxx (working copy)
>
> @@ -4440,8 +4440,9 @@
>
> WN *arg0[8], *arg1[8];
>
> split_vector_load ( WN_kid0(wn), block, arg0, orig_type );
>
> split_vector_load ( WN_kid1(wn), block, arg1, orig_type );
>
> + TYPE_ID comparison_type = Mtype_comparison(elem_type);
>
> for ( int i = 0; i < count; i ++ ) {
>
> - WN* div = WN_Div ( elem_type, arg0[i], arg1[i] );
>
> + WN* div = WN_Div ( comparison_type, arg0[i], arg1[i] );
>
> WN* stid = WN_Stid( elem_type, i * MTYPE_byte_size(elem_type),
>
> result_st, MTYPE_To_TY(elem_type), div, 0 );
>
> WN_INSERT_BlockLast ( block, stid );
>
>
>
> Regards,
> Roger
>
>
> ------------------------------------------------------------------------------
> Nokia and AT&T present the 2010 Calling All Innovators-North America
> contest
> Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in
> marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> _______________________________________________
> Open64-devel mailing list
> Open64-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/open64-devel
>
>
--
Regards,
Lai Jian-Xin
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel