https://bugs.kde.org/show_bug.cgi?id=523843

--- Comment #9 from Martin Cermak <[email protected]> ---
Created attachment 196135
  --> https://bugs.kde.org/attachment.cgi?id=196135&action=edit
proposed patch

The attached patch computes the padding dynamically.  This time the
(temporarily enabled) optional alignment check fully passes for whole the
testsuite, so imho this patch is correct.  The optional alignment check appears
to be pretty performance-expensive, so it is disabled by default (#define
ALIGNMENT_SANITY 0).

So, now we have 3 solutions to this problem.
1) bug 523626 ... This is now part of the master branch.  It is based on
__attribute__((force_align_arg_pointer)) set for g_calc_mpsadbw().
2) bug 523843 ... This is now in branch
users/mcermak/try-bug523843-stack-alignment.  It is based on clang
-mstack-alignment=16 -mstackrealign being applied project wide (for -m32)
3) bug 523843 again ... this is the attached patch.  This dynamically computes
the padding as part of the doHelperCall().

Quick performance comparison for the none/tests/x86/sse4-x86 testcase:

solution 1
--------------------------------------------------------
$ perf stat -e instructions,cycles  -r 10 ./memcheck/memcheck-x86-linux
none/tests/x86/sse4-x86

[ ... stuff deleted ... ]

     9,885,285,429      cpu_atom/instructions/u                                
                ( +-  4.19% )  (0.98%)
    20,140,431,204      cpu_core/instructions/u                                
                ( +-  0.12% )  (99.02%)
     4,112,011,248      cpu_atom/cycles/u                                      
                ( +-  2.59% )  (0.98%)
     7,386,605,960      cpu_core/cycles/u                                      
                ( +-  0.26% )  (99.02%)

       2.019084619 +- 0.006816338 seconds time elapsed  ( +-  0.34% )

$


solution 2
--------------------------------------------------------
$ perf stat -e instructions,cycles  -r 10 ./memcheck/memcheck-x86-linux
none/tests/x86/sse4-x86

[ ... stuff deleted ... ]

     9,266,769,746      cpu_atom/instructions/u                                
                ( +-  6.01% )  (3.45%)
    21,117,716,521      cpu_core/instructions/u                                
                ( +-  0.40% )  (96.56%)
     3,990,517,275      cpu_atom/cycles/u                                      
                ( +-  5.92% )  (3.45%)
     7,344,267,874      cpu_core/cycles/u                                      
                ( +-  0.51% )  (96.56%)

       2.009007333 +- 0.011570906 seconds time elapsed  ( +-  0.58% )

$ 

solution 3
--------------------------------------------------------
$ perf stat -e instructions,cycles  -r 10 ./memcheck/memcheck-x86-linux
none/tests/x86/sse4-x86

[ ... stuff deleted ... ]

    11,825,470,309      cpu_atom/instructions/u                                
                ( +-  5.79% )  (1.69%)
    24,360,751,438      cpu_core/instructions/u                                
                ( +-  0.12% )  (98.31%)
     4,849,802,208      cpu_atom/cycles/u                                      
                ( +-  4.18% )  (1.69%)
     8,647,017,113      cpu_core/cycles/u                                      
                ( +-  0.16% )  (98.31%)

       2.358924210 +- 0.005430696 seconds time elapsed  ( +-  0.23% )

$

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to