This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[m32c] long pointer support


Still working on getting gcc to support multiple pointer sizes
simultaneously; this is a small step in that direction.

2005-08-31  DJ Delorie  <dj@redhat.com>

	* config/m32c/m32c.c (m32c_valid_pointer_mode): New.
	(m32c_asm_integer): Add support for 32 bit pointers.

Index: config/m32c/m32c.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m32c/m32c.c,v
retrieving revision 1.3
diff -p -U3 -r1.3  config/m32c/m32c.c
--- config/m32c/m32c.c	16 Aug 2005 00:31:39 -0000	1.3
+++ config/m32c/m32c.c	1 Sep 2005 01:48:06 -0000
@@ -1503,6 +1503,23 @@ m32c_function_arg_regno_p (int r)
   return (r == R1_REGNO || r == R2_REGNO);
 }
 
+/* HImode and PSImode are the two "native" modes as far as GCC is
+   concerned, but the chips also support a 32 bit mode which is used
+   for some opcodes in R8C/M16C and for reset vectors and such.  */
+#undef TARGET_VALID_POINTER_MODE
+#define TARGET_VALID_POINTER_MODE m32c_valid_pointer_mode
+bool
+m32c_valid_pointer_mode (enum machine_mode mode)
+{
+  fprintf(stderr, "valid_pointer_mode: %s\n", mode_name[mode]);
+  if (mode == HImode
+      || mode == PSImode
+      || mode == SImode
+      )
+    return 1;
+  return 0;
+}
+
 /* How Scalar Function Values Are Returned */
 
 /* Implements LIBCALL_VALUE.  Most values are returned in $r0, or some
@@ -1972,6 +1989,15 @@ m32c_asm_integer (rtx x, unsigned int si
       output_addr_const (asm_out_file, x);
       fputc ('\n', asm_out_file);
       return true;
+    case 4:
+      if (GET_CODE (x) == SYMBOL_REF)
+	{
+	  fprintf (asm_out_file, "\t.long\t");
+	  output_addr_const (asm_out_file, x);
+	  fputc ('\n', asm_out_file);
+	  return true;
+	}
+      break;
     }
   return default_assemble_integer (x, size, aligned_p);
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]