I am seeing i128 from llvm-gcc on Alpha. I know the calling convention for them, they are split into two registers, but I don't know if that should be handled in the frontend or the backend. I would just as soon do it in the backend, but I didn't see any support in the new calling convention work for automatically splitting an argument into multiple registers. Is the backend the best place to do this or should I attempt to make llvm-gcc not generate i128 in the first place? e.g. I need to convert foo(i128) -> foo(i64 (low bits), i64 (high bits)) Andrew
On Thu, Aug 6, 2009 at 12:07 PM, Andrew Lenharth<andrewl at lenharth.org> wrote:> I am seeing i128 from llvm-gcc on Alpha. I know the calling > convention for them, they are split into two registers, but I don't > know if that should be handled in the frontend or the backend. I > would just as soon do it in the backend, but I didn't see any support > in the new calling convention work for automatically splitting an > argument into multiple registers. > > Is the backend the best place to do this or should I attempt to make > llvm-gcc not generate i128 in the first place? > > e.g. I need to convert foo(i128) -> foo(i64 (low bits), i64 (high bits)) > > AndrewAs far as I can tell, i128 already works the way you want it to... is there some case which isn't generating the right code? -Eli
Hello, Andrew> Is the backend the best place to do this or should I attempt to make > llvm-gcc not generate i128 in the first place?It depends whether i128 is a native type for alpha, or not. If it's not - frontend should not generate it. If it's native type then it might be useful just to declare new regclass with virtual 'wide' registers consist of register pairs and then just handle i128 as a type for such register pairs. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
On Thu, Aug 6, 2009 at 2:34 PM, Anton Korobeynikov<anton at korobeynikov.info> wrote:> Hello, Andrew > >> Is the backend the best place to do this or should I attempt to make >> llvm-gcc not generate i128 in the first place? > It depends whether i128 is a native type for alpha, or not. If it's > not - frontend should not generate it. If it's native type then it > might be useful just to declare new regclass with virtual 'wide' > registers consist of register pairs and then just handle i128 as a > type for such register pairs.Not native. That is what I was afraid of. Andrew
On Aug 6, 2009, at 12:34 PM, Anton Korobeynikov wrote:> Hello, Andrew > > >> Is the backend the best place to do this or should I attempt to make >> >> llvm-gcc not generate i128 in the first place? >> > It depends whether i128 is a native type for alpha, or not. If it's > not - frontend should not generate it.No, CodeGen will legalize types like i128 by expanding them into multiple registers, and this includes the calling-convention code (both new and old). The arguments and return values are communicated between target independent code and target dependent code in register-sized pieces. I'll add some comments to describe this better. Dan