1 |
-----BEGIN PGP SIGNED MESSAGE----- |
2 |
Hash: SHA1 |
3 |
|
4 |
Duncan wrote: |
5 |
> |
6 |
> I was somewhat aware of that, but hadn't considered the effect on loops, |
7 |
> and don't understand it enough to be able explain it as you did, nor enough |
8 |
> to grok why if it's so much more efficient, gcc doesn't do it by default |
9 |
> at least on archs sufficiently specified to know the instructions are |
10 |
> there and that it makes sense. |
11 |
|
12 |
- From my reading tree-vectorize attempts to use SIMD wherever possible |
13 |
for parallel computation of arrays/etc. In theory that should almost |
14 |
always be a net-benefit with few drawbacks. |
15 |
|
16 |
The problem I understand is that it is sometimes a bit buggy - ie it |
17 |
sometimes creates broken code. I think these issues have mostly been |
18 |
fixed, but that would explain why it is not applied by default. |
19 |
|
20 |
There is also an -ftree-vectorize-verbose=# parameter which generates |
21 |
informational messages about why particular loops were or were not |
22 |
vectorized. In theory this can help you develop more-easily-optimized code. |
23 |
|
24 |
MMX/etc can tremendously improve program speed. Anytime you can do 4 |
25 |
operations per cycle vs 1 you're going to improve throughput. |
26 |
|
27 |
Otherwise, I agree with you as far as reducing memory footprint goes - |
28 |
I've been running -Os for ages and I'm very happy with this. My RAM is |
29 |
better applied to disk caching than storing unrolled loops in almost all |
30 |
cases. I'm sure in niche cases the opposite is true, but the same |
31 |
applies to -ffast-math and other dangerous optimizations. They should |
32 |
probably be applied on a per-file basis by the developer, and not across |
33 |
an entire build/system. |
34 |
|
35 |
-----BEGIN PGP SIGNATURE----- |
36 |
Version: GnuPG v1.4.5 (GNU/Linux) |
37 |
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org |
38 |
|
39 |
iD8DBQFFCzL2G4/rWKZmVWkRAkzOAKC1jKik3Q+JdWvpH3qkmMfvWZ823gCeP5km |
40 |
odH1v8qKb4xrDL5YPLeC62o= |
41 |
=NnSA |
42 |
-----END PGP SIGNATURE----- |