thier progress
This commit is contained in:
parent
22d6631e24
commit
caa3aecaad
55
thiersort.h
55
thiersort.h
@ -233,4 +233,59 @@
|
|||||||
* the float conversions AND shifts vectorized with SSE somewhat...
|
* the float conversions AND shifts vectorized with SSE somewhat...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#define TS_BOOL uint8_t
|
||||||
|
#define TS_TRUE 1
|
||||||
|
#define TS_FALSE 0
|
||||||
|
|
||||||
|
/* Nearly same alg for all these keys */
|
||||||
|
union thier_key {
|
||||||
|
int32_t i;
|
||||||
|
uint32_t u;
|
||||||
|
float f;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct thier_elem {
|
||||||
|
union thier_key key;
|
||||||
|
uint32_t i;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Forward decl of internal code */
|
||||||
|
static inline void thiersort8_internal(
|
||||||
|
const thier_elem *arr,
|
||||||
|
uint32_t length,
|
||||||
|
const int (*compar)(
|
||||||
|
const union thier_key ak,
|
||||||
|
const union thier_key bk,
|
||||||
|
const void *aiptr,
|
||||||
|
const void *biptr,
|
||||||
|
void *reent_data),
|
||||||
|
const TS_BOOL isint,
|
||||||
|
const TS_BOOL isunsigned,
|
||||||
|
const TS_BOOL isfloat);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sort {key, index32} elements where key is 32 bit integer.
|
||||||
|
*/
|
||||||
|
static inline void thiersort8_intkey(
|
||||||
|
const thier_elem *arr,
|
||||||
|
uint32_t length) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Internal code reuse (branches shoul be optimized out) */
|
||||||
|
static inline void thiersort8_internal(
|
||||||
|
thier_elem *arr,
|
||||||
|
const uint32_t length,
|
||||||
|
const int (*compar)(
|
||||||
|
const union thier_key ak,
|
||||||
|
const union thier_key bk,
|
||||||
|
const void *aiptr,
|
||||||
|
const void *biptr,
|
||||||
|
void *reent_data),
|
||||||
|
const TS_BOOL isint,
|
||||||
|
const TS_BOOL isunsigned,
|
||||||
|
const TS_BOOL isfloat) {
|
||||||
|
// TODO: implement
|
||||||
|
}
|
||||||
#endif /* THIER_SORT_H */
|
#endif /* THIER_SORT_H */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user