Hi Anton,<div>Thanks for reply<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">
> I have defined registers, aliases and subregister set.<br>
> The problem is that register allocator is using 32bit registers that are<br>
> already used in a pair, for example:<br>
> lw $r0, 16[$r12] // load word to r0<br>
> ld $p0, 36[$r12] // load doubleword to p0<br>
> shl $p0, $p0, $r0 // shift left p0 by r0 and store result in p0<br>
> where p0 is a pair r0:r1<br>
> Could anyone tell me what am I doing wrong?<br>
</div>Have you defined aliases properly? Look how this is handled inside<br>
s390 backend (systemz).</blockquote><div> </div><div>I've compared again everything to systemz. The problem was I've defined paired class as a subclass of Register class instead of RegisterWithSubRegs class. After change the code is OK.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Note that in general you'll need to write "paired" reg-reg mov pseudo<br>
instructions.<br></blockquote><div> </div><div>Yes, I have those. </div><div><br></div><div>If you don't mind I'll ask few compilers/LLVM newbie questions.</div><div><br></div><div>I'd appreciate if someone could enlighten me on pseudo instructions.</div>
<div>These work fine if I want to print assembly. What if I want to generate a binary file directly: how can I expand something like this:</div><div>mov $p0, $p1</div><div>into two instructions:</div><div>mov $r0, $r2</div>
<div>mov $r1, $r3</div><div><br></div><div>Another problem: All of my instructions which operates on 64bit operands, take pairs of 32bit registers. However in some of these instructions registers are encoded as a pair number and in some as two single register numbers for each pair.</div>
<div><br></div><div>Similar problem with immediates which not fit in 10bits - they are encoded as separate upper22 bits and lower10 bits (64 bits long version of instruction instead of 32 bits).</div><div><br></div><div>Thanks a lot for explanation/suggestions</div>
<div>Artur</div></div></div>