From: anton@mips.complang.tuwien.ac.at   
      
   Hans Bezemer writes:   
   >On 15-01-2026 13:04, Anton Ertl wrote:   
   >   
   >A few observations concerning the IMHO most interesting paper,   
   >"Code-Copying Compilation in Production":   
   ...   
   >3. Commercial compilers (partly) using conventional compilers (see TF,   
   >fig. 4.7) - that was new to me;   
      
   All Forth compilers I know work at the text interpretation level as   
   the "Forth compiler" of Thinking Forth, Figure 4.7.   
      
   >4. GCC -O1 outperforming GCC -O3 on some benchmarks. That's new to me   
   >too. I might experiment with that one;   
      
   I have analyzed it for bubblesort. There the problem is that gcc -O3   
   auto-vectorizes the pair of loads and the pair of stores (when the two   
   elements are swapped). As a result, if a pair is stored in one   
   iteration, the next iteration loads a pair that overlaps the   
   previously stored pair. This means that the hardware cannot use its   
   fast path in store-to-load forwarding, and leads to a huge slowdown.   
   For a benchmark that has been around for over 40 years.   
      
   In addition, the code generated by gcc -O3 also executes several   
   additonal instructions per iteration, so I doubt that it would be   
   faster even if the store-to-load forwarding problem did not exist.   
      
   For fib, I have also looked at the generated code, but have not   
   understood it well enough to see why the code generated by gcc -O3 is   
   slower.   
      
   - anton   
   --   
   M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html   
   comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html   
    New standard: https://forth-standard.org/   
   EuroForth 2025 CFP: http://www.euroforth.org/ef25/cfp.html   
   EuroForth 2025 registration: https://euro.theforth.net/   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|