-/* Copyright (C) 2009\r
- Free Software Foundation, Inc.\r
- Contributed by Anatoly Sokolov (aesok@post.ru)\r
-\r
- This file is part of GCC.\r
-\r
- GCC is free software; you can redistribute it and/or modify\r
- it under the terms of the GNU General Public License as published by\r
- the Free Software Foundation; either version 3, or (at your option)\r
- any later version.\r
- \r
- GCC is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
- \r
- You should have received a copy of the GNU General Public License\r
- along with GCC; see the file COPYING3. If not see\r
- <http://www.gnu.org/licenses/>. */\r
-\r
-\r
-#include "config.h"\r
-#include "system.h"\r
-#include "coretypes.h"\r
-#include "tm.h"\r
-#include "tm_p.h"\r
-#include "regs.h"\r
-#include "c-common.h"\r
-\r
-\r
-/* Not included in avr.c since this requires C front end. */\r
-\r
-/* Worker function for TARGET_CPU_CPP_BUILTINS. */\r
-\r
-void\r
-avr_cpu_cpp_builtins (struct cpp_reader *pfile)\r
-{\r
- builtin_define_std ("AVR");\r
-\r
- if (avr_current_arch->macro)\r
- cpp_define (pfile, avr_current_arch->macro);\r
- if (avr_extra_arch_macro)\r
- cpp_define (pfile, avr_extra_arch_macro);\r
- if (avr_current_arch->have_elpm)\r
- cpp_define (pfile, "__AVR_HAVE_RAMPZ__");\r
- if (avr_current_arch->have_elpm)\r
- cpp_define (pfile, "__AVR_HAVE_ELPM__");\r
- if (avr_current_arch->have_elpmx)\r
- cpp_define (pfile, "__AVR_HAVE_ELPMX__");\r
- if (avr_current_arch->have_movw_lpmx)\r
- {\r
- cpp_define (pfile, "__AVR_HAVE_MOVW__");\r
- cpp_define (pfile, "__AVR_HAVE_LPMX__");\r
- }\r
- if (avr_current_arch->asm_only)\r
- cpp_define (pfile, "__AVR_ASM_ONLY__");\r
- if (avr_current_arch->have_mul)\r
- {\r
- cpp_define (pfile, "__AVR_ENHANCED__");\r
- cpp_define (pfile, "__AVR_HAVE_MUL__");\r
- }\r
- if (avr_current_arch->have_jmp_call)\r
- {\r
- cpp_define (pfile, "__AVR_MEGA__");\r
- cpp_define (pfile, "__AVR_HAVE_JMP_CALL__");\r
- }\r
- if (avr_current_arch->have_eijmp_eicall)\r
- {\r
- cpp_define (pfile, "__AVR_HAVE_EIJMP_EICALL__");\r
- cpp_define (pfile, "__AVR_3_BYTE_PC__");\r
- }\r
- else\r
- {\r
- cpp_define (pfile, "__AVR_2_BYTE_PC__");\r
- }\r
-\r
- if (avr_current_device->short_sp)\r
- cpp_define (pfile, "__AVR_HAVE_8BIT_SP__");\r
- else\r
- cpp_define (pfile, "__AVR_HAVE_16BIT_SP__");\r
-\r
- if (TARGET_NO_INTERRUPTS)\r
- cpp_define (pfile, "__NO_INTERRUPTS__");\r
-}\r
-\r
+/* Copyright (C) 2009, 2010
+ Free Software Foundation, Inc.
+ Contributed by Anatoly Sokolov (aesok@post.ru)
+
+ 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 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/>. */
+
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "tm_p.h"
+#include "cpplib.h"
+#include "tree.h"
+#include "c-family/c-common.h"
+
+/* Not included in avr.c since this requires C front end. */
+
+/* Worker function for TARGET_CPU_CPP_BUILTINS. */
+
+void
+avr_cpu_cpp_builtins (struct cpp_reader *pfile)
+{
+ builtin_define_std ("AVR");
+
+ if (avr_current_arch->macro)
+ cpp_define (pfile, avr_current_arch->macro);
+ if (avr_extra_arch_macro)
+ cpp_define (pfile, avr_extra_arch_macro);
+ if (avr_current_arch->have_elpm)
+ cpp_define (pfile, "__AVR_HAVE_RAMPZ__");
+ if (avr_current_arch->have_elpm)
+ cpp_define (pfile, "__AVR_HAVE_ELPM__");
+ if (avr_current_arch->have_elpmx)
+ cpp_define (pfile, "__AVR_HAVE_ELPMX__");
+ if (avr_current_arch->have_movw_lpmx)
+ {
+ cpp_define (pfile, "__AVR_HAVE_MOVW__");
+ cpp_define (pfile, "__AVR_HAVE_LPMX__");
+ }
+ if (avr_current_arch->asm_only)
+ cpp_define (pfile, "__AVR_ASM_ONLY__");
+ if (avr_current_arch->have_mul)
+ {
+ cpp_define (pfile, "__AVR_ENHANCED__");
+ cpp_define (pfile, "__AVR_HAVE_MUL__");
+ }
+ if (avr_current_arch->have_jmp_call)
+ {
+ cpp_define (pfile, "__AVR_MEGA__");
+ cpp_define (pfile, "__AVR_HAVE_JMP_CALL__");
+ }
+ if (avr_current_arch->have_eijmp_eicall)
+ {
+ cpp_define (pfile, "__AVR_HAVE_EIJMP_EICALL__");
+ cpp_define (pfile, "__AVR_3_BYTE_PC__");
+ }
+ else
+ {
+ cpp_define (pfile, "__AVR_2_BYTE_PC__");
+ }
+
+ if (avr_current_device->short_sp)
+ cpp_define (pfile, "__AVR_HAVE_8BIT_SP__");
+ else
+ cpp_define (pfile, "__AVR_HAVE_16BIT_SP__");
+
+ if (TARGET_NO_INTERRUPTS)
+ cpp_define (pfile, "__NO_INTERRUPTS__");
+
+ /* Define builtin macros so that the user can
+ easily query if or if not a specific builtin
+ is available. */
+
+ cpp_define (pfile, "__BUILTIN_AVR_NOP");
+ cpp_define (pfile, "__BUILTIN_AVR_SEI");
+ cpp_define (pfile, "__BUILTIN_AVR_CLI");
+ cpp_define (pfile, "__BUILTIN_AVR_WDR");
+ cpp_define (pfile, "__BUILTIN_AVR_SLEEP");
+ cpp_define (pfile, "__BUILTIN_AVR_SWAP");
+ cpp_define (pfile, "__BUILTIN_AVR_DELAY_CYCLES");
+
+ if (AVR_HAVE_MUL)
+ {
+ cpp_define (pfile, "__BUILTIN_AVR_FMUL");
+ cpp_define (pfile, "__BUILTIN_AVR_FMULS");
+ cpp_define (pfile, "__BUILTIN_AVR_FMULSU");
+ }
+}