import upstream maccel baseline
Tests / test_core_function (push) Failing after 12s

This commit is contained in:
2026-03-24 12:10:31 +00:00
parent 6e948d7b39
commit 5f1254d11a
108 changed files with 18930 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#ifndef _UTILS_H_
#define _UTILS_H_
#ifdef __KERNEL__
#include <linux/types.h>
#else
#include <stdint.h>
#endif
#include "dbg.h"
static inline int64_t div128_s64_s64_s64(int64_t high, int64_t low,
int64_t divisor) {
int64_t result;
// s.high.low
// high -> rdx
// low -> rax
uint64_t remainder;
__asm__("idivq %[B]"
: "=a"(result), "=d"(remainder)
: [B] "r"(divisor), "a"(low), "d"(high));
return result;
}
static inline int is_digit(char c) { return '0' <= c && c <= '9'; }
#endif