[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructi
From: |
Chen Gang |
Subject: |
Re: [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib |
Date: |
Wed, 27 May 2015 05:39:12 +0800 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
On 5/12/15 05:26, Chen Gang wrote:
>>> >> +}
>>> >> +
>>> >> +/*
>>> >> + * Functional Description
>>> >> + *
>>> >> + * uint64_t output = 0;
>>> >> + * uint32_t counter;
>>> >> + * for (counter = 0; counter < (WORD_SIZE / 32); counter++)
>>> >> + * {
>>> >> + * bool asel = ((counter & 1) == 1);
>>> >> + * int in_sel = 0 + counter / 2;
>>> >> + * int32_t srca = get4Byte (rf[SrcA], in_sel);
>>> >> + * int32_t srcb = get4Byte (rf[SrcB], in_sel);
>>> >> + * output = set4Byte (output, counter, (asel ? srca : srcb));
>>> >> + * }
>>> >> + * rf[Dest] = output;
>>> >> +*/
>>> >> +
>>> >> +static void gen_v4int_l(struct DisasContext *dc,
>>> >> + uint8_t rdst, uint8_t rsrc, uint8_t rsrcb)
>>> >> +{
>>> >> + TCGv vdst = dest_gr(dc, rdst);
>>> >> + TCGv tmp = tcg_temp_new_i64();
>>> >> +
>>> >> + qemu_log_mask(CPU_LOG_TB_IN_ASM, "v4int_l r%d, r%d, r%d\n",
>>> >> + rdst, rsrc, rsrcb);
>>> >> +
>>> >> + tcg_gen_andi_i64(vdst, load_gr(dc, rsrc), 0xffffffff);
>>> >> + tcg_gen_shli_i64(vdst, vdst, 8);
>>> >> + tcg_gen_andi_i64(tmp, load_gr(dc, rsrcb), 0xffffffff);
>>> >> + tcg_gen_or_i64(vdst, vdst, tmp);
>> >
>> > And herein is a bug, that I'd hope using the helper functions would avoid:
>> > you
>> > shift by 8 instead of 32. This function simplifies to
>> >
> OK, thank you very much.
>
>> > tcg_gen_deposit_i64(vdst, load_gr(dc, rsrc), load_gr(dc, rsrcb),
>> > 32, 32);
>> >
Oh, it is:
tcg_gen_deposit_i64(vdst, load_gr(dc, rsrc), load_gr(dc, rsrcb),
0, 32);
> OK, thanks.
>
Thanks.
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed
- [Qemu-devel] [PATCH 01/10 v10] linux-user: tilegx: Firstly add architecture related features, (continued)
- [Qemu-devel] [PATCH 01/10 v10] linux-user: tilegx: Firstly add architecture related features, Chen Gang, 2015/05/10
- [Qemu-devel] [PATCH 02/10 v10] linux-user: Support tilegx architecture in linux-user, Chen Gang, 2015/05/10
- [Qemu-devel] [PATCH 03/10 v10] linux-user/syscall.c: Conditionalize syscalls which are not defined in tilegx, Chen Gang, 2015/05/10
- [Qemu-devel] [PATCH 04/10 v10] target-tilegx: Add opcode basic implementation from Tilera Corporation, Chen Gang, 2015/05/10
- [Qemu-devel] [PATCH 06/10 v10] target-tilegx: Add special register information from Tilera Corporation, Chen Gang, 2015/05/10
- [Qemu-devel] [PATCH 07/10 v10] target-tilegx: Add cpu basic features for linux-user, Chen Gang, 2015/05/10
- [Qemu-devel] [PATCH 08/10 v10] target-tilegx: Add helper features for linux-user, Chen Gang, 2015/05/10
- [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib, Chen Gang, 2015/05/10
- Re: [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib, Richard Henderson, 2015/05/11
- Re: [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib, Chen Gang, 2015/05/14
- Re: [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib, Chen Gang, 2015/05/14
- Re: [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib, Chen Gang, 2015/05/14
- Re: [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib, Chen Gang, 2015/05/14
- Re: [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib, Chen Gang, 2015/05/29
[Qemu-devel] [PATCH 10/10 v10] target-tilegx: Add TILE-Gx building files, Chen Gang, 2015/05/10
Message not available