[MLton-commit] r7032
Ville Laurikari
ville at mlton.org
Sat Apr 4 09:22:08 PST 2009
Made 64-bit powerpc into it's own architecture, which it should have
been all along, because it really is different than 32-bit powerpc.
----------------------------------------------------------------------
U mlton/trunk/basis-library/mlton/platform.sig
U mlton/trunk/basis-library/mlton/platform.sml
U mlton/trunk/basis-library/primitive/prim-mlton.sml
U mlton/trunk/bin/platform
U mlton/trunk/bin/upgrade-basis
U mlton/trunk/lib/mlton-stubs/mlton.sml
U mlton/trunk/lib/mlton-stubs/platform.sig
U mlton/trunk/mlnlffigen/control.sml
A mlton/trunk/mlnlffigen/sizes-powerpc64.sml
U mlton/trunk/mlnlffigen/sources.mlb
U mlton/trunk/mlton/Makefile
U mlton/trunk/runtime/Makefile
U mlton/trunk/runtime/basis/Word/Word.c
U mlton/trunk/runtime/cenv.h
U mlton/trunk/runtime/platform/aix.h
A mlton/trunk/runtime/platform/powerpc64.h
----------------------------------------------------------------------
Modified: mlton/trunk/basis-library/mlton/platform.sig
===================================================================
--- mlton/trunk/basis-library/mlton/platform.sig 2009-04-04 17:14:46 UTC (rev 7031)
+++ mlton/trunk/basis-library/mlton/platform.sig 2009-04-04 17:22:06 UTC (rev 7032)
@@ -1,4 +1,4 @@
-(* Copyright (C) 2003-2007 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2003-2009 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks.
*
* MLton is released under a BSD-style license.
@@ -10,7 +10,7 @@
structure Arch:
sig
datatype t = Alpha | AMD64 | ARM | HPPA | IA64 | m68k |
- MIPS | PowerPC | S390 | Sparc | X86
+ MIPS | PowerPC | PowerPC64 | S390 | Sparc | X86
val fromString: string -> t option
val host: t
@@ -28,7 +28,7 @@
structure OS:
sig
- datatype t = AIX | Cygwin | Darwin | FreeBSD | HPUX
+ datatype t = AIX | Cygwin | Darwin | FreeBSD | HPUX
| Linux | MinGW | NetBSD | OpenBSD | Solaris
val fromString: string -> t option
Modified: mlton/trunk/basis-library/mlton/platform.sml
===================================================================
--- mlton/trunk/basis-library/mlton/platform.sml 2009-04-04 17:14:46 UTC (rev 7031)
+++ mlton/trunk/basis-library/mlton/platform.sml 2009-04-04 17:22:06 UTC (rev 7032)
@@ -1,4 +1,4 @@
-(* Copyright (C) 2003-2006, 2008 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2003-2009 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks.
*
* MLton is released under a BSD-style license.
@@ -24,9 +24,10 @@
(IA64, "IA64"),
(m68k, "m68k"),
(MIPS, "MIPS"),
- (PowerPC, "PowerPC"),
+ (PowerPC, "PowerPC"),
+ (PowerPC64, "PowerPC64"),
(S390, "S390"),
- (Sparc, "Sparc"),
+ (Sparc, "Sparc"),
(X86, "X86")]
fun fromString s =
Modified: mlton/trunk/basis-library/primitive/prim-mlton.sml
===================================================================
--- mlton/trunk/basis-library/primitive/prim-mlton.sml 2009-04-04 17:14:46 UTC (rev 7031)
+++ mlton/trunk/basis-library/primitive/prim-mlton.sml 2009-04-04 17:22:06 UTC (rev 7032)
@@ -1,4 +1,4 @@
-(* Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 1999-2009 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks.
* Copyright (C) 1997-2000 NEC Research Institute.
*
@@ -154,6 +154,7 @@
| m68k
| MIPS
| PowerPC
+ | PowerPC64
| S390
| Sparc
| X86
@@ -168,6 +169,7 @@
| "m68k" => m68k
| "mips" => MIPS
| "powerpc" => PowerPC
+ | "powerpc64" => PowerPC64
| "s390" => S390
| "sparc" => Sparc
| "x86" => X86
Modified: mlton/trunk/bin/platform
===================================================================
--- mlton/trunk/bin/platform 2009-04-04 17:14:46 UTC (rev 7031)
+++ mlton/trunk/bin/platform 2009-04-04 17:22:06 UTC (rev 7032)
@@ -31,7 +31,7 @@
HOST_OS='aix'
arch=`/usr/sbin/lsattr -a type -F deflt -l proc0`
case $arch in
- POWER) arch=powerpc ;;
+ POWER) arch=powerpc64 ;;
esac
;;
CYGWIN*)
@@ -106,6 +106,9 @@
# big-endian and little-endian detect via headers
HOST_ARCH=mips
;;
+powerpc64)
+ HOST_ARCH=powerpc64
+;;
powerpc)
HOST_ARCH=powerpc
;;
Modified: mlton/trunk/bin/upgrade-basis
===================================================================
--- mlton/trunk/bin/upgrade-basis 2009-04-04 17:14:46 UTC (rev 7031)
+++ mlton/trunk/bin/upgrade-basis 2009-04-04 17:22:06 UTC (rev 7032)
@@ -29,7 +29,7 @@
echo "val () = print \"I work\"" >"$tmp"
if ! mlton "$tmp" 1>&2; then
- die "Error: cannot upgrade basis because the compiler doesn't work"
+ die "Error: cannot upgrade basis because the compiler doesn't work"
fi
feature () {
@@ -67,7 +67,7 @@
end'
feature 'val _ = IntInf.~>>' '
-structure IntInf =
+structure IntInf =
struct
open IntInf
@@ -121,6 +121,9 @@
powerpc)
arch='PowerPC'
;;
+powerpc64)
+ arch='PowerPC64'
+;;
s390)
arch='S390'
;;
@@ -171,7 +174,7 @@
esac
cat <<-EOF
-structure MLton =
+structure MLton =
struct
open MLton
@@ -184,7 +187,7 @@
structure Arch =
struct
datatype t = Alpha | AMD64 | ARM | HPPA | IA64 | m68k |
- MIPS | PowerPC | S390 | Sparc | X86
+ MIPS | PowerPC | PowerPC64 | S390 | Sparc | X86
val all = [(Alpha, "Alpha"),
(AMD64, "AMD64"),
@@ -193,9 +196,10 @@
(IA64, "IA64"),
(m68k, "m68k"),
(MIPS, "MIPS"),
- (PowerPC, "PowerPC"),
+ (PowerPC, "PowerPC"),
+ (PowerPC64, "PowerPC64"),
(S390, "S390"),
- (Sparc, "Sparc"),
+ (Sparc, "Sparc"),
(X86, "X86")]
fun fromString s =
Modified: mlton/trunk/lib/mlton-stubs/mlton.sml
===================================================================
--- mlton/trunk/lib/mlton-stubs/mlton.sml 2009-04-04 17:14:46 UTC (rev 7031)
+++ mlton/trunk/lib/mlton-stubs/mlton.sml 2009-04-04 17:22:06 UTC (rev 7032)
@@ -1,4 +1,4 @@
-(* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 1999-2009 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks.
* Copyright (C) 1997-2000 NEC Research Institute.
*
@@ -30,7 +30,7 @@
(* This file is just a dummy provided in place of the structure that MLton
* supplies so that we can compile under SML/NJ.
- *)
+ *)
structure MLton: MLTON =
struct
type int = Int.int
@@ -182,7 +182,7 @@
structure Arch =
struct
datatype t = Alpha | AMD64 | ARM | HPPA | IA64 | m68k |
- MIPS | PowerPC | S390 | Sparc | X86
+ MIPS | PowerPC | PowerPC64 | S390 | Sparc | X86
val host: t = X86
@@ -193,9 +193,10 @@
(IA64, "IA64"),
(m68k, "m68k"),
(MIPS, "MIPS"),
- (PowerPC, "PowerPC"),
+ (PowerPC, "PowerPC"),
+ (PowerPC64, "PowerPC64"),
(S390, "S390"),
- (Sparc, "Sparc"),
+ (Sparc, "Sparc"),
(X86, "X86")]
fun fromString s =
Modified: mlton/trunk/lib/mlton-stubs/platform.sig
===================================================================
--- mlton/trunk/lib/mlton-stubs/platform.sig 2009-04-04 17:14:46 UTC (rev 7031)
+++ mlton/trunk/lib/mlton-stubs/platform.sig 2009-04-04 17:22:06 UTC (rev 7032)
@@ -1,4 +1,4 @@
-(* Copyright (C) 2003-2006 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2003-2009 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks.
*
* MLton is released under a BSD-style license.
@@ -10,7 +10,7 @@
structure Arch:
sig
datatype t = Alpha | AMD64 | ARM | HPPA | IA64 | m68k |
- MIPS | PowerPC | S390 | Sparc | X86
+ MIPS | PowerPC | PowerPC64 | S390 | Sparc | X86
val fromString: string -> t option
val host: t
Modified: mlton/trunk/mlnlffigen/control.sml
===================================================================
--- mlton/trunk/mlnlffigen/control.sml 2009-04-04 17:14:46 UTC (rev 7031)
+++ mlton/trunk/mlnlffigen/control.sml 2009-04-04 17:22:06 UTC (rev 7032)
@@ -1,4 +1,4 @@
-(* Copyright (C) 2004-2008 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2004-2009 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks.
*
* MLton is released under a BSD-style license.
@@ -109,6 +109,9 @@
endianShift = EndianBig.shift}
| (PowerPC, _) => SOME {name = toString t, sizes = SizesPPC.sizes,
endianShift = EndianLittle.shift}
+ | (PowerPC64, _) => SOME {name = toString t,
+ sizes = SizesPowerPC64.sizes,
+ endianShift = EndianLittle.shift}
| (X86, _) => SOME {name = toString t, sizes = SizesX86.sizes,
endianShift = EndianLittle.shift}
| _ => NONE
Added: mlton/trunk/mlnlffigen/sizes-powerpc64.sml
===================================================================
--- mlton/trunk/mlnlffigen/sizes-powerpc64.sml 2009-04-04 17:14:46 UTC (rev 7031)
+++ mlton/trunk/mlnlffigen/sizes-powerpc64.sml 2009-04-04 17:22:06 UTC (rev 7032)
@@ -0,0 +1,26 @@
+(* This file was automatically generated using size.c.
+ * It contains information about c data sizes and layout.
+
+ * Limitations:
+ * 1. write proper test for bitFieldAlignment.
+ * 2. include date and system information in this file?
+ *)
+
+structure SizesPowerPC64 = struct
+val sizes = { (*** all sizes in bits ***)
+ char = {bits = 8, align = 8},
+ short = {bits = 16, align = 16},
+ int = {bits = 32, align = 32},
+ long = {bits = 64, align = 64},
+ longlong = {bits = 64, align = 64},
+ float = {bits = 32, align = 32},
+ double = {bits = 64, align = 32},
+ longdouble = {bits = 64, align = 32},
+ pointer = {bits = 64, align = 64},
+ min_struct = {bits = 8, align = 8},
+ min_union = {bits = 8, align = 8},
+ onlyPackBitFields = false,
+ ignoreUnnamedBitFieldAlignment = true
+}
+end
+
Modified: mlton/trunk/mlnlffigen/sources.mlb
===================================================================
--- mlton/trunk/mlnlffigen/sources.mlb 2009-04-04 17:14:46 UTC (rev 7031)
+++ mlton/trunk/mlnlffigen/sources.mlb 2009-04-04 17:22:06 UTC (rev 7032)
@@ -21,6 +21,7 @@
sizes-hppa.sml
sizes-ia64.sml
sizes-ppc.sml
+ sizes-powerpc64.sml
sizes-sparc.sml
sizes-x86.sml
end
Modified: mlton/trunk/mlton/Makefile
===================================================================
--- mlton/trunk/mlton/Makefile 2009-04-04 17:14:46 UTC (rev 7031)
+++ mlton/trunk/mlton/Makefile 2009-04-04 17:22:06 UTC (rev 7032)
@@ -1,4 +1,4 @@
-## Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
+## Copyright (C) 1999-2009 Henry Cejtin, Matthew Fluet, Suresh
# Jagannathan, and Stephen Weeks.
# Copyright (C) 1997-2000 NEC Research Institute.
#
Modified: mlton/trunk/runtime/Makefile
===================================================================
--- mlton/trunk/runtime/Makefile 2009-04-04 17:14:46 UTC (rev 7031)
+++ mlton/trunk/runtime/Makefile 2009-04-04 17:22:06 UTC (rev 7032)
@@ -78,7 +78,7 @@
FLAGS += -mlp64 -mtune=itanium2
endif
-ifeq ($(TARGET_OS)-$(TARGET_ARCH), aix-powerpc)
+ifeq ($(TARGET_OS)-$(TARGET_ARCH), aix-powerpc64)
FLAGS += -maix64
AR := ar -X 64 rc
endif
Modified: mlton/trunk/runtime/basis/Word/Word.c
===================================================================
--- mlton/trunk/runtime/basis/Word/Word.c 2009-04-04 17:14:46 UTC (rev 7031)
+++ mlton/trunk/runtime/basis/Word/Word.c 2009-04-04 17:22:06 UTC (rev 7032)
@@ -24,7 +24,7 @@
* implements / and %.
*/
-#if ! (defined (__amd64__) || defined (__hppa__) || defined (__i386__) || defined(__ia64__) || defined(__mips__) || defined (__ppc__) || defined (__powerpc__) || defined (__sparc__))
+#if ! (defined (__amd64__) || defined (__hppa__) || defined (__i386__) || defined(__ia64__) || defined(__mips__) || defined (__ppc__) || defined (__powerpc__) || defined (__powerpc64__) || defined (__sparc__))
#error check that C {/,%} correctly implement {quot,rem} from the basis library
#endif
Modified: mlton/trunk/runtime/cenv.h
===================================================================
--- mlton/trunk/runtime/cenv.h 2009-04-04 17:14:46 UTC (rev 7031)
+++ mlton/trunk/runtime/cenv.h 2009-04-04 17:22:06 UTC (rev 7032)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
+/* Copyright (C) 1999-2009 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks.
* Copyright (C) 1997-2000 NEC Research Institute.
*
@@ -104,6 +104,8 @@
#include "platform/m68k.h"
#elif (defined (__mips__))
#include "platform/mips.h"
+#elif (defined (__powerpc64__))
+#include "platform/powerpc64.h"
#elif (defined (__ppc__)) || (defined (__powerpc__))
#include "platform/powerpc.h"
#elif (defined (__s390__))
Modified: mlton/trunk/runtime/platform/aix.h
===================================================================
--- mlton/trunk/runtime/platform/aix.h 2009-04-04 17:14:46 UTC (rev 7031)
+++ mlton/trunk/runtime/platform/aix.h 2009-04-04 17:22:06 UTC (rev 7032)
@@ -1,4 +1,10 @@
-#define __ppc__
+#if defined(_ARCH_PPC64)
+#define __powerpc64__
+#elif defined(_ARCH_PPC)
+#define __powerpc__
+#else
+#error "Unknown architecture"
+#endif
#include <unistd.h>
Added: mlton/trunk/runtime/platform/powerpc64.h
===================================================================
--- mlton/trunk/runtime/platform/powerpc64.h 2009-04-04 17:14:46 UTC (rev 7031)
+++ mlton/trunk/runtime/platform/powerpc64.h 2009-04-04 17:22:06 UTC (rev 7032)
@@ -0,0 +1 @@
+#define MLton_Platform_Arch_host "powerpc64"
More information about the MLton-commit
mailing list