[m-rev.] for review: add new grade component for unboxed 64-bit integers

Julien Fischer jfischer at opturion.com
Tue Jan 30 11:09:09 AEDT 2018


For review by anyone.

Add new grade component for unboxed 64-bit integers.

Add a new grade component that indicates whether 64-bit integers are boxed or
not.  This is similar to the existing "ubf" component for unboxed floats,
except that its meaning is not also tied up with whether floats are single
precision or not.  (If it wasn't for this latter thing we could just have
single component that indicates whether 64-bit types in general are boxed or
not.)

runtime/mercury_grade.h:
     Add the new component.

     Bump the binary compatibility version number.

compiler/c_util.m:
      Print information about whether 64-bit integers are boxed or not in the
      comment at the head of the file.  The C file compatibility check in the
      configure script will eventually require this information.

Julien.

diff --git a/compiler/c_util.m b/compiler/c_util.m
index d67f400..3e0a218 100644
--- a/compiler/c_util.m
+++ b/compiler/c_util.m
@@ -1037,6 +1037,8 @@ output_c_file_intro_and_grade(Globals, SourceFileName, Version, Fullarch,
      string.int_to_string(NumTagBits, NumTagBitsStr),
      globals.lookup_bool_option(Globals, unboxed_float, UnboxedFloat),
      UnboxedFloatStr = convert_bool_to_string(UnboxedFloat),
+    globals.lookup_bool_option(Globals, unboxed_int64s, UnboxedInt64s),
+    UnboxedInt64sStr = convert_bool_to_string(UnboxedInt64s),
      globals.lookup_bool_option(Globals, pregenerated_dist, PregeneratedDist),
      PregeneratedDistStr = convert_bool_to_string(PregeneratedDist),
      globals.lookup_bool_option(Globals, highlevel_code, HighLevelCode),
@@ -1055,6 +1057,7 @@ output_c_file_intro_and_grade(Globals, SourceFileName, Version, Fullarch,
          "**\n",
          "** TAG_BITS=", NumTagBitsStr, "\n",
          "** UNBOXED_FLOAT=", UnboxedFloatStr, "\n",
+        "** UNBOXED_INT64S=", UnboxedInt64sStr, "\n",
          "** PREGENERATED_DIST=", PregeneratedDistStr, "\n",
          "** HIGHLEVEL_CODE=", HighLevelCodeStr, "\n",
          "**\n",
diff --git a/runtime/mercury_grade.h b/runtime/mercury_grade.h
index 501d5fd..c8f0bff 100644
--- a/runtime/mercury_grade.h
+++ b/runtime/mercury_grade.h
@@ -1,6 +1,7 @@
  // vim: ts=4 sw=4 expandtab ft=c

-// Copyright (C) 1997-2011 The University of Melbourne.
+// Copyright (C) 1997-2012 The University of Melbourne.
+// Copyright (C) 2013-2014, 2016-2018 The Mercury team.
  // This file may only be copied under the terms of the GNU Library General
  // Public License - see the file COPYING.LIB in the Mercury distribution.

@@ -76,7 +77,7 @@
  // breaks binary backwards compatibility only in debugging, deep profiling
  // and low-level C parallel grades respectively.

-#define MR_GRADE_PART_0 v19_
+#define MR_GRADE_PART_0 v20_
  #define MR_GRADE_EXEC_TRACE_VERSION_NO  12
  #define MR_GRADE_DEEP_PROF_VERSION_NO   4
  #define MR_GRADE_LLC_PAR_VERSION_NO 1
@@ -499,8 +500,16 @@
    #define MR_GRADE_OPT_PART_18  MR_GRADE_OPT_PART_17
  #endif

-#define MR_GRADE                MR_GRADE_PART_18
-#define MR_GRADE_OPT            MR_GRADE_OPT_PART_18
+#if defined(MR_BOXED_INT64S)
+  #define MR_GRADE_PART_19     MR_GRADE_PART_18
+  #define MR_GRADE_OPT_PART_19 MR_GRADE_OPT_PART_18
+#else                          // "ubi64" stands for "unboxed integers 64-bit"
+  #define MR_GRADE_PART_19     MR_PASTE2(MR_GRADE_PART_18, _ubi64)
+  #define MR_GRADE_OPT_PART_19 MR_GRADE_OPT_PART_18
+#endif
+
+#define MR_GRADE                MR_GRADE_PART_19
+#define MR_GRADE_OPT            MR_GRADE_OPT_PART_19

  #define MR_GRADE_VAR            MR_PASTE2(MR_grade_,MR_GRADE)
  #define MR_GRADE_STRING         MR_STRINGIFY(MR_GRADE)




More information about the reviews mailing list