mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
Hexagon HVX (target/hexagon) TCG generation
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
This commit is contained in:
parent
33e9ed11d5
commit
a82dd54862
3 changed files with 311 additions and 4 deletions
|
@ -29,6 +29,7 @@ typedef struct DisasContext {
|
|||
uint32_t mem_idx;
|
||||
uint32_t num_packets;
|
||||
uint32_t num_insns;
|
||||
uint32_t num_hvx_insns;
|
||||
int reg_log[REG_WRITES_MAX];
|
||||
int reg_log_idx;
|
||||
DECLARE_BITMAP(regs_written, TOTAL_PER_THREAD_REGS);
|
||||
|
@ -37,6 +38,20 @@ typedef struct DisasContext {
|
|||
DECLARE_BITMAP(pregs_written, NUM_PREGS);
|
||||
uint8_t store_width[STORES_MAX];
|
||||
bool s1_store_processed;
|
||||
int future_vregs_idx;
|
||||
int future_vregs_num[VECTOR_TEMPS_MAX];
|
||||
int tmp_vregs_idx;
|
||||
int tmp_vregs_num[VECTOR_TEMPS_MAX];
|
||||
int vreg_log[NUM_VREGS];
|
||||
bool vreg_is_predicated[NUM_VREGS];
|
||||
int vreg_log_idx;
|
||||
DECLARE_BITMAP(vregs_updated_tmp, NUM_VREGS);
|
||||
DECLARE_BITMAP(vregs_updated, NUM_VREGS);
|
||||
DECLARE_BITMAP(vregs_select, NUM_VREGS);
|
||||
int qreg_log[NUM_QREGS];
|
||||
bool qreg_is_predicated[NUM_QREGS];
|
||||
int qreg_log_idx;
|
||||
bool pre_commit;
|
||||
} DisasContext;
|
||||
|
||||
static inline void ctx_log_reg_write(DisasContext *ctx, int rnum)
|
||||
|
@ -67,6 +82,46 @@ static inline bool is_preloaded(DisasContext *ctx, int num)
|
|||
return test_bit(num, ctx->regs_written);
|
||||
}
|
||||
|
||||
intptr_t ctx_future_vreg_off(DisasContext *ctx, int regnum,
|
||||
int num, bool alloc_ok);
|
||||
intptr_t ctx_tmp_vreg_off(DisasContext *ctx, int regnum,
|
||||
int num, bool alloc_ok);
|
||||
|
||||
static inline void ctx_log_vreg_write(DisasContext *ctx,
|
||||
int rnum, VRegWriteType type,
|
||||
bool is_predicated)
|
||||
{
|
||||
if (type != EXT_TMP) {
|
||||
ctx->vreg_log[ctx->vreg_log_idx] = rnum;
|
||||
ctx->vreg_is_predicated[ctx->vreg_log_idx] = is_predicated;
|
||||
ctx->vreg_log_idx++;
|
||||
|
||||
set_bit(rnum, ctx->vregs_updated);
|
||||
}
|
||||
if (type == EXT_NEW) {
|
||||
set_bit(rnum, ctx->vregs_select);
|
||||
}
|
||||
if (type == EXT_TMP) {
|
||||
set_bit(rnum, ctx->vregs_updated_tmp);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void ctx_log_vreg_write_pair(DisasContext *ctx,
|
||||
int rnum, VRegWriteType type,
|
||||
bool is_predicated)
|
||||
{
|
||||
ctx_log_vreg_write(ctx, rnum ^ 0, type, is_predicated);
|
||||
ctx_log_vreg_write(ctx, rnum ^ 1, type, is_predicated);
|
||||
}
|
||||
|
||||
static inline void ctx_log_qreg_write(DisasContext *ctx,
|
||||
int rnum, bool is_predicated)
|
||||
{
|
||||
ctx->qreg_log[ctx->qreg_log_idx] = rnum;
|
||||
ctx->qreg_is_predicated[ctx->qreg_log_idx] = is_predicated;
|
||||
ctx->qreg_log_idx++;
|
||||
}
|
||||
|
||||
extern TCGv hex_gpr[TOTAL_PER_THREAD_REGS];
|
||||
extern TCGv hex_pred[NUM_PREGS];
|
||||
extern TCGv hex_next_PC;
|
||||
|
@ -85,6 +140,12 @@ extern TCGv hex_dczero_addr;
|
|||
extern TCGv hex_llsc_addr;
|
||||
extern TCGv hex_llsc_val;
|
||||
extern TCGv_i64 hex_llsc_val_i64;
|
||||
extern TCGv hex_VRegs_updated;
|
||||
extern TCGv hex_QRegs_updated;
|
||||
extern TCGv hex_vstore_addr[VSTORES_MAX];
|
||||
extern TCGv hex_vstore_size[VSTORES_MAX];
|
||||
extern TCGv hex_vstore_pending[VSTORES_MAX];
|
||||
|
||||
bool is_gather_store_insn(Insn *insn, Packet *pkt);
|
||||
void process_store(DisasContext *ctx, Packet *pkt, int slot_num);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue