Hi Yongchong,

You should be able to use target-specific variable assignment to avoid
rewriting the rules:

defgu2s: CFLAGS += -OPT:ro=1

See:

http://www.gnu.org/software/make/manual/html_node/Target_002dspecific.html#Target_002dspecific

Two things I am unclear on:
1. The change is specific to IA64.  Wouldn't this be a problem for
other targets, too?
2. What if you are building the library in debug mode?  Should the
flag change also be conditional on -O3 existing in CFLAGS?

-David Coakley / AMD Open Source Compiler Engineering

On Thu, Mar 3, 2011 at 12:34 AM, Wu Yongchong <wuyongch...@gmail.com> wrote:
> can a gatekeeper help review this patch
>
> This is a round off issue in IA64 system relative open64 library, the 
> libffio.a.
>
> we use opencc -O3 to build libffio.a, the round off option in -O3 is
> -OPT:ro=2, it allow reassociation transforma\
> tions.
>
> in line 531 of file osprey/libu/numconv/mpp/defgu2s.c
>
> expression
> pre_result = a*x + (a*y + x*b +(b*y
>           + (table_high*exact_low_number +
>           exact_high_number*table_low +
>           table_low*exact_low_number)));
>
> the compiler will re-associated it to
>
> pre_result = (a*x + a*y + x*b + b*y) +
>           (table_high*exact_low_number +
>           exact_high_number*table_low +
>           table_low*exact_low_number);
>
> so do the precision of pre_result, this difference may affect the
> result of 200.sixtrack and them get outp\
> ut difference error.
>
> Here is my patch, I just add -OPT:ro=1 to make file defgu2s.c when
> building library libffio.a
>
> ===================================================================
> --- osprey/libu/Makefile.gbase  (revision 3495)
> +++ osprey/libu/Makefile.gbase  (working copy)
> @@ -358,3 +358,15 @@
>        ./massage > numbers.h
>  endif
>
> +ifeq ($(BUILD_ARCH), IA64)
> + ifeq ($(BUILD_COMPILER), OSP)
> +defgu2s.o : defgu2s.c
> +       $(cc) -c $(CPPFLAGS) $(CFLAGS) -OPT:ro=1 $< -o $@
> +
> +defgu2s.pic.o : defgu2s.c
> +       $(cc) $(pic_flag) -c $(CPPFLAGS) $(CFLAGS) -OPT:ro=1 $< -o $@
> +
> +defgu2s.pg.o : defgu2s.c
> +       $(cc) $(prof_flag) -c $(CPPFLAGS) $(CFLAGS) -OPT:ro=1 $< -o $@
> + endif
> +endif
> \ No newline at end of file
>
> --
> 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
>

------------------------------------------------------------------------------
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
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to