<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Hi, </div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">I have a question on inline assembly code generation for X64. </div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">I have following LLVM IR : </div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><div id="bloop_customfont" style="margin: 0px;">%c = fsub fast float %a, %b</div><div id="bloop_customfont" style="margin: 0px;"> tail call void asm sideeffect "mov $0, %eax \0A\09 movd $1, %xmm0 \0A\09 xchg %dx, %dx\0A", "ir,r,~{ax}"(i32 100, float %c) </div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">The assembly that I get for this part of the code is as follows (x64 target). </div><div id="bloop_customfont" style="margin: 0px;">*xchgw %dx, %dx is a nop that I am using to do some stuff in binary translator. </div><div id="bloop_customfont" style="margin: 0px;"><b><br></b></div><div id="bloop_customfont" style="margin: 0px;"><div id="bloop_customfont" style="margin: 0px;"><b>subss<span class="Apple-tab-span" style="white-space:pre"> </span>%xmm1, %xmm0</b></div><div id="bloop_customfont" style="margin: 0px;"><b>movd<span class="Apple-tab-span" style="white-space:pre"> </span>%xmm0, %edi</b></div><div id="bloop_customfont" style="margin: 0px;"><b>#APP</b></div><div id="bloop_customfont" style="margin: 0px;"><b>movl<span class="Apple-tab-span" style="white-space:pre"> </span>$25, %eax</b></div><div id="bloop_customfont" style="margin: 0px;"><b>movd<span class="Apple-tab-span" style="white-space:pre"> </span>%edi, %xmm0</b></div><div id="bloop_customfont" style="margin: 0px;"><b>xchgw<span class="Apple-tab-span" style="white-space:pre"> </span>%dx, %dx</b></div></div><div id="bloop_customfont" style="margin: 0px;"> </div><div id="bloop_customfont" style="margin: 0px;">What I wanted/expected was following : </div><div id="bloop_customfont" style="margin: 0px;"><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;"><b>subss<span class="Apple-tab-span" style="white-space: pre;"> </span>%xmm1, %xmm0</b></div><div id="bloop_customfont" style="margin: 0px;"><b>#APP</b></div><div id="bloop_customfont" style="margin: 0px;"><b>movl<span class="Apple-tab-span" style="white-space: pre;"> </span>$25, %eax</b></div><div id="bloop_customfont" style="margin: 0px;"><b>movd<span class="Apple-tab-span" style="white-space: pre;"> </span>%xmm0, %xmm0</b></div><div id="bloop_customfont" style="margin: 0px;"><b>xchgw<span class="Apple-tab-span" style="white-space: pre;"> </span>%dx, %dx</b></div></div></div><div class="bloop_container"><div class="bloop_frame"> </div></div><div><br></div><div>What would be the proper way to get the output I want ? </div><div><br></div><div>Thank you</div><div id="bloop_sign_1426919345030449920" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">-- <br>Tae Jun Ham</div></div></body></html>