diff mbox

Add a load_extend_op wrapper

Message ID 87inrlqfq6.fsf@e105548-lin.cambridge.arm.com
State New
Headers show

Commit Message

Richard Sandiford Nov. 18, 2016, 9:50 a.m. UTC
Eric Botcazou <ebotcazou@adacore.com> writes:
>> 2016-11-15  Richard Sandiford  <richard.sandiford@arm.com>
>> 	    Alan Hayward  <alan.hayward@arm.com>
>> 	    David Sherwood  <david.sherwood@arm.com>
>> 
>> 	* rtl.h (load_extend_op): Declare.
>> 	* rtlanal.c (load_extend_op): New function.
>
> I'd make it an inline function.

Sorry, I'd committed it before I got this message.

Tested on aarch64-linux-gnu and x86_64-linux-gnu.  OK to install?

Thanks,
Richard


gcc/
	* rtlanal.c (load_extend_op): Move to...
	* rtl.h: ...here and make inline.

Comments

Eric Botcazou Nov. 18, 2016, 11 a.m. UTC | #1
> Tested on aarch64-linux-gnu and x86_64-linux-gnu.  OK to install?
> 
> Thanks,
> Richard
> 
> 
> gcc/
> 	* rtlanal.c (load_extend_op): Move to...
> 	* rtl.h: ...here and make inline.

OK, thanks.
diff mbox

Patch

diff --git a/gcc/rtl.h b/gcc/rtl.h
index df5172b..b21514f 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2954,7 +2954,6 @@  extern void set_insn_deleted (rtx);
 
 /* Functions in rtlanal.c */
 
-extern rtx_code load_extend_op (machine_mode);
 extern rtx single_set_2 (const rtx_insn *, const_rtx);
 extern bool contains_symbol_ref_p (const_rtx);
 extern bool contains_symbolic_reference_p (const_rtx);
@@ -3771,5 +3770,17 @@  struct GTY(()) cgraph_rtl_info {
   unsigned function_used_regs_valid: 1;
 };
 
+/* If loads from memories of mode MODE always sign or zero extend,
+   return SIGN_EXTEND or ZERO_EXTEND as appropriate.  Return UNKNOWN
+   otherwise.  */
+
+inline rtx_code
+load_extend_op (machine_mode mode)
+{
+  if (SCALAR_INT_MODE_P (mode)
+      && GET_MODE_PRECISION (mode) < BITS_PER_WORD)
+    return LOAD_EXTEND_OP (mode);
+  return UNKNOWN;
+}
 
 #endif /* ! GCC_RTL_H */
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index f07a77a..55a9d2c 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -3863,19 +3863,6 @@  subreg_nregs_with_regno (unsigned int regno, const_rtx x)
   return info.nregs;
 }
 
-/* If loads from memories of mode MODE always sign or zero extend,
-   return SIGN_EXTEND or ZERO_EXTEND as appropriate.  Return UNKNOWN
-   otherwise.  */
-
-rtx_code
-load_extend_op (machine_mode mode)
-{
-  if (SCALAR_INT_MODE_P (mode)
-      && GET_MODE_PRECISION (mode) < BITS_PER_WORD)
-    return LOAD_EXTEND_OP (mode);
-  return UNKNOWN;
-}
-
 struct parms_set_data
 {
   int nregs;