1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-16 05:34:48 +00:00

More work on compile-opt

This commit is contained in:
Calvin Rose 2024-06-21 17:16:56 -05:00
parent b6fb7ae69c
commit 3510e235ee
5 changed files with 9 additions and 5 deletions

View File

@ -337,6 +337,10 @@
[]
(print (sysir/to-x64 ctx)))
(defn dumpx64-windows
[]
(print (sysir/to-x64 ctx @"" :windows)))
(defn dumpc
[]
(print (sysir/to-c ctx)))

View File

@ -11,4 +11,4 @@
(compile1 winmain)
#(dump)
#(dumpc)
(dumpx64)
(dumpx64-windows)

View File

@ -1891,9 +1891,9 @@ JANET_CORE_FN(cfun_sysir_tox64,
#else
target = JANET_SYS_TARGET_X64_LINUX;
#endif
} else if (janet_keyeq(argv[1], "windows")) {
} else if (janet_keyeq(argv[2], "windows")) {
target = JANET_SYS_TARGET_X64_WINDOWS;
} else if (janet_keyeq(argv[1], "linux")) {
} else if (janet_keyeq(argv[2], "linux")) {
target = JANET_SYS_TARGET_X64_LINUX;
} else {
janet_panicf("unknown target %v", argv[1]);

View File

@ -67,7 +67,7 @@ typedef enum {
JANET_SYSREG_16,
JANET_SYSREG_32,
JANET_SYSREG_64,
JANET_SYSREG_2x64,
JANET_SYSREG_2x64, /* Figure out how to represent this */
JANET_SYSREG_XMM
} x64RegKind;

View File

@ -972,7 +972,7 @@ const char *janet_strerror(int e) {
#ifdef JANET_WINDOWS
/* Microsoft strerror seems sane here and is thread safe by default */
return strerror(e);
#elif defined(_GNU_SOURCE)
#elif defined(__GLIBC__)
/* See https://linux.die.net/man/3/strerror_r */
return strerror_r(e, janet_vm.strerror_buf, sizeof(janet_vm.strerror_buf));
#else