Author: aagarwa
Date: 2011-03-07 04:02:58 -0500 (Mon, 07 Mar 2011)
New Revision: 3508
Modified:
trunk/osprey/be/com/opt_cvtl_rule.cxx
trunk/osprey/be/com/wn_lower.cxx
trunk/osprey/be/opt/opt_emit_template.h
trunk/osprey/wgen/wgen_expr.cxx
Log:
Fix bug Id 723 739 and 741. If def for X8664 for the changes I made
to fix bug Id 732 with the checkin rev 3499. Made changes for CVT
not needed for vector types and the CVT generated by LNO has to
be kept. Added the check for gs_decl_initial for GS_VAR_DECL operand
Code reviewed by Sun Chan.
Modified: trunk/osprey/be/com/opt_cvtl_rule.cxx
===================================================================
--- trunk/osprey/be/com/opt_cvtl_rule.cxx 2011-03-06 11:59:41 UTC (rev
3507)
+++ trunk/osprey/be/com/opt_cvtl_rule.cxx 2011-03-07 09:02:58 UTC (rev
3508)
@@ -160,6 +160,12 @@
#endif
if (!(MTYPE_is_integral(from_ty) && MTYPE_is_integral(to_ty))) {
if (from_ty == to_ty) return NOT_AT_ALL;
+#ifdef TARG_X8664
+ if (MTYPE_is_vector(from_ty) && MTYPE_is_vector(to_ty) &&
+ MTYPE_is_mmx_vector(from_ty) == MTYPE_is_mmx_vector(to_ty)) {
+ return NOT_AT_ALL;
+ }
+#endif
if (opc != NULL)
*opc = OPCODE_make_op(OPR_CVT, to_ty, from_ty);
return NEED_CVT;
Modified: trunk/osprey/be/com/wn_lower.cxx
===================================================================
--- trunk/osprey/be/com/wn_lower.cxx 2011-03-06 11:59:41 UTC (rev 3507)
+++ trunk/osprey/be/com/wn_lower.cxx 2011-03-07 09:02:58 UTC (rev 3508)
@@ -4855,11 +4855,15 @@
#endif // TARG_X8664 || VECTOR_MTYPES
case MTYPE_M:
+#if defined(TARG_X8664)
WN_st_idx(tree) = ST_st_idx(MTYPE_To_PREG(MTYPE_U8));
WN_load_offset(tree) = First_Int_Preg_Return_Offset;
WN_set_rtype(tree, MTYPE_U8);
WN_set_desc(tree, MTYPE_U8);
return tree;
+#endif
+ Fail_FmtAssertion ("MLDID of Return_Val_Preg not allowed in middle"
+ " of expression");
/*NOTREACHED*/
default:
Fail_FmtAssertion ("Unexpected type in lower_return_ldid");
@@ -11394,8 +11398,11 @@
: parm;
ploc = Get_Output_Parameter_Location(TY_Of_Parameter(parm));
- if (MTYPE_is_m(parmType)&&(WN_operator(actual) != OPR_LDID))
- {
+#ifdef TARG_X8664
+ if (MTYPE_is_m(parmType)&&(WN_operator(actual) != OPR_LDID)){
+#else
+ if (MTYPE_is_m(parmType)){
+#endif
/*
* structure parameter
*/
Modified: trunk/osprey/be/opt/opt_emit_template.h
===================================================================
--- trunk/osprey/be/opt/opt_emit_template.h 2011-03-06 11:59:41 UTC (rev
3507)
+++ trunk/osprey/be/opt/opt_emit_template.h 2011-03-07 09:02:58 UTC (rev
3508)
@@ -106,9 +106,16 @@
if (WOPT_Enable_Cvt_Folding && !emitter->For_preopt()) {
INT cvt_kind;
OPCODE opc;
- cvt_kind =
- Need_type_conversion(exp->Dsctyp(), exp->Dtyp(), &opc);//326120
-
+ if (MTYPE_is_vector(exp->Dtyp()) && MTYPE_is_vector(exp->Dsctyp())
+ && exp->Dtyp() != exp->Dsctyp()) {
+ opc = OPCODE_make_op(OPR_CVT, exp->Dtyp(), exp->Dsctyp());
+ cvt_kind = NEED_CVT;
+ }
+ else
+ {
+ cvt_kind =
+ Need_type_conversion(exp->Dsctyp(), exp->Dtyp(), &opc);//326120
+ }
CODEREP *kid = exp->Get_opnd(0);
if (cvt_kind == NEED_CVT) {
Modified: trunk/osprey/wgen/wgen_expr.cxx
===================================================================
--- trunk/osprey/wgen/wgen_expr.cxx 2011-03-06 11:59:41 UTC (rev 3507)
+++ trunk/osprey/wgen/wgen_expr.cxx 2011-03-07 09:02:58 UTC (rev 3508)
@@ -9828,6 +9828,7 @@
TY_mtype(TY_pointed(ty_idx)) == MTYPE_V) /* pointer to void */
ty_idx = nop_ty_idx;
#endif
+#ifdef TARG_X8664
if((ret_mtype == MTYPE_M) && (Is_Target_64bit()))
{
for (list = gs_tree_operand (exp, 1); list;
@@ -9836,14 +9837,21 @@
{
if (gs_tree_code(
gs_tree_operand(gs_tree_value (list),0)) == GS_VAR_DECL )
- is_gs_addr_arg = TRUE;
+ {
+ gs_t argument = gs_tree_operand(gs_tree_value (list),0);
+ if(gs_decl_initial(argument))
+ is_gs_addr_arg = TRUE;
+ }
}
}
}
+#endif
wn1 = WN_Ldid (ret_mtype, -1, Return_Val_Preg, ty_idx);
-
+#ifdef TARG_X8664
if (ret_mtype == MTYPE_M && (!is_gs_addr_arg)) { // copy the -1 preg
to a temp area
-
+#else
+ if (ret_mtype == MTYPE_M){// copy the -1 preg to a temp area
+#endif
TY_IDX ret_ty_idx = ty_idx;
is_gs_addr_arg = FALSE;
#ifndef KEY
------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Open64-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/open64-devel