[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 21/26] target-xtensa: implement unaligned except
From: |
Max Filippov |
Subject: |
Re: [Qemu-devel] [PATCH 21/26] target-xtensa: implement unaligned exception option |
Date: |
Sun, 22 May 2011 16:10:16 +0400 |
User-agent: |
KMail/1.13.6 (Linux/2.6.34.8-68.fc13.x86_64; KDE/4.5.5; x86_64; ; ) |
> > +static void gen_load_store_alignment(DisasContext *dc, int shift, TCGv_i32
> > addr)
> > +{
> > + TCGv_i32 tmp = tcg_temp_local_new_i32();
> > + tcg_gen_mov_i32(tmp, addr);
> > + tcg_gen_andi_i32(addr, addr, ~0 << shift);
> > + if (option_enabled(dc, XTENSA_OPTION_UNALIGNED_EXCEPTION)) {
> > + int label = gen_new_label();
> > + tcg_gen_brcond_i32(TCG_COND_EQ, addr, tmp, label);
> > + gen_exception_cause_vaddr(dc, LOAD_STORE_ALIGNMENT_CAUSE, tmp);
> > + gen_set_label(label);
> > + }
> > + tcg_temp_free(tmp);
> > +}
>
> This is not the correct method for this. Set ALIGNED_ONLY before
> defining the softmmu_templates. Define do_unaligned_access to raise
> the exception. See e.g. target-sparc/op_helper.c.
There are three alignment possibilities for xtensa: no unaligned exception,
unaligned exception and hardware alignment.
In the first case unaligned access silently goes to aligned address. It looks
like it cannot be done via do_unaligned_access, can it?
In the third case most unaligned accesses are handled transparently by the
hardware. But e.g. unaligned access by multiprocessor synchronization
instructions still cause alignment exception. Do I need to implement a
different alignment checking mechanism for those unhandled cases?
Thanks.
-- Max
- Re: [Qemu-devel] [PATCH 19/26] target-xtensa: implement loop option, (continued)
[Qemu-devel] [PATCH 20/26] target-xtensa: implement extended L32R, Max Filippov, 2011/05/17
[Qemu-devel] [PATCH 21/26] target-xtensa: implement unaligned exception option, Max Filippov, 2011/05/17
- Re: [Qemu-devel] [PATCH 21/26] target-xtensa: implement unaligned exception option, Richard Henderson, 2011/05/19
- Re: [Qemu-devel] [PATCH 21/26] target-xtensa: implement unaligned exception option,
Max Filippov <=
- Re: [Qemu-devel] [PATCH 21/26] target-xtensa: implement unaligned exception option, Richard Henderson, 2011/05/22
- Re: [Qemu-devel] [PATCH 21/26] target-xtensa: implement unaligned exception option, Max Filippov, 2011/05/22
- Re: [Qemu-devel] [PATCH 21/26] target-xtensa: implement unaligned exception option, Richard Henderson, 2011/05/23
- Re: [Qemu-devel] [PATCH 21/26] target-xtensa: implement unaligned exception option, Max Filippov, 2011/05/23
- Re: [Qemu-devel] [PATCH 21/26] target-xtensa: implement unaligned exception option, Richard Henderson, 2011/05/24
[Qemu-devel] [PATCH 22/26] target-xtensa: implement SIMCALL, Max Filippov, 2011/05/17
[Qemu-devel] [PATCH 23/26] target-xtensa: implement interrupt option, Max Filippov, 2011/05/17