From: Stepan D. <stp...@na...> - 2013-06-24 18:19:16
|
Hi Borja, > What happens in your example above when you use a real instruction like > for example LDD? Does it still use GPR8 regs? To me it's weird that if > you use a real instruction where operands are clearly defined in the td > file the instruction selector uses an invalid regclass. There are two kinds of inline asm support in LLVM: 1. You just support all the constraints and pastes inline-asm contents as-is. That's why its still allowed to use names like "some_instr". 2. You may expand inline-asm strings set, or in another words just parse it onto set of instructions. In this case you have to implement TargetLowering::ExpandInlineAsm method. I'd want to start it on this week though... But first we have to get avr-libc compilable (perhpas I read you thoughts ;-) ) Relative to memory constrains. I implemented initial version it can catch simplest cases (from test-case): @a = internal global i16 0, align 4 @b = internal global i16 0, align 4 define void @mem() { ;CHECK: some_instr Z, Y call void asm "some_instr $0, $1", "=*Q,=*Q"(i16* @a, i16* @b) ret void } The patch is attached. Its in my todo yet, to handle local variables. They could be emitted as Y+q expression. Hope to present this support tomorrow. So if 'a' and 'b' from example above would be local we could get "some_instr Y, Y+2" -Stepan. |