Re: [AD] SSE2 vs malloc() |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] SSE2 vs malloc()
- From: Chris <chris.kcat@xxxxxxxxxx>
- Date: Sat, 15 Oct 2005 03:01:03 -0700
- 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=KNqncoqxMHFQT+Gp2zNy9wisi1JKaMn1GQlR+SOIcavwQhDae6jR6CtYed7hT5JN4eWYtTilnm+7FcHElM47AtdaXEs8p7PIScvjj3B3s2+VHCSF9alu8laUyGKGY1+V2Ay54cbY77JPD7BzapF9RrodrBiKIKVQfPXoJAreW1g=
On Saturday 15 October 2005 02:28 am, aj wrote:
> You would not be doing SSE2 instructions on video bitmaps, it makes no
> sense to do so.
Depends on what you're doing. As I understand it, for properly implemented
systems, when you lock a bitmap the system gives you a pointer to the VRAM
data to do with what you need (write to it, read from it, whichever). You
can't gaurantee the alignment of that pointer.
Also, it's worth pointing out, that bitmaps are aligned per pixel. Since SSE2
uses 16-byte alignment, that means someone grabbing pixel 2 through 15 of an
8-bit bitmap is grabbing unaligned data.
Part of me thinks the compiler is smart enough to not handle pointer variables
using SSE2 for this very reason.. because it can't know if it's aligned or
not. Instead, it would do this for global or local variables where it can
predetermine the memory address, and it will know where it's aligned and safe
to use SSE2 instructions on.