Hi Renato, First, I appreciate your answer again. :)>> %Char = type { c3, c4, c3, c2 } >> %Short = type { s3, s4, s3, s2 } >> %Int = type { i3, i4, i3, i2 } > See, i is not for int (the C data type) but for every integer type on > any language/platform combination. Normally, booleans are i1 and char > i8, in ARM short is 16 and int is 32, and all of them use the 'i' > notation.I think you misunderstood our type notation. By using your suggetion, "s4" means "i4 align short" in our notation. In "i4 align 2" for "short a:4", I think that "align 2" is already target dependent because short can be 2 or 4 bytes according to each target. so I wonder how do you think about "i4 align short" notation. (Is it impossible to have c specifier in align in order to be consistent with the rest of LLVM?) Your answer is so helpful to me. :) Thanks, Jin-Gu Kang
On 21 October 2010 08:26, Jin Gu Kang <jaykang10 at imrc.kist.re.kr> wrote:> I think you misunderstood our type notation. > By using your suggetion, "s4" means "i4 align short" in our notation. > In "i4 align 2" for "short a:4", I think that "align 2" is already target dependent > because short can be 2 or 4 bytes according to each target.I see, but that still doesn't change the fact that "short" means many things, but 2 means only 2. Saying that a variable aligns to something is already going towards platform-specific choices, I agree, but at least with explicit sizes, the back-end can ponder about its consequences in an organized way. But if you say "short" compiling to one architecture X, the architecture Y has no way of knowing what did you really mean, so it can't determine if it's going to change the alignment of all short or leave it.> so I wonder how do you think about "i4 align short" notation. > (Is it impossible to have c specifier in align in order to be consistent with the rest of LLVM?)The symbol 'i' is canonical in LLVM to mean any type of integer, I doubt that's going to change. Besides, there is already an explicit way of expressing the alignment, via the 'align' keyword. Besides, it's already a heavy change just to make sure type and/or variable alignment won't break all kinds of codegen/optimizations for all platforms you have access to. cheers, --renato