You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(56) |
Sep
(40) |
Oct
(30) |
Nov
(144) |
Dec
(23) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(41) |
Feb
(29) |
Mar
(31) |
Apr
(39) |
May
(193) |
Jun
(45) |
Jul
(19) |
Aug
(3) |
Sep
(23) |
Oct
(83) |
Nov
(92) |
Dec
(123) |
| 2007 |
Jan
(90) |
Feb
(267) |
Mar
(120) |
Apr
(51) |
May
(40) |
Jun
(121) |
Jul
(109) |
Aug
(173) |
Sep
(77) |
Oct
(52) |
Nov
(121) |
Dec
(62) |
| 2008 |
Jan
(76) |
Feb
(53) |
Mar
(98) |
Apr
(87) |
May
(26) |
Jun
(27) |
Jul
(23) |
Aug
(136) |
Sep
(79) |
Oct
(68) |
Nov
(29) |
Dec
(14) |
| 2009 |
Jan
(7) |
Feb
(2) |
Mar
(11) |
Apr
(75) |
May
(1) |
Jun
(95) |
Jul
(19) |
Aug
(4) |
Sep
(8) |
Oct
(93) |
Nov
(43) |
Dec
(21) |
| 2010 |
Jan
(20) |
Feb
(23) |
Mar
(18) |
Apr
(6) |
May
(20) |
Jun
(23) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(2) |
Feb
(6) |
Mar
(15) |
Apr
(5) |
May
(9) |
Jun
(14) |
Jul
(9) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
(2) |
Jun
(17) |
Jul
(37) |
Aug
|
Sep
(1) |
Oct
(6) |
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
(5) |
Apr
(2) |
May
(7) |
Jun
(11) |
Jul
(8) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(1) |
Jul
(7) |
Aug
(2) |
Sep
|
Oct
(5) |
Nov
(2) |
Dec
(4) |
| 2015 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
(9) |
Jul
(1) |
Aug
|
Sep
|
Oct
(4) |
Nov
(1) |
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
(1) |
Feb
(3) |
Mar
(3) |
Apr
(7) |
May
(2) |
Jun
(2) |
Jul
(5) |
Aug
(1) |
Sep
(2) |
Oct
(17) |
Nov
(4) |
Dec
(7) |
| 2018 |
Jan
(5) |
Feb
(14) |
Mar
(2) |
Apr
(5) |
May
(2) |
Jun
(5) |
Jul
|
Aug
(2) |
Sep
|
Oct
(3) |
Nov
(5) |
Dec
|
| 2019 |
Jan
(4) |
Feb
(2) |
Mar
(3) |
Apr
(1) |
May
(8) |
Jun
(14) |
Jul
(2) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
(15) |
Dec
(2) |
| 2020 |
Jan
(10) |
Feb
(3) |
Mar
(1) |
Apr
|
May
(9) |
Jun
(4) |
Jul
(16) |
Aug
(10) |
Sep
(4) |
Oct
(3) |
Nov
|
Dec
|
| 2021 |
Jan
(11) |
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(5) |
Sep
|
Oct
(6) |
Nov
(4) |
Dec
(4) |
| 2022 |
Jan
(4) |
Feb
(2) |
Mar
(2) |
Apr
|
May
(6) |
Jun
(3) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(5) |
Jun
(1) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(13) |
Dec
|
| 2024 |
Jan
(1) |
Feb
|
Mar
(5) |
Apr
|
May
(10) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(1) |
Dec
(14) |
| 2025 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(3) |
Jul
|
Aug
|
Sep
(2) |
Oct
(3) |
Nov
|
Dec
|
|
From: Stephen W. <sw...@ml...> - 2006-05-24 17:31:30
|
Fixed fegetround prototype.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c 2006-05-25 00:30:29 UTC (rev 4587)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c 2006-05-25 00:31:28 UTC (rev 4588)
@@ -11,7 +11,7 @@
#define ROUNDING_CONTROL_MASK 0x0C00
#define ROUNDING_CONTROL_SHIFT 10
-int fegetround (void) {
+static inline int fegetround (void) {
unsigned short controlWord;
_FPU_GETCW (controlWord);
|
|
From: Stephen W. <sw...@ml...> - 2006-05-24 17:30:33
|
Fixed r4585 -- only include functions used for time profiling when
HAS_TIME_PROFILING.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.c 2006-05-24 23:35:22 UTC (rev 4586)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.c 2006-05-25 00:30:29 UTC (rev 4587)
@@ -19,6 +19,8 @@
return getSourceName (s, i);
}
+#if HAS_TIME_PROFILING
+
int compareSourceLabels (const void *v1, const void *v2) {
const struct GC_sourceLabel* l1 = (const struct GC_sourceLabel*)v1;
const struct GC_sourceLabel* l2 = (const struct GC_sourceLabel*)v2;
@@ -54,8 +56,6 @@
<= s->sourceMaps.sourceLabels[i].label);
}
-#if HAS_TIME_PROFILING
-
void initTextSources (GC_state s) {
GC_sourceLabelIndex i;
code_pointer p;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.h 2006-05-24 23:35:22 UTC (rev 4586)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.h 2006-05-25 00:30:29 UTC (rev 4587)
@@ -79,9 +79,11 @@
static inline char* getSourceName (GC_state s, GC_sourceIndex i);
+#if HAS_TIME_PROFILING
static inline int compareSourceLabels (const void *v1, const void *v2);
static void sortSourceLabels (GC_state s);
static void initTextSources (GC_state s);
+#endif
static void showSources (GC_state s);
|
|
From: Stephen W. <sw...@ml...> - 2006-05-24 16:35:22
|
Renamed variable to avoid gcc "shadows a global" warning.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/recv.nonblock.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/recv.nonblock.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/recv.nonblock.c 2006-05-24 23:31:53 UTC (rev 4585)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/recv.nonblock.c 2006-05-24 23:35:22 UTC (rev 4586)
@@ -1,10 +1,10 @@
/* Simulates MSG_DONTWAIT using fcntl() and O_NONBLOCK. */
-static void fd_modify(int fd, int flags, int add, int remove)
+static void fd_modify(int fd, int flags, int add, int shouldRemove)
{
if (flags & MSG_DONTWAIT) {
int f = fcntl(fd, F_GETFL);
- fcntl(fd, F_SETFL, (f | add) & ~remove);
+ fcntl(fd, F_SETFL, (f | add) & ~shouldRemove);
}
}
|
|
From: Stephen W. <sw...@ml...> - 2006-05-24 16:31:54
|
Only define initTextSources if HAS_TIME_PROFILING, since that is the
only situation in which it is used. Without an #ifdef, one gets
"defined but not used" warnings from gcc.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.c 2006-05-24 23:28:55 UTC (rev 4584)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.c 2006-05-24 23:31:53 UTC (rev 4585)
@@ -54,6 +54,8 @@
<= s->sourceMaps.sourceLabels[i].label);
}
+#if HAS_TIME_PROFILING
+
void initTextSources (GC_state s) {
GC_sourceLabelIndex i;
code_pointer p;
@@ -87,6 +89,7 @@
s->sourceMaps.textSources[p - s->sourceMaps.textStart] = sourceSeqIndex;
}
+#endif
void showSources (GC_state s) {
uint32_t i;
|
|
From: Stephen W. <sw...@ml...> - 2006-05-24 16:28:56
|
Fixed prototype.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c 2006-05-24 22:29:56 UTC (rev 4583)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c 2006-05-24 23:28:55 UTC (rev 4584)
@@ -11,7 +11,7 @@
#define ROUNDING_CONTROL_MASK 0x0C00
#define ROUNDING_CONTROL_SHIFT 10
-int fegetround () {
+int fegetround (void) {
unsigned short controlWord;
_FPU_GETCW (controlWord);
|
|
From: Stephen W. <sw...@ml...> - 2006-05-24 15:29:57
|
Used a more generic name than "FromSpace" for the temp file.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/tempFileDes.mkstemp.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/tempFileDes.mkstemp.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/tempFileDes.mkstemp.c 2006-05-24 22:15:28 UTC (rev 4582)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/tempFileDes.mkstemp.c 2006-05-24 22:29:56 UTC (rev 4583)
@@ -2,7 +2,7 @@
int fd;
char *template;
const char *tmpDir;
- const char *tag = "/FromSpaceXXXXXXXXXX";
+ const char *tag = "/TempFileXXXXXXXXXX";
mode_t m;
tmpDir = getenv ("TMP");
|
|
From: Stephen W. <sw...@ml...> - 2006-05-24 15:15:33
|
Moved code to create a temporary file descriptor into platform/*,
available via tempFileDes(). The idea is that tempFileDes returns a
file descriptor for a temporary file that will be automatically
deleted upon close.
Put in a Unix implementation of tempFileDes based on mkstemp and umask
followed by unlink.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/aix.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/hpux.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.c
A mlton/branches/on-20050822-x86_64-branch/runtime/platform/tempFileDes.mkstemp.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c 2006-05-24 22:10:31 UTC (rev 4581)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c 2006-05-24 22:15:28 UTC (rev 4582)
@@ -307,39 +307,18 @@
newHeap.oldGenSize = size;
*curHeapp = newHeap;
} else {
- /* Write the heap to a file and try again. */
+ /* Write the heap to disk and try again. */
int fd;
- char template[80];
- const char *tmpDefault;
- char *tmpDir;
- const char *tmpVar;
-#if (defined (__MSVCRT__))
- tmpVar = "TEMP";
- tmpDefault = "C:/WINNT/TEMP";
-#else
- tmpVar = "TMPDIR";
- tmpDefault = "/tmp";
-#endif
- tmpDir = getenv (tmpVar);
- strcpy (template, (NULL == tmpDir) ? tmpDefault : tmpDir);
- strcat (template, "/FromSpaceXXXXXX");
- fd = mkstemp_safe (template);
- close_safe (fd);
- if (s->controls.messages)
- fprintf (stderr, "Paging heap from "FMTPTR" to %s.\n",
- (uintptr_t)orig, template);
- fd = open_safe (template, O_WRONLY, S_IRUSR | S_IWUSR);
+ fd = tempFileDes ();
write_safe (fd, orig, size);
- close_safe (fd);
releaseHeap (s, curHeapp);
if (createHeap (s, curHeapp, desiredSize, minSize)) {
- fd = open_safe (template, O_RDONLY, S_IRUSR | S_IWUSR);
+ lseek (fd, 0, SEEK_SET);
read_safe (fd, curHeapp->start, size);
close_safe (fd);
- unlink_safe (template);
} else {
- unlink_safe (template);
+ close_safe (fd);
if (s->controls.messages)
GC_displayMem ();
die ("Out of memory. Unable to allocate %s bytes.\n",
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/aix.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/aix.c 2006-05-24 22:10:31 UTC (rev 4581)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/aix.c 2006-05-24 22:15:28 UTC (rev 4582)
@@ -14,6 +14,7 @@
#include "mkdir2.c"
#include "recv.nonblock.c"
#include "ssmmap.c"
+#include "tempFileDes.mkstemp.c"
#include "use-mmap.c"
int fegetround(void)
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c 2006-05-24 22:10:31 UTC (rev 4581)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c 2006-05-24 22:15:28 UTC (rev 4582)
@@ -6,6 +6,7 @@
#include "mkdir2.c"
#include "mmap-protect.c"
+#include "tempFileDes.mkstemp.c"
#include "use-mmap.c"
code_pointer GC_getTextEnd (void) {
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.c 2006-05-24 22:10:31 UTC (rev 4581)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.c 2006-05-24 22:15:28 UTC (rev 4582)
@@ -3,6 +3,7 @@
#include "getText.c"
#include "mkdir2.c"
#include "mmap-protect.c"
+#include "tempFileDes.mkstemp.c"
#include "use-mmap.c"
void GC_displayMem () {
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/hpux.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/hpux.c 2006-05-24 22:10:31 UTC (rev 4581)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/hpux.c 2006-05-24 22:15:28 UTC (rev 4582)
@@ -12,6 +12,7 @@
#include "recv.nonblock.c"
#include "setenv.putenv.c"
#include "mmap-protect.c"
+#include "tempFileDes.mkstemp.c"
#include "use-mmap.c"
extern unsigned char __text_start;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.c 2006-05-24 22:10:31 UTC (rev 4581)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.c 2006-05-24 22:15:28 UTC (rev 4582)
@@ -7,6 +7,7 @@
#include "displayMem.linux.c"
#include "mmap-protect.c"
#include "sysconf.c"
+#include "tempFileDes.mkstemp.c"
#include "use-mmap.c"
#ifndef EIP
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c 2006-05-24 22:10:31 UTC (rev 4581)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c 2006-05-24 22:15:28 UTC (rev 4582)
@@ -5,6 +5,7 @@
#include "displayMem.linux.c"
#include "mmap-protect.c"
#include "sysctl.c"
+#include "tempFileDes.mkstemp.c"
#include "use-mmap.c"
static void catcher (__attribute__ ((unused)) int sig,
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c 2006-05-24 22:10:31 UTC (rev 4581)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c 2006-05-24 22:15:28 UTC (rev 4582)
@@ -5,6 +5,7 @@
#include "displayMem.linux.c"
#include "mmap-protect.c"
#include "sysctl.c"
+#include "tempFileDes.mkstemp.c"
#include "use-mmap.c"
static void catcher (__attribute__ ((unused)) int sig,
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.c 2006-05-24 22:10:31 UTC (rev 4581)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.c 2006-05-24 22:15:28 UTC (rev 4582)
@@ -9,6 +9,7 @@
#include "mmap-protect.c"
#include "sysconf.c"
#include "setenv.putenv.c"
+#include "tempFileDes.mkstemp.c"
int fegetround () {
int mode;
Added: mlton/branches/on-20050822-x86_64-branch/runtime/platform/tempFileDes.mkstemp.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/tempFileDes.mkstemp.c 2006-05-24 22:10:31 UTC (rev 4581)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/tempFileDes.mkstemp.c 2006-05-24 22:15:28 UTC (rev 4582)
@@ -0,0 +1,23 @@
+int tempFileDes (void) {
+ int fd;
+ char *template;
+ const char *tmpDir;
+ const char *tag = "/FromSpaceXXXXXXXXXX";
+ mode_t m;
+
+ tmpDir = getenv ("TMP");
+ if (NULL == tmpDir) {
+ tmpDir = getenv ("TMPDIR");
+ if (NULL == tmpDir)
+ tmpDir = "/var/tmp";
+ }
+ template = malloc_safe (strlen(tmpDir) + strlen(tag) + 1);
+ strcpy (template, tmpDir);
+ strcat (template, tag);
+ m = umask(077);
+ fd = mkstemp_safe (template);
+ (void)umask(m);
+ unlink_safe (template);
+ free (template);
+ return fd;
+}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-05-24 22:10:31 UTC (rev 4581)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-05-24 22:15:28 UTC (rev 4582)
@@ -129,6 +129,7 @@
/* ---------------------------------------------------------------- */
int mkdir2 (const char *pathname, mode_t mode);
+int tempFileDes (void);
/* ---------------------------------------------------------------- */
/* Garbage Collector */
|
|
From: Matthew F. <fl...@ml...> - 2006-05-24 15:10:32
|
A somewhat different solution to the issue discussed in r4578. Rather
than include "basis-ffi.h" (and suffer incompatible extern
declarations for Basis Library values imported as _symbol), we
conditionally include either a declaration of WordS<N>_{quot,rem} or a
static inline definition.
Also fixed a bug whereby the inlined Real<N>_Math_* functions did not
have declarations for the underlying <math.h> functions; again, this
is a consequence of "c-chunk.h" not including "platform.h".
Both issues could be solved by including "platform.h" in "c-chunk.h",
but it isn't clear why this was never done before. (Of course, the
extern/_symbol issue remains.)
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.c
U mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Math-fns.h
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Word/Word-ops.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.c 2006-05-24 21:52:07 UTC (rev 4580)
+++ mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.c 2006-05-24 22:10:31 UTC (rev 4581)
@@ -6,7 +6,22 @@
*/
#define MLTON_GC_INTERNAL_TYPES
+#ifndef MLTON_CODEGEN_STATIC_INLINE
#define MLTON_CODEGEN_STATIC_INLINE static inline
+#endif
+/* No need to declare inlined math functions, since <math.h> comes
+ * with "platform.h".
+ */
+#ifndef MLTON_CODEGEN_MATHFN
+#define MLTON_CODEGEN_MATHFN(decl)
+#endif
+/* WordS<N>_quot and WordS<N>_rem can be inlined with the
+ * bytecode-codegen, since they will be used in a context where the
+ * arguments are variables.
+ */
+#ifndef MLTON_CODEGEN_WORDSQUOTREM
+#define MLTON_CODEGEN_WORDSQUOTREM(decl, func) func
+#endif
#include "platform.h"
#include "interpret.h"
Modified: mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h 2006-05-24 21:52:07 UTC (rev 4580)
+++ mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h 2006-05-24 22:10:31 UTC (rev 4581)
@@ -196,8 +196,20 @@
#ifndef MLTON_CODEGEN_STATIC_INLINE
#define MLTON_CODEGEN_STATIC_INLINE static inline
#endif
-#define MLTON_CCODEGEN_HIDE(z)
-#include "basis-ffi.h"
+/* Declare inlined math functions, since <math.h> isn't included.
+ */
+#ifndef MLTON_CODEGEN_MATHFN
+#define MLTON_CODEGEN_MATHFN(decl) decl
+#endif
+/* WordS<N>_quot and WordS<N>_rem can't be inlined with the C-codegen,
+ * because the gcc optimizer sometimes produces incorrect results when
+ * one of the arguments is a constant.
+ * However, we need the declarations for Word-check.h
+ */
+#ifndef MLTON_CODEGEN_WORDSQUOTREM
+#define MLTON_CODEGEN_WORDSQUOTREM(decl, func) decl
+#endif
+// #include "basis-ffi.h"
#include "basis/coerce.h"
#include "basis/Real/Real-ops.h"
#include "basis/Real/Math-fns.h"
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Math-fns.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Math-fns.h 2006-05-24 21:52:07 UTC (rev 4580)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Math-fns.h 2006-05-24 22:10:31 UTC (rev 4581)
@@ -1,9 +1,15 @@
+#ifndef MLTON_CODEGEN_MATHFN
+#define MLTON_CODEGEN_MATHFN(decl)
+#endif
+
#define unaryReal(g, h) \
+ MLTON_CODEGEN_MATHFN(Real64_t h(Real64_t x);) \
MLTON_CODEGEN_STATIC_INLINE \
Real64_t Real64_##g (Real64_t x) { \
return h (x); \
} \
+ MLTON_CODEGEN_MATHFN(Real32_t h##f(Real32_t x);) \
MLTON_CODEGEN_STATIC_INLINE \
Real32_t Real32_##g (Real32_t x) { \
return h##f (x); \
@@ -13,10 +19,12 @@
#undef unaryReal
#define binaryReal(g, h) \
+ MLTON_CODEGEN_MATHFN(Real64_t h(Real64_t x, Real64_t y);) \
MLTON_CODEGEN_STATIC_INLINE \
Real64_t Real64_Math_##g (Real64_t x, Real64_t y) { \
return h (x, y); \
} \
+ MLTON_CODEGEN_MATHFN(Real32_t h##f(Real32_t x, Real32_t y);) \
MLTON_CODEGEN_STATIC_INLINE \
Real32_t Real32_Math_##g (Real32_t x, Real32_t y) { \
return h##f (x, y); \
@@ -26,10 +34,12 @@
#undef binaryReal
#define unaryReal(g, h) \
+ MLTON_CODEGEN_MATHFN(Real64_t h(Real64_t x);) \
MLTON_CODEGEN_STATIC_INLINE \
Real64_t Real64_Math_##g (Real64_t x) { \
return h (x); \
} \
+ MLTON_CODEGEN_MATHFN(Real32_t h##f(Real32_t x);) \
MLTON_CODEGEN_STATIC_INLINE \
Real32_t Real32_Math_##g (Real32_t x) { \
return h##f (x); \
@@ -50,10 +60,12 @@
#undef unaryReal
#define binaryRealIntRef(g, h) \
+ MLTON_CODEGEN_MATHFN(Real64_t h (Real64_t x, int* ip);) \
MLTON_CODEGEN_STATIC_INLINE \
Real64_t Real64_##g (Real64_t x, Ref(C_Int_t) i) { \
return h (x, (int*)i); \
} \
+ MLTON_CODEGEN_MATHFN(Real32_t h##f (Real32_t x, int* ip);) \
MLTON_CODEGEN_STATIC_INLINE \
Real32_t Real32_##g (Real32_t x, Ref(C_Int_t) i) { \
return h##f (x, (int*)i); \
@@ -62,10 +74,12 @@
#undef binaryRealIntRef
#define binaryRealInt(g, h) \
+ MLTON_CODEGEN_MATHFN(Real64_t h (Real64_t x, int i);) \
MLTON_CODEGEN_STATIC_INLINE \
Real64_t Real64_##g (Real64_t x, C_Int_t i) { \
return h (x, i); \
} \
+ MLTON_CODEGEN_MATHFN(Real32_t h##f (Real32_t x, int i);) \
MLTON_CODEGEN_STATIC_INLINE \
Real32_t Real32_##g (Real32_t x, C_Int_t i) { \
return h##f (x, i); \
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Word/Word-ops.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Word/Word-ops.h 2006-05-24 21:52:07 UTC (rev 4580)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Word/Word-ops.h 2006-05-24 22:10:31 UTC (rev 4581)
@@ -1,8 +1,11 @@
-#ifndef MLTON_CCODEGEN_HIDE
-#define MLTON_CCODEGEN_HIDE(z) z
+#ifndef MLTON_CODEGEN_WORDSQUOTREM
+#define MLTON_CODEGEN_WORDSQUOTREM(decl, func) func
#endif
+#define binaryDecl(kind, name) \
+ Word##kind Word##kind##_##name (Word##kind w1, Word##kind w2);
+
#define binary(kind, name, op) \
MLTON_CODEGEN_STATIC_INLINE \
Word##kind Word##kind##_##name (Word##kind w1, Word##kind w2) { \
@@ -61,10 +64,14 @@
unary (size, notb, ~) \
/* WordS<N>_quot and WordS<N>_rem can't be inlined with the C-codegen, \
* because the gcc optimizer sometimes produces incorrect results \
- * when one of th arguments is a constant. \
+ * when one of the arguments is a constant. \
+ * However, we need the declarations for Word-check.h \
+ * WordS<N>_quot and WordS<N>_rem can be inlined with the \
+ * bytecode-codegen, since they will be used in a context where the \
+ * arguments are variables. \
*/ \
-MLTON_CCODEGEN_HIDE(binary (S##size, quot, /)) \
-MLTON_CCODEGEN_HIDE(binary (S##size, rem, %)) \
+MLTON_CODEGEN_WORDSQUOTREM(binaryDecl (S##size, quot), binary (S##size, quot, /)) \
+MLTON_CODEGEN_WORDSQUOTREM(binaryDecl (S##size, rem), binary (S##size, rem, %)) \
binary (U##size, quot, /) \
binary (U##size, rem, %) \
binary (size, orb, |) \
|
|
From: Stephen W. <sw...@ml...> - 2006-05-24 14:52:15
|
Removed out-of-date comment.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-24 21:37:04 UTC (rev 4579)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-24 21:52:07 UTC (rev 4580)
@@ -188,10 +188,6 @@
all: libgdtoa.a libmlton.a libmlton-gdb.a
-# When compiling gdtoa, we use defines to replace strto{d,f} with
-# gdtoa_strto{d,f} to avoid conflicts with the C library on some
-# platforms that define their own strto{d,f}.
-
libgdtoa.a: gdtoa/arith.h
cd gdtoa && \
$(CC) $(OPTCFLAGS) $(OPTWARNCFLAGS) \
|
|
From: Stephen W. <sw...@ml...> - 2006-05-24 14:37:09
|
Took out --param inline-unit-growth=125 which causes the following error for my gcc 3.3.5 invalid parameter `inline-unit-growth' ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-24 14:25:55 UTC (rev 4578) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-24 21:37:04 UTC (rev 4579) @@ -34,7 +34,7 @@ FLAGS += -malign-loops=2 -malign-jumps=2 -malign-functions=5 endif ifeq ($(findstring $(GCC_VERSION), 3.3 3.4 4.0),$(GCC_VERSION)) -GCOPTFLAGS += --param inline-unit-growth=125 --param max-inline-insns-single=1000 +GCOPTFLAGS += --param max-inline-insns-single=1000 endif DEBUGFLAGS += -gstabs+ OPTWARNFLAGS += -Winline |
|
From: Wesley T. <we...@ml...> - 2006-05-24 07:25:56
|
We need to prototype the basis FFI before use in Word-check.h. Therefore, include the header. This fixes this regression: testing fixed-integer /tmp/file8kzjD6.12.c:137: error: conflicting types for 'WordS16_quot' /Users/terpstra/src/mlton/mlton.x86_64/build/lib/include/basis/Word/Word-check.h:158: error: previous implicit declaration of 'WordS16_quot' was here /tmp/file8kzjD6.12.c:139: error: conflicting types for 'WordS8_quot' /Users/terpstra/src/mlton/mlton.x86_64/build/lib/include/basis/Word/Word-check.h:157: error: previous implicit declaration of 'WordS8_quot' was here call to system failed with exit status 1: gcc -std=gnu99 -c -I/Users/terpstra/src/mlton/mlton.x86_64/build/lib/include -O1 -fno-strict-aliasing -fomit-frame-pointer -w -I/sw/include -o /tmp/fileJro07X.o /tmp/file8kzjD6.12.c compilation of fixed-integer failed with -type-check true ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h 2006-05-24 13:36:35 UTC (rev 4577) +++ mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h 2006-05-24 14:25:55 UTC (rev 4578) @@ -197,6 +197,7 @@ #define MLTON_CODEGEN_STATIC_INLINE static inline #endif #define MLTON_CCODEGEN_HIDE(z) +#include "basis-ffi.h" #include "basis/coerce.h" #include "basis/Real/Real-ops.h" #include "basis/Real/Math-fns.h" |
|
From: Matthew F. <fl...@ml...> - 2006-05-24 06:36:35
|
In r4571:
Calling translateHeap with s->heap.oldGenSize is incorrect, because
when heapRemap fails and heapCreate succeeds, s->heap is updated with
an newly initialized heap with oldGenSize == 0. Instead, call
translateHeap with size, which has the original oldGenSize.
The commit message failed to note that it additionally set the newly
initialized heap's oldGenSize to size. Leaving the newly initialized
heap with oldGenSize == 0 is incorrect, at it makes the heap appear to
have no data. Once the newly initialized heap's oldGenSize is set
correctly, then it is acceptable to call translateHeap with
s->heap.oldGenSize.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c 2006-05-24 13:29:31 UTC (rev 4576)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c 2006-05-24 13:36:35 UTC (rev 4577)
@@ -286,7 +286,6 @@
pointer to;
size_t remaining;
- newHeap.oldGenSize = size;
from = curHeapp->start + size;
to = newHeap.start + size;
remaining = size;
@@ -305,6 +304,7 @@
goto copy;
}
releaseHeap (s, curHeapp);
+ newHeap.oldGenSize = size;
*curHeapp = newHeap;
} else {
/* Write the heap to a file and try again. */
@@ -348,7 +348,7 @@
}
done:
unless (orig == s->heap.start) {
- translateHeap (s, orig, s->heap.start, size);
+ translateHeap (s, orig, s->heap.start, s->heap.oldGenSize);
setCardMapAbsolute (s);
}
}
|
|
From: Matthew F. <fl...@ml...> - 2006-05-24 06:29:32
|
Revert to r4571.
In 4575:
In r4572:
Calling translateHeap with s->heap.oldGenSize is incorrect, because
when heapRemap fails and heapCreate succeeds, s->heap is updated with
an newly initialized heap with oldGenSize == 0. Instead, call
translateHeap with size, which has the original oldGenSize.
However, it seems that leaving the newly initialized heap with
oldGenSize == 0 is incorrect, at it makes the heap appear to have no
data.
These changes were due to a mistaken belief that the corresponding
changes in the x86_64 branch were also relevant in the trunk. The
trunk revision of gc.c maintains the oldGenSize as a component of the
GC_state; hence, calling translateHeap with s->oldGenSize is correct.
In the x86_64 branch, each GC_heap maintains it's own oldGenSize and
nursery; normally, only the current heap (the heap component of
GC_state) matters at any given time, but in the situation above, the
newly created heap needs to have it's oldGenSize set to reflect the
fact that it gets a copy of the current heap and then becomes the new
current heap (for which the oldGenSize will matter).
----------------------------------------------------------------------
U mlton/trunk/runtime/gc.c
----------------------------------------------------------------------
Modified: mlton/trunk/runtime/gc.c
===================================================================
--- mlton/trunk/runtime/gc.c 2006-05-24 12:28:01 UTC (rev 4575)
+++ mlton/trunk/runtime/gc.c 2006-05-24 13:29:31 UTC (rev 4576)
@@ -2826,7 +2826,6 @@
uint remaining;
pointer to;
- h2.oldGenSize = size;
from = old + size;
to = h2.start + size;
remaining = size;
@@ -2888,7 +2887,7 @@
}
done:
unless (old == s->heap.start) {
- translateHeap (s, old, s->heap.start, size);
+ translateHeap (s, old, s->heap.start, s->oldGenSize);
setCardMapForMutator (s);
}
}
|
|
From: Matthew F. <fl...@ml...> - 2006-05-24 05:28:02
|
In r4572:
Calling translateHeap with s->heap.oldGenSize is incorrect, because
when heapRemap fails and heapCreate succeeds, s->heap is updated with
an newly initialized heap with oldGenSize == 0. Instead, call
translateHeap with size, which has the original oldGenSize.
However, it seems that leaving the newly initialized heap with
oldGenSize == 0 is incorrect, at it makes the heap appear to have no
data.
----------------------------------------------------------------------
U mlton/trunk/runtime/gc.c
----------------------------------------------------------------------
Modified: mlton/trunk/runtime/gc.c
===================================================================
--- mlton/trunk/runtime/gc.c 2006-05-24 12:23:53 UTC (rev 4574)
+++ mlton/trunk/runtime/gc.c 2006-05-24 12:28:01 UTC (rev 4575)
@@ -2826,6 +2826,7 @@
uint remaining;
pointer to;
+ h2.oldGenSize = size;
from = old + size;
to = h2.start + size;
remaining = size;
|
|
From: Matthew F. <fl...@ml...> - 2006-05-24 05:23:55
|
Formatting
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c 2006-05-24 02:24:47 UTC (rev 4573)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c 2006-05-24 12:23:53 UTC (rev 4574)
@@ -286,9 +286,9 @@
pointer to;
size_t remaining;
+ newHeap.oldGenSize = size;
from = curHeapp->start + size;
to = newHeap.start + size;
- newHeap.oldGenSize = size;
remaining = size;
copy:
assert (remaining == (size_t)(from - curHeapp->start)
|
|
From: Matthew F. <fl...@ml...> - 2006-05-23 19:24:50
|
Drop unused GC_availRam
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/sysvals.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/sysconf.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.c 2006-05-24 02:18:53 UTC (rev 4572)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.c 2006-05-24 02:24:47 UTC (rev 4573)
@@ -283,7 +283,6 @@
sigemptyset (&s->signalsInfo.signalsHandled);
sigemptyset (&s->signalsInfo.signalsPending);
s->startTime = getCurrentTime ();
- s->sysvals.availRam = GC_availRam ();
s->sysvals.totalRam = GC_totalRam ();
s->sysvals.pageSize = GC_pageSize ();
s->weaks = NULL;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/sysvals.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/sysvals.h 2006-05-24 02:18:53 UTC (rev 4572)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/sysvals.h 2006-05-24 02:24:47 UTC (rev 4573)
@@ -10,7 +10,6 @@
struct GC_sysvals {
size_t ram;
- size_t availRam;
size_t totalRam;
size_t pageSize;
};
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c 2006-05-24 02:18:53 UTC (rev 4572)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c 2006-05-24 02:24:47 UTC (rev 4573)
@@ -54,18 +54,6 @@
return mem;
}
-// Not quite right... what does 'available' mean anyways?!
-// This returns the number of bytes available to userspace programs.
-size_t GC_availRam (void) {
- int mem;
- size_t len;
-
- len = sizeof (int);
- if (-1 == sysctlbyname ("hw.usermem", &mem, &len, NULL, 0))
- diee ("sysctl failed");
- return mem;
-}
-
// This is not windows
__attribute__ ((noreturn))
C_Errno_t(C_PId_t) MLton_Process_cwait (__attribute__ ((unused)) C_PId_t pid,
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/sysconf.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/sysconf.c 2006-05-24 02:18:53 UTC (rev 4572)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/sysconf.c 2006-05-24 02:24:47 UTC (rev 4573)
@@ -12,11 +12,3 @@
tmp = sysconf (_SC_PHYS_PAGES);
return pageSize * (size_t)tmp;
}
-
-size_t GC_availRam (void) {
- size_t pageSize = GC_pageSize ();
- long int tmp;
-
- tmp = sysconf (_SC_AVPHYS_PAGES);
- return pageSize * (size_t)tmp;
-}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-05-24 02:18:53 UTC (rev 4572)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-05-24 02:24:47 UTC (rev 4573)
@@ -153,7 +153,6 @@
size_t GC_pageSize (void);
size_t GC_totalRam (void);
-size_t GC_availRam (void);
void GC_setCygwinUseMmap (bool b);
|
|
From: Matthew F. <fl...@ml...> - 2006-05-23 19:18:57
|
Calling translateHeap with s->heap.oldGenSize is incorrect, because
when heapRemap fails and heapCreate succeeds, s->heap is updated with
an newly initialized heap with oldGenSize == 0. Instead, call
translateHeap with size, which has the original oldGenSize.
----------------------------------------------------------------------
U mlton/trunk/runtime/gc.c
----------------------------------------------------------------------
Modified: mlton/trunk/runtime/gc.c
===================================================================
--- mlton/trunk/runtime/gc.c 2006-05-24 02:17:01 UTC (rev 4571)
+++ mlton/trunk/runtime/gc.c 2006-05-24 02:18:53 UTC (rev 4572)
@@ -2887,7 +2887,7 @@
}
done:
unless (old == s->heap.start) {
- translateHeap (s, old, s->heap.start, s->oldGenSize);
+ translateHeap (s, old, s->heap.start, size);
setCardMapForMutator (s);
}
}
|
|
From: Matthew F. <fl...@ml...> - 2006-05-23 19:17:03
|
Calling translateHeap with s->heap.oldGenSize is incorrect, because
when heapRemap fails and heapCreate succeeds, s->heap is updated with
an newly initialized heap with oldGenSize == 0. Instead, call
translateHeap with size, which has the original oldGenSize.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c 2006-05-23 19:53:29 UTC (rev 4570)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c 2006-05-24 02:17:01 UTC (rev 4571)
@@ -199,7 +199,7 @@
if (s->controls.messages)
fprintf(stderr,
"[Requested %s cannot be satisfied, "
- "backing off by %s (min size = %s).\n",
+ "backing off by %s (min size = %s).]\n",
sizeToBytesApproxString (h->size),
sizeToBytesApproxString (backoff),
sizeToBytesApproxString (minSize));
@@ -288,6 +288,7 @@
from = curHeapp->start + size;
to = newHeap.start + size;
+ newHeap.oldGenSize = size;
remaining = size;
copy:
assert (remaining == (size_t)(from - curHeapp->start)
@@ -347,7 +348,7 @@
}
done:
unless (orig == s->heap.start) {
- translateHeap (s, orig, s->heap.start, s->heap.oldGenSize);
+ translateHeap (s, orig, s->heap.start, size);
setCardMapAbsolute (s);
}
}
|
|
From: Wesley T. <we...@ml...> - 2006-05-23 12:53:30
|
Hrm - apparently this stub is needed by mlprof
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c 2006-05-23 19:19:54 UTC (rev 4569)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c 2006-05-23 19:53:29 UTC (rev 4570)
@@ -65,3 +65,10 @@
diee ("sysctl failed");
return mem;
}
+
+// This is not windows
+__attribute__ ((noreturn))
+C_Errno_t(C_PId_t) MLton_Process_cwait (__attribute__ ((unused)) C_PId_t pid,
+ __attribute__ ((unused)) Ref(C_Status_t) status) {
+ die("MLton_Process_cwait not implemented");
+}
|
|
From: Wesley T. <we...@ml...> - 2006-05-23 12:19:56
|
Implement the new GC_availRam as simply returning all userspace available memory.
I couldn't find a better match for this after about 2-3 hours of googling. :-(
Discovered 'vmmap' which provides a process memory map on osx.
This might also work for BSD in case it needs to be fixed there still.
Finally, grab the pagesize from sysconf for the other new GC method.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c 2006-05-23 03:17:29 UTC (rev 4568)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c 2006-05-23 19:19:54 UTC (rev 4569)
@@ -22,10 +22,9 @@
}
void GC_displayMem (void) {
- /* FIXME: this won't actually work. */
static char buffer[256];
- sprintf (buffer, "/bin/cat /proc/%d/map\n", (int)getpid ());
+ sprintf (buffer, "/usr/bin/vmmap -w -interleaved %d\n", (int)getpid ());
(void)system (buffer);
}
@@ -40,6 +39,11 @@
sa->sa_sigaction = (void (*)(int, siginfo_t*, void*))catcher;
}
+size_t GC_pageSize (void) {
+ long int pageSize = sysconf(_SC_PAGESIZE);
+ return (size_t)pageSize;
+}
+
size_t GC_totalRam (void) {
int mem;
size_t len;
@@ -49,3 +53,15 @@
diee ("sysctl failed");
return mem;
}
+
+// Not quite right... what does 'available' mean anyways?!
+// This returns the number of bytes available to userspace programs.
+size_t GC_availRam (void) {
+ int mem;
+ size_t len;
+
+ len = sizeof (int);
+ if (-1 == sysctlbyname ("hw.usermem", &mem, &len, NULL, 0))
+ diee ("sysctl failed");
+ return mem;
+}
|
|
From: Matthew F. <fl...@ml...> - 2006-05-22 20:17:30
|
Working on OpenBSD(3.8) ---------------------------------------------------------------------- A mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/x86-openbsd/c-types.sml ---------------------------------------------------------------------- Added: mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/x86-openbsd/c-types.sml =================================================================== --- mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/x86-openbsd/c-types.sml 2006-05-23 03:16:05 UTC (rev 4567) +++ mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/x86-openbsd/c-types.sml 2006-05-23 03:17:29 UTC (rev 4568) @@ -0,0 +1,131 @@ +(* Copyright (C) 2004-2006 Henry Cejtin, Matthew Fluet, Suresh + * Jagannathan, and Stephen Weeks. + * + * MLton is released under a BSD-style license. + * See the file MLton-LICENSE for details. + *) + + +(* C *) +structure C_Char = struct open Int8 type t = int end +functor C_Char_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int8 (A) +structure C_SChar = struct open Int8 type t = int end +functor C_SChar_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int8 (A) +structure C_UChar = struct open Word8 type t = word end +functor C_UChar_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word8 (A) +structure C_Short = struct open Int16 type t = int end +functor C_Short_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int16 (A) +structure C_SShort = struct open Int16 type t = int end +functor C_SShort_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int16 (A) +structure C_UShort = struct open Word16 type t = word end +functor C_UShort_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word16 (A) +structure C_Int = struct open Int32 type t = int end +functor C_Int_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_SInt = struct open Int32 type t = int end +functor C_SInt_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_UInt = struct open Word32 type t = word end +functor C_UInt_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_Long = struct open Int32 type t = int end +functor C_Long_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_SLong = struct open Int32 type t = int end +functor C_SLong_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_ULong = struct open Word32 type t = word end +functor C_ULong_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_LongLong = struct open Int64 type t = int end +functor C_LongLong_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int64 (A) +structure C_SLongLong = struct open Int64 type t = int end +functor C_SLongLong_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int64 (A) +structure C_ULongLong = struct open Word64 type t = word end +functor C_ULongLong_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word64 (A) +structure C_Float = struct open Real32 type t = real end +functor C_Float_ChooseRealN (A: CHOOSE_REALN_ARG) = ChooseRealN_Real32 (A) +structure C_Double = struct open Real64 type t = real end +functor C_Double_ChooseRealN (A: CHOOSE_REALN_ARG) = ChooseRealN_Real64 (A) +structure C_Size = struct open Word32 type t = word end +functor C_Size_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + +structure C_Pointer = struct open Word32 type t = word end +functor C_Pointer_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_String = struct open Word32 type t = word end +functor C_String_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_StringArray = struct open Word32 type t = word end +functor C_StringArray_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + +(* Generic integers *) +structure C_Fd = C_Int +functor C_Fd_ChooseIntN (A: CHOOSE_INTN_ARG) = C_Int_ChooseIntN (A) +structure C_Signal = C_Int +functor C_Signal_ChooseIntN (A: CHOOSE_INTN_ARG) = C_Int_ChooseIntN (A) +structure C_Status = C_Int +functor C_Status_ChooseIntN (A: CHOOSE_INTN_ARG) = C_Int_ChooseIntN (A) +structure C_Sock = C_Int +functor C_Sock_ChooseIntN (A: CHOOSE_INTN_ARG) = C_Int_ChooseIntN (A) + +(* C99 *) +structure C_Ptrdiff = struct open Int32 type t = int end +functor C_Ptrdiff_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_Intmax = struct open Int64 type t = int end +functor C_Intmax_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int64 (A) +structure C_UIntmax = struct open Word64 type t = word end +functor C_UIntmax_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word64 (A) +structure C_Intptr = struct open Int32 type t = int end +functor C_Intptr_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_UIntptr = struct open Word32 type t = word end +functor C_UIntptr_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + +(* from <dirent.h> *) +structure C_DirP = struct open Word32 type t = word end +functor C_DirP_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + +(* from <poll.h> *) +structure C_NFds = struct open Word32 type t = word end +functor C_NFds_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + +(* from <resource.h> *) +structure C_RLim = struct open Word64 type t = word end +functor C_RLim_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word64 (A) + +(* from <sys/types.h> *) +structure C_Clock = struct open Word32 type t = word end +functor C_Clock_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_Dev = struct open Int32 type t = int end +functor C_Dev_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_GId = struct open Word32 type t = word end +functor C_GId_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_Id = struct open Word32 type t = word end +functor C_Id_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_INo = struct open Word32 type t = word end +functor C_INo_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_Mode = struct open Word32 type t = word end +functor C_Mode_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_NLink = struct open Word32 type t = word end +functor C_NLink_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_Off = struct open Int64 type t = int end +functor C_Off_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int64 (A) +structure C_PId = struct open Int32 type t = int end +functor C_PId_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_SSize = struct open Int32 type t = int end +functor C_SSize_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_SUSeconds = struct open Int32 type t = int end +functor C_SUSeconds_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_Time = struct open Int32 type t = int end +functor C_Time_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_UId = struct open Word32 type t = word end +functor C_UId_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + +(* from <sys/socket.h> *) +structure C_Socklen = struct open Word32 type t = word end +functor C_Socklen_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + +(* from <termios.h> *) +structure C_CC = struct open Word8 type t = word end +functor C_CC_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word8 (A) +structure C_Speed = struct open Word32 type t = word end +functor C_Speed_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_TCFlag = struct open Word32 type t = word end +functor C_TCFlag_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + +(* from "gmp.h" *) +structure C_MPLimb = struct open Word32 type t = word end +functor C_MPLimb_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + |
|
From: Matthew F. <fl...@ml...> - 2006-05-22 20:16:10
|
Working on OpenBSD(3.8)
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.h
D mlton/branches/on-20050822-x86_64-branch/runtime/platform/showMem.linux.c
A mlton/branches/on-20050822-x86_64-branch/runtime/platform/sysctl.c
D mlton/branches/on-20050822-x86_64-branch/runtime/platform/totalRam.sysctl.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-22 22:51:00 UTC (rev 4566)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-23 03:16:05 UTC (rev 4567)
@@ -33,7 +33,7 @@
else
FLAGS += -malign-loops=2 -malign-jumps=2 -malign-functions=5
endif
-ifeq ($(findstring $(GCC_VERSION), 3.4 4.0),$(GCC_VERSION))
+ifeq ($(findstring $(GCC_VERSION), 3.3 3.4 4.0),$(GCC_VERSION))
GCOPTFLAGS += --param inline-unit-growth=125 --param max-inline-insns-single=1000
endif
DEBUGFLAGS += -gstabs+
@@ -63,6 +63,10 @@
FLAGS += -I/usr/local/include
endif
+ifeq ($(TARGET_OS), openbsd)
+FLAGS += -I/usr/local/include
+endif
+
ifeq ($(TARGET_OS), solaris)
FLAGS += -funroll-all-loops
endif
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c 2006-05-22 22:51:00 UTC (rev 4566)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c 2006-05-23 03:16:05 UTC (rev 4567)
@@ -2,9 +2,9 @@
#include "getText.c"
#include "mkdir2.c"
-#include "showMem.linux.c"
+#include "displayMem.linux.c"
#include "mmap-protect.c"
-#include "totalRam.sysctl.c"
+#include "sysctl.c"
#include "use-mmap.c"
static void catcher (__attribute__ ((unused)) int sig,
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c 2006-05-22 22:51:00 UTC (rev 4566)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c 2006-05-23 03:16:05 UTC (rev 4567)
@@ -2,9 +2,9 @@
#include "getText.c"
#include "mkdir2.c"
-#include "showMem.linux.c"
+#include "displayMem.linux.c"
#include "mmap-protect.c"
-#include "totalRam.sysctl.c"
+#include "sysctl.c"
#include "use-mmap.c"
static void catcher (__attribute__ ((unused)) int sig,
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.h 2006-05-22 22:51:00 UTC (rev 4566)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.h 2006-05-23 03:16:05 UTC (rev 4567)
@@ -24,6 +24,8 @@
#define HAS_FEROUND FALSE
#define HAS_FPCLASSIFY FALSE
+#define HAS_FPCLASSIFY32 FALSE
+#define HAS_FPCLASSIFY64 FALSE
#define HAS_MSG_DONTWAIT TRUE
#define HAS_REMAP FALSE
#define HAS_SIGALTSTACK TRUE
@@ -35,3 +37,37 @@
int fpclassify32 (float f);
int fpclassify64 (double d);
+
+#ifndef PRIu8
+#define PRIu8 "hhu"
+#endif
+#ifndef PRIu16
+#define PRIu16 "hu"
+#endif
+#ifndef PRIx16
+#define PRIx16 "hx"
+#endif
+#ifndef PRId32
+#define PRId32 "d"
+#endif
+#ifndef PRIu32
+#define PRIu32 "u"
+#endif
+#ifndef PRIx32
+#define PRIx32 "x"
+#endif
+typedef long long int intmax_t;
+#ifndef INTMAX_MIN
+#define INTMAX_MIN LLONG_MIN
+#endif
+typedef unsigned long long int uintmax_t;
+#ifndef PRIuMAX
+#define PRIuMAX "llu"
+#endif
+#ifndef PRIxMAX
+#define PRIxMAX "llx"
+#endif
+
+#ifndef PRIxPTR
+#define PRIxPTR "lx"
+#endif
Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/platform/showMem.linux.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/showMem.linux.c 2006-05-22 22:51:00 UTC (rev 4566)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/showMem.linux.c 2006-05-23 03:16:05 UTC (rev 4567)
@@ -1,6 +0,0 @@
-void showMem () {
- static char buffer[256];
-
- sprintf (buffer, "/bin/cat /proc/%d/maps\n", (int)(getpid ()));
- system (buffer);
-}
Added: mlton/branches/on-20050822-x86_64-branch/runtime/platform/sysctl.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/sysctl.c 2006-05-22 22:51:00 UTC (rev 4566)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/sysctl.c 2006-05-23 03:16:05 UTC (rev 4567)
@@ -0,0 +1,12 @@
+size_t GC_totalRam (void) {
+ int mem;
+ size_t len;
+ int mib[2];
+
+ mib[0] = CTL_HW;
+ mib[1] = HW_PHYSMEM;
+ len = sizeof(mem);
+ if (-1 == sysctl (mib, 2, &mem, &len, NULL, 0))
+ diee ("sysctl failed");
+ return (size_t)mem;
+}
Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/platform/totalRam.sysctl.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/totalRam.sysctl.c 2006-05-22 22:51:00 UTC (rev 4566)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/totalRam.sysctl.c 2006-05-23 03:16:05 UTC (rev 4567)
@@ -1,11 +0,0 @@
-W32 totalRam (GC_state s) {
- uint mem;
- int len, mib[2];
-
- mib[0] = CTL_HW;
- mib[1] = HW_PHYSMEM;
- len = sizeof(mem);
- if (-1 == sysctl (mib, 2, &mem, &len, NULL, 0))
- diee ("sysctl failed");
- return mem;
-}
|
|
From: Matthew F. <fl...@ml...> - 2006-05-22 15:51:02
|
Update todo ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/TODO ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/TODO =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/TODO 2006-05-22 22:46:27 UTC (rev 4565) +++ mlton/branches/on-20050822-x86_64-branch/runtime/TODO 2006-05-22 22:51:00 UTC (rev 4566) @@ -13,5 +13,4 @@ Real_toWord, Word_toReal that correspond to bit-wise identities. -basis/Int/Word.c basis/MLton/allocTooLarge.c |
|
From: Matthew F. <fl...@ml...> - 2006-05-22 15:46:29
|
Move n-way platform-arch #ifdef to cenv.h and include trivial platform/<arch>.h files ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile U mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h A mlton/branches/on-20050822-x86_64-branch/runtime/platform/alpha.h A mlton/branches/on-20050822-x86_64-branch/runtime/platform/amd64.h A mlton/branches/on-20050822-x86_64-branch/runtime/platform/arm.h A mlton/branches/on-20050822-x86_64-branch/runtime/platform/hppa.h A mlton/branches/on-20050822-x86_64-branch/runtime/platform/ia64.h A mlton/branches/on-20050822-x86_64-branch/runtime/platform/m68k.h A mlton/branches/on-20050822-x86_64-branch/runtime/platform/mips.h A mlton/branches/on-20050822-x86_64-branch/runtime/platform/powerpc.h A mlton/branches/on-20050822-x86_64-branch/runtime/platform/s390.h A mlton/branches/on-20050822-x86_64-branch/runtime/platform/sparc.h A mlton/branches/on-20050822-x86_64-branch/runtime/platform/x86.h U mlton/branches/on-20050822-x86_64-branch/runtime/platform.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-22 15:56:43 UTC (rev 4564) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-22 22:46:27 UTC (rev 4565) @@ -157,6 +157,7 @@ basis-ffi.h \ platform.h \ platform/$(TARGET_OS).h \ + platform/$(TARGET_ARCH).h \ $(BASISHFILES) FILES = $(basename $(CFILES)) Modified: mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h 2006-05-22 15:56:43 UTC (rev 4564) +++ mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h 2006-05-22 22:46:27 UTC (rev 4565) @@ -67,6 +67,33 @@ #include "gmp.h" +#if (defined (__alpha__)) +#include "platform/alpha.h" +#elif (defined (__x86_64__)) +#include "platform/amd64.h" +#elif (defined (__arm__)) +#include "platform/arm.h" +#elif (defined (__hppa__)) +#include "platform/hppa.h" +#elif (defined (__ia64__)) +#include "platform/ia64.h" +#elif (defined (__m68k__)) +#include "platform/m68k.h" +#elif (defined (__mips__)) +#include "platform/mips.h" +#elif (defined (__ppc__)) || (defined (__powerpc__)) +#include "platform/powerpc.h" +#elif (defined (__s390__)) +#include "platform/s390.h" +#elif (defined (__sparc__)) +#include "platform/sparc.h" +#elif (defined (__i386__)) +#include "platform/x86.h" +#else +#error unknown platform arch +#endif + + #if (defined (__APPLE_CC__)) #define __Darwin__ #endif @@ -92,9 +119,7 @@ #elif (defined (__sun__)) #include "platform/solaris.h" #else -#error unknown platform +#error unknown platform os #endif - - #endif /* _MLTON_CENV_H_ */ Added: mlton/branches/on-20050822-x86_64-branch/runtime/platform/alpha.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/platform/alpha.h 2006-05-22 15:56:43 UTC (rev 4564) +++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/alpha.h 2006-05-22 22:46:27 UTC (rev 4565) @@ -0,0 +1 @@ +#define MLton_Platform_Arch_host "alpha" Added: mlton/branches/on-20050822-x86_64-branch/runtime/platform/amd64.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/platform/amd64.h 2006-05-22 15:56:43 UTC (rev 4564) +++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/amd64.h 2006-05-22 22:46:27 UTC (rev 4565) @@ -0,0 +1 @@ +#define MLton_Platform_Arch_host "amd64" Added: mlton/branches/on-20050822-x86_64-branch/runtime/platform/arm.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/platform/arm.h 2006-05-22 15:56:43 UTC (rev 4564) +++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/arm.h 2006-05-22 22:46:27 UTC (rev 4565) @@ -0,0 +1 @@ +#define MLton_Platform_Arch_host "arm" Added: mlton/branches/on-20050822-x86_64-branch/runtime/platform/hppa.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/platform/hppa.h 2006-05-22 15:56:43 UTC (rev 4564) +++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/hppa.h 2006-05-22 22:46:27 UTC (rev 4565) @@ -0,0 +1 @@ +#define MLton_Platform_Arch_host "hppa" Added: mlton/branches/on-20050822-x86_64-branch/runtime/platform/ia64.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/platform/ia64.h 2006-05-22 15:56:43 UTC (rev 4564) +++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/ia64.h 2006-05-22 22:46:27 UTC (rev 4565) @@ -0,0 +1 @@ +#define MLton_Platform_Arch_host "ia64" Added: mlton/branches/on-20050822-x86_64-branch/runtime/platform/m68k.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/platform/m68k.h 2006-05-22 15:56:43 UTC (rev 4564) +++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/m68k.h 2006-05-22 22:46:27 UTC (rev 4565) @@ -0,0 +1 @@ +#define MLton_Platform_Arch_host "m68k" Added: mlton/branches/on-20050822-x86_64-branch/runtime/platform/mips.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/platform/mips.h 2006-05-22 15:56:43 UTC (rev 4564) +++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/mips.h 2006-05-22 22:46:27 UTC (rev 4565) @@ -0,0 +1 @@ +#define MLton_Platform_Arch_host "mips" Added: mlton/branches/on-20050822-x86_64-branch/runtime/platform/powerpc.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/platform/powerpc.h 2006-05-22 15:56:43 UTC (rev 4564) +++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/powerpc.h 2006-05-22 22:46:27 UTC (rev 4565) @@ -0,0 +1 @@ +#define MLton_Platform_Arch_host "powerpc" Added: mlton/branches/on-20050822-x86_64-branch/runtime/platform/s390.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/platform/s390.h 2006-05-22 15:56:43 UTC (rev 4564) +++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/s390.h 2006-05-22 22:46:27 UTC (rev 4565) @@ -0,0 +1 @@ +#define MLton_Platform_Arch_host "s390" Added: mlton/branches/on-20050822-x86_64-branch/runtime/platform/sparc.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/platform/sparc.h 2006-05-22 15:56:43 UTC (rev 4564) +++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/sparc.h 2006-05-22 22:46:27 UTC (rev 4565) @@ -0,0 +1 @@ +#define MLton_Platform_Arch_host "sparc" Added: mlton/branches/on-20050822-x86_64-branch/runtime/platform/x86.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/platform/x86.h 2006-05-22 15:56:43 UTC (rev 4564) +++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/x86.h 2006-05-22 22:46:27 UTC (rev 4565) @@ -0,0 +1 @@ +#define MLton_Platform_Arch_host "x86" Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-05-22 15:56:43 UTC (rev 4564) +++ mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-05-22 22:46:27 UTC (rev 4565) @@ -13,6 +13,10 @@ #include "util.h" #include "gc.h" +#ifndef MLton_Platform_Arch_host +#error MLton_Platform_Arch_host not defined +#endif + #ifndef MLton_Platform_OS_host #error MLton_Platform_OS_host not defined #endif @@ -113,11 +117,12 @@ #include "basis-ffi.h" /* ---------------------------------------------------------------- */ -/* Runtime Init/Exit */ +/* Runtime Init/Exit/Alloc */ /* ---------------------------------------------------------------- */ void MLton_init (int argc, char **argv, GC_state s); __attribute__ ((noreturn)) void MLton_exit (GC_state s, C_Int_t status); +__attribute__ ((noreturn)) void MLton_allocTooLarge (void); /* ---------------------------------------------------------------- */ /* Utility libraries */ @@ -173,40 +178,12 @@ /* MLton */ /* ------------------------------------------------- */ -__attribute__ ((noreturn)) void MLton_allocTooLarge (void); - /* ---------------------------------- */ /* MLton.Platform */ /* ---------------------------------- */ #define MLton_Platform_Arch_bigendian isBigEndian() -#if (defined (__alpha__)) -#define MLton_Platform_Arch_host "alpha" -#elif (defined (__x86_64__)) -#define MLton_Platform_Arch_host "amd64" -#elif (defined (__arm__)) -#define MLton_Platform_Arch_host "arm" -#elif (defined (__hppa__)) -#define MLton_Platform_Arch_host "hppa" -#elif (defined (__ia64__)) -#define MLton_Platform_Arch_host "ia64" -#elif (defined (__m68k__)) -#define MLton_Platform_Arch_host "m68k" -#elif (defined (__mips__)) -#define MLton_Platform_Arch_host "mips" -#elif (defined (__ppc__)) || (defined (__powerpc__)) -#define MLton_Platform_Arch_host "powerpc" -#elif (defined (__s390__)) -#define MLton_Platform_Arch_host "s390" -#elif (defined (__sparc__)) -#define MLton_Platform_Arch_host "sparc" -#elif (defined (__i386__)) -#define MLton_Platform_Arch_host "x86" -#else -#error MLton_Platform_Arch_host not defined -#endif - extern Bool MLton_Platform_CygwinUseMmap; /* ------------------------------------------------- */ |
|
From: Matthew F. <fl...@ml...> - 2006-05-22 08:56:53
|
Allow the C-side implementation of primitives to be shared among
libmlton, C-codegen headers, and Bytecode-codgen implementation.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/Makefile
U mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/basis-ffi.sml
U mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/check-real.sml
U mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.c
U mlton/branches/on-20050822-x86_64-branch/include/bytecode-main.h
U mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h
U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
A mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Math-fns.h
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Math.c
A mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Real-consts.c
A mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Real-ops.h
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Real.c
D mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/frexp.c
A mlton/branches/on-20050822-x86_64-branch/runtime/basis/Word/Word-check.h
A mlton/branches/on-20050822-x86_64-branch/runtime/basis/Word/Word-consts.h
A mlton/branches/on-20050822-x86_64-branch/runtime/basis/Word/Word-ops.h
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Word/Word.c
A mlton/branches/on-20050822-x86_64-branch/runtime/basis/coerce.c
A mlton/branches/on-20050822-x86_64-branch/runtime/basis/coerce.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def
U mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-basis-ffi.sml
U mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/Makefile 2006-05-21 23:07:23 UTC (rev 4563)
+++ mlton/branches/on-20050822-x86_64-branch/Makefile 2006-05-22 15:56:43 UTC (rev 4564)
@@ -286,13 +286,11 @@
basis-library/config/c/$(TARGET_ARCH)-$(TARGET_OS)/c-types.sml
cp runtime/gen/basis-ffi.sml \
basis-library/primitive/basis-ffi.sml
- mkdir -p "$(INC)/gc"
- mkdir -p "$(INC)/util"
- mkdir -p "$(INC)/platform"
$(CP) runtime/*.h "$(INC)/"
- $(CP) runtime/gc/*.h "$(INC)/gc"
- $(CP) runtime/util/*.h "$(INC)/util"
- $(CP) runtime/platform/*.h "$(INC)/platform"
+ for d in basis basis/Real basis/Word gc platform util; do \
+ mkdir -p "$(INC)/$$d"; \
+ $(CP) runtime/$$d/*.h "$(INC)/$$d"; \
+ done
$(CP) bytecode/interpret.h "$(INC)"
$(MAKE) -C bytecode
bytecode/print-opcodes >"$(LIB)/opcodes"
@@ -331,7 +329,7 @@
@echo 'Instantiating version numbers.'
for f in \
package/debian/changelog \
- "$(SPEC)" \
+ "$(SPEC)" \
package/freebsd/Makefile \
mlton/control/control-flags.sml; \
do \
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/basis-ffi.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/basis-ffi.sml 2006-05-21 23:07:23 UTC (rev 4563)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/basis-ffi.sml 2006-05-22 15:56:43 UTC (rev 4564)
@@ -951,11 +951,17 @@
end
structure Real32 =
struct
+type t = Real32.t
val abs = _import "Real32_abs" : Real32.t -> Real32.t;
+val add = _import "Real32_add" : Real32.t * Real32.t -> Real32.t;
val class = _import "Real32_class" : Real32.t -> C_Int.t;
+val div = _import "Real32_div" : Real32.t * Real32.t -> Real32.t;
+val equal = _import "Real32_equal" : Real32.t * Real32.t -> Bool.t;
val frexp = _import "Real32_frexp" : Real32.t * (C_Int.t) ref -> Real32.t;
val gdtoa = _import "Real32_gdtoa" : Real32.t * C_Int.t * C_Int.t * (C_Int.t) ref -> C_String.t;
val ldexp = _import "Real32_ldexp" : Real32.t * C_Int.t -> Real32.t;
+val le = _import "Real32_le" : Real32.t * Real32.t -> Bool.t;
+val lt = _import "Real32_lt" : Real32.t * Real32.t -> Bool.t;
structure Math =
struct
val acos = _import "Real32_Math_acos" : Real32.t -> Real32.t;
@@ -980,18 +986,39 @@
val (minNormalPosGet, minNormalPosSet) = _symbol "Real32_minNormalPos": (unit -> (Real32.t)) * ((Real32.t) -> unit);
val (minPosGet, minPosSet) = _symbol "Real32_minPos": (unit -> (Real32.t)) * ((Real32.t) -> unit);
val modf = _import "Real32_modf" : Real32.t * (Real32.t) ref -> Real32.t;
+val mul = _import "Real32_mul" : Real32.t * Real32.t -> Real32.t;
+val muladd = _import "Real32_muladd" : Real32.t * Real32.t * Real32.t -> Real32.t;
+val mulsub = _import "Real32_mulsub" : Real32.t * Real32.t * Real32.t -> Real32.t;
+val neg = _import "Real32_neg" : Real32.t -> Real32.t;
val nextAfter = _import "Real32_nextAfter" : Real32.t * Real32.t -> Real32.t;
val round = _import "Real32_round" : Real32.t -> Real32.t;
val signBit = _import "Real32_signBit" : Real32.t -> C_Int.t;
val strto = _import "Real32_strto" : NullString8.t -> Real32.t;
+val sub = _import "Real32_sub" : Real32.t * Real32.t -> Real32.t;
+val toReal32 = _import "Real32_toReal32" : Real32.t -> Real32.t;
+val toReal64 = _import "Real32_toReal64" : Real32.t -> Real64.t;
+val toWordS16 = _import "Real32_toWordS16" : Real32.t -> Int16.t;
+val toWordS32 = _import "Real32_toWordS32" : Real32.t -> Int32.t;
+val toWordS64 = _import "Real32_toWordS64" : Real32.t -> Int64.t;
+val toWordS8 = _import "Real32_toWordS8" : Real32.t -> Int8.t;
+val toWordU16 = _import "Real32_toWordU16" : Real32.t -> Word16.t;
+val toWordU32 = _import "Real32_toWordU32" : Real32.t -> Word32.t;
+val toWordU64 = _import "Real32_toWordU64" : Real32.t -> Word64.t;
+val toWordU8 = _import "Real32_toWordU8" : Real32.t -> Word8.t;
end
structure Real64 =
struct
+type t = Real64.t
val abs = _import "Real64_abs" : Real64.t -> Real64.t;
+val add = _import "Real64_add" : Real64.t * Real64.t -> Real64.t;
val class = _import "Real64_class" : Real64.t -> C_Int.t;
+val div = _import "Real64_div" : Real64.t * Real64.t -> Real64.t;
+val equal = _import "Real64_equal" : Real64.t * Real64.t -> Bool.t;
val frexp = _import "Real64_frexp" : Real64.t * (C_Int.t) ref -> Real64.t;
val gdtoa = _import "Real64_gdtoa" : Real64.t * C_Int.t * C_Int.t * (C_Int.t) ref -> C_String.t;
val ldexp = _import "Real64_ldexp" : Real64.t * C_Int.t -> Real64.t;
+val le = _import "Real64_le" : Real64.t * Real64.t -> Bool.t;
+val lt = _import "Real64_lt" : Real64.t * Real64.t -> Bool.t;
structure Math =
struct
val acos = _import "Real64_Math_acos" : Real64.t -> Real64.t;
@@ -1016,10 +1043,25 @@
val (minNormalPosGet, minNormalPosSet) = _symbol "Real64_minNormalPos": (unit -> (Real64.t)) * ((Real64.t) -> unit);
val (minPosGet, minPosSet) = _symbol "Real64_minPos": (unit -> (Real64.t)) * ((Real64.t) -> unit);
val modf = _import "Real64_modf" : Real64.t * (Real64.t) ref -> Real64.t;
+val mul = _import "Real64_mul" : Real64.t * Real64.t -> Real64.t;
+val muladd = _import "Real64_muladd" : Real64.t * Real64.t * Real64.t -> Real64.t;
+val mulsub = _import "Real64_mulsub" : Real64.t * Real64.t * Real64.t -> Real64.t;
+val neg = _import "Real64_neg" : Real64.t -> Real64.t;
val nextAfter = _import "Real64_nextAfter" : Real64.t * Real64.t -> Real64.t;
val round = _import "Real64_round" : Real64.t -> Real64.t;
val signBit = _import "Real64_signBit" : Real64.t -> C_Int.t;
val strto = _import "Real64_strto" : NullString8.t -> Real64.t;
+val sub = _import "Real64_sub" : Real64.t * Real64.t -> Real64.t;
+val toReal32 = _import "Real64_toReal32" : Real64.t -> Real32.t;
+val toReal64 = _import "Real64_toReal64" : Real64.t -> Real64.t;
+val toWordS16 = _import "Real64_toWordS16" : Real64.t -> Int16.t;
+val toWordS32 = _import "Real64_toWordS32" : Real64.t -> Int32.t;
+val toWordS64 = _import "Real64_toWordS64" : Real64.t -> Int64.t;
+val toWordS8 = _import "Real64_toWordS8" : Real64.t -> Int8.t;
+val toWordU16 = _import "Real64_toWordU16" : Real64.t -> Word16.t;
+val toWordU32 = _import "Real64_toWordU32" : Real64.t -> Word32.t;
+val toWordU64 = _import "Real64_toWordU64" : Real64.t -> Word64.t;
+val toWordU8 = _import "Real64_toWordU8" : Real64.t -> Word8.t;
end
structure Socket =
struct
@@ -1135,5 +1177,225 @@
val terminate = _import "Windows_Process_terminate" : C_PId.t * C_Signal.t -> (C_Int.t) C_Errno.t;
end
end
+structure Word16 =
+struct
+type t = Word16.t
+val add = _import "Word16_add" : Word16.t * Word16.t -> Word16.t;
+val andb = _import "Word16_andb" : Word16.t * Word16.t -> Word16.t;
+val equal = _import "Word16_equal" : Word16.t * Word16.t -> Bool.t;
+val lshift = _import "Word16_lshift" : Word16.t * Word32.t -> Word16.t;
+val neg = _import "Word16_neg" : Word16.t -> Word16.t;
+val notb = _import "Word16_notb" : Word16.t -> Word16.t;
+val orb = _import "Word16_orb" : Word16.t * Word16.t -> Word16.t;
+val rol = _import "Word16_rol" : Word16.t * Word32.t -> Word16.t;
+val ror = _import "Word16_ror" : Word16.t * Word32.t -> Word16.t;
+val sub = _import "Word16_sub" : Word16.t * Word16.t -> Word16.t;
+val xorb = _import "Word16_xorb" : Word16.t * Word16.t -> Word16.t;
end
+structure Word32 =
+struct
+type t = Word32.t
+val add = _import "Word32_add" : Word32.t * Word32.t -> Word32.t;
+val andb = _import "Word32_andb" : Word32.t * Word32.t -> Word32.t;
+val equal = _import "Word32_equal" : Word32.t * Word32.t -> Bool.t;
+val lshift = _import "Word32_lshift" : Word32.t * Word32.t -> Word32.t;
+val neg = _import "Word32_neg" : Word32.t -> Word32.t;
+val notb = _import "Word32_notb" : Word32.t -> Word32.t;
+val orb = _import "Word32_orb" : Word32.t * Word32.t -> Word32.t;
+val rol = _import "Word32_rol" : Word32.t * Word32.t -> Word32.t;
+val ror = _import "Word32_ror" : Word32.t * Word32.t -> Word32.t;
+val sub = _import "Word32_sub" : Word32.t * Word32.t -> Word32.t;
+val xorb = _import "Word32_xorb" : Word32.t * Word32.t -> Word32.t;
end
+structure Word64 =
+struct
+type t = Word64.t
+val add = _import "Word64_add" : Word64.t * Word64.t -> Word64.t;
+val andb = _import "Word64_andb" : Word64.t * Word64.t -> Word64.t;
+val equal = _import "Word64_equal" : Word64.t * Word64.t -> Bool.t;
+val lshift = _import "Word64_lshift" : Word64.t * Word32.t -> Word64.t;
+val neg = _import "Word64_neg" : Word64.t -> Word64.t;
+val notb = _import "Word64_notb" : Word64.t -> Word64.t;
+val orb = _import "Word64_orb" : Word64.t * Word64.t -> Word64.t;
+val rol = _import "Word64_rol" : Word64.t * Word32.t -> Word64.t;
+val ror = _import "Word64_ror" : Word64.t * Word32.t -> Word64.t;
+val sub = _import "Word64_sub" : Word64.t * Word64.t -> Word64.t;
+val xorb = _import "Word64_xorb" : Word64.t * Word64.t -> Word64.t;
+end
+structure Word8 =
+struct
+type t = Word8.t
+val add = _import "Word8_add" : Word8.t * Word8.t -> Word8.t;
+val andb = _import "Word8_andb" : Word8.t * Word8.t -> Word8.t;
+val equal = _import "Word8_equal" : Word8.t * Word8.t -> Bool.t;
+val lshift = _import "Word8_lshift" : Word8.t * Word32.t -> Word8.t;
+val neg = _import "Word8_neg" : Word8.t -> Word8.t;
+val notb = _import "Word8_notb" : Word8.t -> Word8.t;
+val orb = _import "Word8_orb" : Word8.t * Word8.t -> Word8.t;
+val rol = _import "Word8_rol" : Word8.t * Word32.t -> Word8.t;
+val ror = _import "Word8_ror" : Word8.t * Word32.t -> Word8.t;
+val sub = _import "Word8_sub" : Word8.t * Word8.t -> Word8.t;
+val xorb = _import "Word8_xorb" : Word8.t * Word8.t -> Word8.t;
+end
+structure WordS16 =
+struct
+val addCheckOverflows = _import "WordS16_addCheckOverflows" : Int16.t * Int16.t -> Bool.t;
+val ge = _import "WordS16_ge" : Int16.t * Int16.t -> Bool.t;
+val gt = _import "WordS16_gt" : Int16.t * Int16.t -> Bool.t;
+val le = _import "WordS16_le" : Int16.t * Int16.t -> Bool.t;
+val lt = _import "WordS16_lt" : Int16.t * Int16.t -> Bool.t;
+val mul = _import "WordS16_mul" : Int16.t * Int16.t -> Int16.t;
+val mulCheckOverflows = _import "WordS16_mulCheckOverflows" : Int16.t * Int16.t -> Bool.t;
+val negCheckOverflows = _import "WordS16_negCheckOverflows" : Int16.t -> Bool.t;
+val quot = _import "WordS16_quot" : Int16.t * Int16.t -> Int16.t;
+val rem = _import "WordS16_rem" : Int16.t * Int16.t -> Int16.t;
+val rshift = _import "WordS16_rshift" : Int16.t * Word32.t -> Int16.t;
+val subCheckOverflows = _import "WordS16_subCheckOverflows" : Int16.t * Int16.t -> Bool.t;
+val toReal32 = _import "WordS16_toReal32" : Int16.t -> Real32.t;
+val toReal64 = _import "WordS16_toReal64" : Int16.t -> Real64.t;
+val toWord16 = _import "WordS16_toWord16" : Int16.t -> Word16.t;
+val toWord32 = _import "WordS16_toWord32" : Int16.t -> Word32.t;
+val toWord64 = _import "WordS16_toWord64" : Int16.t -> Word64.t;
+val toWord8 = _import "WordS16_toWord8" : Int16.t -> Word8.t;
+end
+structure WordS32 =
+struct
+val addCheckOverflows = _import "WordS32_addCheckOverflows" : Int32.t * Int32.t -> Bool.t;
+val ge = _import "WordS32_ge" : Int32.t * Int32.t -> Bool.t;
+val gt = _import "WordS32_gt" : Int32.t * Int32.t -> Bool.t;
+val le = _import "WordS32_le" : Int32.t * Int32.t -> Bool.t;
+val lt = _import "WordS32_lt" : Int32.t * Int32.t -> Bool.t;
+val mul = _import "WordS32_mul" : Int32.t * Int32.t -> Int32.t;
+val mulCheckOverflows = _import "WordS32_mulCheckOverflows" : Int32.t * Int32.t -> Bool.t;
+val negCheckOverflows = _import "WordS32_negCheckOverflows" : Int32.t -> Bool.t;
+val quot = _import "WordS32_quot" : Int32.t * Int32.t -> Int32.t;
+val rem = _import "WordS32_rem" : Int32.t * Int32.t -> Int32.t;
+val rshift = _import "WordS32_rshift" : Int32.t * Word32.t -> Int32.t;
+val subCheckOverflows = _import "WordS32_subCheckOverflows" : Int32.t * Int32.t -> Bool.t;
+val toReal32 = _import "WordS32_toReal32" : Int32.t -> Real32.t;
+val toReal64 = _import "WordS32_toReal64" : Int32.t -> Real64.t;
+val toWord16 = _import "WordS32_toWord16" : Int32.t -> Word16.t;
+val toWord32 = _import "WordS32_toWord32" : Int32.t -> Word32.t;
+val toWord64 = _import "WordS32_toWord64" : Int32.t -> Word64.t;
+val toWord8 = _import "WordS32_toWord8" : Int32.t -> Word8.t;
+end
+structure WordS64 =
+struct
+val addCheckOverflows = _import "WordS64_addCheckOverflows" : Int64.t * Int64.t -> Bool.t;
+val ge = _import "WordS64_ge" : Int64.t * Int64.t -> Bool.t;
+val gt = _import "WordS64_gt" : Int64.t * Int64.t -> Bool.t;
+val le = _import "WordS64_le" : Int64.t * Int64.t -> Bool.t;
+val lt = _import "WordS64_lt" : Int64.t * Int64.t -> Bool.t;
+val mul = _import "WordS64_mul" : Int64.t * Int64.t -> Int64.t;
+val mulCheckOverflows = _import "WordS64_mulCheckOverflows" : Int64.t * Int64.t -> Bool.t;
+val negCheckOverflows = _import "WordS64_negCheckOverflows" : Int64.t -> Bool.t;
+val quot = _import "WordS64_quot" : Int64.t * Int64.t -> Int64.t;
+val rem = _import "WordS64_rem" : Int64.t * Int64.t -> Int64.t;
+val rshift = _import "WordS64_rshift" : Int64.t * Word32.t -> Int64.t;
+val subCheckOverflows = _import "WordS64_subCheckOverflows" : Int64.t * Int64.t -> Bool.t;
+val toReal32 = _import "WordS64_toReal32" : Int64.t -> Real32.t;
+val toReal64 = _import "WordS64_toReal64" : Int64.t -> Real64.t;
+val toWord16 = _import "WordS64_toWord16" : Int64.t -> Word16.t;
+val toWord32 = _import "WordS64_toWord32" : Int64.t -> Word32.t;
+val toWord64 = _import "WordS64_toWord64" : Int64.t -> Word64.t;
+val toWord8 = _import "WordS64_toWord8" : Int64.t -> Word8.t;
+end
+structure WordS8 =
+struct
+val addCheckOverflows = _import "WordS8_addCheckOverflows" : Int8.t * Int8.t -> Bool.t;
+val ge = _import "WordS8_ge" : Int8.t * Int8.t -> Bool.t;
+val gt = _import "WordS8_gt" : Int8.t * Int8.t -> Bool.t;
+val le = _import "WordS8_le" : Int8.t * Int8.t -> Bool.t;
+val lt = _import "WordS8_lt" : Int8.t * Int8.t -> Bool.t;
+val mul = _import "WordS8_mul" : Int8.t * Int8.t -> Int8.t;
+val mulCheckOverflows = _import "WordS8_mulCheckOverflows" : Int8.t * Int8.t -> Bool.t;
+val negCheckOverflows = _import "WordS8_negCheckOverflows" : Int8.t -> Bool.t;
+val quot = _import "WordS8_quot" : Int8.t * Int8.t -> Int8.t;
+val rem = _import "WordS8_rem" : Int8.t * Int8.t -> Int8.t;
+val rshift = _import "WordS8_rshift" : Int8.t * Word32.t -> Int8.t;
+val subCheckOverflows = _import "WordS8_subCheckOverflows" : Int8.t * Int8.t -> Bool.t;
+val toReal32 = _import "WordS8_toReal32" : Int8.t -> Real32.t;
+val toReal64 = _import "WordS8_toReal64" : Int8.t -> Real64.t;
+val toWord16 = _import "WordS8_toWord16" : Int8.t -> Word16.t;
+val toWord32 = _import "WordS8_toWord32" : Int8.t -> Word32.t;
+val toWord64 = _import "WordS8_toWord64" : Int8.t -> Word64.t;
+val toWord8 = _import "WordS8_toWord8" : Int8.t -> Word8.t;
+end
+structure WordU16 =
+struct
+val addCheckOverflows = _import "WordU16_addCheckOverflows" : Word16.t * Word16.t -> Bool.t;
+val ge = _import "WordU16_ge" : Word16.t * Word16.t -> Bool.t;
+val gt = _import "WordU16_gt" : Word16.t * Word16.t -> Bool.t;
+val le = _import "WordU16_le" : Word16.t * Word16.t -> Bool.t;
+val lt = _import "WordU16_lt" : Word16.t * Word16.t -> Bool.t;
+val mul = _import "WordU16_mul" : Word16.t * Word16.t -> Word16.t;
+val mulCheckOverflows = _import "WordU16_mulCheckOverflows" : Word16.t * Word16.t -> Bool.t;
+val quot = _import "WordU16_quot" : Word16.t * Word16.t -> Word16.t;
+val rem = _import "WordU16_rem" : Word16.t * Word16.t -> Word16.t;
+val rshift = _import "WordU16_rshift" : Word16.t * Word32.t -> Word16.t;
+val toReal32 = _import "WordU16_toReal32" : Word16.t -> Real32.t;
+val toReal64 = _import "WordU16_toReal64" : Word16.t -> Real64.t;
+val toWord16 = _import "WordU16_toWord16" : Word16.t -> Word16.t;
+val toWord32 = _import "WordU16_toWord32" : Word16.t -> Word32.t;
+val toWord64 = _import "WordU16_toWord64" : Word16.t -> Word64.t;
+val toWord8 = _import "WordU16_toWord8" : Word16.t -> Word8.t;
+end
+structure WordU32 =
+struct
+val addCheckOverflows = _import "WordU32_addCheckOverflows" : Word32.t * Word32.t -> Bool.t;
+val ge = _import "WordU32_ge" : Word32.t * Word32.t -> Bool.t;
+val gt = _import "WordU32_gt" : Word32.t * Word32.t -> Bool.t;
+val le = _import "WordU32_le" : Word32.t * Word32.t -> Bool.t;
+val lt = _import "WordU32_lt" : Word32.t * Word32.t -> Bool.t;
+val mul = _import "WordU32_mul" : Word32.t * Word32.t -> Word32.t;
+val mulCheckOverflows = _import "WordU32_mulCheckOverflows" : Word32.t * Word32.t -> Bool.t;
+val quot = _import "WordU32_quot" : Word32.t * Word32.t -> Word32.t;
+val rem = _import "WordU32_rem" : Word32.t * Word32.t -> Word32.t;
+val rshift = _import "WordU32_rshift" : Word32.t * Word32.t -> Word32.t;
+val toReal32 = _import "WordU32_toReal32" : Word32.t -> Real32.t;
+val toReal64 = _import "WordU32_toReal64" : Word32.t -> Real64.t;
+val toWord16 = _import "WordU32_toWord16" : Word32.t -> Word16.t;
+val toWord32 = _import "WordU32_toWord32" : Word32.t -> Word32.t;
+val toWord64 = _import "WordU32_toWord64" : Word32.t -> Word64.t;
+val toWord8 = _import "WordU32_toWord8" : Word32.t -> Word8.t;
+end
+structure WordU64 =
+struct
+val addCheckOverflows = _import "WordU64_addCheckOverflows" : Word64.t * Word64.t -> Bool.t;
+val ge = _import "WordU64_ge" : Word64.t * Word64.t -> Bool.t;
+val gt = _import "WordU64_gt" : Word64.t * Word64.t -> Bool.t;
+val le = _import "WordU64_le" : Word64.t * Word64.t -> Bool.t;
+val lt = _import "WordU64_lt" : Word64.t * Word64.t -> Bool.t;
+val mul = _import "WordU64_mul" : Word64.t * Word64.t -> Word64.t;
+val mulCheckOverflows = _import "WordU64_mulCheckOverflows" : Word64.t * Word64.t -> Bool.t;
+val quot = _import "WordU64_quot" : Word64.t * Word64.t -> Word64.t;
+val rem = _import "WordU64_rem" : Word64.t * Word64.t -> Word64.t;
+val rshift = _import "WordU64_rshift" : Word64.t * Word32.t -> Word64.t;
+val toReal32 = _import "WordU64_toReal32" : Word64.t -> Real32.t;
+val toReal64 = _import "WordU64_toReal64" : Word64.t -> Real64.t;
+val toWord16 = _import "WordU64_toWord16" : Word64.t -> Word16.t;
+val toWord32 = _import "WordU64_toWord32" : Word64.t -> Word32.t;
+val toWord64 = _import "WordU64_toWord64" : Word64.t -> Word64.t;
+val toWord8 = _import "WordU64_toWord8" : Word64.t -> Word8.t;
+end
+structure WordU8 =
+struct
+val addCheckOverflows = _import "WordU8_addCheckOverflows" : Word8.t * Word8.t -> Bool.t;
+val ge = _import "WordU8_ge" : Word8.t * Word8.t -> Bool.t;
+val gt = _import "WordU8_gt" : Word8.t * Word8.t -> Bool.t;
+val le = _import "WordU8_le" : Word8.t * Word8.t -> Bool.t;
+val lt = _import "WordU8_lt" : Word8.t * Word8.t -> Bool.t;
+val mul = _import "WordU8_mul" : Word8.t * Word8.t -> Word8.t;
+val mulCheckOverflows = _import "WordU8_mulCheckOverflows" : Word8.t * Word8.t -> Bool.t;
+val quot = _import "WordU8_quot" : Word8.t * Word8.t -> Word8.t;
+val rem = _import "WordU8_rem" : Word8.t * Word8.t -> Word8.t;
+val rshift = _import "WordU8_rshift" : Word8.t * Word32.t -> Word8.t;
+val toReal32 = _import "WordU8_toReal32" : Word8.t -> Real32.t;
+val toReal64 = _import "WordU8_toReal64" : Word8.t -> Real64.t;
+val toWord16 = _import "WordU8_toWord16" : Word8.t -> Word16.t;
+val toWord32 = _import "WordU8_toWord32" : Word8.t -> Word32.t;
+val toWord64 = _import "WordU8_toWord64" : Word8.t -> Word64.t;
+val toWord8 = _import "WordU8_toWord8" : Word8.t -> Word8.t;
+end
+end
+end
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/check-real.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/check-real.sml 2006-05-21 23:07:23 UTC (rev 4563)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/check-real.sml 2006-05-22 15:56:43 UTC (rev 4564)
@@ -32,18 +32,28 @@
val () = check (R1.Math.tanh, R2.Math.tanh)
val () = check (R1.abs, R2.abs)
+ val () = check (R1.+, R2.add)
val () = check (R1.class, R2.class)
+ val () = check (R1./, R2.div)
+ val () = check (R1.==, R2.equal)
val () = check (R1.frexp, R2.frexp)
val () = check (R1.gdtoa, R2.gdtoa)
val () = check (R1.ldexp, R2.ldexp)
+ val () = check (R1.<=, R2.le)
+ val () = check (R1.<, R2.lt)
val () = check (fn () => R1.maxFinite, R2.maxFiniteGet)
val () = check (fn () => R1.minNormalPos, R2.minNormalPosGet)
val () = check (fn () => R1.minPos, R2.minPosGet)
val () = check (R1.modf, R2.modf)
+ val () = check (R1.*, R2.mul)
+ val () = check (R1.*+, R2.muladd)
+ val () = check (R1.*-, R2.mulsub)
+ val () = check (R1.~, R2.neg)
val () = check (R1.nextAfter, R2.nextAfter)
val () = check (R1.round, R2.round)
val () = check (R1.signBit, R2.signBit)
val () = check (R1.strto, R2.strto)
+ val () = check (R1.-, R2.sub)
end
local
@@ -69,18 +79,28 @@
val () = check (R1.Math.tanh, R2.Math.tanh)
val () = check (R1.abs, R2.abs)
+ val () = check (R1.+, R2.add)
val () = check (R1.class, R2.class)
+ val () = check (R1./, R2.div)
+ val () = check (R1.==, R2.equal)
val () = check (R1.frexp, R2.frexp)
val () = check (R1.gdtoa, R2.gdtoa)
val () = check (R1.ldexp, R2.ldexp)
+ val () = check (R1.<=, R2.le)
+ val () = check (R1.<, R2.lt)
val () = check (fn () => R1.maxFinite, R2.maxFiniteGet)
val () = check (fn () => R1.minNormalPos, R2.minNormalPosGet)
val () = check (fn () => R1.minPos, R2.minPosGet)
val () = check (R1.modf, R2.modf)
+ val () = check (R1.*, R2.mul)
+ val () = check (R1.*+, R2.muladd)
+ val () = check (R1.*-, R2.mulsub)
+ val () = check (R1.~, R2.neg)
val () = check (R1.nextAfter, R2.nextAfter)
val () = check (R1.round, R2.round)
val () = check (R1.signBit, R2.signBit)
val () = check (R1.strto, R2.strto)
+ val () = check (R1.-, R2.sub)
end
in
Modified: mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.c 2006-05-21 23:07:23 UTC (rev 4563)
+++ mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.c 2006-05-22 15:56:43 UTC (rev 4564)
@@ -6,7 +6,7 @@
*/
#define MLTON_GC_INTERNAL_TYPES
-#define MLTON_BASIS_FFI_STATIC
+#define MLTON_CODEGEN_STATIC_INLINE static inline
#include "platform.h"
#include "interpret.h"
@@ -61,18 +61,6 @@
#define R(ty, i) (ty##VReg [i])
-#define quotRem1(qr, size) \
- Word##size WordS##size##_##qr (Word##size w1, Word##size w2);
-#define quotRem2(qr) \
- quotRem1 (qr, 8) \
- quotRem1 (qr, 16) \
- quotRem1 (qr, 32) \
- quotRem1 (qr, 64)
-quotRem2 (quot)
-quotRem2 (rem)
-#undef quotRem1
-#undef quotRem2
-
//----------------------------------------------------------------------
#define Fetch(t, z) \
Modified: mlton/branches/on-20050822-x86_64-branch/include/bytecode-main.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/include/bytecode-main.h 2006-05-21 23:07:23 UTC (rev 4563)
+++ mlton/branches/on-20050822-x86_64-branch/include/bytecode-main.h 2006-05-22 15:56:43 UTC (rev 4564)
@@ -30,20 +30,20 @@
fprintf (stderr, "MLton_callFromC() starting\n"); \
s = &gcState; \
s->savedThread = s->currentThread; \
- s->canHandle += 3; \
+ s->atomicState += 3; \
/* Switch to the C Handler thread. */ \
- GC_switchToThread (s, s->callFromCHandler, 0); \
+ GC_switchToThread (s, s->callFromCHandlerThread, 0); \
nextFun = *(int*)(s->stackTop - GC_RETURNADDRESS_SIZE); \
MLton_Bytecode_interpret (&MLton_bytecode, nextFun); \
GC_switchToThread (s, s->savedThread, 0); \
- s->savedThread = BOGUS_THREAD; \
+ s->savedThread = BOGUS_OBJPTR; \
if (DEBUG_CODEGEN) \
fprintf (stderr, "MLton_callFromC done\n"); \
} \
int main (int argc, char **argv) { \
int nextFun; \
Initialize (al, mg, mfs, mmc, pk, ps); \
- if (gcState.isOriginal) { \
+ if (gcState.amOriginal) { \
real_Init(); \
nextFun = ml; \
} else { \
Modified: mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h 2006-05-21 23:07:23 UTC (rev 4563)
+++ mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h 2006-05-22 15:56:43 UTC (rev 4564)
@@ -11,9 +11,9 @@
#include <stdio.h>
-#include "assert.h"
-#include "c-common.h"
#include "ml-types.h"
+#include "c-types.h"
+#include "c-common.h"
#ifndef TRUE
#define TRUE 1
@@ -169,7 +169,6 @@
fprintf (stderr, "%s:%d: Push (%d)\n", \
__FILE__, __LINE__, bytes); \
StackTop += (bytes); \
- assert (StackBottom <= StackTop); \
} while (0)
#define Return() \
@@ -191,91 +190,24 @@
} while (0) \
/* ------------------------------------------------- */
-/* Real */
+/* Primitives */
/* ------------------------------------------------- */
-#define unaryReal(f, g) \
- Real64 g (Real64 x); \
- static inline Real64 Real64_##f (Real64 x) { \
- return g (x); \
- } \
- static inline Real32 Real32_##f (Real32 x) { \
- return (Real32)(Real64_##f ((Real64)x)); \
- }
-unaryReal(round, rint)
-#undef unaryReal
+#ifndef MLTON_CODEGEN_STATIC_INLINE
+#define MLTON_CODEGEN_STATIC_INLINE static inline
+#endif
+#define MLTON_CCODEGEN_HIDE(z)
+#include "basis/coerce.h"
+#include "basis/Real/Real-ops.h"
+#include "basis/Real/Math-fns.h"
+#include "basis/Word/Word-ops.h"
+#include "basis/Word/Word-consts.h"
+#include "basis/Word/Word-check.h"
-#define binaryReal(f, g) \
- Real64 g (Real64 x, Real64 y); \
- static inline Real64 Real64_Math_##f (Real64 x, Real64 y) { \
- return g (x, y); \
- } \
- static inline Real32 Real32_Math_##f (Real32 x, Real32 y) { \
- return (Real32)(Real64_Math_##f ((Real64)x, (Real64)y)); \
- }
-binaryReal(atan2, atan2)
-#undef binaryReal
+/* ------------------------------------------------- */
+/* Real */
+/* ------------------------------------------------- */
-#define unaryReal(f, g) \
- Real64 g (Real64 x); \
- static inline Real64 Real64_Math_##f (Real64 x) { \
- return g (x); \
- } \
- static inline Real32 Real32_Math_##f (Real32 x) { \
- return (Real32)(Real64_Math_##f ((Real64)x)); \
- }
-unaryReal(acos, acos)
-unaryReal(asin, asin)
-unaryReal(atan, atan)
-unaryReal(cos, cos)
-unaryReal(exp, exp)
-unaryReal(ln, log)
-unaryReal(log10, log10)
-unaryReal(sin, sin)
-unaryReal(sqrt, sqrt)
-unaryReal(tan, tan)
-#undef unaryReal
-
-double ldexp (double x, int i);
-static inline Real64 Real64_ldexp (Real64 x, Int32 i) {
- return ldexp (x, i);
-}
-static inline Real32 Real32_ldexp (Real32 x, Int32 i) {
- return (Real32)Real64_ldexp ((Real64)x, i);
-}
-
-#define binaryReal(name, op) \
- static inline Real32 Real32_##name (Real32 x, Real32 y) { \
- return x op y; \
- } \
- static inline Real64 Real64_##name (Real64 x, Real64 y) { \
- return x op y; \
- }
-binaryReal(add, +)
-binaryReal(div, /)
-binaryReal(mul, *)
-binaryReal(sub, -)
-#undef binaryReal
-
-#define binaryReal(name, op) \
- static inline Bool Real32_##name (Real32 x, Real32 y) { \
- return x op y; \
- } \
- static inline Bool Real64_##name (Real64 x, Real64 y) { \
- return x op y; \
- }
-binaryReal(equal, ==)
-binaryReal(le, <=)
-binaryReal(lt, <)
-#undef binaryReal
-
-#define Real32_muladd(x, y, z) ((x) * (y) + (z))
-#define Real32_mulsub(x, y, z) ((x) * (y) - (z))
-#define Real64_muladd(x, y, z) ((x) * (y) + (z))
-#define Real64_mulsub(x, y, z) ((x) * (y) - (z))
-#define Real32_neg(x) (-(x))
-#define Real64_neg(x) (-(x))
-
typedef volatile union {
Word32 tab[2];
Real64 d;
@@ -317,255 +249,109 @@
/* Word */
/* ------------------------------------------------- */
-#define wordBinary(size, name, op) \
- static inline Word##size Word##size##_##name \
- (Word##size w1, Word##size w2) { \
- return w1 op w2; \
- }
-#define wordCmp(size, name, op) \
- static inline Bool Word##size##_##name \
- (Word##size w1, Word##size w2) { \
- Bool res = w1 op w2; \
- if (DEBUG_CCODEGEN) \
- fprintf (stderr, "%s = 0x%08x " #op " 0x%08x\n", \
- res ? "true": "false", \
- (unsigned int)w1, \
- (unsigned int)w2); \
- return w1 op w2; \
- }
-#define wordShift(size, name, op) \
- static inline Word##size Word##size##_##name \
- (Word##size w1, Word32 w2) { \
- return w1 op w2; \
- }
-#define wordUnary(size, name, op) \
- static inline Word##size Word##size##_##name (Word##size w) { \
- return op w; \
- }
-#define wordOps(size) \
- wordBinary (size, add, +) \
- wordBinary (size, andb, &) \
- wordBinary (S##size, mul, *) \
- wordBinary (U##size, mul, *) \
- wordBinary (size, orb, |) \
- wordBinary (U##size, quot, /) \
- wordBinary (U##size, rem, %) \
- wordBinary (size, sub, -) \
- wordBinary (size, xorb, ^) \
- wordCmp (size, equal, ==) \
- wordCmp (S##size, lt, <) \
- wordCmp (U##size, lt, <) \
- wordShift (size, lshift, <<) \
- wordShift (U##size, rshift, >>) \
- wordUnary (size, neg, -) \
- wordUnary (size, notb, ~) \
- /* WordS_rshift isn't ANSI C, because ANSI doesn't guarantee sign \
- * extension. We use it anyway cause it always seems to work. \
- */ \
- static inline Word##size WordS##size##_rshift (WordS##size w, Word32 s) { \
- return w >> s; \
- } \
- static inline Word##size Word##size##_rol (Word##size w1, Word32 w2) { \
- return (w1 >> (size - w2)) | (w1 << w2); \
- } \
- static inline Word##size Word##size##_ror (Word##size w1, Word32 w2) { \
- return (w1 >> w2) | (w1 << (size - w2)); \
- }
-wordOps(8)
-wordOps(16)
-wordOps(32)
-wordOps(64)
-#undef wordBinary
-#undef wordCmp
-#undef wordOps
-#undef wordShift
-#undef wordUnary
+#define WordS_addCheckCX(size, dst, cW, xW, l) \
+ do { \
+ WordS##size c = cW; \
+ WordS##size x = xW; \
+ WordS_addCheckBodyCX(size, c, x, goto l, dst = c + x); \
+ } while (0)
+#define WordS8_addCheckCX(dst, c, x, l) WordS_addCheckCX(8, dst, c, x, l)
+#define WordS16_addCheckCX(dst, c, x, l) WordS_addCheckCX(16, dst, c, x, l)
+#define WordS32_addCheckCX(dst, c, x, l) WordS_addCheckCX(32, dst, c, x, l)
+#define WordS64_addCheckCX(dst, c, x, l) WordS_addCheckCX(64, dst, c, x, l)
-#define coerce(f, t) \
- static inline t f##_to##t (f x) { \
- return (t)x; \
- }
-coerce (Real32, Real64)
-coerce (Real32, WordS32)
-coerce (Real64, Real32)
-coerce (Real64, WordS32)
-coerce (WordS16, Real32)
-coerce (WordS16, Real64)
-coerce (WordS16, Word32)
-coerce (WordS16, Word64)
-coerce (WordS32, Real32)
-coerce (WordS32, Real64)
-coerce (WordS32, Word64)
-coerce (WordS8, Real32)
-coerce (WordS8, Real64)
-coerce (WordS8, Word16)
-coerce (WordS8, Word32)
-coerce (WordS8, Word64)
-coerce (WordU16, Word32)
-coerce (WordU16, Word64)
-coerce (WordU16, Word8)
-coerce (WordU32, Word16)
-coerce (WordU32, Word64)
-coerce (WordU32, Word8)
-coerce (WordU64, Word16)
-coerce (WordU64, Word32)
-coerce (WordU64, Word8)
-coerce (WordU8, Word16)
-coerce (WordU8, Word32)
-coerce (WordU8, Word64)
-#undef coerce
+#define WordS8_addCheckXC(dst, x, c, l) WordS8_addCheckCX(dst, c, x, l)
+#define WordS16_addCheckXC(dst, x, c, l) WordS16_addCheckCX(dst, c, x, l)
+#define WordS32_addCheckXC(dst, x, c, l) WordS32_addCheckCX(dst, c, x, l)
+#define WordS64_addCheckXC(dst, x, c, l) WordS64_addCheckCX(dst, c, x, l)
-#define WordS8_max (WordS8)0x7F
-#define WordS8_min (WordS8)0x80
-#define WordS16_max (WordS16)0x7FFF
-#define WordS16_min (WordS16)0x8000
-#define WordS32_max (WordS32)0x7FFFFFFF
-#define WordS32_min (WordS32)0x80000000
-#define WordS64_max (WordS64)0x7FFFFFFFFFFFFFFFll
-#define WordS64_min (WordS64)0x8000000000000000ll
-#define Word8_max (Word8)0xFF
-#define Word16_max (Word16)0xFFFF
-#define Word32_max (Word32)0xFFFFFFFF
-#define Word64_max (Word64)0xFFFFFFFFFFFFFFFFull
-
-#define WordS_addCheckXC(size, dst, xW, cW, l) \
- do { \
- WordS##size x = xW; \
- WordS##size c = cW; \
- dst = x + c; \
- if (c >= 0) { \
- if (x > WordS##size##_max - c) \
- goto l; \
- } else if (x < WordS##size##_min - c) \
- goto l; \
- } while (0)
-#define WordS8_addCheckXC(dst, x, c, l) WordS_addCheckXC(8, dst, x, c, l)
-#define WordS16_addCheckXC(dst, x, c, l) WordS_addCheckXC(16, dst, x, c, l)
-#define WordS32_addCheckXC(dst, x, c, l) WordS_addCheckXC(32, dst, x, c, l)
-#define WordS64_addCheckXC(dst, x, c, l) WordS_addCheckXC(64, dst, x, c, l)
-
-#define WordS8_addCheckCX(dst, c, x, l) WordS8_addCheckXC(dst, x, c, l)
-#define WordS16_addCheckCX(dst, c, x, l) WordS16_addCheckXC(dst, x, c, l)
-#define WordS32_addCheckCX(dst, c, x, l) WordS32_addCheckXC(dst, x, c, l)
-#define WordS64_addCheckCX(dst, c, x, l) WordS64_addCheckXC(dst, x, c, l)
-
-#define WordS8_addCheck(dst, x, y, l) WordS8_addCheckXC (dst, x, y, l)
+#define WordS8_addCheck WordS8_addCheckXC
#define WordS16_addCheck WordS16_addCheckXC
#define WordS32_addCheck WordS32_addCheckXC
#define WordS64_addCheck WordS64_addCheckXC
-#define WordS_negCheck(size, dst, nW, l) \
- do { \
- WordS##size n = nW; \
- dst = -n; \
- if (n == WordS##size##_min) \
- goto l; \
- } while (0)
-#define Word8_negCheck(dst, n, l) WordS_negCheck(8, dst, n, l)
-#define Word16_negCheck(dst, n, l) WordS_negCheck(16, dst, n, l)
-#define Word32_negCheck(dst, n, l) WordS_negCheck(32, dst, n, l)
-#define Word64_negCheck(dst, n, l) WordS_negCheck(64, dst, n, l)
+#define WordU_addCheckCX(size, dst, cW, xW, l) \
+ do { \
+ WordU##size c = cW; \
+ WordU##size x = xW; \
+ WordU_addCheckBodyCX(size, c, x, goto l, dst = c + x); \
+ } while (0)
+#define WordU8_addCheckCX(dst, c, x, l) WordU_addCheckCX(8, dst, c, x, l)
+#define WordU16_addCheckCX(dst, c, x, l) WordU_addCheckCX(16, dst, c, x, l)
+#define WordU32_addCheckCX(dst, c, x, l) WordU_addCheckCX(32, dst, c, x, l)
+#define WordU64_addCheckCX(dst, c, x, l) WordU_addCheckCX(64, dst, c, x, l)
-#define WordS_subCheckCX(size, dst, cW, xW, l) \
- do { \
- WordS##size c = cW; \
- WordS##size x = xW; \
- dst = c - x; \
- if (c >= 0) { \
- if (x < c - WordS##size##_max) \
- goto l; \
- } else if (x > c - WordS##size##_min) \
- goto l; \
- } while (0)
+#define WordU8_addCheckXC(dst, x, c, l) WordU8_addCheckCX(dst, c, x, l)
+#define WordU16_addCheckXC(dst, x, c, l) WordU16_addCheckCX(dst, c, x, l)
+#define WordU32_addCheckXC(dst, x, c, l) WordU32_addCheckCX(dst, c, x, l)
+#define WordU64_addCheckXC(dst, x, c, l) WordU64_addCheckCX(dst, c, x, l)
+
+#define WordU8_addCheck WordU8_addCheckXC
+#define WordU16_addCheck WordU16_addCheckXC
+#define WordU32_addCheck WordU32_addCheckXC
+#define WordU64_addCheck WordU64_addCheckXC
+
+
+#define WordS_negCheck(size, dst, xW, l) \
+ do { \
+ WordS##size x = xW; \
+ WordS_negCheckBody(size, x, goto l, dst = -x); \
+ } while (0)
+#define Word8_negCheck(dst, x, l) WordS_negCheck(8, dst, x, l)
+#define Word16_negCheck(dst, x, l) WordS_negCheck(16, dst, x, l)
+#define Word32_negCheck(dst, x, l) WordS_negCheck(32, dst, x, l)
+#define Word64_negCheck(dst, x, l) WordS_negCheck(64, dst, x, l)
+
+
+#define WordS_subCheckCX(size, dst, cW, xW, l) \
+ do { \
+ WordS##size c = cW; \
+ WordS##size x = xW; \
+ WordS_subCheckBodyCX(size, c, x, goto l, dst = c - x); \
+ } while (0)
#define WordS8_subCheckCX(dst, c, x, l) WordS_subCheckCX(8, dst, c, x, l)
#define WordS16_subCheckCX(dst, c, x, l) WordS_subCheckCX(16, dst, c, x, l)
#define WordS32_subCheckCX(dst, c, x, l) WordS_subCheckCX(32, dst, c, x, l)
#define WordS64_subCheckCX(dst, c, x, l) WordS_subCheckCX(64, dst, c, x, l)
-#define WordS_subCheckXC(size, dst, xW, cW, l) \
- do { \
- WordS##size c = cW; \
- WordS##size x = xW; \
- if (c <= 0) { \
- if (x > WordS##size##_max + c) \
- goto l; \
- } else if (x < WordS##size##_min + c) \
- goto l; \
- dst = x - c; \
- } while (0)
-#define WordS8_subCheckXC(dst, c, x, l) WordS_subCheckXC(8, dst, c, x, l)
-#define WordS16_subCheckXC(dst, c, x, l) WordS_subCheckXC(16, dst, c, x, l)
-#define WordS32_subCheckXC(dst, c, x, l) WordS_subCheckXC(32, dst, c, x, l)
-#define WordS64_subCheckXC(dst, c, x, l) WordS_subCheckXC(64, dst, c, x, l)
+#define WordS_subCheckXC(size, dst, xW, cW, l) \
+ do { \
+ WordS##size x = xW; \
+ WordS##size c = cW; \
+ WordS_subCheckBodyXC(size, x, c, goto l, dst = x - c); \
+ } while (0)
+#define WordS8_subCheckXC(dst, x, c, l) WordS_subCheckXC(8, dst, x, c, l)
+#define WordS16_subCheckXC(dst, x, c, l) WordS_subCheckXC(16, dst, x, c, l)
+#define WordS32_subCheckXC(dst, x, c, l) WordS_subCheckXC(32, dst, x, c, l)
+#define WordS64_subCheckXC(dst, x, c, l) WordS_subCheckXC(64, dst, x, c, l)
#define WordS8_subCheck WordS8_subCheckXC
#define WordS16_subCheck WordS16_subCheckXC
#define WordS32_subCheck WordS32_subCheckXC
#define WordS64_subCheck WordS64_subCheckXC
-#define WordU_addCheckXC(size, dst, x, c, l) \
- do { \
- dst = x + c; \
- if (x > Word##size##_max - c) \
- goto l; \
- } while (0)
-#define WordU8_addCheckXC(dst, x, c, l) WordU_addCheckXC(8, dst, x, c, l)
-#define WordU16_addCheckXC(dst, x, c, l) WordU_addCheckXC(16, dst, x, c, l)
-#define WordU32_addCheckXC(dst, x, c, l) WordU_addCheckXC(32, dst, x, c, l)
-#define WordU64_addCheckXC(dst, x, c, l) WordU_addCheckXC(64, dst, x, c, l)
-#define WordU8_addCheckCX(dst, c, x, l) WordU_addCheckXC(8, dst, x, c, l)
-#define WordU16_addCheckCX(dst, c, x, l) WordU_addCheckXC(16, dst, x, c, l)
-#define WordU32_addCheckCX(dst, c, x, l) WordU_addCheckXC(32, dst, x, c, l)
-#define WordU64_addCheckCX(dst, c, x, l) WordU_addCheckXC(64, dst, x, c, l)
-#define WordU8_addCheck WordU8_addCheckXC
-#define WordU16_addCheck WordU16_addCheckXC
-#define WordU32_addCheck WordU32_addCheckXC
-#define WordU64_addCheck WordU64_addCheckXC
+#define WordS_mulCheck(size, dst, xW, yW, l) \
+ do { \
+ WordS##size x = xW; \
+ WordS##size y = yW; \
+ WordS_mulCheckBody(size, x, y, goto l, dst = x * y); \
+ } while (0)
+#define WordS8_mulCheck(dst, x, y, l) WordS_mulCheck(8, dst, x, y, l)
+#define WordS16_mulCheck(dst, x, y, l) WordS_mulCheck(16, dst, x, y, l)
+#define WordS32_mulCheck(dst, x, y, l) WordS_mulCheck(32, dst, x, y, l)
+#define WordS64_mulCheck(dst, x, y, l) WordS_mulCheck(64, dst, x, y, l)
-#define mulOverflow(small, large) \
- static inline Word##small Word##small##_##mulOverflow \
- (Word##small x1, Word##small x2, Bool *overflow) { \
- Word##large tmp; \
- Word##small res; \
- \
- tmp = (Word##large)x1 * x2; \
- res = tmp; \
- *overflow = (tmp != res); \
- return res; \
- }
-mulOverflow(S8, S16)
-mulOverflow(S16, S32)
-mulOverflow(S32, S64)
-mulOverflow(U8, U16)
-mulOverflow(U16, U32)
-mulOverflow(U32, U64)
-#undef mulOverflow
+#define WordU_mulCheck(size, dst, xW, yW, l) \
+ do { \
+ WordU##size x = xW; \
+ WordU##size y = yW; \
+ WordU_mulCheckBody(size, x, y, goto l, dst = x * y); \
+ } while (0)
+#define WordU8_mulCheck(dst, x, y, l) WordU_mulCheck(8, dst, x, y, l)
+#define WordU16_mulCheck(dst, x, y, l) WordU_mulCheck(16, dst, x, y, l)
+#define WordU32_mulCheck(dst, x, y, l) WordU_mulCheck(32, dst, x, y, l)
+#define WordU64_mulCheck(dst, x, y, l) WordU_mulCheck(64, dst, x, y, l)
-#define check(dst, n1, n2, l, ty); \
- do { \
- Bool overflow; \
- ty tmp; \
- tmp = ty##_mulOverflow (n1, n2, &overflow); \
- if (DEBUG_CCODEGEN) \
- fprintf (stderr, "%s:%d: " #ty "_mulOverflow (%d, %d) = %d\n", \
- __FILE__, __LINE__, \
- (int)n1, (int)n2, (int)tmp); \
- if (overflow) { \
- if (DEBUG_CCODEGEN) \
- fprintf (stderr, "%s:%d: overflow\n", \
- __FILE__, __LINE__); \
- goto l; \
- } \
- dst = tmp; \
- } while (0)
-
-#define WordS8_mulCheck(dst, n1, n2, l) check (dst, n1, n2, l, WordS8)
-#define WordS16_mulCheck(dst, n1, n2, l) check (dst, n1, n2, l, WordS16)
-#define WordS32_mulCheck(dst, n1, n2, l) check (dst, n1, n2, l, WordS32)
-#define WordU8_mulCheck(dst, n1, n2, l) check (dst, n1, n2, l, WordU8)
-#define WordU16_mulCheck(dst, n1, n2, l) check (dst, n1, n2, l, WordU16)
-#define WordU32_mulCheck(dst, n1, n2, l) check (dst, n1, n2, l, WordU32)
-
#endif /* #ifndef _C_CHUNK_H_ */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-21 23:07:23 UTC (rev 4563)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-22 15:56:43 UTC (rev 4564)
@@ -138,10 +138,12 @@
GCHFILES = \
$(shell find gc -type f | grep '\.h$$')
+BASISHFILES = \
+ $(shell find basis -type f | grep '\.h$$')
+
CFILES = \
$(UTILCFILES) \
$(shell find basis -type f | grep '\.c$$' | grep -v Real/) \
- $(shell find Posix -type f | grep '\.c$$') \
gc.c \
platform.c
@@ -154,7 +156,8 @@
c-types.h \
basis-ffi.h \
platform.h \
- platform/$(TARGET_OS).h
+ platform/$(TARGET_OS).h \
+ $(BASISHFILES)
FILES = $(basename $(CFILES))
@@ -255,9 +258,9 @@
# with -fno-strict-aliasing to prevent gcc from taking advantage of
# this aspect of the C spec.
basis/Real/%-gdb.o: basis/Real/%.c gdtoa/arith.h $(HFILES)
- $(CC) $(DEBUGCFLAGS) $(DEBUGWARNCFLAGS) -c -o $@ $<
+ $(CC) $(DEBUGCFLAGS) $(DEBUGWARNCFLAGS) -Wno-float-equal -c -o $@ $<
basis/Real/%.o: basis/Real/%.c gdtoa/arith.h $(HFILES)
- $(CC) $(OPTCFLAGS) $(OPTWARNCFLAGS) -O1 -fno-strict-aliasing -c -o $@ $<
+ $(CC) $(OPTCFLAGS) $(OPTWARNCFLAGS) -Wno-float-equal -O1 -fno-strict-aliasing -c -o $@ $<
%-gdb.o: %.c $(HFILES)
$(CC) $(DEBUGCFLAGS) $(DEBUGWARNCFLAGS) -c -o $@ $<
Added: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Math-fns.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Math-fns.h 2006-05-21 23:07:23 UTC (rev 4563)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Math-fns.h 2006-05-22 15:56:43 UTC (rev 4564)
@@ -0,0 +1,74 @@
+
+#define unaryReal(g, h) \
+ MLTON_CODEGEN_STATIC_INLINE \
+ Real64_t Real64_##g (Real64_t x) { \
+ return h (x); \
+ } \
+ MLTON_CODEGEN_STATIC_INLINE \
+ Real32_t Real32_##g (Real32_t x) { \
+ return h##f (x); \
+ }
+unaryReal(abs, fabs)
+unaryReal(round, rint)
+#undef unaryReal
+
+#define binaryReal(g, h) \
+ MLTON_CODEGEN_STATIC_INLINE \
+ Real64_t Real64_Math_##g (Real64_t x, Real64_t y) { \
+ return h (x, y); \
+ } \
+ MLTON_CODEGEN_STATIC_INLINE \
+ Real32_t Real32_Math_##g (Real32_t x, Real32_t y) { \
+ return h##f (x, y); \
+ }
+binaryReal(atan2, atan2)
+binaryReal(pow, pow)
+#undef binaryReal
+
+#define unaryReal(g, h) \
+ MLTON_CODEGEN_STATIC_INLINE \
+ Real64_t Real64_Math_##g (Real64_t x) { \
+ return h (x); \
+ } \
+ MLTON_CODEGEN_STATIC_INLINE \
+ Real32_t Real32_Math_##g (Real32_t x) { \
+ return h##f (x); \
+ }
+unaryReal(acos, acos)
+unaryReal(asin, asin)
+unaryReal(atan, atan)
+unaryReal(cos, cos)
+unaryReal(cosh, cosh)
+unaryReal(exp, exp)
+unaryReal(ln, log)
+unaryReal(log10, log10)
+unaryReal(sin, sin)
+unaryReal(sinh, sinh)
+unaryReal(sqrt, sqrt)
+unaryReal(tan, tan)
+unaryReal(tanh, tanh)
+#undef unaryReal
+
+#define binaryRealIntRef(g, h) \
+ MLTON_CODEGEN_STATIC_INLINE \
+ Real64_t Real64_##g (Real64_t x, Ref(C_Int_t) i) { \
+ return h (x, (int*)i); \
+ } \
+ MLTON_CODEGEN_STATIC_INLINE \
+ Real32_t Real32_##g (Real32_t x, Ref(C_Int_t) i) { \
+ return h##f (x, (int*)i); \
+ }
+binaryRealIntRef(frexp, frexp)
+#undef binaryRealIntRef
+
+#define binaryRealInt(g, h) \
+ MLTON_CODEGEN_STATIC_INLINE \
+ Real64_t Real64_##g (Real64_t x, C_Int_t i) { \
+ return h (x, i); \
+ } \
+ MLTON_CODEGEN_STATIC_INLINE \
+ Real32_t Real32_##g (Real32_t x, C_Int_t i) { \
+ return h##f (x, i); \
+ }
+binaryRealInt(ldexp, ldexp)
+#undef binaryRealInt
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Math.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Math.c 2006-05-21 23:07:23 UTC (rev 4563)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Math.c 2006-05-22 15:56:43 UTC (rev 4564)
@@ -1,55 +1,3 @@
#include "platform.h"
-#define unaryReal(g, h) \
-Real64_t Real64_##g (Real64_t x) { \
- return h (x); \
-} \
-Real32_t Real32_##g (Real32_t x) { \
- return h##f (x); \
-}
-unaryReal(abs, fabs)
-unaryReal(round, rint)
-#undef unaryReal
-
-#define binaryReal(g, h) \
-Real64_t Real64_Math_##g (Real64_t x, Real64_t y) { \
- return h (x, y); \
-} \
-Real32_t Real32_Math_##g (Real32_t x, Real32_t y) { \
- return h##f (x, y); \
-}
-binaryReal(atan2, atan2)
-binaryReal(pow, pow)
-#undef binaryReal
-
-#define unaryReal(g, h) \
-Real64_t Real64_Math_##g (Real64_t x) { \
- return h (x); \
-} \
-Real32_t Real32_Math_##g (Real32_t x) { \
- return h##f (x); \
-}
-unaryReal(acos, acos)
-unaryReal(asin, asin)
-unaryReal(atan, atan)
-unaryReal(cos, cos)
-unaryReal(cosh, cosh)
-unaryReal(exp, exp)
-unaryReal(ln, log)
-unaryReal(log10, log10)
-unaryReal(sin, sin)
-unaryReal(sinh, sinh)
-unaryReal(sqrt, sqrt)
-unaryReal(tan, tan)
-unaryReal(tanh, tanh)
-#undef unaryReal
-
-#define binaryRealInt(g, h) \
-Real64_t Real64_##g (Real64_t x, C_Int_t i) { \
- return h (x, i); \
-} \
-Real32_t Real32_##g (Real32_t x, C_Int_t i) { \
- return h##f (x, i); \
-}
-binaryRealInt(ldexp, ldexp)
-#undef binaryRealInt
+#include "Math-fns.h"
Added: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Real-consts.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Real-consts.c 2006-05-21 23:07:23 UTC (rev 4563)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Real-consts.c 2006-05-22 15:56:43 UTC (rev 4564)
@@ -0,0 +1,15 @@
+#include "platform.h"
+
+Real32_t Real32_Math_pi = (Real32_t)3.14159265358979323846;
+Real32_t Real32_Math_e = (Real32_t)2.71828182845904523536;
+
+Real32_t Real32_maxFinite = 3.40282347e+38;
+Real32_t Real32_minNormalPos = 1.17549435e-38;
+Real32_t Real32_minPos = 1.40129846e-45;
+
+Real64_t Real64_Math_pi = 3.14159265358979323846;
+Real64_t Real64_Math_e = 2.71828182845904523536;
+
+Real64_t Real64_maxFinite = 1.7976931348623157e+308;
+Real64_t Real64_minNormalPos = 2.2250738585072014e-308;
+Real64_t Real64_minPos = 4.9406564584124654e-324;
Added: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Real-ops.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Real-ops.h 2006-05-21 23:07:23 UTC (rev 4563)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Real-ops.h 2006-05-22 15:56:43 UTC (rev 4564)
@@ -0,0 +1,45 @@
+
+#define binary(size, name, op) \
+ MLTON_CODEGEN_STATIC_INLINE \
+ Real##size##_t Real##size##_##name (Real##size##_t r1, Real##size##_t r2) { \
+ return r1 op r2; \
+ }
+
+#define compare(size, name, op) \
+ MLTON_CODEGEN_STATIC_INLINE \
+ Bool Real##size##_##name (Real##size##_t r1, Real##size##_t r2) { \
+ return r1 op r2; \
+ }...
[truncated message content] |