comparison gcc/config/xtensa/xtensa.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* Subroutines for insn-output.c for Tensilica's Xtensa architecture. 1 /* Subroutines for insn-output.c for Tensilica's Xtensa architecture.
2 Copyright (C) 2001-2017 Free Software Foundation, Inc. 2 Copyright (C) 2001-2018 Free Software Foundation, Inc.
3 Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica. 3 Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
4 4
5 This file is part of GCC. 5 This file is part of GCC.
6 6
7 GCC is free software; you can redistribute it and/or modify it under 7 GCC is free software; you can redistribute it and/or modify it under
15 for more details. 15 for more details.
16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see 18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */ 19 <http://www.gnu.org/licenses/>. */
20
21 #define IN_TARGET_CODE 1
20 22
21 #include "config.h" 23 #include "config.h"
22 #include "system.h" 24 #include "system.h"
23 #include "coretypes.h" 25 #include "coretypes.h"
24 #include "backend.h" 26 #include "backend.h"
181 static unsigned int xtensa_hard_regno_nregs (unsigned int, machine_mode); 183 static unsigned int xtensa_hard_regno_nregs (unsigned int, machine_mode);
182 static bool xtensa_hard_regno_mode_ok (unsigned int, machine_mode); 184 static bool xtensa_hard_regno_mode_ok (unsigned int, machine_mode);
183 static bool xtensa_modes_tieable_p (machine_mode, machine_mode); 185 static bool xtensa_modes_tieable_p (machine_mode, machine_mode);
184 static HOST_WIDE_INT xtensa_constant_alignment (const_tree, HOST_WIDE_INT); 186 static HOST_WIDE_INT xtensa_constant_alignment (const_tree, HOST_WIDE_INT);
185 static HOST_WIDE_INT xtensa_starting_frame_offset (void); 187 static HOST_WIDE_INT xtensa_starting_frame_offset (void);
188 static unsigned HOST_WIDE_INT xtensa_asan_shadow_offset (void);
186 189
187 190
188 191
189 /* These hooks specify assembly directives for creating certain kinds 192 /* These hooks specify assembly directives for creating certain kinds
190 of integer object. */ 193 of integer object. */
322 #undef TARGET_CONSTANT_ALIGNMENT 325 #undef TARGET_CONSTANT_ALIGNMENT
323 #define TARGET_CONSTANT_ALIGNMENT xtensa_constant_alignment 326 #define TARGET_CONSTANT_ALIGNMENT xtensa_constant_alignment
324 327
325 #undef TARGET_STARTING_FRAME_OFFSET 328 #undef TARGET_STARTING_FRAME_OFFSET
326 #define TARGET_STARTING_FRAME_OFFSET xtensa_starting_frame_offset 329 #define TARGET_STARTING_FRAME_OFFSET xtensa_starting_frame_offset
330
331 #undef TARGET_ASAN_SHADOW_OFFSET
332 #define TARGET_ASAN_SHADOW_OFFSET xtensa_asan_shadow_offset
327 333
328 struct gcc_target targetm = TARGET_INITIALIZER; 334 struct gcc_target targetm = TARGET_INITIALIZER;
329 335
330 336
331 /* Functions to test Xtensa immediate operand validity. */ 337 /* Functions to test Xtensa immediate operand validity. */
1606 tmp = expand_simple_binop (SImode, code, old, val, 1612 tmp = expand_simple_binop (SImode, code, old, val,
1607 new_rtx, 1, OPTAB_DIRECT); 1613 new_rtx, 1, OPTAB_DIRECT);
1608 break; 1614 break;
1609 1615
1610 case MULT: /* NAND */ 1616 case MULT: /* NAND */
1611 tmp = expand_simple_binop (SImode, XOR, old, ac.modemask, 1617 tmp = expand_simple_binop (SImode, AND, old, val,
1612 NULL_RTX, 1, OPTAB_DIRECT); 1618 NULL_RTX, 1, OPTAB_DIRECT);
1613 tmp = expand_simple_binop (SImode, AND, tmp, val, 1619 tmp = expand_simple_binop (SImode, XOR, tmp, ac.modemask,
1614 new_rtx, 1, OPTAB_DIRECT); 1620 new_rtx, 1, OPTAB_DIRECT);
1615 break; 1621 break;
1616 1622
1617 default: 1623 default:
1618 gcc_unreachable (); 1624 gcc_unreachable ();
2690 2696
2691 #define STACK_BYTES (STACK_BOUNDARY / BITS_PER_UNIT) 2697 #define STACK_BYTES (STACK_BOUNDARY / BITS_PER_UNIT)
2692 #define XTENSA_STACK_ALIGN(LOC) (((LOC) + STACK_BYTES-1) & ~(STACK_BYTES-1)) 2698 #define XTENSA_STACK_ALIGN(LOC) (((LOC) + STACK_BYTES-1) & ~(STACK_BYTES-1))
2693 2699
2694 long 2700 long
2695 compute_frame_size (int size) 2701 compute_frame_size (poly_int64 size)
2696 { 2702 {
2697 int regno; 2703 int regno;
2698 2704
2699 if (reload_completed && cfun->machine->frame_laid_out) 2705 if (reload_completed && cfun->machine->frame_laid_out)
2700 return cfun->machine->current_frame_size; 2706 return cfun->machine->current_frame_size;
4247 else 4253 else
4248 { 4254 {
4249 entry_after = BB_END (entry_bb); 4255 entry_after = BB_END (entry_bb);
4250 while (DEBUG_INSN_P (entry_after) 4256 while (DEBUG_INSN_P (entry_after)
4251 || (NOTE_P (entry_after) 4257 || (NOTE_P (entry_after)
4252 && NOTE_KIND (entry_after) != NOTE_INSN_BASIC_BLOCK 4258 && NOTE_KIND (entry_after) != NOTE_INSN_BASIC_BLOCK))
4253 /* Make sure we don't split a call and its corresponding
4254 CALL_ARG_LOCATION note. */
4255 && NOTE_KIND (entry_after) != NOTE_INSN_CALL_ARG_LOCATION))
4256 entry_after = PREV_INSN (entry_after); 4259 entry_after = PREV_INSN (entry_after);
4257 4260
4258 emit_insn_after (seq, entry_after); 4261 emit_insn_after (seq, entry_after);
4259 } 4262 }
4260 4263
4411 if (FRAME_GROWS_DOWNWARD) 4414 if (FRAME_GROWS_DOWNWARD)
4412 return 0; 4415 return 0;
4413 return crtl->outgoing_args_size; 4416 return crtl->outgoing_args_size;
4414 } 4417 }
4415 4418
4419 /* Implement TARGET_ASAN_SHADOW_OFFSET. */
4420
4421 static unsigned HOST_WIDE_INT
4422 xtensa_asan_shadow_offset (void)
4423 {
4424 return HOST_WIDE_INT_UC (0x10000000);
4425 }
4426
4416 #include "gt-xtensa.h" 4427 #include "gt-xtensa.h"