| 1 |
/* Generated automatically by "genstr" from "isa-evolution.in". |
| 2 |
Please do not edit this file directly. |
| 3 |
|
| 4 |
Copyright (C) 2023-2025 Free Software Foundation, Inc. |
| 5 |
|
| 6 |
This file is part of GCC. |
| 7 |
|
| 8 |
GCC is free software; you can redistribute it and/or modify |
| 9 |
it under the terms of the GNU General Public License as published by |
| 10 |
the Free Software Foundation; either version 3, or (at your option) |
| 11 |
any later version. |
| 12 |
|
| 13 |
GCC is distributed in the hope that it will be useful, |
| 14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
GNU General Public License for more details. |
| 17 |
|
| 18 |
You should have received a copy of the GNU General Public License |
| 19 |
along with GCC; see the file COPYING3. If not see |
| 20 |
<http://www.gnu.org/licenses/>. |
| 21 |
*/ |
| 22 |
|
| 23 |
#ifndef LOONGARCH_EVOLUTION_H |
| 24 |
#define LOONGARCH_EVOLUTION_H |
| 25 |
|
| 26 |
#if !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS) && !defined(IN_RTS) |
| 27 |
|
| 28 |
#include "options.h" |
| 29 |
|
| 30 |
static constexpr struct { |
| 31 |
int cpucfg_word; |
| 32 |
unsigned int cpucfg_bit; |
| 33 |
HOST_WIDE_INT isa_evolution_bit; |
| 34 |
} cpucfg_map[] = { |
| 35 |
{ 2, 1u << 25, OPTION_MASK_ISA_FRECIPE }, |
| 36 |
{ 2, 1u << 26, OPTION_MASK_ISA_DIV32 }, |
| 37 |
{ 2, 1u << 27, OPTION_MASK_ISA_LAM_BH }, |
| 38 |
{ 2, 1u << 28, OPTION_MASK_ISA_LAMCAS }, |
| 39 |
{ 3, 1u << 23, OPTION_MASK_ISA_LD_SEQ_SA }, |
| 40 |
}; |
| 41 |
|
| 42 |
static constexpr int cpucfg_useful_idx[] = { |
| 43 |
0, |
| 44 |
1, |
| 45 |
2, |
| 46 |
3, |
| 47 |
16, |
| 48 |
17, |
| 49 |
18, |
| 50 |
19, |
| 51 |
}; |
| 52 |
|
| 53 |
static constexpr int N_CPUCFG_WORDS = 20; |
| 54 |
|
| 55 |
/* ISA evolution features */ |
| 56 |
enum { |
| 57 |
EVO_FRECIPE = 0, |
| 58 |
EVO_DIV32 = 1, |
| 59 |
EVO_LAM_BH = 2, |
| 60 |
EVO_LAMCAS = 3, |
| 61 |
EVO_LD_SEQ_SA = 4, |
| 62 |
N_EVO_FEATURES = 5 |
| 63 |
}; |
| 64 |
|
| 65 |
/* Condition macros */ |
| 66 |
#define ISA_HAS_FRECIPE \ |
| 67 |
(la_target.isa.evolution & OPTION_MASK_ISA_FRECIPE) |
| 68 |
#define ISA_HAS_DIV32 \ |
| 69 |
(la_target.isa.evolution & OPTION_MASK_ISA_DIV32) |
| 70 |
#define ISA_HAS_LAM_BH \ |
| 71 |
(la_target.isa.evolution & OPTION_MASK_ISA_LAM_BH) |
| 72 |
#define ISA_HAS_LAMCAS \ |
| 73 |
(la_target.isa.evolution & OPTION_MASK_ISA_LAMCAS) |
| 74 |
#define ISA_HAS_LD_SEQ_SA \ |
| 75 |
(la_target.isa.evolution & OPTION_MASK_ISA_LD_SEQ_SA) |
| 76 |
|
| 77 |
/* Bitmasks on la_target.isa.evolution. */ |
| 78 |
extern int la_evo_feature_masks[N_EVO_FEATURES]; |
| 79 |
|
| 80 |
/* Builtin macro names for the evolution features. */ |
| 81 |
extern const char* la_evo_macro_name[N_EVO_FEATURES]; |
| 82 |
|
| 83 |
/* The ISA version where a specific feature is introduced. */ |
| 84 |
extern int la_evo_version_major[N_EVO_FEATURES]; |
| 85 |
extern int la_evo_version_minor[N_EVO_FEATURES]; |
| 86 |
|
| 87 |
#endif |
| 88 |
|
| 89 |
#endif /* LOONGARCH_EVOLUTION_H */ |