Mercurial > libavcodec.hg
comparison mem.c @ 2979:bfabfdf9ce55 libavcodec
COSMETICS: tabs --> spaces, some prettyprinting
author | diego |
---|---|
date | Thu, 22 Dec 2005 01:10:11 +0000 |
parents | ef2149182f1c |
children | e23d2bddf122 |
comparison
equal
deleted
inserted
replaced
2978:403183bbb505 | 2979:bfabfdf9ce55 |
---|---|
62 ptr = memalign(16,size); | 62 ptr = memalign(16,size); |
63 /* Why 64? | 63 /* Why 64? |
64 Indeed, we should align it: | 64 Indeed, we should align it: |
65 on 4 for 386 | 65 on 4 for 386 |
66 on 16 for 486 | 66 on 16 for 486 |
67 on 32 for 586, PPro - k6-III | 67 on 32 for 586, PPro - k6-III |
68 on 64 for K7 (maybe for P3 too). | 68 on 64 for K7 (maybe for P3 too). |
69 Because L1 and L2 caches are aligned on those values. | 69 Because L1 and L2 caches are aligned on those values. |
70 But I don't want to code such logic here! | 70 But I don't want to code such logic here! |
71 */ | 71 */ |
72 /* Why 16? | 72 /* Why 16? |
73 because some cpus need alignment, for example SSE2 on P4, & most RISC cpus | 73 because some cpus need alignment, for example SSE2 on P4, & most RISC cpus |
74 it will just trigger an exception and the unaligned load will be done in the | 74 it will just trigger an exception and the unaligned load will be done in the |
75 exception handler or it will just segfault (SSE2 on P4) | 75 exception handler or it will just segfault (SSE2 on P4) |
76 Why not larger? because i didnt see a difference in benchmarks ... | 76 Why not larger? because i didnt see a difference in benchmarks ... |
77 */ | 77 */ |
78 /* benchmarks with p3 | 78 /* benchmarks with p3 |
79 memalign(64)+1 3071,3051,3032 | 79 memalign(64)+1 3071,3051,3032 |
80 memalign(64)+2 3051,3032,3041 | 80 memalign(64)+2 3051,3032,3041 |
81 memalign(64)+4 2911,2896,2915 | 81 memalign(64)+4 2911,2896,2915 |
82 memalign(64)+8 2545,2554,2550 | 82 memalign(64)+8 2545,2554,2550 |
83 memalign(64)+16 2543,2572,2563 | 83 memalign(64)+16 2543,2572,2563 |
84 memalign(64)+32 2546,2545,2571 | 84 memalign(64)+32 2546,2545,2571 |
85 memalign(64)+64 2570,2533,2558 | 85 memalign(64)+64 2570,2533,2558 |
86 | 86 |
87 btw, malloc seems to do 8 byte alignment by default here | 87 btw, malloc seems to do 8 byte alignment by default here |
88 */ | 88 */ |
89 #else | 89 #else |
90 ptr = malloc(size); | 90 ptr = malloc(size); |