[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/5] qom: Allow objects to be allocated with increased alignm
From: |
Eduardo Habkost |
Subject: |
Re: [PATCH 1/5] qom: Allow objects to be allocated with increased alignment |
Date: |
Tue, 15 Sep 2020 18:00:55 -0400 |
On Tue, Sep 15, 2020 at 02:30:34PM -0700, Richard Henderson wrote:
> On 9/15/20 2:27 PM, Eduardo Habkost wrote:
> > On Tue, Sep 15, 2020 at 01:51:48PM -0700, Richard Henderson wrote:
> >> On 9/15/20 1:19 PM, Eduardo Habkost wrote:
> >>> Once we move to C11, we can just use max_align_t.
> >>
> >> Yes.
> >>
> >>> While we don't move to C11, why not just use
> >>> __alignof__(union { long l; void *p; double d; long double ld;})
> >>> ?
> >>
> >> For i386, this is 4.
> >
> > Is i386-linux the only case where there are additional alignment
> > guarantees not covered by C99?
>
> I think so.
>
> > I would prefer a i386-linux-specific #ifdef for that case instead
> > of guessing based on undocumented libc internals.
>
> I was thinking abi, not internals.
I see. As long as we can point to the specification backing the
assumptions in the code, I'm OK with that.
To me, it seems simpler to start with something that works on all
hosts (the alignment guarantees provided by C99), and add
arch-specific optimizations later.
--
Eduardo
- [PATCH 0/5] qom: Allow object to be aligned, Richard Henderson, 2020/09/15
- [PATCH 3/5] target/ppc: Set instance_align on PowerPCCPU TypeInfo, Richard Henderson, 2020/09/15
- [PATCH 2/5] target/arm: Set instance_align on CPUARM TypeInfo, Richard Henderson, 2020/09/15
- [PATCH 1/5] qom: Allow objects to be allocated with increased alignment, Richard Henderson, 2020/09/15
- Re: [PATCH 1/5] qom: Allow objects to be allocated with increased alignment, Eduardo Habkost, 2020/09/15
- Re: [PATCH 1/5] qom: Allow objects to be allocated with increased alignment, Richard Henderson, 2020/09/15
- Re: [PATCH 1/5] qom: Allow objects to be allocated with increased alignment, Eduardo Habkost, 2020/09/15
- Re: [PATCH 1/5] qom: Allow objects to be allocated with increased alignment, Richard Henderson, 2020/09/15
- Re: [PATCH 1/5] qom: Allow objects to be allocated with increased alignment, Eduardo Habkost, 2020/09/15
- Re: [PATCH 1/5] qom: Allow objects to be allocated with increased alignment, Richard Henderson, 2020/09/15
- Re: [PATCH 1/5] qom: Allow objects to be allocated with increased alignment,
Eduardo Habkost <=
[PATCH 4/5] target/riscv: Set instance_align on RISCVCPU TypeInfo, Richard Henderson, 2020/09/15
[PATCH 5/5] target/s390x: Set instance_align on S390CPU TypeInfo, Richard Henderson, 2020/09/15
Re: [PATCH 0/5] qom: Allow object to be aligned, Richard Henderson, 2020/09/15