[m-rev.] for review: enable the use of unboxed 64-bit integers

Julien Fischer jfischer at opturion.com
Sat Feb 17 17:29:00 AEDT 2018


On Sat, 17 Feb 2018, Peter Wang wrote:

> On Fri, 16 Feb 2018 03:59:46 -0500 (EST), Julien Fischer <jfischer at opturion.com> wrote:
>> diff --git a/configure.ac b/configure.ac
>> index a47734d..f53b58d 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -2329,11 +2329,28 @@ AC_SUBST(MR_LONG_DOUBLE_IS_64_BIT)
>>
>>   #-----------------------------------------------------------------------------#
>>
>> -# XXX INT64 -- while we are boostrapping the changes that introduce int64
>> -# and uint64, we always box them.  Support for unboxed 64-bit integer types
>> -# will be enabled later.
>> -
>> -AC_DEFINE(MR_BOXED_INT64S)
>> +AC_MSG_CHECKING([whether we can use unboxed 64-bit integers])
>> +AC_CACHE_VAL([mercury_cv_unboxed_int64s],
>> +    AC_TRY_RUN([
>
> Run-time tests don't work when cross compiling.

True, but that's already a problem with a lot of the existing tests in
the configure script.

> We should be able to use a compile-time test, e.g. the trick in
> MR_STATIC_ASSERT.

Ok, although as a separate change; since we now require C99 we
could actually get rid of a few of them as well.

>> +    #include <stdint.h>
>> +    int main() {
>> +        if (sizeof(uint64_t) == sizeof(void *))
>> +            exit(0);
>> +        else
>> +            exit(1);
>> +        }],
>> +        [mercury_cv_unboxed_int64s=yes],
>> +        [mercury_cv_unboxed_int64s=no],
>> +        [mercury_cv_unboxed_int64s=no])
>> +)
>> +AC_MSG_RESULT($mercury_cv_unbxed_int64s)
>
> unboxed

Fixed.

Julien.


More information about the reviews mailing list