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]

Committed: Fix xstormy16 build problems.


Hi Guys,

  I am applying the attached patch to fix some build problems with the
  xstormy16 port.  In particular the port's attempt to synthesise 32-bit
  comparisons was not working properly, so I have removed the patterns
  and just allowed gcc to generate the necessary RTL itself.

Cheers
  Nick

gcc/ChangeLog
2010-04-22  Nick Clifton  <nickc@redhat.com>

	* config/stormy16/stormy16.c
	(xstormy16_asm_output_aligned_common): Handle a NULL decl
	parameter.
	* config/stormy16/stormy16.h: Tidy up formatting.
	(DONT_USE_BUILTIN_SETJMP): Remove definition.
	* config/stormy16/stormy16.c (cbranchsi4): Delete pattern.
	(ineqbranchsi): Delete pattern.
	* config/stormy16/stormy16-lib2-ucmpsi2.c: New file.
	* config/stormy16/stormy16-lib2.c (__ucmpsi2): New function.
	* config/stormy16/t-stormy16 (LIB2FUNCS_EXTRA): Add
	stormy16-lib2-ucmpsi2.c.

Index: config/stormy16/stormy16.c
===================================================================
--- config/stormy16/stormy16.c	(revision 158639)
+++ config/stormy16/stormy16.c	(working copy)
@@ -1561,7 +1561,7 @@
 				     int align,
 				     int global)
 {
-  rtx mem = DECL_RTL (decl);
+  rtx mem = decl == NULL_TREE ? NULL_RTX : DECL_RTL (decl);
   rtx symbol;
 
   if (mem != NULL_RTX
Index: config/stormy16/stormy16.h
===================================================================
--- config/stormy16/stormy16.h	(revision 158639)
+++ config/stormy16/stormy16.h	(working copy)
@@ -1,29 +1,28 @@
 /* Xstormy16 cpu description.
    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007,
-   2008, 2009  Free Software Foundation, Inc.
+   2008, 2009, 2010  Free Software Foundation, Inc.
    Contributed by Red Hat, Inc.
 
-This file is part of GCC.
+   This file is part of GCC.
 
-GCC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
+   GCC is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
 
-GCC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   GCC is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3.  If not see
-<http://www.gnu.org/licenses/>.  */
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
 
 
-/* Driver configuration */
+/* Driver configuration.  */
 
-/* Defined in svr4.h.  */
-#undef ASM_SPEC
+#undef  ASM_SPEC
 #define ASM_SPEC ""
 
 /* For xstormy16:
@@ -31,41 +30,33 @@
    - If -T is specified, that linker script is used, and it should provide
      appropriate libraries.
    - If neither is specified, everything is built as for the sim, but no
-     I/O support is assumed.
-
-*/
-#undef LIB_SPEC
+     I/O support is assumed.  */
+#undef  LIB_SPEC
 #define LIB_SPEC "-( -lc %{msim:-lsim}%{!msim:%{!T*:-lnosys}} -)"
 
-/* Defined in svr4.h.  */
-#undef STARTFILE_SPEC
+#undef  STARTFILE_SPEC
 #define STARTFILE_SPEC "crt0.o%s crti.o%s crtbegin.o%s"
 
-/* Defined in svr4.h.  */
-#undef ENDFILE_SPEC
+#undef  ENDFILE_SPEC
 #define ENDFILE_SPEC "crtend.o%s crtn.o%s"
 
-/* Defined in svr4.h for host compilers.  */
-/* #define MD_EXEC_PREFIX "" */
-
-/* Defined in svr4.h for host compilers.  */
-/* #define MD_STARTFILE_PREFIX "" */
-
 
-/* Run-time target specifications */
+/* Run-time target specifications.  */
 
-#define TARGET_CPU_CPP_BUILTINS() do {	\
-  builtin_define_std ("xstormy16");	\
-  builtin_assert ("machine=xstormy16");	\
-  builtin_assert ("cpu=xstormy16");     \
-} while (0)
+#define TARGET_CPU_CPP_BUILTINS()		\
+  do						\
+    {						\
+      builtin_define_std ("xstormy16");		\
+      builtin_assert ("machine=xstormy16");	\
+      builtin_assert ("cpu=xstormy16");		\
+    }						\
+  while (0)
 
 #define TARGET_VERSION fprintf (stderr, " (xstormy16 cpu core)");
 
 #define CAN_DEBUG_WITHOUT_FP
-
 
-/* Storage Layout */
+/* Storage Layout.  */
 
 #define BITS_BIG_ENDIAN 1
 
@@ -75,12 +66,14 @@
 
 #define UNITS_PER_WORD 2
 
-#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE)				\
-do {									\
-  if (GET_MODE_CLASS (MODE) == MODE_INT					\
-      && GET_MODE_SIZE (MODE) < 2)					\
-    (MODE) = HImode;							\
-} while (0)
+#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE)	\
+  do						\
+    {						\
+      if (GET_MODE_CLASS (MODE) == MODE_INT	\
+	  && GET_MODE_SIZE (MODE) < 2)		\
+	(MODE) = HImode;			\
+    }						\
+  while (0)
 
 #define PARM_BOUNDARY 16
 
@@ -90,9 +83,6 @@
 
 #define BIGGEST_ALIGNMENT 16
 
-/* Defined in svr4.h.  */
-/* #define MAX_OFILE_ALIGNMENT */
-
 #define DATA_ALIGNMENT(TYPE, ALIGN)		\
   (TREE_CODE (TYPE) == ARRAY_TYPE		\
    && TYPE_MODE (TREE_TYPE (TYPE)) == QImode	\
@@ -104,10 +94,9 @@
 
 #define STRICT_ALIGNMENT 1
 
-/* Defined in svr4.h.  */
 #define PCC_BITFIELD_TYPE_MATTERS 1
 
-/* Layout of Source Language Data Types */
+/* Layout of Source Language Data Types.  */
 
 #define INT_TYPE_SIZE 16
 
@@ -125,27 +114,15 @@
 
 #define DEFAULT_SIGNED_CHAR 0
 
-/* Defined in svr4.h.  */
 #define SIZE_TYPE "unsigned int"
 
-/* Defined in svr4.h.  */
 #define PTRDIFF_TYPE "int"
 
-/* Defined in svr4.h, to "long int".  */
-/* #define WCHAR_TYPE "long int" */
-
-/* Defined in svr4.h.  */
-#undef WCHAR_TYPE_SIZE
+#undef  WCHAR_TYPE_SIZE
 #define WCHAR_TYPE_SIZE 32
 
-/* Define this macro if the type of Objective-C selectors should be `int'.
-
-   If this macro is not defined, then selectors should have the type `struct
-   objc_selector *'.  */
-/* #define OBJC_INT_SELECTORS */
-
 
-/* Register Basics */
+/* Register Basics.  */
 
 #define FIRST_PSEUDO_REGISTER 19
 
@@ -156,12 +133,12 @@
   { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1 }
 
 
-/* Order of allocation of registers */
+/* Order of allocation of registers.  */
 
 #define REG_ALLOC_ORDER { 7, 6, 5, 4, 3, 2, 1, 0, 9, 8, 10, 11, 12, 13, 14, 15, 16 }
 
 
-/* How Values Fit in Registers */
+/* How Values Fit in Registers.  */
 
 #define HARD_REGNO_NREGS(REGNO, MODE) 				\
   ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
@@ -178,7 +155,7 @@
 #define MODES_TIEABLE_P(MODE1, MODE2) ((MODE1) != BImode && (MODE2) != BImode)
 
 
-/* Register Classes */
+/* Register Classes.  */
 
 enum reg_class
 {
@@ -199,7 +176,7 @@
 
 #define IRA_COVER_CLASSES			\
 {						\
-  GENERAL_REGS, LIM_REG_CLASSES	\
+  GENERAL_REGS, LIM_REG_CLASSES			\
 }
 
 #define REG_CLASS_NAMES				\
@@ -251,7 +228,7 @@
 	'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P'
 	'Q', 'R', 'S', 'T', 'U'
 	'V', 'X'
-	'g', 'i', 'm', 'n', 'o', 'p', 'r', 's' */
+	'g', 'i', 'm', 'n', 'o', 'p', 'r', 's'.  */
 
 #define REG_CLASS_FROM_LETTER(CHAR)		\
  (  (CHAR) == 'a' ? R0_REGS			\
@@ -267,7 +244,6 @@
 
 #define REGNO_OK_FOR_INDEX_P(NUM) REGNO_OK_FOR_BASE_P (NUM)
 
-/* This declaration must be present.  */
 #define PREFERRED_RELOAD_CLASS(X, CLASS) \
   xstormy16_preferred_reload_class (X, CLASS)
 
@@ -279,40 +255,9 @@
 #define SECONDARY_RELOAD_CLASS(CLASS, MODE, X)			\
   xstormy16_secondary_reload_class (CLASS, MODE, X)
 
-/* Normally the compiler avoids choosing registers that have been explicitly
-   mentioned in the rtl as spill registers (these registers are normally those
-   used to pass parameters and return values).  However, some machines have so
-   few registers of certain classes that there would not be enough registers to
-   use as spill registers if this were done.
-
-   Define `SMALL_REGISTER_CLASSES' to be an expression with a nonzero value on
-   these machines.  When this macro has a nonzero value, the compiler allows
-   registers explicitly used in the rtl to be used as spill registers but
-   avoids extending the lifetime of these registers.
-
-   It is always safe to define this macro with a nonzero value, but if you
-   unnecessarily define it, you will reduce the amount of optimizations that
-   can be performed in some cases.  If you do not define this macro with a
-   nonzero value when it is required, the compiler will run out of spill
-   registers and print a fatal error message.  For most machines, you should
-   not define this macro at all.  */
-/* #define SMALL_REGISTER_CLASSES */
-
-/* This declaration is required.  */
 #define CLASS_MAX_NREGS(CLASS, MODE) \
   ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
 
-/* If defined, a C expression for a class that contains registers which the
-   compiler must always access in a mode that is the same size as the mode in
-   which it loaded the register.
-
-   For the example, loading 32-bit integer or floating-point objects into
-   floating-point registers on the Alpha extends them to 64-bits.  Therefore
-   loading a 64-bit object and then storing it as a 32-bit object does not
-   store the low-order 32-bits, as would be the case for a normal register.
-   Therefore, `alpha.h' defines this macro as `FLOAT_REGS'.  */
-/* #define CLASS_CANNOT_CHANGE_SIZE */
-
 #define CONST_OK_FOR_LETTER_P(VALUE, C)			\
   (  (C) == 'I' ? (VALUE) >= 0 && (VALUE) <= 3		\
    : (C) == 'J' ? exact_log2 (VALUE) != -1		\
@@ -330,7 +275,7 @@
   xstormy16_extra_constraint_p (VALUE, C)
 
 
-/* Basic Stack Layout */
+/* Basic Stack Layout.  */
 
 /* We want to use post-increment instructions to push things on the stack,
    because we don't have any pre-increment ones.  */
@@ -365,7 +310,7 @@
 #define ARG_POINTER_REGNUM	18
 
 
-/* Eliminating the Frame Pointer and the Arg Pointer */
+/* Eliminating the Frame Pointer and the Arg Pointer.  */
 
 #define ELIMINABLE_REGS					\
 {							\
@@ -379,16 +324,16 @@
   (OFFSET) = xstormy16_initial_elimination_offset (FROM, TO)
 
 
-/* Passing Function Arguments on the Stack */
+/* Passing Function Arguments on the Stack.  */
 
 #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
 
 #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
 
 
-/* Function Arguments in Registers */
+/* Function Arguments in Registers.  */
 
-#define NUM_ARGUMENT_REGISTERS 6
+#define NUM_ARGUMENT_REGISTERS  6
 #define FIRST_ARGUMENT_REGISTER 2
 
 #define XSTORMY16_WORD_SIZE(TYPE, MODE)				\
@@ -414,7 +359,7 @@
    && (REGNO) < FIRST_ARGUMENT_REGISTER + NUM_ARGUMENT_REGISTERS)
 
 
-/* How Scalar Function Values are Returned */
+/* How Scalar Function Values are Returned.  */
 
 /* The number of the hard register that is used to return a scalar value from a
    function call.  */
@@ -428,7 +373,7 @@
 #define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == RETURN_VALUE_REGNUM)
 
 
-/* Function Entry and Exit */
+/* Function Entry and Exit.  */
 
 #define EPILOGUE_USES(REGNO) \
   xstormy16_epilogue_uses (REGNO)
@@ -442,82 +387,14 @@
 #define FUNCTION_PROFILER(FILE, LABELNO) xstormy16_function_profiler ()
 
 
-/* If the target has particular reasons why a function cannot be inlined,
-   it may define the TARGET_CANNOT_INLINE_P.  This macro takes one argument,
-   the DECL describing the function.  The function should NULL if the function
-   *can* be inlined.  Otherwise it should return a pointer to a string containing
-   a message describing why the function could not be inlined.  The message will
-   displayed if the '-Winline' command line switch has been given.  If the message
-   contains a '%s' sequence, this will be replaced by the name of the function.  */
-/* #define TARGET_CANNOT_INLINE_P(FN_DECL) xstormy16_cannot_inline_p (FN_DECL) */
-
 /* Trampolines for Nested Functions.  */
 
 #define TRAMPOLINE_SIZE 8
 #define TRAMPOLINE_ALIGNMENT 16
 
-/* Define this macro to override the type used by the library routines to pick
-   up arguments of type `float'.  (By default, they use a union of `float' and
-   `int'.)
 
-   The obvious choice would be `float'--but that won't work with traditional C
-   compilers that expect all arguments declared as `float' to arrive as
-   `double'.  To avoid this conversion, the library routines ask for the value
-   as some other type and then treat it as a `float'.  */
-/* #define FLOAT_ARG_TYPE */
+/* Addressing Modes.  */
 
-/* Define this macro to override the way library routines redesignate a `float'
-   argument as a `float' instead of the type it was passed as.  The default is
-   an expression which takes the `float' field of the union.  */
-/* #define FLOATIFY(PASSED_VALUE) */
-
-/* Define this macro to override the type used by the library routines to
-   return values that ought to have type `float'.  (By default, they use
-   `int'.)
-
-   The obvious choice would be `float'--but that won't work with traditional C
-   compilers gratuitously convert values declared as `float' into `double'.  */
-/* #define FLOAT_VALUE_TYPE */
-
-/* Define this macro to override the way the value of a `float'-returning
-   library routine should be packaged in order to return it.  These functions
-   are actually declared to return type `FLOAT_VALUE_TYPE' (normally `int').
-
-   These values can't be returned as type `float' because traditional C
-   compilers would gratuitously convert the value to a `double'.
-
-   A local variable named `intify' is always available when the macro `INTIFY'
-   is used.  It is a union of a `float' field named `f' and a field named `i'
-   whose type is `FLOAT_VALUE_TYPE' or `int'.
-
-   If you don't define this macro, the default definition works by copying the
-   value through that union.  */
-/* #define INTIFY(FLOAT_VALUE) */
-
-/* Define this macro as the name of the data type corresponding to `SImode' in
-   the system's own C compiler.
-
-   You need not define this macro if that type is `long int', as it usually is.  */
-/* #define nongcc_SI_type */
-
-/* Define this macro as the name of the data type corresponding to the
-   word_mode in the system's own C compiler.
-
-   You need not define this macro if that type is `long int', as it usually is.  */
-/* #define nongcc_word_type */
-
-/* Define these macros to supply explicit C statements to carry out various
-   arithmetic operations on types `float' and `double' in the library routines
-   in `libgcc1.c'.  See that file for a full list of these macros and their
-   arguments.
-
-   On most machines, you don't need to define any of these macros, because the
-   C compiler that comes with the system takes care of doing them.  */
-/* #define perform_...  */
-
-
-/* Addressing Modes */
-
 #define HAVE_POST_INCREMENT 1
 
 #define HAVE_PRE_DECREMENT 1
@@ -536,16 +413,15 @@
 /* On this chip, this is true if the address is valid with an offset
    of 0 but not of 6, because in that case it cannot be used as an
    address for DImode or DFmode, or if the address is a post-increment
-   or pre-decrement address.
-*/
+   or pre-decrement address.  */
 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)			\
-  if (xstormy16_mode_dependent_address_p (ADDR))				\
+  if (xstormy16_mode_dependent_address_p (ADDR))			\
     goto LABEL
 
 #define LEGITIMATE_CONSTANT_P(X) 1
 
 
-/* Describing Relative Costs of Operations */
+/* Describing Relative Costs of Operations.  */
 
 #define REGISTER_MOVE_COST(MODE, FROM, TO) 2
 
@@ -602,64 +478,31 @@
 /* Output and Generation of Labels.  */
 #define SYMBOL_FLAG_XSTORMY16_BELOW100	(SYMBOL_FLAG_MACH_DEP << 0)
 
-#define ASM_OUTPUT_SYMBOL_REF(STREAM, SYMBOL)				\
-  do {									\
-    const char *rn = XSTR (SYMBOL, 0);					\
-    if (SYMBOL_REF_FUNCTION_P (SYMBOL))					\
-      ASM_OUTPUT_LABEL_REF ((STREAM), rn);				\
-    else								\
-      assemble_name (STREAM, rn);					\
-  } while (0)
+#define ASM_OUTPUT_SYMBOL_REF(STREAM, SYMBOL)	\
+  do						\
+    {						\
+      const char *rn = XSTR (SYMBOL, 0);	\
+						\
+      if (SYMBOL_REF_FUNCTION_P (SYMBOL))	\
+	ASM_OUTPUT_LABEL_REF ((STREAM), rn);	\
+      else					\
+	assemble_name (STREAM, rn);		\
+    }						\
+  while (0)
 
 #define ASM_OUTPUT_LABEL_REF(STREAM, NAME)	\
-do  {						\
-  fputs ("@fptr(", STREAM);			\
-  assemble_name (STREAM, NAME);			\
-  fputc (')', STREAM);				\
-} while (0)
+  do						\
+    {						\
+      fputs ("@fptr(", STREAM);			\
+      assemble_name (STREAM, NAME);		\
+      fputc (')', STREAM);			\
+    }						\
+  while (0)
 
 /* Globalizing directive for a label.  */
 #define GLOBAL_ASM_OP "\t.globl "
 
 
-/* Macros Controlling Initialization Routines.  */
-
-/* When you are using special sections for
-   initialization and termination functions, this macro also controls how
-   `crtstuff.c' and `libgcc2.c' arrange to run the initialization functions.
-
-   Defined in svr4.h.  */
-/* #define INIT_SECTION_ASM_OP */
-
-/* Define this macro as a C statement to output on the stream STREAM the
-   assembler code to arrange to call the function named NAME at initialization
-   time.
-
-   Assume that NAME is the name of a C function generated automatically by the
-   compiler.  This function takes no arguments.  Use the function
-   `assemble_name' to output the name NAME; this performs any system-specific
-   syntactic transformations such as adding an underscore.
-
-   If you don't define this macro, nothing special is output to arrange to call
-   the function.  This is correct when the function will be called in some
-   other manner--for example, by means of the `collect2' program, which looks
-   through the symbol table to find these functions by their names.
-
-   Defined in svr4.h.  */
-/* #define ASM_OUTPUT_CONSTRUCTOR(STREAM, NAME) */
-
-/* This is like `ASM_OUTPUT_CONSTRUCTOR' but used for termination functions
-   rather than initialization functions.
-
-   Defined in svr4.h.  */
-/* #define ASM_OUTPUT_DESTRUCTOR(STREAM, NAME) */
-
-/* Define this macro if the system uses ELF format object files.
-
-   Defined in svr4.h.  */
-/* #define OBJECT_FORMAT_ELF */
-
-
 /* Output of Assembler Instructions.  */
 
 #define REGISTER_NAMES							\
@@ -705,9 +548,7 @@
 #define DWARF2_UNWIND_INFO 		0
 #define DWARF_CIE_DATA_ALIGNMENT	1
 
-/* Don't use __builtin_setjmp for unwinding, since it's tricky to get
-   at the high 16 bits of an address.  */
-#define DONT_USE_BUILTIN_SETJMP
+#undef  DONT_USE_BUILTIN_SETJMP
 #define JMP_BUF_SIZE  8
 
 /* Assembler Commands for Alignment.  */
@@ -719,7 +560,7 @@
 /* Macros Affecting all Debug Formats.  */
 
 /* Defined in svr4.h.  */
-#undef PREFERRED_DEBUGGING_TYPE
+#undef  PREFERRED_DEBUGGING_TYPE
 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
 
 
@@ -757,22 +598,4 @@
 
 #define NO_IMPLICIT_EXTERN_C
 
-/* Defined in svr4.h.  */
 #define HANDLE_SYSV_PRAGMA 1
-
-/* Define this if the target system supports the function `atexit' from the
-   ANSI C standard.  If this is not defined, and `INIT_SECTION_ASM_OP' is not
-   defined, a default `exit' function will be provided to support C++.
-
-   Defined by svr4.h */
-/* #define HAVE_ATEXIT */
-
-/* A C statement which is executed by the Haifa scheduler after it has scheduled
-   an insn from the ready list.  FILE is either a null pointer, or a stdio stream
-   to write any debug output to.  VERBOSE is the verbose level provided by
-   -fsched-verbose-<n>.  INSN is the instruction that was scheduled.  MORE is the
-   number of instructions that can be issued in the current cycle.  This macro
-   is responsible for updating the value of MORE (typically by (MORE)--).  */
-/* #define MD_SCHED_VARIABLE_ISSUE (FILE, VERBOSE, INSN, MORE) */
-
-/* End of xstormy16.h */
Index: config/stormy16/stormy16-lib2-ucmpsi2.c
===================================================================
--- config/stormy16/stormy16-lib2-ucmpsi2.c	(revision 0)
+++ config/stormy16/stormy16-lib2-ucmpsi2.c	(revision 0)
@@ -0,0 +1,2 @@
+#define XSTORMY16_UCMPSI2
+#include "stormy16-lib2.c"
Index: config/stormy16/stormy16.md
===================================================================
--- config/stormy16/stormy16.md	(revision 158639)
+++ config/stormy16/stormy16.md	(working copy)
@@ -759,21 +759,6 @@
   DONE;
 })
 
-(define_expand "cbranchsi4"
-  [(set (pc)
-	(if_then_else (match_operator 0 "comparison_operator"
-				      [(match_operand:SI 1 "register_operand" "")
-				       (match_operand:SI 2 "nonmemory_operand" "")])
-		      (label_ref (match_operand 3 "" ""))
-		      (pc)))
-   (clobber (reg:BI CARRY_REG))]
-  ""
-  {
-  xstormy16_emit_cbranch (GET_CODE (operands[0]), operands[1], operands[2],
-			  operands[3]);
-  DONE;
-})
-
 (define_insn "cbranchhi"
   [(set (pc)
 	(if_then_else (match_operator:HI 1 "comparison_operator"
@@ -827,24 +812,6 @@
   [(set_attr "branch_class" "bcc8p2")
    (set_attr "psw_operand" "clobber")])
 
-(define_insn_and_split "*ineqbranchsi"
-  [(set (pc)
-	(if_then_else (match_operator:SI 1 "xstormy16_ineqsi_operator"
-				      [(match_operand:SI 2 "register_operand"
-							 "r")
-				       (match_operand:SI 3 "nonmemory_operand"
-							 "ri")])
-		      (label_ref (match_operand 0 "" ""))
-		      (pc)))
-   (clobber (match_operand:SI 4 "register_operand" "=2"))
-   (clobber (reg:BI CARRY_REG))]
-  ""
-  "#"
-  "reload_completed"
-  [(pc)]
-  { xstormy16_split_cbranch (SImode, operands[0], operands[1], operands[2]); DONE; }
-  [(set_attr "length" "8")])
-
 (define_insn "*ineqbranch_1"
   [(set (pc)
 	(if_then_else (match_operator:HI 4 "xstormy16_ineqsi_operator"
Index: config/stormy16/t-stormy16
===================================================================
--- config/stormy16/t-stormy16	(revision 158639)
+++ config/stormy16/t-stormy16	(working copy)
@@ -1,6 +1,6 @@
 # -*- makefile -*-
 #
-# Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2004, 2010 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -32,7 +32,8 @@
 	$(srcdir)/config/stormy16/stormy16-lib2-parityhi2.c \
 	$(srcdir)/config/stormy16/stormy16-lib2-clzhi2.c \
 	$(srcdir)/config/stormy16/stormy16-lib2-ctzhi2.c \
-	$(srcdir)/config/stormy16/stormy16-lib2-ffshi2.c
+	$(srcdir)/config/stormy16/stormy16-lib2-ffshi2.c \
+	$(srcdir)/config/stormy16/stormy16-lib2-ucmpsi2.c
 
 # Floating point emulation libraries.
 FPBIT = fp-bit.c
Index: config/stormy16/stormy16-lib2.c
===================================================================
--- config/stormy16/stormy16-lib2.c	(revision 158639)
+++ config/stormy16/stormy16-lib2.c	(working copy)
@@ -4,7 +4,7 @@
    files.  On this glorious day maybe this code can be integrated into
    it too.  */
 
-/* Copyright (C) 2005, 2008, 2009  Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2008, 2009, 2010  Free Software Foundation, Inc.
 
    This file is part of GCC.
 
@@ -309,3 +309,26 @@
   return 16 - __builtin_clz (u & - u);
 }
 #endif
+
+#ifdef XSTORMY16_UCMPSI2
+/* Performs an unsigned comparison of two 32-bit values: A and B.
+   If A is less than B, then 0 is returned.  If A is greater than B,
+   then 2 is returned.  Otherwise A and B are equal and 1 is returned.  */
+
+word_type
+__ucmpsi2 (USItype a, USItype b)
+{
+  word_type hi_a = (a << 16);
+  word_type hi_b = (b << 16);
+
+  if (hi_a == hi_b)
+    {
+      word_type low_a = (a & 0xff);
+      word_type low_b = (b & 0xff);
+
+      return low_a < low_b ? 0 : (low_a > low_b ? 2 : 1);
+    }
+
+  return hi_a < hi_b ? 0 : 2;
+}
+#endif

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