<div dir="ltr">Hello,<div>    I wrote the following IR code:"</div><div>    ...</div><div>    call @fesetround int32 0x400</div><div>    %result = call @llvm.rint.f32 f32 value</div><div>    call @fesetround int32 0x0</div>

<div>    ...</div><div>"</div><div><div><div dir="ltr"><div>   However, when the IR is JITed, "llvm.rint.f32" is translated to "roundps" and scheduled out of the two fesetround call. The final native code  looks like:"</div>

<div>    ...</div><div>    movabs <fesetround>, %rax</div><div>    mov 0x400, %rdi</div><div>    call *%rax</div><div>    xor %rdi, %rdi</div><div>    call *%rax</div><div>    roundps 0x4 %mmx0, %mmx0</div><div>    ...</div>

<div>"</div><div><br></div><div>   Is there any way to stop the optimization pass from scheduling the "llvm.rint.f32" out of two 'fesetround' calls? Or is there any other way to solve this problem?</div>

<div><br></div><div><br></div><div>Bin LI,</div><div>State Key Laboratory of Computer Architecture,</div><div>Institute of Computing Technology of Chinese Academy of Sciences,</div><div>Address: NO.6 Kexueyuan South Road, Haidian District, Beijing, China</div>

<div>Phone: 18811212264</div><div>email: <a href="mailto:richardustc@gmail.com" target="_blank">richardustc@gmail.com</a></div></div></div>
</div></div>