[m-dev.] argument packing

Peter Wang novalazy at gmail.com
Thu May 17 10:57:33 AEST 2018


On Thu, 17 May 2018 01:26:10 +0200 (CEST), "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> diff --git a/compiler/handle_options.m b/compiler/handle_options.m
> index dce8cd8..6695702 100644
> --- a/compiler/handle_options.m
> +++ b/compiler/handle_options.m
> @@ -1344,14 +1344,17 @@ convert_options_to_globals(OptionTable0, OpMode, Target,
>      ),
>  
>      % Argument packing only works on C back-ends with low-level data.
> -    % In the future, we may want to use C bit-field syntax for high-level data.
> -    % For other back-ends, any RTTI code will need to be updated to cope with
> -    % packed arguments.
> -    %
> -    % Only C targets may store a constructor argument across two words.
> -    option_implies(highlevel_data, arg_pack_bits, int(0), !Globals),
> -    (
> +    % In the future, we may want to use C bit-field syntax on C backends
> +    % with high-level data. For the other target languages, implementing
> +    % argument packing will not just a lot of work on RTTI, but also
> +    % generalizing field addressing, to allow both single fields and
> +    % a group of adjacent fields packed into a single word to be
> +    % addressed via a mechanism other than an argument's name.
> +    globals.lookup_bool_option(!.Globals, highlevel_data, HighLevelData),
> +    ( if
>          Target = target_c,
> +        HighLevelData = yes
> +    then
>          globals.lookup_int_option(!.Globals, arg_pack_bits, ArgPackBits0),
>          globals.lookup_int_option(!.Globals, bits_per_word, BitsPerWord),
>          % If --arg-pack-bits is negative then it means use all word bits.

HighLevelData = no

Peter


More information about the developers mailing list