summaryrefslogtreecommitdiff
path: root/gcc/config/i386/i386-c.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-01 06:35:08 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-01 06:35:08 +0000
commita30fe044170c44da9e441535e2167ca8e885b3cb (patch)
tree2ebaaed9567b6d2c562b45ef1d92bcb5cb136795 /gcc/config/i386/i386-c.c
parentddda25955ee583217ccbd7ad5c33c6bb9f304649 (diff)
downloadgcc-a30fe044170c44da9e441535e2167ca8e885b3cb.tar.gz
2008-09-01 Basile Starynkevitch <basile@starynkevitch.net>
MERGED WITH TRUNK rev139820 * gcc/melt/warmelt-first.bysl: added location argument to inform. * gcc/warmelt-first-0.c: regenerated. * gcc/warmelt-macro-0.c: regenerated. * gcc/warmelt-normal-0.c: regenerated. * gcc/warmelt-genobj-0.c: regenerated. * gcc/warmelt-outobj-0.c: regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@139849 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386/i386-c.c')
-rw-r--r--gcc/config/i386/i386-c.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c
index f0a3a17f9f6..3d17c104e39 100644
--- a/gcc/config/i386/i386-c.c
+++ b/gcc/config/i386/i386-c.c
@@ -33,7 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "cpplib.h"
#include "c-pragma.h"
-static bool ix86_pragma_option_parse (tree);
+static bool ix86_pragma_target_parse (tree, tree);
static void ix86_target_macros_internal
(int, enum processor_type, enum processor_type, enum fpmath_unit,
void (*def_or_undef) (cpp_reader *, const char *));
@@ -217,6 +217,10 @@ ix86_target_macros_internal (int isa_flag,
def_or_undef (parse_in, "__AES__");
if (isa_flag & OPTION_MASK_ISA_PCLMUL)
def_or_undef (parse_in, "__PCLMUL__");
+ if (isa_flag & OPTION_MASK_ISA_AVX)
+ def_or_undef (parse_in, "__AVX__");
+ if (isa_flag & OPTION_MASK_ISA_FMA)
+ def_or_undef (parse_in, "__FMA__");
if (isa_flag & OPTION_MASK_ISA_SSE4A)
def_or_undef (parse_in, "__SSE4A__");
if (isa_flag & OPTION_MASK_ISA_SSE5)
@@ -228,11 +232,12 @@ ix86_target_macros_internal (int isa_flag,
}
-/* Hook to validate the current #pragma option and set the state, and update
- the macros based on what was changed. */
+/* Hook to validate the current #pragma GCC target and set the state, and
+ update the macros based on what was changed. If ARGS is NULL, then
+ POP_TARGET is used to reset the options. */
static bool
-ix86_pragma_option_parse (tree args)
+ix86_pragma_target_parse (tree args, tree pop_target)
{
tree prev_tree = build_target_option_node ();
tree cur_tree;
@@ -248,12 +253,14 @@ ix86_pragma_option_parse (tree args)
if (! args)
{
- cur_tree = target_option_default_node;
+ cur_tree = ((pop_target)
+ ? pop_target
+ : target_option_default_node);
cl_target_option_restore (TREE_TARGET_OPTION (cur_tree));
}
else
{
- cur_tree = ix86_valid_option_attribute_tree (args);
+ cur_tree = ix86_valid_target_attribute_tree (args);
if (!cur_tree)
return false;
}
@@ -335,8 +342,8 @@ ix86_target_macros (void)
void
ix86_register_pragmas (void)
{
- /* Update pragma hook to allow parsing #pragma GCC option. */
- targetm.target_option.pragma_parse = ix86_pragma_option_parse;
+ /* Update pragma hook to allow parsing #pragma GCC target. */
+ targetm.target_option.pragma_parse = ix86_pragma_target_parse;
#ifdef REGISTER_SUBTARGET_PRAGMAS
REGISTER_SUBTARGET_PRAGMAS ();