[PATCH] [RFC] Lame fix for PR20376

Reid Kleckner rnk at google.com
Tue Jul 22 10:22:40 PDT 2014


On Tue, Jul 22, 2014 at 10:00 AM, Tim Northover <t.p.northover at gmail.com>
wrote:

> When we do need to copy EFLAGS, we currently emit a pushf/popw or
> pushw/popf pair, which could clobber a local variable if we actually
> made use of the red zone. I don't think we do though (fortunately).
> There are apparently "lahf" and "sahf" we could use instead, if it
> came to it (at least for our purposes).
>

That's horrible.  Can we please never, ever, ever emit popf?  It's a really
slow instruction because could change lots of processor state (TF, DF, IF,
AC).  sahf+seto and lahf+add0x7f are what we used in DynamoRIO, and they
are enough to save the six so-called arithmetic flags.

My guess is that "patches are welcome" here.  :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140722/89054850/attachment.html>


More information about the llvm-commits mailing list