[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] malloc
- From: Chris <chris.kcat@xxxxxxxxxx>
- Date: Sun, 20 Nov 2005 19:43:46 -0800
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=S30V0PpoBduU1Q1jUlvarCh6IP8nFyjT06rX1G0xAjR7R5TltMHc3AHVw7xU+xQ7Mk+2a9gKfZrrYwI8bVJu4460PV9NUzxKhIUHXF8S3OV2xrJ2f/SYpwtOwEESEK1Vtksf0qJRqBSXkK8aLMYKEvtGScmwaD+bwkK58+ibfPI=
On Saturday 19 November 2005 09:20 pm, aj wrote:
> As it stands at the moment, allegro can be severly performance hit, if
> someone compiles it with SSE turned on, P4, and AMD CPUs both have SSE.
Have you tried enabling SSE to test the performance hit? And if so, do you
know if it's not just from improper SSE code use, or due to improper memory
alignment? Do you know if GCC/MSVC don't already optimize malloc calls to
return aligned pointers when SSE is being used?
Besides, I thought we already talked about this on IRC and such. Memory
bitmaps and samples and such won't benefit from aligned allocation since even
if the pointer is aligned, each value within will not be (eg. if
bmp->line[0][0] is an aligned access, ((uint32_t*)bmp->line[0])[1] won't be,
etc). Plus, you can't gaurantee the alignment of video bitmaps since the
system allocates/maps them, not your program.
Personally, I don't see why GCC would generate SSE code to use on dereferenced
pointers (which it'll almost never know at compile time if they're aligned or
not). Instead, it probably would only use SSE code to use on the variables
themselves, where it'll know for certain if it will be properly aligned or
not.
> Intel are now recommending that code favour SSE instead of MMX (cpu
> manufacturers have already signalled the death of MMX)
MMX won't disappear from processors. There are programs that require an
MMX-compatible CPU, and such programs would become unrunable if MMX went
away. And it's only natural that Intel would favour SSE over MMX. SSE is
newer, and probably better than MMX (and it gives users more of an incentive
to buy a newer CPU if they still have old ones).