* config/xtensa/xtensa.h (target_flags, MASK_NO_FUSED_MADD)
authorRichard Sandiford <rsandifo@redhat.com>
Fri, 8 Apr 2005 07:57:27 +0000 (07:57 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Fri, 8 Apr 2005 07:57:27 +0000 (07:57 +0000)
(MASK_CONST16, TARGET_NO_FUSED_MADD, TARGET_CONST16)
(TARGET_SWITCHES): Delete.
* config/xtensa/xtensa.c (TARGET_DEFAULT_TARGET_FLAGS): Define.
* config/xtensa/xtensa.md (muladdsf3, mulsubsf3): Check
TARGET_FUSED_MADD instead of !TARGET_NO_FUSED_MADD.
* config/xtensa/xtensa.opt: New file.

From-SVN: r97822

gcc/ChangeLog
gcc/config/xtensa/xtensa.c
gcc/config/xtensa/xtensa.h
gcc/config/xtensa/xtensa.md
gcc/config/xtensa/xtensa.opt [new file with mode: 0644]

index 5ac794255a98e01a536123fcb5fc70fc639cc9ea..8308b7b0f09087eafbcf452ec025be046800e775 100644 (file)
@@ -1,3 +1,13 @@
+2005-04-08  Richard Sandiford  <rsandifo@redhat.com>
+
+       * config/xtensa/xtensa.h (target_flags, MASK_NO_FUSED_MADD)
+       (MASK_CONST16, TARGET_NO_FUSED_MADD, TARGET_CONST16)
+       (TARGET_SWITCHES): Delete.
+       * config/xtensa/xtensa.c (TARGET_DEFAULT_TARGET_FLAGS): Define.
+       * config/xtensa/xtensa.md (muladdsf3, mulsubsf3): Check
+       TARGET_FUSED_MADD instead of !TARGET_NO_FUSED_MADD.
+       * config/xtensa/xtensa.opt: New file.
+
 2005-04-08  Ben Elliston  <bje@au.ibm.com>
 
        * config/fp-bit.c: Include L_mul_tf in #endif comment.
index b6084c9c5d2e599759f1cc8f935a5791320d91fd..7d0ba485f656621d846afa06ce79f75f7cdc7ae0 100644 (file)
@@ -232,6 +232,9 @@ static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
 #undef TARGET_ASM_SELECT_RTX_SECTION
 #define TARGET_ASM_SELECT_RTX_SECTION  xtensa_select_rtx_section
 
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | MASK_FUSED_MADD)
+
 #undef TARGET_RTX_COSTS
 #define TARGET_RTX_COSTS xtensa_rtx_costs
 #undef TARGET_ADDRESS_COST
index ebaed273d14f63926cbc3b482e65ae9c1342bc8f..fc5351a92ec006de918b74f4f101d555b8399fec 100644 (file)
@@ -24,7 +24,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 /* Standard GCC variables that we reference.  */
 extern int current_function_calls_alloca;
-extern int target_flags;
 extern int optimize;
 
 /* External variables defined in xtensa.c.  */
@@ -42,10 +41,6 @@ extern struct rtx_def * branch_cmp[2];       /* operands for compare */
 extern enum cmp_type branch_type;      /* what type of branch to use */
 extern unsigned xtensa_current_frame_size;
 
-/* Masks for the -m switches */
-#define MASK_NO_FUSED_MADD     0x00000001      /* avoid f-p mul/add */
-#define MASK_CONST16           0x00000002      /* use CONST16 instruction */
-
 /* Macros used in the machine description to select various Xtensa
    configuration options.  */
 #define TARGET_BIG_ENDIAN      XCHAL_HAVE_BE
@@ -66,39 +61,9 @@ extern unsigned xtensa_current_frame_size;
 #define TARGET_ABS             XCHAL_HAVE_ABS
 #define TARGET_ADDX            XCHAL_HAVE_ADDX
 
