[m-rev.] for post-commit review: ops on double word int64s

Julien Fischer jfischer at opturion.com
Wed Mar 28 13:30:40 AEDT 2018


Hi Zoltan,

On Wed, 28 Mar 2018, Zoltan Somogyi wrote:

> diff --git a/compiler/opt_debug.m b/compiler/opt_debug.m
> index 7574c5e..add6d09 100644
> --- a/compiler/opt_debug.m
> +++ b/compiler/opt_debug.m

...

> @@ -186,23 +177,17 @@
>    #define MR_float_const(f) MR_float_to_word(f)
>
>    #if defined(MR_GNUC) || defined(MR_CLANG)
> -
> -    // GNU C allows you to cast to a union type.
> -    // clang also provides this extension.
> -
> -    #define MR_float_to_word(f) (__extension__                          \
> -                                ((union MR_Float_Word)(MR_Float)(f)).w)
> -    #define MR_word_to_float(w) (__extension__                          \
> -                                ((union MR_Float_Word)(MR_Word)(w)).f)
> -
> -  #else // not MR_GNUC or MR_CLANG
> -
> +    // GNU C and clag both allow you to cast to a union type.

s/clag/clang/ there.

> +    #define MR_float_to_word(f)                                             \
> +        (__extension__ ((union MR_Float_Word) (MR_Float) (f)).w)
> +    #define MR_word_to_float(w)                                             \
> +        (__extension__ ((union MR_Float_Word) (MR_Word) (w)).f)
> +  #else // ! (defined(MR_GNUC) || defined(MR_CLANG))
>      static MR_Word MR_float_to_word(MR_Float f)
>          { union MR_Float_Word tmp; tmp.f = f; return tmp.w; }
>      static MR_Float MR_word_to_float(MR_Word w)
>          { union MR_Float_Word tmp; tmp.w = w; return tmp.f; }
> -
> -  #endif // not MR_GNUC or MR_CLANG
> +  #endif // defined(MR_GNUC) || defined(MR_CLANG)
>
>  #endif // not MR_BOXED_FLOAT

Looks fine otherwise.

Julien.


More information about the reviews mailing list