Author: chenr
Date: 2010-10-27 22:22:49 -0400 (Wed, 27 Oct 2010)
New Revision: 3381
Modified:
trunk/osprey/be/cg/x8664/expand.cxx
trunk/osprey/be/vho/vho_lower.cxx
Log:
Fix for bug 608. Support vector "/" and "~" operation.
Approved by JianXin Lai.
Modified: trunk/osprey/be/cg/x8664/expand.cxx
===================================================================
--- trunk/osprey/be/cg/x8664/expand.cxx 2010-10-22 02:53:04 UTC (rev 3380)
+++ trunk/osprey/be/cg/x8664/expand.cxx 2010-10-28 02:22:49 UTC (rev 3381)
@@ -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)
Modified: trunk/osprey/be/vho/vho_lower.cxx
===================================================================
--- trunk/osprey/be/vho/vho_lower.cxx 2010-10-22 02:53:04 UTC (rev 3380)
+++ trunk/osprey/be/vho/vho_lower.cxx 2010-10-28 02:22:49 UTC (rev 3381)
@@ -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 );
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/open64-devel