On Tue, 2021-05-18 at 16:39 -0400, Michael Meissner wrote:
> [PATCH] Change rs6000_const_f32_to_i32 return type.
>
> The function rs6000_const_f32_to_i32 called REAL_VALUE_TO_TARGET_SINGLE
> with a long long type and returns it. This patch changes the type to long
> which is the proper type for REAL_VALUE_TO_TARGET_SINGLE.
ok
That seems consistent with the tm.texi blurb:
For @code{REAL_VALUE_TO_TARGET_SINGLE} and
@code{REAL_VALUE_TO_TARGET_DECIMAL32}, this variable should be
a simple @code{long int}.
>
> I have done bootstraps on little endian power9 and big endian power8 systems.
> Can I check this into the trunk?
>
> This does not need to go into GCC 11, unless some of the other patches that
> use
> this function are also back ported.
>
> gcc/
> 2021-05-18 Michael Meissner <[email protected]>
>
> * config/rs6000/rs6000-protos.h (rs6000_const_f32_to_i32): Change
> return type to long.
> * config/rs6000/rs6000.c (rs6000_const_f32_to_i32): Change return
> type to long.
> ---
> gcc/config/rs6000/rs6000-protos.h | 2 +-
> gcc/config/rs6000/rs6000.c | 6 ++++--
> 2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/gcc/config/rs6000/rs6000-protos.h
> b/gcc/config/rs6000/rs6000-protos.h
> index bef727e0a64..c407034d58c 100644
> --- a/gcc/config/rs6000/rs6000-protos.h
> +++ b/gcc/config/rs6000/rs6000-protos.h
> @@ -282,7 +282,7 @@ extern void rs6000_asm_output_dwarf_pcrel (FILE *file,
> int size,
> const char *label);
> extern void rs6000_asm_output_dwarf_datarel (FILE *file, int size,
> const char *label);
> -extern long long rs6000_const_f32_to_i32 (rtx operand);
> +extern long rs6000_const_f32_to_i32 (rtx operand);
>
> /* Declare functions in rs6000-c.c */
ok
>
> diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
> index 86f53297cb9..ef1ebaaee05 100644
> --- a/gcc/config/rs6000/rs6000.c
> +++ b/gcc/config/rs6000/rs6000.c
> @@ -27937,10 +27937,12 @@ rs6000_invalid_conversion (const_tree fromtype,
> const_tree totype)
> return NULL;
> }
>
> -long long
> +/* Convert a SFmode constant to the integer bit pattern. */
> +
> +long
> rs6000_const_f32_to_i32 (rtx operand)
> {
> - long long value;
> + long value;
> const struct real_value *rv = CONST_DOUBLE_REAL_VALUE (operand);
ok
Thanks
-Will
>
> gcc_assert (GET_MODE (operand) == SFmode);
> --
> 2.31.1
>