[M3devel] eliminating volatile on floats

Tony Hosking hosking at cs.purdue.edu
Sun Jul 4 16:49:55 CEST 2010


I don't understand what we would need to do to fix this without the hack of commenting out gcc functionality.  Better to give gcc something it likes than to hack it.

On 4 Jul 2010, at 10:25, Jay K wrote:

> 
> Through simple trial/error I've tracked a need (the only need?) for floats down:
> 
> If I set flag_tree_ter = 0, I can compile m3core where I couldn't before, with -O3.
> 
> 
> I suspect due to:
> 
> builtins.c:
> 
> int
> get_pointer_alignment (tree exp, unsigned int max_align)
> {
>   unsigned int align, inner;
> 
>   /* We rely on TER to compute accurate alignment information.  */
>   if (!(optimize && flag_tree_ter))
>     return 0;
> 
> 
> Another thing to try is #if 0 out this block of code (it is not in parse,c but "gcc  itself").
> That should yield more optimization, but more patch to gcc.
> I'm inclined to try that.
> 
> 
> There should be additional options, like getting the alignment correct or such.
> 
> 
> The code that fails to compile is:
> /dev2/cm3/m3-libs/m3core/src/float/IEEE/LongFloat.m3 
> 
> 
> PROCEDURE CopySign (x, y: T): T =
>   VAR res := x;
>   BEGIN
>     LOOPHOLE (res, Rep.T).sign := LOOPHOLE (y, Rep.T).sign;
>     RETURN res;
>   END CopySign;
> 
> 
> I also tried some other options like adding volatile and/or temporaries on loophole's using t_struct.
> 
> 
> (To be clear, we only have volatile on float loads, not stores, though I think only stores would be preferable to only loads.
> "reads are more common than writes", "consider the registers to be a write-through cache")
> 
> 
>  - Jay
> 		 	   		  




More information about the M3devel mailing list