-/* Macros controlled by command-line options.  */
-#define TARGET_NO_FUSED_MADD   (target_flags & MASK_NO_FUSED_MADD)
-#define TARGET_CONST16         (target_flags & MASK_CONST16)
-
 #define TARGET_DEFAULT (                                               \
   (XCHAL_HAVE_L32R     ? 0 : MASK_CONST16))
 
-#define TARGET_SWITCHES                                                        \
-{                                                                      \
-  {"const16",                  MASK_CONST16,                           \
-    N_("Use CONST16 instruction to load constants")},                  \
-  {"no-const16",               -MASK_CONST16,                          \
-    N_("Use PC-relative L32R instruction to load constants")},         \
-  {"no-fused-madd",            MASK_NO_FUSED_MADD,                     \
-    N_("Disable fused multiply/add and multiply/subtract FP instructions")}, \
-  {"fused-madd",               -MASK_NO_FUSED_MADD,                    \
-    N_("Enable fused multiply/add and multiply/subtract FP instructions")}, \
-  {"text-section-literals",    0,                                      \
-    N_("Intersperse literal pools with code in the text section")},    \
-  {"no-text-section-literals", 0,                                      \
-    N_("Put literal pools in a separate literal section")},            \
-  {"target-align",             0,                                      \
-    N_("Automatically align branch targets to reduce branch penalties")}, \
-  {"no-target-align",          0,                                      \
-    N_("Do not automatically align branch targets")},                  \
-  {"longcalls",                        0,                                      \
-    N_("Use indirect CALLXn instructions for large programs")},                \
-  {"no-longcalls",             0,                                      \
-    N_("Use direct CALLn instructions for fast calls")},               \
-  {"",                         TARGET_DEFAULT, 0}                      \
-}
-
-
 #define OVERRIDE_OPTIONS override_options ()
 \f
 /* Target CPU builtins.  */
index 507465124105f280f4ca06708f9e1b2ca7c4f414..c40ad345def7e92c4ef047a662a57cbe8c3e4ac8 100644 (file)
        (plus:SF (mult:SF (match_operand:SF 1 "register_operand" "%f")
                          (match_operand:SF 2 "register_operand" "f"))
                 (match_operand:SF 3 "register_operand" "0")))]
-  "TARGET_HARD_FLOAT && !TARGET_NO_FUSED_MADD"
+  "TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
   "madd.s\t%0, %1, %2"
   [(set_attr "type"    "fmadd")
    (set_attr "mode"    "SF")
        (minus:SF (match_operand:SF 1 "register_operand" "0")
                  (mult:SF (match_operand:SF 2 "register_operand" "%f")
                           (match_operand:SF 3 "register_operand" "f"))))]
-  "TARGET_HARD_FLOAT && !TARGET_NO_FUSED_MADD"
+  "TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
   "msub.s\t%0, %2, %3"
   [(set_attr "type"    "fmadd")
    (set_attr "mode"    "SF")
diff --git a/gcc/config/xtensa/xtensa.opt b/gcc/config/xtensa/xtensa.opt
new file mode 100644 (file)
index 0000000..6be1b38
--- /dev/null
@@ -0,0 +1,40 @@
+; Options for the Tensilica Xtensa port of the compiler.
+
+; Copyright (C) 2005 Free Software Foundation, Inc.
+;
+; 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 2, 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.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING.  If not, write to the Free
+; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+; 02111-1307, USA.
+
+mconst16
+Target Report Mask(CONST16)
+Use CONST16 instruction to load constants
+
+mfused-madd
+Target Report Mask(FUSED_MADD)
+Enable fused multiply/add and multiply/subtract FP instructions
+
+mlongcalls
+Target
+Use indirect CALLXn instructions for large programs
+
+mtarget-align
+Target
+Automatically align branch targets to reduce branch penalties
+
+mtext-section-literals
+Target
+Intersperse literal pools with code in the text section