On Tue, Feb 18, 2025 at 10:52 PM James K. Lowden
<jklow...@schemamania.org> wrote:
>
> From f89a50238de62b73d9fc44ee7226461650ab119d Tue 18 Feb 2025 04:19:11 PM EST
> From: "James K. Lowden" <jklow...@symas.com>
> Date: Tue 18 Feb 2025 04:19:11 PM EST
> Subject: [PATCH] COBOL  8/14 516K api: GENERIC interface

A few comments about this:

> +static
> +void
> +treeplet_fill_source(TREEPLET &treeplet, cbl_refer_t &refer)
> +  {
> +  treeplet.pfield = gg_get_address_of(refer.field->var_decl_node);
> +  treeplet.offset = refer_offset_source(refer);
> +  treeplet.length = refer_size_source(refer);
> +  }

This function (and many others) are missing a comment in the front
describing what it does with each argument.

> +            _Float128 src = (_Float128)sourceref.field->data.value;

Is this in the front-end or is this in the target library.  Either way
I see it is used unconditionally.
For the front-end, you should use the real.h interface for floats. For
the target you need to use it only conditionally otherwise it won't
work on targets which don't have _Float128.
I noticed __int128 use in this file too. The same thing applies here
except for the front-end, you should use the wide-int.h interface. And
only define it conditionally for target code.

Also you can't use 128bit integer as a tree type either unless you
check the target supports it. There is at least one 64bit GCC target
which does NOT support 128bit integers (HPPA64).

I see strfromf128 is used here but that was only added to glibc in
2017 and GCC still supports older glibc that don't have full _Float128
support. see above about using real.h.

Thanks,
Andrew Pinski

Reply via email to