Re: [AD] CPU capabilities patch |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Eric Botcazou wrote:
[snip]
#define cpu_mmx (cpu_capabilities & CPU_MMX)
Yes. I think this is both necessary and sufficient.
Ok, here's what you need to add to allegro.h: I didn't make it a patch
because of the current allegro.h vs allegro4.h mess going on on the [AD]
list :) I think this code should go in allegro.h only.
/* Defines to not break the pre-WIP-40 API */
#define cpu_mmx ((cpu_capabilities & CPU_MMX) ? TRUE : FALSE)
#define cpu_sse ((cpu_capabilities & CPU_SSE) ? ((cpu_capabilities &
CPU_SSE2) ? 2 : 1) : 0)
#define cpu_3dnow ((cpu_capabilities & CPU_3DNOW) ? ((cpu_capabilities &
CPU_ENH3DNOW) ? 2 : 1) : 0)
#define cpu_fpu ((cpu_capabilities & CPU_FPU) ? TRUE : FALSE)
#define cpu_id ((cpu_capabilities & CPU_ID) ? TRUE : FALSE)
--
- Robert J Ohannessian
"Microsoft code is probably O(n^20)" (my CS prof)
http://pages.infinit.net/voidstar/