<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Agreed, I looked at whether it was worth modeling each sub-flag a while ago and it didn’t seem worth it back then:<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><a href="https://github.com/jfbastien/benchmark-x86-flags" class="">https://github.com/jfbastien/benchmark-x86-flags</a></div></blockquote><div class="">Of course it’s a microbenchmark of what I was looking at back then… Might still be worth doing. At the time I remember that GCC did really well on each sub-flag, but I think they did their magic through simple peepholes instead of fully modeling stuff. Maybe we can do more of that first?</div><div class=""><br class=""></div><div class="">Also, IIRC Chandler had looked into EFLAGS some more recently.</div><div class=""><br class=""></div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jun 24, 2019, at 8:45 PM, Craig Topper via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><div dir="auto" class="">We don’t model the eflags at that level. With maybe the exception of the direction flag. It’s just not that useful to the compiler to have the exact bits that are changed. And I’m not even sure we would ever emit CLC on our own.</div></div><div class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 24, 2019 at 7:59 PM Antonin Reitz via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br class="">
<br class="">
Here is one question regarding the LLVM TableGen:<br class="">
<br class="">
Which file in the llvm/lib/Target/X86 folder describes how the bits in <br class="">
the EFLAGS register are modified by the x86 instructions? For example, <br class="">
in the "X86InstrInfo.td" file, lines 2134-2135, it says:<br class="">
<br class="">
let SchedRW = [WriteALU], Defs = [EFLAGS], Uses = [EFLAGS] in {<br class="">
def CLC : I<0xF8, RawFrm, (outs), (ins), "clc", []>;<br class="">
<br class="">
So it says the Defs of CLC is EFLAGS, but actually the CLC instruction <br class="">
only clears the "CF" flag in the EFLAGS register and has nothing to do <br class="">
with the other bits of EFLAGS. So which files in this folder describes <br class="">
the fact that CLC only modifies the CF bit?<br class="">
<br class="">
Thank you in advance,<br class="">
Antonin Reitz<br class="">
<br class="">
_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class="">
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
</blockquote></div></div>-- <br class=""><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">~Craig</div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></body></html>