public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Repost: [PATCH] Change rs6000_const_f32_to_i32 return type.
@ 2021-07-07 19:59 Michael Meissner
  2021-07-12 16:07 ` Bill Schmidt
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Meissner @ 2021-07-07 19:59 UTC (permalink / raw)
  To: gcc-patches, Michael Meissner, Segher Boessenkool,
	David Edelsohn, Bill Schmidt, Peter Bergner, Will Schmidt

[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.

2021-07-07  Michael Meissner  <meissner@linux.ibm.com>

gcc/
	* 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 9de294d3b28..94bf961c6b7 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -281,7 +281,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 */
 
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 9a5db63d0ef..de11de5e079 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -27936,10 +27936,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);
 
   gcc_assert (GET_MODE (operand) == SFmode);
-- 
2.31.1


-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meissner@linux.ibm.com, phone: +1 (978) 899-4797

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Repost: [PATCH] Change rs6000_const_f32_to_i32 return type.
  2021-07-07 19:59 Repost: [PATCH] Change rs6000_const_f32_to_i32 return type Michael Meissner
@ 2021-07-12 16:07 ` Bill Schmidt
  2021-07-12 19:37   ` David Edelsohn
  0 siblings, 1 reply; 3+ messages in thread
From: Bill Schmidt @ 2021-07-12 16:07 UTC (permalink / raw)
  To: Michael Meissner, gcc-patches, Segher Boessenkool,
	David Edelsohn, Peter Bergner, Will Schmidt

Hi Mike,

On 7/7/21 2:59 PM, 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.
>
> 2021-07-07  Michael Meissner  <meissner@linux.ibm.com>
>
> gcc/
> 	* 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 9de294d3b28..94bf961c6b7 100644
> --- a/gcc/config/rs6000/rs6000-protos.h
> +++ b/gcc/config/rs6000/rs6000-protos.h
> @@ -281,7 +281,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 */
>   
> diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
> index 9a5db63d0ef..de11de5e079 100644
> --- a/gcc/config/rs6000/rs6000.c
> +++ b/gcc/config/rs6000/rs6000.c
> @@ -27936,10 +27936,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);
>   
>     gcc_assert (GET_MODE (operand) == SFmode);

These changes look OK.  Can you please also fix the expander for 
xxspltiw_v4sf, which incorrectly expects a long long?

I can't approve, but recommend approval with that also fixed.

Thanks!
Bill


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Repost: [PATCH] Change rs6000_const_f32_to_i32 return type.
  2021-07-12 16:07 ` Bill Schmidt
@ 2021-07-12 19:37   ` David Edelsohn
  0 siblings, 0 replies; 3+ messages in thread
From: David Edelsohn @ 2021-07-12 19:37 UTC (permalink / raw)
  To: Bill Schmidt, Michael Meissner
  Cc: GCC Patches, Segher Boessenkool, Peter Bergner, Will Schmidt

On Mon, Jul 12, 2021 at 12:07 PM Bill Schmidt <wschmidt@linux.ibm.com> wrote:
>
> Hi Mike,
>
> On 7/7/21 2:59 PM, 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.
> >
> > 2021-07-07  Michael Meissner  <meissner@linux.ibm.com>
> >
> > gcc/
> >       * 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 9de294d3b28..94bf961c6b7 100644
> > --- a/gcc/config/rs6000/rs6000-protos.h
> > +++ b/gcc/config/rs6000/rs6000-protos.h
> > @@ -281,7 +281,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 */
> >
> > diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
> > index 9a5db63d0ef..de11de5e079 100644
> > --- a/gcc/config/rs6000/rs6000.c
> > +++ b/gcc/config/rs6000/rs6000.c
> > @@ -27936,10 +27936,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);
> >
> >     gcc_assert (GET_MODE (operand) == SFmode);
>
> These changes look OK.  Can you please also fix the expander for
> xxspltiw_v4sf, which incorrectly expects a long long?
>
> I can't approve, but recommend approval with that also fixed.

This is okay with the fix to xxspltiw_v4sf in altivec.md.  And please
update the ChangeLog appropriately.

Thanks, David

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-12 19:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-07 19:59 Repost: [PATCH] Change rs6000_const_f32_to_i32 return type Michael Meissner
2021-07-12 16:07 ` Bill Schmidt
2021-07-12 19:37   ` David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).