[m-dev.] for review: MR_int_leastN_t, and remove refs to old macros
Zoltan Somogyi
zs at cs.mu.OZ.AU
Tue Aug 17 15:44:25 AEST 1999
I'd like David Overton to check the changes to fact_table.m, and Fergus
to check everything else.
Use our own MR_ prefixed variants of int_leastN_t, and ensure that
the system compiles and bootstraps with all but the most recent parts
of mercury_bootstrap.h being disabled.
configure.in:
Do not test for inttypes.h, stdint.h, or sys/types.h; check
for at-least-given-sized integers directly.
runtime/mercury_conf.h.in:
runtime/mercury_types.h:
Always use our own MR_int_leastN_t types; do not include inttypes.h,
stdint.h or sys/types.h.
compiler/llds_out.m:
Add the MR_ prefix to references to int_leastN_t.
runtime/mercury_bootstrap.h:
Leave the most recent part outside the scope of MR_NO_BACKWARDS_COMPAT.
runtime/*.[ch]:
trace/*.c:
compiler/*.m:
library/*.m:
Get rid of references to macros now defined in mercury_bootstrap.h;
apply the substitutions defined in that header file by hand.
BTW, I can commit the changes relating to MR_int_leastN_T separately
if anyone insists.
Zoltan.
cvs diff: Diffing .
Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.176
diff -u -b -r1.176 configure.in
--- configure.in 1999/06/03 16:29:32 1.176
+++ configure.in 1999/06/10 02:51:41
@@ -663,130 +663,8 @@
fi
fi
#-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(sys/types.h, HAVE_SYS_TYPES_H=1)
-AC_CHECK_HEADER(inttypes.h, HAVE_INTTYPES_H=1)
-AC_CHECK_HEADER(stdint.h, HAVE_STDINT_H=1)
-
-# On some systems, e.g. SGI IRIX 5.2, you can include
-# <inttypes.h>, or <sys/types.h>, but not both!
-
-if test "$HAVE_INTTYPES_H" = 1 && test "$HAVE_SYS_TYPES_H" = 1; then
- AC_CACHE_VAL(mercury_cv_inttypes_compat,
- AC_MSG_CHECKING(whether inttypes.h is compatible with sys/types.h)
- AC_TRY_COMPILE([
- #include <inttypes.h>
- #include <sys/types.h>
- ],
- [],
- [mercury_cv_inttypes_compat=yes], [mercury_cv_inttypes_compat=no]))
- AC_MSG_RESULT($mercury_cv_inttypes_compat)
-
- # If <inttypes.h> is not compatible with <sys/types.h>, then
- # don't use it.
- if test "$mercury_cv_inttypes_compat" = no; then
- HAVE_INTTYPES_H=0
- fi
-fi
-
-if test "$HAVE_SYS_TYPES_H" = 1; then
- AC_DEFINE(HAVE_SYS_TYPES)
-fi
-if test "$HAVE_INTTYPES_H" = 1; then
- AC_DEFINE(HAVE_INTTYPES)
-fi
-if test "$HAVE_STDINT_H" = 1; then
- AC_DEFINE(HAVE_STDINT)
-fi
-
-#-----------------------------------------------------------------------------#
-AC_MSG_CHECKING(for intptr_t)
-AC_CACHE_VAL(mercury_cv_have_intptr_t,
- AC_TRY_COMPILE([
- #ifdef HAVE_STDINT
- #include <stdint.h>
- #endif
- #ifdef HAVE_INTTYPES
- #include <inttypes.h>
- #endif
- #ifdef HAVE_SYS_TYPES
- #include <sys/types.h>
- #endif
- ], [
- changequote(<<,>>)
-
- /* test the existence of the types */
- intptr_t foo;
- uintptr_t bar;
-
- /* check that they have the right size */
- #define ASSERTION \
- (sizeof(intptr_t) == sizeof(void *) && \
- sizeof(uintptr_t) == sizeof(void *))
-
- /* this forces a compile error if ASSERTION is false */
- int array[ASSERTION ? 1 : -1];
-
- changequote([,])
- ],
- [mercury_cv_have_intptr_t=yes],
- [mercury_cv_have_intptr_t=no])
-)
-AC_MSG_RESULT($mercury_cv_have_intptr_t)
-if test "$mercury_cv_have_intptr_t" = yes; then
- AC_DEFINE(MR_HAVE_INTPTR_T)
-fi
-#-----------------------------------------------------------------------------#
-AC_MSG_CHECKING(for int_leastN_t)
-AC_CACHE_VAL(mercury_cv_have_int_leastN_t,
- AC_TRY_COMPILE([
- #ifdef HAVE_STDINT
- #include <stdint.h>
- #endif
- #ifdef HAVE_INTTYPES
- #include <inttypes.h>
- #endif
- #ifdef HAVE_SYS_TYPES
- #include <sys/types.h>
- #endif
- #include <limits.h> /* for CHAR_BIT */
- ], [
- changequote(<<,>>)
-
- /* test the existence of the types */
- int_least8_t foo8;
- uint_least8_t bar8;
- int_least16_t foo16;
- uint_least16_t bar16;
- int_least32_t foo32;
- uint_least32_t bar32;
-
- /* check that they have the right size */
- #define ASSERTION \
- (sizeof(int_least8_t) * CHAR_BIT >= 8 && \
- sizeof(uint_least8_t) * CHAR_BIT >= 8 && \
- sizeof(int_least16_t) * CHAR_BIT >= 16 && \
- sizeof(uint_least16_t) * CHAR_BIT >= 16 && \
- sizeof(int_least32_t) * CHAR_BIT >= 32 && \
- sizeof(uint_least32_t) * CHAR_BIT >= 32)
-
- /* this forces a compile error if ASSERTION is false */
- int array[ASSERTION ? 1 : -1];
-
- changequote([,])
- ],
- [mercury_cv_have_int_leastN_t=yes],
- [mercury_cv_have_int_leastN_t=no])
-)
-AC_MSG_RESULT($mercury_cv_have_int_leastN_t)
-if test "$mercury_cv_have_int_leastN_t" = yes; then
- AC_DEFINE(MR_HAVE_INT_LEASTN_T)
-fi
-#-----------------------------------------------------------------------------#
-if test "$mercury_cv_have_intptr_t" = yes; then
- true
-else
- AC_MSG_CHECKING(for an integer type with the same size as a pointer)
- AC_CACHE_VAL(mercury_cv_word_type,
+AC_MSG_CHECKING(for an integer type with the same size as a pointer)
+AC_CACHE_VAL(mercury_cv_word_type,
AC_TRY_RUN([
#include <stdio.h>
int main() {
@@ -814,8 +692,8 @@
[mercury_cv_word_type=`cat conftest.tags`],
[mercury_cv_word_type=unknown],
[mercury_cv_word_type=unknown])
- )
- if test "$mercury_cv_word_type" = unknown; then
+)
+if test "$mercury_cv_word_type" = unknown; then
AC_TRY_RUN([
#include <stdio.h>
int main() {
@@ -837,18 +715,14 @@
[mercury_cv_word_type=`cat conftest.tags`],
[mercury_cv_word_type=unknown],
[mercury_cv_word_type=unknown])
- fi
- AC_MSG_RESULT($mercury_cv_word_type)
- AC_DEFINE_UNQUOTED(MR_WORD_TYPE, $mercury_cv_word_type)
- MR_WORD_TYPE=$mercury_cv_word_type
- AC_SUBST(MR_WORD_TYPE)
-fi # ! have_int_ptr_t
+fi
+AC_MSG_RESULT($mercury_cv_word_type)
+AC_DEFINE_UNQUOTED(MR_WORD_TYPE, $mercury_cv_word_type)
+MR_WORD_TYPE=$mercury_cv_word_type
+AC_SUBST(MR_WORD_TYPE)
#-----------------------------------------------------------------------------#
-if test "$mercury_cv_have_int_leastN_t" = yes; then
- true
-else
- AC_MSG_CHECKING(for an integer type of at least 32 bits)
- AC_CACHE_VAL(mercury_cv_int_least32_type,
+AC_MSG_CHECKING(for an integer type of at least 64 bits)
+AC_CACHE_VAL(mercury_cv_int_least64_type,
AC_TRY_RUN([
#include <stdio.h>
#include <limits.h>
@@ -859,6 +733,68 @@
if (fp == NULL)
exit(1);
+ if (sizeof(int) * CHAR_BIT >= 64)
+ {
+ fprintf(fp, "int\n");
+ exit(0);
+ }
+
+ if (sizeof(long) * CHAR_BIT >= 64)
+ {
+ fprintf(fp, "long\n");
+ exit(0);
+ }
+
+ fprintf(fp, "unknown\n");
+ exit(1);
+ }],
+ [mercury_cv_int_least64_type=`cat conftest.tags`],
+ [mercury_cv_int_least64_type=unknown],
+ [mercury_cv_int_least64_type=unknown])
+)
+if test "$mercury_cv_int_least64_type" = unknown; then
+ AC_TRY_RUN([
+ #include <stdio.h>
+ #include <limits.h>
+ int main() {
+ FILE *fp;
+
+ fp = fopen("conftest.tags", "w");
+ if (fp == NULL)
+ exit(1);
+
+ if (sizeof(long long) * CHAR_BIT >= 64)
+ {
+ fprintf(fp, "long long\n");
+ exit(0);
+ }
+
+ fprintf(fp, "unknown\n");
+ exit(1);
+ }],
+ [mercury_cv_int_least64_type=`cat conftest.tags`],
+ [mercury_cv_int_least64_type=unknown],
+ [mercury_cv_int_least64_type=unknown])
+fi
+AC_MSG_RESULT($mercury_cv_int_least64_type)
+if test "$mercury_cv_int_least64_type" != unknown; then
+ AC_DEFINE_UNQUOTED(MR_INT_LEAST64_TYPE, $mercury_cv_int_least64_type)
+ MR_INT_LEAST64_TYPE=$mercury_cv_int_least64_type
+ AC_SUBST(MR_INT_LEAST64_TYPE)
+fi
+#-----------------------------------------------------------------------------#
+AC_MSG_CHECKING(for an integer type of at least 32 bits)
+AC_CACHE_VAL(mercury_cv_int_least32_type,
+ AC_TRY_RUN([
+ #include <stdio.h>
+ #include <limits.h>
+ int main() {
+ FILE *fp;
+
+ fp = fopen("conftest.tags", "w");
+ if (fp == NULL)
+ exit(1);
+
if (sizeof(int) * CHAR_BIT >= 32)
{
fprintf(fp, "int\n");
@@ -877,14 +813,14 @@
[mercury_cv_int_least32_type=`cat conftest.tags`],
[mercury_cv_int_least32_type=unknown],
[mercury_cv_int_least32_type=unknown])
- )
- AC_MSG_RESULT($mercury_cv_int_least32_type)
- AC_DEFINE_UNQUOTED(MR_INT_LEAST32_TYPE, $mercury_cv_int_least32_type)
- MR_INT_LEAST32_TYPE=$mercury_cv_int_least32_type
- AC_SUBST(MR_INT_LEAST32_TYPE)
+)
+AC_MSG_RESULT($mercury_cv_int_least32_type)
+AC_DEFINE_UNQUOTED(MR_INT_LEAST32_TYPE, $mercury_cv_int_least32_type)
+MR_INT_LEAST32_TYPE=$mercury_cv_int_least32_type
+AC_SUBST(MR_INT_LEAST32_TYPE)
#-----------------------------------------------------------------------------#
- AC_MSG_CHECKING(for an integer type of at least 16 bits)
- AC_CACHE_VAL(mercury_cv_int_least16_type,
+AC_MSG_CHECKING(for an integer type of at least 16 bits)
+AC_CACHE_VAL(mercury_cv_int_least16_type,
AC_TRY_RUN([
#include <stdio.h>
#include <limits.h>
@@ -913,12 +849,11 @@
[mercury_cv_int_least16_type=`cat conftest.tags`],
[mercury_cv_int_least16_type=unknown],
[mercury_cv_int_least16_type=unknown])
- )
- AC_MSG_RESULT($mercury_cv_int_least16_type)
- AC_DEFINE_UNQUOTED(MR_INT_LEAST16_TYPE, $mercury_cv_int_least16_type)
- MR_INT_LEAST16_TYPE=$mercury_cv_int_least16_type
- AC_SUBST(MR_INT_LEAST16_TYPE)
-fi # ! have_int_leastN_t
+)
+AC_MSG_RESULT($mercury_cv_int_least16_type)
+AC_DEFINE_UNQUOTED(MR_INT_LEAST16_TYPE, $mercury_cv_int_least16_type)
+MR_INT_LEAST16_TYPE=$mercury_cv_int_least16_type
+AC_SUBST(MR_INT_LEAST16_TYPE)
#-----------------------------------------------------------------------------#
AC_MSG_CHECKING(the number of low tag bits available)
AC_CACHE_VAL(mercury_cv_low_tag_bits,
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/fact_table.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/fact_table.m,v
retrieving revision 1.25
diff -u -b -r1.25 fact_table.m
--- fact_table.m 1999/06/01 09:43:41 1.25
+++ fact_table.m 1999/06/09 07:27:10
@@ -2529,20 +2529,20 @@
BEGIN_CODE
Define_entry(%s);
mkframe(""%s/%d"", 1, LABEL(%s_i1));
- framevar(0) = (Integer) 0;
+ MR_framevar(1) = (Integer) 0;
GOTO(LABEL(%s_i1));
Define_label(%s_i1);
- if (framevar(0) >= %s) fail();
+ if (MR_framevar(1) >= %s) fail();
{
/* declare argument vars */
%s
- Word ind = framevar(0), tmp;
+ Word ind = MR_framevar(1), tmp;
/* lookup fact table */
%s
/* save output args to registers */
%s
}
- framevar(0)++;
+ MR_framevar(1)++;
succeed();
END_MODULE
@@ -3058,18 +3058,18 @@
%s
/* save output args to registers */
%s
- framevar(0) = ind + 1;
+ MR_framevar(1) = ind + 1;
succeed();
failure_code_%s:
fail();
}
Define_label(%s_i1);
- if (framevar(0) >= %s)
+ if (MR_framevar(1) >= %s)
fail();
{
/* create argument vars */
%s
- int ind = framevar(0);
+ int ind = MR_framevar(1);
/* copy framevars to registers */
%s
/* copy registers to input arg vars */
@@ -3081,7 +3081,7 @@
/* save output args to registers */
%s
}
- framevar(0)++;
+ MR_framevar(1)++;
succeed();
END_MODULE
@@ -3192,10 +3192,10 @@
->
generate_arg_decl_code(VarName, Type, DeclCode0),
( ArgMode = top_in ->
+ NumInputArgs1 is NumInputArgs0 + 1,
generate_arg_input_code(VarName, Type, Loc,
- NumInputArgs0, InputCode0, SaveRegsCode0,
+ NumInputArgs1, InputCode0, SaveRegsCode0,
GetRegsCode0),
- NumInputArgs1 is NumInputArgs0 + 1,
OutputCode0 = ""
; ArgMode = top_out ->
generate_arg_output_code(VarName, Type, Loc,
@@ -3234,9 +3234,9 @@
convert_type_from_mercury(RegName, Type, Converted),
Template = "\t\t%s = %s;\n",
string__format(Template, [s(Name), s(Converted)], InputCode),
- string__format("\t\tframevar(%d) = %s;\n",
+ string__format("\t\tMR_framevar(%d) = %s;\n",
[i(FrameVarNum), s(RegName)], SaveRegCode),
- string__format("\t\t%s = framevar(%d);\n",
+ string__format("\t\t%s = MR_framevar(%d);\n",
[s(RegName), i(FrameVarNum)], GetRegCode).
:- pred generate_arg_output_code(string::in, (type)::in, int::in,
@@ -3357,10 +3357,10 @@
/* save output args to registers */
%s
if (hashval == -1) succeed_discard();
- framevar(0) = hashval;
- framevar(1) = (Word) current_table;
- framevar(2) = (Word) keytype;
- framevar(3) = current_key;
+ MR_framevar(1) = hashval;
+ MR_framevar(2) = (Word) current_table;
+ MR_framevar(3) = (Word) keytype;
+ MR_framevar(4) = current_key;
succeed();
failure_code_%s:
fail();
@@ -3369,10 +3369,10 @@
{
/* create argument vars */
%s
- Integer hashval = framevar(0);
+ Integer hashval = MR_framevar(1);
Word ind;
- void *current_table = (void *)framevar(1);
- char keytype = (char) framevar(2);
+ void *current_table = (void *) MR_framevar(2);
+ char keytype = (char) MR_framevar(3);
/* lookup hash table */
switch(keytype)
@@ -3395,7 +3395,7 @@
/* save output args to registers */
%s
if (hashval == -1) succeed_discard();
- framevar(0) = hashval;
+ MR_framevar(1) = hashval;
succeed();
failure_code_%s:
fail();
@@ -3424,13 +3424,13 @@
generate_hash_code(PragmaVars, ArgTypes, ModuleInfo, LabelName, 0,
PredName, 1, FactTableSize, HashCode),
- generate_hash_lookup_code("(char *)framevar(3)", LabelName2, 0,
+ generate_hash_lookup_code("(char *) MR_framevar(4)", LabelName2, 0,
"strcmp(%s, %s) == 0", 's', no, "", [], [], ModuleInfo, 0, 0,
StringHashLookupCode),
- generate_hash_lookup_code("framevar(3)", LabelName2, 1, "%s == %s",
+ generate_hash_lookup_code("MR_framevar(4)", LabelName2, 1, "%s == %s",
'i', no, "", [], [], ModuleInfo, 0, 0, IntHashLookupCode),
- generate_hash_lookup_code("word_to_float(framevar(3))", LabelName2, 2,
- "%s == %s", 'f', no, "", [], [], ModuleInfo, 0, 0,
+ generate_hash_lookup_code("word_to_float(MR_framevar(4))", LabelName2,
+ 2, "%s == %s", 'f', no, "", [], [], ModuleInfo, 0, 0,
FloatHashLookupCode),
generate_fact_lookup_code(PredName, PragmaVars, ArgTypes, ModuleInfo, 1,
FactTableSize, FactLookupCode),
Index: compiler/llds_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/llds_out.m,v
retrieving revision 1.113
diff -u -b -r1.113 llds_out.m
--- llds_out.m 1999/05/28 05:26:22 1.113
+++ llds_out.m 1999/06/10 02:00:10
@@ -2390,12 +2390,12 @@
:- pred output_llds_type(llds_type::in, io__state::di, io__state::uo) is det.
-output_llds_type(int_least8) --> io__write_string("int_least8_t").
-output_llds_type(uint_least8) --> io__write_string("uint_least8_t").
-output_llds_type(int_least16) --> io__write_string("int_least16_t").
-output_llds_type(uint_least16) --> io__write_string("uint_least16_t").
-output_llds_type(int_least32) --> io__write_string("int_least32_t").
-output_llds_type(uint_least32) --> io__write_string("uint_least32_t").
+output_llds_type(int_least8) --> io__write_string("MR_int_least8_t").
+output_llds_type(uint_least8) --> io__write_string("MR_uint_least8_t").
+output_llds_type(int_least16) --> io__write_string("MR_int_least16_t").
+output_llds_type(uint_least16) --> io__write_string("MR_uint_least16_t").
+output_llds_type(int_least32) --> io__write_string("MR_int_least32_t").
+output_llds_type(uint_least32) --> io__write_string("MR_uint_least32_t").
output_llds_type(bool) --> io__write_string("Integer").
output_llds_type(integer) --> io__write_string("Integer").
output_llds_type(unsigned) --> io__write_string("Unsigned").
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/exceptions
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing library
Index: library/benchmarking.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/benchmarking.m,v
retrieving revision 1.24
diff -u -b -r1.24 benchmarking.m
--- benchmarking.m 1999/06/01 09:45:42 1.24
+++ benchmarking.m 1999/06/09 07:19:56
@@ -588,13 +588,13 @@
/*
** Create a nondet stack frame. The contents of the slots:
**
- ** framevar(0): the closure to be called.
- ** framevar(1): the input for the closure.
- ** framevar(2): the number of iterations left to be done.
- ** framevar(3): the number of solutions found so far.
- ** framevar(4): the time at entry to the first iteration.
- ** framevar(5): the saved heap pointer
- ** framevar(6): the saved trail pointer (if trailing enabled)
+ ** MR_framevar(1): the closure to be called.
+ ** MR_framevar(2): the input for the closure.
+ ** MR_framevar(3): the number of iterations left to be done.
+ ** MR_framevar(4): the number of solutions found so far.
+ ** MR_framevar(5): the time at entry to the first iteration.
+ ** MR_framevar(6): the saved heap pointer
+ ** MR_framevar(7): the saved trail pointer (if trailing enabled)
**
** We must make that the closure is called at least once,
** otherwise the count we return isn't valid.
@@ -603,22 +603,22 @@
mkframe(""benchmark_nondet"", BENCHMARK_NONDET_STACK_SLOTS,
LABEL(mercury__benchmarking__benchmark_nondet_5_0_i2));
- framevar(0) = r3;
- framevar(1) = r4;
+ MR_framevar(1) = r3;
+ MR_framevar(2) = r4;
/* r5 is the repetition count */
if ((Integer) r5 <= 0) {
- framevar(2) = 1;
+ MR_framevar(3) = 1;
} else {
- framevar(2) = r5;
+ MR_framevar(3) = r5;
}
- framevar(3) = 0;
- mark_hp(framevar(5));
+ MR_framevar(4) = 0;
+ mark_hp(MR_framevar(6));
#ifdef MR_USE_TRAIL
- framevar(6) = (Word) MR_trail_ptr;
+ MR_framevar(7) = (Word) MR_trail_ptr;
#endif
- framevar(4) = MR_get_user_cpu_miliseconds();
+ MR_framevar(5) = MR_get_user_cpu_miliseconds();
/* call the higher-order pred closure that we were passed in r3 */
r1 = r3;
@@ -634,7 +634,7 @@
LABEL(mercury__benchmarking__benchmark_nondet_5_0));
/* we found a solution */
- framevar(3) = framevar(3) + 1;
+ MR_framevar(4) = MR_framevar(4) + 1;
redo();
Define_label(mercury__benchmarking__benchmark_nondet_5_0_i2);
@@ -642,32 +642,32 @@
LABEL(mercury__benchmarking__benchmark_nondet_5_0));
/* no more solutions for this iteration, so mark it completed */
- framevar(2) = framevar(2) - 1;
+ MR_framevar(3) = MR_framevar(3) - 1;
/* we can now reclaim memory by resetting the heap pointer */
- restore_hp(framevar(5));
+ restore_hp(MR_framevar(6));
#ifdef MR_USE_TRAIL
/* ... and the trail pointer */
- MR_trail_ptr = (MR_TrailEntry *) framevar(6);
+ MR_trail_ptr = (MR_TrailEntry *) MR_framevar(7);
#endif
/* are there any other iterations? */
- if (framevar(2) > 0) {
+ if (MR_framevar(3) > 0) {
/* yes, so reset the solution counter */
/* and then set up the call just like last time */
- framevar(3) = 0;
- r1 = framevar(0);
+ MR_framevar(4) = 0;
+ r1 = MR_framevar(1);
r2 = (Word) 1;
r3 = (Word) 1;
- r4 = framevar(1);
+ r4 = MR_framevar(2);
call(ENTRY(mercury__do_call_closure),
LABEL(mercury__benchmarking__benchmark_nondet_5_0_i1),
LABEL(mercury__benchmarking__benchmark_nondet_5_0));
}
/* no more iterations */
- r1 = framevar(3);
- r2 = MR_get_user_cpu_miliseconds() - framevar(4);
+ r1 = MR_framevar(4);
+ r2 = MR_get_user_cpu_miliseconds() - MR_framevar(5);
succeed_discard();
END_MODULE
cvs diff: Diffing profiler
cvs diff: Diffing runtime
Index: runtime/mercury_conf.h.in
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_conf.h.in,v
retrieving revision 1.21
diff -u -b -r1.21 mercury_conf.h.in
--- mercury_conf.h.in 1999/05/31 18:25:27 1.21
+++ mercury_conf.h.in 1999/06/10 02:56:07
@@ -46,13 +46,13 @@
#undef MR_WORD_TYPE
/*
-** MR_INT_LEAST16_TYPE:
-** This must be a C integral type (e.g. short, int)
+** MR_INT_LEAST64_TYPE:
+** This must be a C integral type (e.g. int, long, long long)
** without any explicit signedness.
-** It ought to be at least 16 bits in size.
-** It may be bigger, but any bits beyond 16 are not used.
+** It ought to be at least 64 bits in size.
+** It may be bigger, but any bits beyond 64 are not used.
*/
-#undef MR_INT_LEAST16_TYPE
+#undef MR_INT_LEAST64_TYPE
/*
** MR_INT_LEAST32_TYPE:
@@ -64,6 +64,15 @@
#undef MR_INT_LEAST32_TYPE
/*
+** MR_INT_LEAST16_TYPE:
+** This must be a C integral type (e.g. short, int)
+** without any explicit signedness.
+** It ought to be at least 16 bits in size.
+** It may be bigger, but any bits beyond 16 are not used.
+*/
+#undef MR_INT_LEAST16_TYPE
+
+/*
** LOW_TAG_BITS: an integer, specifying the number of low-order tag bits
** we can use. Normally this is the base-2 log of the word size in bytes.
*/
@@ -92,9 +101,6 @@
** HAVE_SYS_PARAM we have <sys/param.h>
** HAVE_SYS_WAIT we have <sys/wait.h>
** HAVE_DLFCN_H we have <dlfcn.h>
-** HAVE_STDINT we have <stdint.h>
-** HAVE_INTTYPES we have <inttypes.h>
-** HAVE_SYS_TYPES we have <sys/types.h>
*/
#undef HAVE_SYS_SIGINFO
#undef HAVE_UCONTEXT
@@ -104,9 +110,6 @@
#undef HAVE_SYS_PARAM
#undef HAVE_SYS_WAIT
#undef HAVE_DLFCN_H
-#undef HAVE_STDINT
-#undef HAVE_INTTYPES
-#undef HAVE_SYS_TYPES
/*
** The following macros are defined iff the corresponding type
Index: runtime/mercury_stack_layout.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_stack_layout.h,v
retrieving revision 1.25
diff -u -b -r1.25 mercury_stack_layout.h
--- mercury_stack_layout.h 1999/05/28 05:29:09 1.25
+++ mercury_stack_layout.h 1999/06/10 04:14:50
@@ -42,7 +42,7 @@
** that we do not set the 1 bit unless we also set the 2 bit.
*/
-typedef int_least16_t MR_Determinism;
+typedef MR_int_least16_t MR_Determinism;
#define MR_DETISM_DET 6
#define MR_DETISM_SEMI 2
@@ -70,10 +70,11 @@
*/
/*
-** MR_Long_Lval is a uint_least32_t which describes an location. This includes
-** lvals such as stack slots, general registers, and special registers
-** such as succip, hp, etc, as well as locations whose address is given
-** as a typeinfo inside the type class info structure pointed to by an lval.
+** MR_Long_Lval is a MR_uint_least32_t which describes an location.
+** This includes lvals such as stack slots, general registers, and special
+** registers such as succip, hp, etc, as well as locations whose address is
+** given as a typeinfo inside the type class info structure pointed to by an
+** lval.
**
** What kind of location an MR_Long_Lval refers to is encoded using
** a low tag with MR_LONG_LVAL_TAGBITS bits; the type MR_Lval_Type describes
@@ -104,7 +105,7 @@
** which must be kept in sync with the constants and macros defined here.
*/
-typedef uint_least32_t MR_Long_Lval;
+typedef MR_uint_least32_t MR_Long_Lval;
typedef enum {
MR_LONG_LVAL_TYPE_R,
@@ -149,9 +150,9 @@
((Word) ((n) << MR_LONG_LVAL_TAGBITS) + MR_LONG_LVAL_TYPE_R)
/*
-** MR_Short_Lval is a uint_least8_t which describes an location. This includes
-** lvals such as stack slots and general registers that have small numbers,
-** and special registers such as succip, hp, etc.
+** MR_Short_Lval is a MR_uint_least8_t which describes an location. This
+** includes lvals such as stack slots and general registers that have small
+** numbers, and special registers such as succip, hp, etc.
**
** What kind of location an MR_Long_Lval refers to is encoded using
** a low tag with 2 bits; the type MR_Short_Lval_Type describes
@@ -168,7 +169,7 @@
** which must be kept in sync with the constants and macros defined here.
*/
-typedef uint_least8_t MR_Short_Lval;
+typedef MR_uint_least8_t MR_Short_Lval;
typedef enum {
MR_SHORT_LVAL_TYPE_R,
@@ -213,7 +214,7 @@
*/
typedef struct MR_Type_Param_Locns_Struct {
- uint_least32_t MR_tp_param_count;
+ MR_uint_least32_t MR_tp_param_count;
MR_Long_Lval MR_tp_param_locns[MR_VARIABLE_SIZED];
} MR_Type_Param_Locns;
@@ -230,8 +231,8 @@
*/
typedef struct MR_Var_Name_Struct {
- uint_least16_t MR_var_num;
- uint_least16_t MR_var_name_offset;
+ MR_uint_least16_t MR_var_num;
+ MR_uint_least16_t MR_var_name_offset;
} MR_Var_Name;
/*
@@ -265,11 +266,12 @@
#define MR_end_of_var_ptis(slvs) \
(&MR_var_pti((slvs), MR_all_desc_var_count(slvs)))
#define MR_long_desc_var_locn(slvs, i) \
- (((uint_least32_t *) MR_end_of_var_ptis(slvs))[(i)])
+ (((MR_uint_least32_t *) MR_end_of_var_ptis(slvs))[(i)])
#define MR_end_of_long_desc_var_locns(slvs) \
(&MR_long_desc_var_locn((slvs), MR_long_desc_var_count(slvs)))
#define MR_short_desc_var_locn(slvs, i) \
- (((uint_least8_t *) MR_end_of_long_desc_var_locns(slvs))[(i)])
+ (((MR_uint_least8_t *) \
+ MR_end_of_long_desc_var_locns(slvs))[(i)])
#define MR_name_if_present(module_layout, vars, i) \
(((vars)->MR_slvs_names == NULL) ? "" : \
@@ -351,7 +353,7 @@
/* stack traversal group */
Code *MR_sle_code_addr;
MR_Long_Lval MR_sle_succip_locn;
- int_least16_t MR_sle_stack_slots;
+ MR_int_least16_t MR_sle_stack_slots;
MR_Determinism MR_sle_detism;
/* proc id group */
@@ -362,8 +364,8 @@
*MR_sle_call_label;
struct MR_Module_Layout_Struct
*MR_sle_module_layout;
- int_least16_t MR_sle_maybe_from_full;
- int_least16_t MR_sle_maybe_decl_debug;
+ MR_int_least16_t MR_sle_maybe_from_full;
+ MR_int_least16_t MR_sle_maybe_decl_debug;
} MR_Stack_Layout_Entry;
#define MR_sle_user MR_sle_proc_id.MR_proc_user
Index: runtime/mercury_types.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_types.h,v
retrieving revision 1.17
diff -u -b -r1.17 mercury_types.h
--- mercury_types.h 1999/05/31 18:25:28 1.17
+++ mercury_types.h 1999/06/10 04:20:40
@@ -22,45 +22,38 @@
#include "mercury_conf.h"
/*
-** This section defines the relevant types from C9X's
-** <stdint.h> header, either by including that header,
-** or if necessary by emulating it ourselves, with some
-** help from the autoconfiguration script.
+** This section defines type similar to C9X's <stdint.h> header.
+** We do not use this header file, or the <inttypes.h> or <sys/types.h> files
+** that substitute for it on some systems because (a) some such files
+** do not define the types we need, and (b) some such files include
+** things that conflict with our desire to reserve some real machine registers
+** for Mercury abstract machine registers.
*/
-#ifdef HAVE_STDINT
- #include <stdint.h>
-#endif
-#ifdef HAVE_INTTYPES
- #include <inttypes.h>
-#endif
-#ifdef HAVE_SYS_TYPES
- #include <sys/types.h>
-#endif
+typedef unsigned MR_WORD_TYPE MR_uintptr_t;
+typedef MR_WORD_TYPE MR_intptr_t;
-#ifndef MR_HAVE_INTPTR_T
- typedef unsigned MR_WORD_TYPE uintptr_t;
- typedef MR_WORD_TYPE intptr_t;
+#ifdef MR_INT_LEAST64_TYPE
+typedef unsigned MR_INT_LEAST64_TYPE MR_uint_least64_t;
+typedef MR_INT_LEAST64_TYPE MR_int_least64_t;
#endif
-#ifndef MR_HAVE_INT_LEASTN_T
- typedef unsigned MR_INT_LEAST32_TYPE uint_least32_t;
- typedef MR_INT_LEAST32_TYPE int_least32_t;
- typedef unsigned MR_INT_LEAST16_TYPE uint_least16_t;
- typedef MR_INT_LEAST16_TYPE int_least16_t;
- typedef unsigned char uint_least8_t;
- typedef signed char int_least8_t;
-#endif
+typedef unsigned MR_INT_LEAST32_TYPE MR_uint_least32_t;
+typedef MR_INT_LEAST32_TYPE MR_int_least32_t;
+typedef unsigned MR_INT_LEAST16_TYPE MR_uint_least16_t;
+typedef MR_INT_LEAST16_TYPE MR_int_least16_t;
+typedef unsigned char MR_uint_least8_t;
+typedef signed char MR_int_least8_t;
/*
** This section defines the basic types that we use.
** Note that we require sizeof(Word) == sizeof(Integer) == sizeof(Code*).
*/
-typedef uintptr_t Word;
-typedef intptr_t Integer;
-typedef uintptr_t Unsigned;
-typedef intptr_t Bool;
+typedef MR_uintptr_t Word;
+typedef MR_intptr_t Integer;
+typedef MR_uintptr_t Unsigned;
+typedef MR_intptr_t Bool;
/*
** `Code *' is used as a generic pointer-to-label type that can point
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
Index: trace/mercury_trace.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace.c,v
retrieving revision 1.10
diff -u -b -r1.10 mercury_trace.c
--- mercury_trace.c 1999/05/28 05:29:39 1.10
+++ mercury_trace.c 1999/06/10 04:16:00
@@ -58,7 +58,7 @@
MR_Trace_Port port, Unsigned seqno, Unsigned depth,
const char *path, int max_r_num);
static Word MR_trace_find_input_arg(const MR_Stack_Layout_Label *label,
- Word *saved_regs, uint_least16_t var_num,
+ Word *saved_regs, MR_uint_least16_t var_num,
bool *succeeded);
/*
@@ -423,7 +423,7 @@
static Word
MR_trace_find_input_arg(const MR_Stack_Layout_Label *label, Word *saved_regs,
- uint_least16_t var_num, bool *succeeded)
+ MR_uint_least16_t var_num, bool *succeeded)
{
const MR_Stack_Layout_Vars *vars;
int i;
cvs diff: Diffing trial
cvs diff: Diffing util
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list