Revert of replace SkFixedDiv impl with native 64bit math (patchset #2 id:20001 of https://codereview.chromium.org/1022543003/)

Reason for revert:
http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/53096

layouttests failures

Original issue's description:
> replace SkFixedDiv impl with native 64bit math
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/7c44ca926bf42b3b2e56131f250c0fd58f87ac71

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1018523008
This commit is contained in:
reed 2015-03-19 04:10:42 -07:00 committed by Commit bot
parent 562d0e1cd2
commit effcba4a4d
2 changed files with 1 additions and 48 deletions

View File

@ -545,50 +545,6 @@ private:
///////////////////////////////////////////////////////////////////////////////
class DivBitsBench : public Benchmark {
protected:
enum {
N = 1000
};
volatile int32_t fSrc[N], fDst[N];
public:
DivBitsBench() {
SkRandom rand;
for (int i = 0; i < N; ++i) {
fSrc[i] = rand.nextU();
}
}
protected:
virtual void onDraw(const int loops, SkCanvas*) {
for (int j = 0; j < loops; ++j) {
for (int i = 0; i < N - 4; ++i) {
fDst[i] = SkDivBits(fSrc[i], fSrc[i] >> 3, 16);
}
}
}
virtual const char* onGetName() {
return "divbits";
}
};
DEF_BENCH( return new DivBitsBench; )
class FixedDivBench : public DivBitsBench {
protected:
virtual void onDraw(const int loops, SkCanvas*) {
for (int j = 0; j < loops; ++j) {
for (int i = 0; i < N - 4; ++i) {
fDst[i] = SkFixedDiv(fSrc[i], fSrc[i] >> 3);
}
}
}
virtual const char* onGetName() {
return "fixeddiv";
}
};
DEF_BENCH( return new FixedDivBench; )
///////////////////////////////////////////////////////////////////////////////
template <typename T>
class DivModBench : public Benchmark {
SkString fName;

View File

@ -78,10 +78,7 @@ typedef int32_t SkFixed;
#define SkFixedAbs(x) SkAbs32(x)
#define SkFixedAve(a, b) (((a) + (b)) >> 1)
static inline int32_t SkFixedDiv(int32_t numer, int32_t denom) {
int64_t tmp = ((int64_t)numer << 16) / denom;
return (int32_t)tmp;
}
#define SkFixedDiv(numer, denom) SkDivBits(numer, denom, 16)
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Now look for ASM overrides for our portable versions (should consider putting this in its own file)