diff options
| author | 2025-08-20 14:15:05 +0330 | |
|---|---|---|
| committer | 2025-08-20 14:15:05 +0330 | |
| commit | a6d16990fd6109f569324bb1422bfb603f6d031b (patch) | |
| tree | dfe95ec2a8740dc8dfd29e4199af56bcd5938015 /pu2/pu2.c | |
| parent | the speedster (diff) | |
added compat flags for easier cross-compilation
Diffstat (limited to 'pu2/pu2.c')
| -rw-r--r-- | pu2/pu2.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -286,7 +286,7 @@ int *Data; init_ir2() { Code = &m[ 4000 ]; - Data = &m[ S * sizeof(int) - 1 ]; // grows downwards + Data = &m[ S - 1 ]; // grows downwards } __attribute__((always_inline)) emit(int op, int val) { @@ -638,9 +638,13 @@ string op_names[] = { "hlt", "imm", "lod", "str", "swp", "add", "sub", "and", "n "a2u", "u2a", "b2u", "u2b", "nop", "cb1", "cb2", "cb3", "cb4" }; unsigned long long rdtsc(void) { +#ifndef PU2_NO_ASM unsigned hi, lo; __asm__ __volatile__("rdtsc" : "=a"(lo), "=d"(hi)); return ((unsigned long long) hi << 32) | lo; +#else + return 0; +#endif } clock_t ntime() { |
