2025-11-01 03:37:40 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
|
|
#ifndef __MW_LOWLEVEL_INTERNAL_MATH_H__
|
|
|
|
|
#define __MW_LOWLEVEL_INTERNAL_MATH_H__
|
|
|
|
|
|
2025-11-01 04:32:06 +00:00
|
|
|
#include <Mw/BaseTypes.h>
|
2025-11-01 03:37:40 +00:00
|
|
|
#include <Mw/LowLevelMath.h>
|
|
|
|
|
|
2025-11-01 04:32:06 +00:00
|
|
|
/* Bitfield of cpu features we get from x86's CPUID */
|
2025-11-01 08:01:26 +00:00
|
|
|
#if defined(MwLLMathMMX)
|
|
|
|
|
#define FEATX86_MMX (1 << 23)
|
|
|
|
|
#define FEATX86_SSE (1 << 25)
|
|
|
|
|
#define FEATX86_SSE2 (1 << 26)
|
2025-11-01 04:32:06 +00:00
|
|
|
#endif
|
2025-11-01 04:25:22 +00:00
|
|
|
|
2025-11-01 03:37:40 +00:00
|
|
|
struct _MwLLMathVTable {
|
|
|
|
|
void (*Add)(MwLLVec* a, MwLLVec* b, MwLLVec* out);
|
|
|
|
|
void (*Multiply)(MwLLVec* a, MwLLVec* b, MwLLVec* out);
|
|
|
|
|
void (*Sub)(MwLLVec* a, MwLLVec* b, MwLLVec* out);
|
|
|
|
|
void (*Reciprocal)(MwLLVec* a, MwLLVec* out);
|
|
|
|
|
void (*SquareRoot)(MwLLVec* a, MwLLVec* out);
|
|
|
|
|
void (*And)(MwLLVec* a, MwLLVec* b, MwLLVec* out);
|
|
|
|
|
void (*Or)(MwLLVec* a, MwLLVec* b, MwLLVec* out);
|
|
|
|
|
void (*ShiftRight)(MwLLVec* a, MwLLVec* b, MwLLVec* out);
|
|
|
|
|
void (*ShiftLeft)(MwLLVec* a, MwLLVec* b, MwLLVec* out);
|
|
|
|
|
void (*Equal)(MwLLVec* a, MwLLVec* b, MwLLVec* out);
|
|
|
|
|
void (*GreaterThen)(MwLLVec* a, MwLLVec* b, MwLLVec* out);
|
|
|
|
|
void (*LesserThen)(MwLLVec* a, MwLLVec* b, MwLLVec* out);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef struct _MwLLMathVTable MwLLMathVTable;
|
|
|
|
|
|
2025-11-01 03:59:45 +00:00
|
|
|
MwLLMathVTable** default_multi_table(void);
|
2025-11-01 03:37:40 +00:00
|
|
|
void mmx_apply(MwLLMathVTable**);
|
|
|
|
|
|
|
|
|
|
#endif
|