[patch] Fixed-point patch 10/10

Fu, Chao-Ying fu@mips.com
Fri Sep 21 20:19:00 GMT 2007


Richard Sandiford wrote:
> >   I am not sure how this works when testing multilibs, either.
> > But, the fixed-point extension is an option when configuring GCC.
> > I don't think the extension could be disabled or enabled 
> under multilibs.
> > So, using the cached function should be safe.  Thanks a lot!
> 
> The procedures in question are:
> 
> +# Return 1 if the target supports compiling fixed-point,
> +# 0 otherwise.
> +
> +proc check_effective_target_fixed_point_nocache { } {
> +    verbose "check_effective_target_fixed_point_nocache: 
> compiling source" 2
> +    set ret [string match "" [get_compiler_messages 
> fixed_point 0 object {
> +        _Sat _Fract x; _Sat _Accum y;
> +    }]]
> +    verbose "check_effective_target_fixed_point_nocache: 
> returning $ret" 2
> +    return $ret
> +}
> +
> +# Return 1 if the target supports compiling fixed-point,
> +# 0 otherwise.
> +#
> +# This won't change for different subtargets so cache the result.
> +
> +proc check_effective_target_fixed_point { } {
> +    global et_fixed_point_saved
> +
> +    if [info exists et_fixed_point_saved] {
> +	verbose "check_effective_target_fixed_point: using 
> cached result" 2
> +    } else {
> +	set et_fixed_point_saved 
> [check_effective_target_fixed_point_nocache]
> +    }
> +    verbose "check_effective_target_fixed_point: returning 
> $et_fixed_point_saved" 2
> +    return $et_fixed_point_saved
> +}
> 
> Doesn't that just reduce to:
> 
> proc check_effective_target_fixed_point { } {
>     return [check_no_compiler_messages fixed_point object {
>         _Sat _Fract x; _Sat _Accum y;
>     }]
> }
> 

  This function is much simpler.  I will change to use this.  Thanks a lot!

Regards,
Chao-ying



More information about the Gcc-patches mailing list