Re: Minimum target alignment for a datatype

2005-07-22 Thread Richard Henderson
On Fri, Jul 22, 2005 at 02:13:12PM -0700, Chris Lattner wrote: > Anyone have any thoughts or opinions? This may have impact on a > number of things, including any pointer alignment analysis. MEM_ALIGN has code to deal with this. There's no reason you can't apply that to TYPE_ALIGN. I suspect

Re: Minimum target alignment for a datatype

2005-07-22 Thread Chris Lattner
On Jul 22, 2005, at 1:14 PM, Richard Henderson wrote: On Fri, Jul 22, 2005 at 11:30:40AM -0700, Chris Lattner wrote: Understood. I'm just looking for the minimum type alignment without user alignment. It appears that this is impossible to get from the targets, due to the way the targets can

Re: Minimum target alignment for a datatype

2005-07-22 Thread Chris Lattner
On Jul 22, 2005, at 12:42 PM, Andrew Pinski wrote: struct X { int A; double B; }; This is modified by things like ADJUST_FIELD_ALIGN and ROUND_TYPE_ALIGN. As such, I don't think there is a way to get this alignment in a target-independent way. Does that sound right? You want the alignment

Re: Minimum target alignment for a datatype

2005-07-22 Thread Richard Henderson
On Fri, Jul 22, 2005 at 11:30:40AM -0700, Chris Lattner wrote: > Understood. I'm just looking for the minimum type alignment without > user alignment. It appears that this is impossible to get from the > targets, due to the way the targets can override type alignments in > (almost completel

Re: Minimum target alignment for a datatype

2005-07-22 Thread Andrew Pinski
> > I'm having a hard time with the simplicity of your question: > > ? Certainly, I don't expect that to answer your question, but I > > don't understand why. > > The problem I am running into is that the double in this struct is > only 4-byte aligned on darwin: > > struct X { int A; double

Re: Minimum target alignment for a datatype

2005-07-22 Thread Chris Lattner
On Jul 22, 2005, at 12:33 PM, Mike Stump wrote: On Friday, July 22, 2005, at 11:07 AM, Chris Lattner wrote: I'm trying to determine (in target-independent code) what the *minimum* target alignment of a type is. For example, on darwin, double's are normally 4-byte aligned, but are 8-byte a

Re: Minimum target alignment for a datatype

2005-07-22 Thread Mike Stump
On Friday, July 22, 2005, at 11:07 AM, Chris Lattner wrote: I'm trying to determine (in target-independent code) what the *minimum* target alignment of a type is. For example, on darwin, double's are normally 4-byte aligned, but are 8-byte aligned in some cases (e.g. when they are the first el

Re: Minimum target alignment for a datatype

2005-07-22 Thread Chris Lattner
On Jul 22, 2005, at 11:27 AM, Dale Johannesen wrote: On Jul 22, 2005, at 11:07 AM, Chris Lattner wrote: I'm trying to determine (in target-independent code) what the *minimum* target alignment of a type is. For example, on darwin, double's are normally 4-byte aligned, but are 8-byte aligned

Re: Minimum target alignment for a datatype

2005-07-22 Thread Dale Johannesen
On Jul 22, 2005, at 11:07 AM, Chris Lattner wrote: Hi All, I'm trying to determine (in target-independent code) what the *minimum* target alignment of a type is. For example, on darwin, double's are normally 4-byte aligned, but are 8-byte aligned in some cases (e.g. when they are the firs

Minimum target alignment for a datatype

2005-07-22 Thread Chris Lattner
Hi All, I'm trying to determine (in target-independent code) what the *minimum* target alignment of a type is. For example, on darwin, double's are normally 4-byte aligned, but are 8-byte aligned in some cases (e.g. when they are the first element of a struct). TYPE_ALIGN on a double r