[LLVMdev] What CCAssignToXXXWithShadow means?

陳韋任 chenwj at iis.sinica.edu.tw
Fri Sep 23 04:38:40 PDT 2011

Hi, Anton

> On Win64 general purpose registers shadow xmm and vice versa, so, say,
> if you put argument into ecx, the xmm0 is marked as already occupied,
> if you put argument into xmm1, edx is marked as occupied, etc.

  I think ecx and xmm0 are physical different registers (not like ecx
and cx), right? So why we cannot use xmm0 while ecx has been used? Is
it just a rule or there are some considerations behind it?

>> CCIfType<[i32], CCIfAlign<"8", CCAssignToRegWithShadow<[R0, R2], [R0,
>> R1]>>>
>>  If we assign a value to R0(R2), then what happen to R0(R1)?
>It will be marked as occupied.

  If we assign to R0, then R0 is marked occupied. Is it a redundant
> Yes. On ARM shadowing used as a trick to ensure "register alignment"
> for i64 arguments - they should always be allocated starting from
> even-numbered register and remaining (odd-numbered) one should be left
> unallocated.

  If you can point me to some reference aboue "register alignment", I'll
be very appreciate it. Does register alignment bring benefit? In other
word, why register alignment is needed? 

  So the word "shadow" on http://www.heyrick.co.uk/assembler/regs.html
means different thing, hugh?

  Thanks! :-)


Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667

More information about the llvm-dev mailing list