Is that even a valid instruction? I thought TEST only took 32-bit immediates. Fiona> On Jan 22, 2015, at 2:48 PM, Chris Sears <chris.sears at gmail.com> wrote: > > The problem is that REX TEST reg,#(1<<37) is 10 bytes vs 5 bytes for REX BT reg,37. > That's a large space penalty to pay for a possible partial update stall. > > So the idea of generating BT for -Os and TEST for -Ofast makes sense to me. > Regardless, LowerToBT is generating TEST for small values. > > I'm still tracking down the Clang issue and I'd like folks to look at that. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
My bad on that. So that's what the comment meant. That means BT is pretty much req'd in the 64b case. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150122/0b1bbd26/attachment.html>
Yeah, the alternative is to do movabs and then test, which is doable but I’m not sure if it’s worth it (surely BT + risk of flags merging penalty has to be better than two ops, one of which is ~9-10 bytes). Fiona> On Jan 22, 2015, at 2:59 PM, Chris Sears <chris.sears at gmail.com> wrote: > > My bad on that. So that's what the comment meant. > That means BT is pretty much req'd in the 64b case.
> On Jan 22, 2015, at 5:59 PM, Chris Sears <chris.sears at gmail.com> wrote: > > My bad on that. So that's what the comment meant. > That means BT is pretty much req'd in the 64b case.In the 64b case we can TEST with mask from memory. This is *still* preferable to BT in most instruction streams. One can reasonably argue that we should generate BT under –Os (I disagree, but only because I think that optimizing for code size to the point of completely disregarding performance is pointlessly stupid; if that’s what Os is meant to be, then by all means use BT). I don’t think one can make a case for BT outside of –Os. – Steve