Author: ycwu
Date: 2011-03-01 00:54:57 -0500 (Tue, 01 Mar 2011)
New Revision: 3498

Added:
   trunk/osprey/testsuite/cases/single_src_cases/cg/x8664/
   trunk/osprey/testsuite/cases/single_src_cases/cg/x8664/bug516.c
Modified:
   trunk/osprey/be/cg/x8664/exp_loadstore.cxx
Log:
fixed bug 516
the use of store64 and ld64 is wrong when it's a mmx operation
store64_fm and ld64_2m should be used instead.
add the testcase too. 

code review by lai jianxin, thanks



Modified: trunk/osprey/be/cg/x8664/exp_loadstore.cxx
===================================================================
--- trunk/osprey/be/cg/x8664/exp_loadstore.cxx  2011-02-28 16:46:35 UTC (rev 
3497)
+++ trunk/osprey/be/cg/x8664/exp_loadstore.cxx  2011-03-01 05:54:57 UTC (rev 
3498)
@@ -188,7 +188,9 @@
   case MTYPE_V8I4: 
   case MTYPE_V8I8: 
   case MTYPE_V8F4:
-    if ( rclass == ISA_REGISTER_CLASS_float )
+    if ( rclass == ISA_REGISTER_CLASS_mmx )
+      return base != NULL ? TOP_ld64_2m : TOP_ld64_2m_n32;
+    else if ( rclass == ISA_REGISTER_CLASS_float )
       return base != NULL ? TOP_ld64_2sse : TOP_ld64_2sse_n32;
     else
       return base != NULL ? TOP_ld64 : TOP_ld64_off;
@@ -450,7 +452,9 @@
   case MTYPE_V8I4: 
   case MTYPE_V8I8: 
   case MTYPE_V8F4:
-    if ( rclass == ISA_REGISTER_CLASS_float )
+    if ( rclass == ISA_REGISTER_CLASS_mmx )
+      return base != NULL ? TOP_store64_fm : TOP_store64_fm_n32;
+    else if ( rclass == ISA_REGISTER_CLASS_float )
       return base != NULL ? TOP_store64_fsse : TOP_store64_fsse_n32;
     else
       return base != NULL ? TOP_store64 : TOP_store64_off;

Added: trunk/osprey/testsuite/cases/single_src_cases/cg/x8664/bug516.c
===================================================================
--- trunk/osprey/testsuite/cases/single_src_cases/cg/x8664/bug516.c             
                (rev 0)
+++ trunk/osprey/testsuite/cases/single_src_cases/cg/x8664/bug516.c     
2011-03-01 05:54:57 UTC (rev 3498)
@@ -0,0 +1,10 @@
+//OBJ
+//CFLAGS: -O0 -m32 -mmmx 
+
+
+typedef float __v2f __attribute__ ((__vector_size__ (8)));
+__v2f
+foo3 (__v2f a0 ,__v2f a1,__v2f a2,__v2f a3)
+{
+  return a0;
+}


------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to