[LLVMdev] inline asm semantics: output constraint width smaller than input

Duncan Sands baldrick at free.fr
Tue Jan 27 23:41:08 PST 2009


Hi Chris,

> > LLVM's Codegen is rejecting inline asm when input/output constraints
> > have different bitwidths.
> >
> > For example in the Linux kernel calls to the various __put_user_
> > functions take %al, %ax, %eax, %rax/ (%eax:%edx) as input parameter,
> > and the output parameter is always an int (%eax). (hope I explained  
> > this
> > right)
> 
> Right, the interesting wrinkle is that I think llvm's codegen should  
> only see matching constraints of the same type.  If the front-end sees  
> an i8 tied to an i32, it should extend the i8 or do whatever else it  
> needs to do.

if I understand right the two cases are (for example):

(1): input (I) is i32, output (O) is i8.  In this case the asm output
type should be changed to i32 (O'), and O is obtained by truncating
O' to i8.

(2): input (I) is i8, output (O) is i32.  In this case the asm input
type should be changed to i32 (I'), and I' is obtained from I by
extending I to i32.

Is that it?

Thanks,

Duncan.



More information about the llvm-dev mailing list