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-02 19:15:38 +00:00
|
|
|
typedef struct _MwLLMathVTable MwLLMathVTable;
|
2025-11-01 04:25:22 +00:00
|
|
|
|
2025-11-01 03:37:40 +00:00
|
|
|
struct _MwLLMathVTable {
|
2025-11-02 19:15:38 +00:00
|
|
|
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);
|
2025-11-01 03:37:40 +00:00
|
|
|
};
|
|
|
|
|
|
2025-11-02 19:15:38 +00:00
|
|
|
struct _MwLLVec {
|
|
|
|
|
void* buffer;
|
|
|
|
|
int ty;
|
|
|
|
|
MwU64 size;
|
|
|
|
|
MwLLMathVTable vtable;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void default_apply(MwLLVec*);
|
2025-11-01 03:37:40 +00:00
|
|
|
|
2025-11-02 19:15:38 +00:00
|
|
|
/* Bitfield of cpu features we get from x86's CPUID */
|
|
|
|
|
#if defined(MwLLMath_x86)
|
|
|
|
|
#define FEATX86_MMX (1 << 23)
|
|
|
|
|
// #define FEATX86_SSE (1 << 25)
|
|
|
|
|
#define FEATX86_SSE2 (1 << 26)
|
|
|
|
|
void mmx_apply(MwLLVec*);
|
|
|
|
|
#endif
|
2025-11-01 03:37:40 +00:00
|
|
|
|
|
|
|
|
#endif
|