comparison gcc/addresses.h @ 16:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents f6334be47118
children 84e7813d76e9
comparison
equal deleted inserted replaced
15:561a7518be6b 16:04ced10e8804
1 /* Inline functions to test validity of reg classes for addressing modes. 1 /* Inline functions to test validity of reg classes for addressing modes.
2 Copyright (C) 2006, 2007, 2010 Free Software Foundation, Inc. 2 Copyright (C) 2006-2017 Free Software Foundation, Inc.
3 3
4 This file is part of GCC. 4 This file is part of GCC.
5 5
6 GCC is free software; you can redistribute it and/or modify it under 6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free 7 the terms of the GNU General Public License as published by the Free
19 19
20 /* Wrapper function to unify target macros MODE_CODE_BASE_REG_CLASS, 20 /* Wrapper function to unify target macros MODE_CODE_BASE_REG_CLASS,
21 MODE_BASE_REG_REG_CLASS, MODE_BASE_REG_CLASS and BASE_REG_CLASS. 21 MODE_BASE_REG_REG_CLASS, MODE_BASE_REG_CLASS and BASE_REG_CLASS.
22 Arguments as for the MODE_CODE_BASE_REG_CLASS macro. */ 22 Arguments as for the MODE_CODE_BASE_REG_CLASS macro. */
23 23
24 #ifndef GCC_ADDRESSES_H
25 #define GCC_ADDRESSES_H
26
24 static inline enum reg_class 27 static inline enum reg_class
25 base_reg_class (enum machine_mode mode ATTRIBUTE_UNUSED, 28 base_reg_class (machine_mode mode ATTRIBUTE_UNUSED,
29 addr_space_t as ATTRIBUTE_UNUSED,
26 enum rtx_code outer_code ATTRIBUTE_UNUSED, 30 enum rtx_code outer_code ATTRIBUTE_UNUSED,
27 enum rtx_code index_code ATTRIBUTE_UNUSED) 31 enum rtx_code index_code ATTRIBUTE_UNUSED)
28 { 32 {
29 #ifdef MODE_CODE_BASE_REG_CLASS 33 #ifdef MODE_CODE_BASE_REG_CLASS
30 return MODE_CODE_BASE_REG_CLASS (mode, outer_code, index_code); 34 return MODE_CODE_BASE_REG_CLASS (mode, as, outer_code, index_code);
31 #else 35 #else
32 #ifdef MODE_BASE_REG_REG_CLASS 36 #ifdef MODE_BASE_REG_REG_CLASS
33 if (index_code == REG) 37 if (index_code == REG)
34 return MODE_BASE_REG_REG_CLASS (mode); 38 return MODE_BASE_REG_REG_CLASS (mode);
35 #endif 39 #endif
46 REGNO_OK_FOR_BASE_P. 50 REGNO_OK_FOR_BASE_P.
47 Arguments as for the REGNO_MODE_CODE_OK_FOR_BASE_P macro. */ 51 Arguments as for the REGNO_MODE_CODE_OK_FOR_BASE_P macro. */
48 52
49 static inline bool 53 static inline bool
50 ok_for_base_p_1 (unsigned regno ATTRIBUTE_UNUSED, 54 ok_for_base_p_1 (unsigned regno ATTRIBUTE_UNUSED,
51 enum machine_mode mode ATTRIBUTE_UNUSED, 55 machine_mode mode ATTRIBUTE_UNUSED,
56 addr_space_t as ATTRIBUTE_UNUSED,
52 enum rtx_code outer_code ATTRIBUTE_UNUSED, 57 enum rtx_code outer_code ATTRIBUTE_UNUSED,
53 enum rtx_code index_code ATTRIBUTE_UNUSED) 58 enum rtx_code index_code ATTRIBUTE_UNUSED)
54 { 59 {
55 #ifdef REGNO_MODE_CODE_OK_FOR_BASE_P 60 #ifdef REGNO_MODE_CODE_OK_FOR_BASE_P
56 return REGNO_MODE_CODE_OK_FOR_BASE_P (regno, mode, outer_code, index_code); 61 return REGNO_MODE_CODE_OK_FOR_BASE_P (regno, mode, as,
62 outer_code, index_code);
57 #else 63 #else
58 #ifdef REGNO_MODE_OK_FOR_REG_BASE_P 64 #ifdef REGNO_MODE_OK_FOR_REG_BASE_P
59 if (index_code == REG) 65 if (index_code == REG)
60 return REGNO_MODE_OK_FOR_REG_BASE_P (regno, mode); 66 return REGNO_MODE_OK_FOR_REG_BASE_P (regno, mode);
61 #endif 67 #endif
69 75
70 /* Wrapper around ok_for_base_p_1, for use after register allocation is 76 /* Wrapper around ok_for_base_p_1, for use after register allocation is
71 complete. Arguments as for the called function. */ 77 complete. Arguments as for the called function. */
72 78
73 static inline bool 79 static inline bool
74 regno_ok_for_base_p (unsigned regno, enum machine_mode mode, 80 regno_ok_for_base_p (unsigned regno, machine_mode mode, addr_space_t as,
75 enum rtx_code outer_code, enum rtx_code index_code) 81 enum rtx_code outer_code, enum rtx_code index_code)
76 { 82 {
77 if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] >= 0) 83 if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] >= 0)
78 regno = reg_renumber[regno]; 84 regno = reg_renumber[regno];
79 85
80 return ok_for_base_p_1 (regno, mode, outer_code, index_code); 86 return ok_for_base_p_1 (regno, mode, as, outer_code, index_code);
81 } 87 }
88
89 #endif /* GCC_ADDRESSES_H */