[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 0/8] tcg: tidy the type of code_ptr
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH 0/8] tcg: tidy the type of code_ptr |
Date: |
Sun, 30 Mar 2014 20:19:29 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
On 03/30/2014 08:31 AM, Richard Henderson wrote:
> On 03/29/2014 01:26 PM, Peter Maydell wrote:
>> It seems like it might be worth abstracting out "give me the byte
>> difference between these two code pointers" rather than having
>> inline (uintptr_t)codeptr1 - (uintptr_t)codeptr2, but I dunno.
>
> Yeah, I dithered about that. I couldn't come up with a good name that
> adequately described what I wanted that was really any shorter than just
> having
> the casts.
static inline ptrdiff_t tcg_ptr_byte_diff(void *a, void *b)
{
return a - b;
}
static inline ptrdiff_t tcg_pcrel_diff(TCGContext *s, void *target)
{
return tcg_ptr_byte_diff(target, s->code_ptr);
}
static inline size_t tcg_current_code_size(TCGContext *s)
{
return tcg_ptr_byte_diff(s->code_ptr, s->code_buf);
}
>> Is there a better name than 'tcg_itype' ? Putting 'type' in the
>> name of a type is a bit redundant, and suggests it contains
>> a type rather than an insn.
>
> I'm open to suggestions there as well. On x86 and ia64, it won't hold an
> entire insn, so "tcg_insn" seemed inappropriate.
tcg_{isa,insn}_{part,elt} ?
r~
- [Qemu-devel] [PATCH 1/8] exec-all.h: Use stl_p to avoid undefined behaviour patching x86 jumps, (continued)
- [Qemu-devel] [PATCH 1/8] exec-all.h: Use stl_p to avoid undefined behaviour patching x86 jumps, Richard Henderson, 2014/03/28
- [Qemu-devel] [PATCH 2/8] tcg: Avoid stores to unaligned addresses, Richard Henderson, 2014/03/28
- [Qemu-devel] [PATCH 3/8] tcg: Avoid undefined behaviour patching code at unaligned addresses, Richard Henderson, 2014/03/28
- [Qemu-devel] [PATCH 4/8] tcg: Define tcg_itype for code pointers, Richard Henderson, 2014/03/28
- [Qemu-devel] [PATCH 5/8] tcg-ppc64: Define TCG_TARGET_ITYPE_SIZE, Richard Henderson, 2014/03/28
- [Qemu-devel] [PATCH 6/8] tcg-ppc: Define TCG_TARGET_ITYPE_SIZE, Richard Henderson, 2014/03/28
- [Qemu-devel] [PATCH 7/8] tcg-aarch64: Define TCG_TARGET_ITYPE_SIZE, Richard Henderson, 2014/03/28
- [Qemu-devel] [PATCH 8/8] tcg-sparc: Define TCG_TARGET_ITYPE_SIZE, Richard Henderson, 2014/03/28
- Re: [Qemu-devel] [PATCH 0/8] tcg: tidy the type of code_ptr, Peter Maydell, 2014/03/29
- Re: [Qemu-devel] [PATCH 0/8] tcg: tidy the type of code_ptr, Jay Foad, 2014/03/31