This patch looks fine to me. Please check it in. Thank you very much.

2011/2/28 Wu Yongchong <wuyongch...@gmail.com>

> Hi,
> can a gatekeeper help review this patch?
> I have make a patch for bug 516,
> https://bugs.open64.net/show_bug.cgi?id=516
> $ cat test.c
>
> typedef float __v2f __attribute__ ((__vector_size__ (8)));
> __v2f
> foo3 (__v2f a0,__v2f a1,__v2f a2,__v2f a3)
> {
>    return a0;
> }
>
> $ opencc -O0 -m32 -mmmx -c test.c
> ### Compiler Error in file testmmx1.c during PU_adjust_addr_flags phase:
> ### Invalid return mtype V8F4 encountered
> opencc INTERNAL ERROR:
>
> /proj/opensrc_nobackup/ycwu/open64/x86_64/binroot_orig/lib/gcc-lib/x86_64-open64-linux/4.2/be
> returned non-zero status 1
>
> for the whirl node
>
>  V8F4V8F4LDID 41 <1,36,.preg_V8F4> T<39,.predef_V8F4,8>
>  V8F4STID 0 <2,1,a0> T<39,.predef_V8F4,8> {line: 1/4}
>  V8F4V8F4LDID 0 <2,1,a0> T<39,.predef_V8F4,8>
>  V8F4STID 41 <1,36,.preg_V8F4> T<39,.predef_V8F4,8> {line: 1/5}
>
> open64 will generate CG IR as following
>
> [   4, 0] :- store64 GTN44(%mm0) GTN3(%rbp) (sym:a0+0) ;
> [   4, 0] :- emms ;
> [   5, 0] GTN44(%mm0) :- ld64 GTN3(%rbp) (sym:a0+0) ;
> [   5, 0] :- emms ;
>
>
> the use of store64 and ld64 is wrong as this is a mmx operation.
> store64_fm and ld64_2m should be used instead.
>
> here is the patch
>
> ===================================================================
> --- osprey/be/cg/x8664/exp_loadstore.cxx        (revision 3485)
> +++ osprey/be/cg/x8664/exp_loadstore.cxx        (working copy)
> @@ -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;
>
>
>
>
> --
> yongchong
>
>
> ------------------------------------------------------------------------------
> 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
>



-- 
Regards,
Lai Jian-Xin
------------------------------------------------------------------------------
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