R600/SI: Replace ffs(x) - 1 with countTrailingZeros(x)
authorTom Stellard <thomas.stellard@amd.com>
Wed, 23 Oct 2013 03:50:25 +0000 (03:50 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Wed, 23 Oct 2013 03:50:25 +0000 (03:50 +0000)
ffs(x) broke the mingw buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193225 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/R600/SIISelLowering.cpp

index b37d5b282b243f0cd592de08d3ff49d358d38009..371572e31a17ebaabdb754e56e0ae8641fc111d8 100644 (file)
@@ -1115,7 +1115,7 @@ void SITargetLowering::adjustWritemask(MachineSDNode *&Node,
     unsigned Comp;
     for (unsigned i = 0, Dmask = OldDmask; i <= Lane; i++) {
       assert(Dmask);
-      Comp = ffs(Dmask)-1;
+      Comp = countTrailingZeros(Dmask);
       Dmask &= ~(1 << Comp);
     }