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

Julien Fischer jfischer at opturion.com
Tue Jan 30 14:04:04 AEDT 2018


Hi Zoltan,

On Tue, 30 Jan 2018, Zoltan Somogyi wrote:

> On Mon, 29 Jan 2018 19:09:09 -0500 (EST), Julien Fischer <jfischer at opturion.com> wrote:
>> Add a new grade component that indicates whether 64-bit integers are boxed or
>> not.
>
> Are you proposing it to be a permanent grade, or just a temporary device
> to simplify the switchover from the current default of not using unboxed 64 bit ints
> even on 64 bit platforms to using them by default?

It's a permanent grade component; it's not a user-visible though.  We do
the same thing for floats with the "ubf" component in order to avoid
linking code that uses unboxed floats with code that uses boxed floats.
Note that both floats and 64-bit integers may still be boxed on 64-bit
platforms, e.g. in the .pregen grades.

>> runtime/mercury_grade.h:
>>      Bump the binary compatibility version number.
>
> Why? I see that in options.m, the default value of unboxed_int64s is "no",

It's always going to be "no" in options.m.  The actual value will
eventually be set in Mercury.config by the configure script.

> so there should be no effect in binary compatibility in existing grades.
> The incompatibility will be *between* grades. Wouldn't the right time
> to do the bump be when we switch the default from no ubi64 to ubi64
> on 64 bit machines?

It will have to be done at some point; I'm not anticipating there
being too much of delay with enabling unboxed 64-bit integers.

>> @@ -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
>
> The definition of MR_GRADE_OPT_PART_19 should add ".ubi64" to
> MR_GRADE_OPT_PART_18 if unboxed 64 bit ints is not the default.

The MR_GRADE_OPT marcro is only intended for user-visible grade
components; this isn't one.

Julien.


More information about the reviews mailing list