diff options
| author | 2025-08-20 14:31:59 +0330 | |
|---|---|---|
| committer | 2025-08-20 14:31:59 +0330 | |
| commit | 4c0d59ff16f76dcbe0c16cf34e6a09dbc2422f93 (patch) | |
| tree | 997d0e0c3e4579dd80ef36869a16fe10820fe647 /pu2/pu2.out.c | |
| parent | added compat flags for easier cross-compilation (diff) | |
compat flags explanation
Diffstat (limited to 'pu2/pu2.out.c')
| -rw-r--r-- | pu2/pu2.out.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/pu2/pu2.out.c b/pu2/pu2.out.c index 98f0554..cd403f5 100644 --- a/pu2/pu2.out.c +++ b/pu2/pu2.out.c @@ -1,10 +1,26 @@ +// clang-format off + // COMPILE TIME FLAGS EXPLANATION + // - NO_MMAP Prevents usage of mmap+hugepages, which is only supported on linux + // - NO_ASM Prevents usage of inline assembly, useful for non-x86 platforms + // - BAD_CLOCK Use if your system clock does not support nanoseconds. Uses microseconds instead. + // - OLD_CLANG Use if your compiler version is not very up-to-date. + // - SPEED_IMPROVEMENT Almost doubles clock rate for the VM with a few optimizations. + // - EXTENDED_INSTRUCTION_SET Adds a few instructions which decrease token throughput for ir2. The high-level IR emitter will not work otherwise. +// clang-format on + /* -- BEGIN COMPILE TIME FLAGS -- */ // #define PU2_NO_MMAP // #define PU2_NO_ASM -#define __PU2_SPEED_IMPROVEMENT -#define __PU2_EXTENDED_INSTRUCTION_SET +// #define PU2_BAD_CLOCK +// #define PU2_OLD_CLANG +#define PU2_SPEED_IMPROVEMENT +#define PU2_EXTENDED_INSTRUCTION_SET /* -- END COMPILE TIME FLAGS --*/ +#ifdef PU2_NO_ASM + #warning Enabling this flag will invalidate all clock speed and cycle count measurements (thus, your CPU clock rate will be reported as 0MHz) +#endif + #define _GNU_SOURCE #include <ctype.h> #include <sched.h> @@ -32,9 +48,9 @@ #define J while #define H !--c -#ifndef __PU2_SPEED_IMPROVEMENT +#ifndef PU2_SPEED_IMPROVEMENT - #ifndef __PU2_EXTENDED_INSTRUCTION_SET + #ifndef PU2_EXTENDED_INSTRUCTION_SET // clang-format off m[S],c,v,a,b,u;pu2(){J(c=m[m[7]++],v=m[m[7]++],c){H?a=v:H?a=m[b]:H?u?m[a]=b:0:H?v=a,a=b,b=v:H?a+=b:H?a-=b:H?a&=b:H?a=!a:H?u=v:H?u=a:H?a=u:H?u=b:H?b=u:A;}} |
