<div dir="ltr">Hi<div><br></div><div>I write a machinefunction pass  to print all the machinefunction's machine instructions.</div><div><br></div><div>My target architecture is ARM. However, I don't understand some part of the machine instructions.</div><div><br></div><div>Below is some of the assembly language for function A.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">.text:0001C034                 STMFD   SP!, {R4,R10,R11,LR}</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">.text:0001C038                 ADD     R11, SP, #8</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">.text:0001C03C                 SUB     SP, SP, #0x20</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">.text:0001C040                 STR     R0, [R11,#statbuf]</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">.text:0001C044                 STR     R1, [SP,#0x28+var_14]</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">.text:0001C048                 LDR     R0, [SP,#0x28+var_14]</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">.text:0001C04C                 LDR     R0, [R0]</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">.text:0001C050                 STR     R0, [SP,#0x28+ts]</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">.text:0001C054                 LDR     R0, [SP,#0x28+ts]</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">.text:0001C058                 LDR     R0, [R0,#4]</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">.text:0001C05C                 CMN     R0, #0xC0000002</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">.text:0001C060                 BNE     loc_1C088</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">.text:0001C064                 B       loc_1C068</div><br></blockquote><div><br></div><div>Below is the corresponding MachineInstr</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">%1:gpr = COPY $r1</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">%0:gpr = COPY $r0</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">%3:gpr = COPY %1:gpr</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">%2:gpr = COPY %0:gpr</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">STRi12 %0:gpr, %stack.1.statbuf.addr, 0, 14, $noreg :: (store 4 into %ir.statbuf.addr)</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">STRi12 %1:gpr, %stack.2.ts.addr, 0, 14, $noreg :: (store 4 into %ir.ts.addr)</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">%4:gpr = LDRi12 %stack.2.ts.addr, 0, 14, $noreg</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">%5:gpr = LDRi12 killed %4:gpr, 0, 14, $noreg</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">STRi12 killed %5:gpr, %stack.3.timespec, 0, 14, $noreg</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">%6:gpr = LDRi12 %stack.3.timespec, 0, 14, $noreg</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">%7:gpr = LDRi12 killed %6:gpr, 4, 14, $noreg</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">CMNri killed %7:gpr, -1073741822, 14, $noreg</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Bcc %bb.3, 1, $cpsr</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">B %bb.1</blockquote></blockquote><div><br></div><div>I don't know how "<span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">STMFD   SP!, {R4,R10,R11,LR}</span>" is translated into the machineinstr. Also, what does $noreg mean? what does gpr and the value in front of it mean? It would be great if someone who are familiar with this can explain it to me or give me some reference. Thank you very much.</div><div><br></div><div>Regards</div><div>Muhui</div></div>