[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 26/35] Hexagon (target/hexagon) TCG generation
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v8 26/35] Hexagon (target/hexagon) TCG generation |
Date: |
Fri, 12 Feb 2021 01:22:55 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 |
Hi Taylor,
On 2/8/21 6:46 AM, Taylor Simpson wrote:
> Include the generated files and set up the data structures
>
> Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
> ---
> target/hexagon/genptr.h | 25 ++++
> target/hexagon/genptr.c | 331
> ++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 356 insertions(+)
> create mode 100644 target/hexagon/genptr.h
> create mode 100644 target/hexagon/genptr.c
>
> diff --git a/target/hexagon/genptr.h b/target/hexagon/genptr.h
> new file mode 100644
> index 0000000..c158005
> --- /dev/null
> +++ b/target/hexagon/genptr.h
> @@ -0,0 +1,25 @@
> +/*
> + * Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights
> Reserved.
> + *
> + * This program 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 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program 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 this program; if not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#ifndef HEXAGON_GENPTR_H
> +#define HEXAGON_GENPTR_H
> +
> +#include "insn.h"
> +
> +extern const SemanticInsn opcode_genptr[];
> +
> +#endif
> diff --git a/target/hexagon/genptr.c b/target/hexagon/genptr.c
> new file mode 100644
> index 0000000..7481f4c
> --- /dev/null
> +++ b/target/hexagon/genptr.c
> @@ -0,0 +1,331 @@
> +/*
> + * Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights
> Reserved.
> + *
> + * This program 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 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program 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 this program; if not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#define QEMU_GENERATE
Maybe move this ...
> +#include "qemu/osdep.h"
> +#include "qemu/log.h"
> +#include "cpu.h"
> +#include "internal.h"
> +#include "tcg/tcg-op.h"
> +#include "insn.h"
> +#include "opcodes.h"
> +#include "translate.h"
... here with a comment:
#define QEMU_GENERATE /* Used internally by macros.h */
> +#include "macros.h"
and undef?
#undef QEMU_GENERATE
> +#include "gen_tcg.h"
> +
> +static inline TCGv gen_read_preg(TCGv pred, uint8_t num)
> +{
> + tcg_gen_mov_tl(pred, hex_pred[num]);
> + return pred;
> +}
> +
> +static inline void gen_log_predicated_reg_write(int rnum, TCGv val, int slot)
> +{
> + TCGv one = tcg_const_tl(1);
> + TCGv zero = tcg_const_tl(0);
> + TCGv slot_mask = tcg_temp_new();
> +
> + tcg_gen_andi_tl(slot_mask, hex_slot_cancelled, 1 << slot);
> + tcg_gen_movcond_tl(TCG_COND_EQ, hex_new_value[rnum], slot_mask, zero,
> + val, hex_new_value[rnum]);
> +#if HEX_DEBUG
Can you declare an 'bool hexagon_debug_enabled(void);' eventually
inlined, so we can get this code compiled (to avoid bitroting) using
if (hexagon_debug_enabled()) {
> + /* Do this so HELPER(debug_commit_end) will know */
> + tcg_gen_movcond_tl(TCG_COND_EQ, hex_reg_written[rnum], slot_mask, zero,
> + one, hex_reg_written[rnum]);
}
> +#endif
> +
> + tcg_temp_free(one);
> + tcg_temp_free(zero);
> + tcg_temp_free(slot_mask);
> +}
Otherwise looks good.
Regards,
Phil.
- [PATCH v8 05/35] Hexagon (disas) disassembler, (continued)
- [PATCH v8 05/35] Hexagon (disas) disassembler, Taylor Simpson, 2021/02/08
- [PATCH v8 13/35] Hexagon (target/hexagon) instruction/packet decode, Taylor Simpson, 2021/02/08
- [PATCH v8 19/35] Hexagon (target/hexagon) generator phase 1 - C preprocessor for semantics, Taylor Simpson, 2021/02/08
- [PATCH v8 06/35] Hexagon (target/hexagon) register names, Taylor Simpson, 2021/02/08
- [PATCH v8 09/35] Hexagon (target/hexagon) architecture types, Taylor Simpson, 2021/02/08
- [PATCH v8 26/35] Hexagon (target/hexagon) TCG generation, Taylor Simpson, 2021/02/08
- [PATCH v8 10/35] Hexagon (target/hexagon) instruction and packet types, Taylor Simpson, 2021/02/08
- [PATCH v8 15/35] Hexagon (target/hexagon/arch.[ch]) utility functions, Taylor Simpson, 2021/02/08
- [PATCH v8 25/35] Hexagon (target/hexagon) instruction classes, Taylor Simpson, 2021/02/08
- [PATCH v8 17/35] Hexagon (target/hexagon/fma_emu.[ch]) utility functions, Taylor Simpson, 2021/02/08