Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Unified Diff: src/core/SkMath.cpp

Issue 18539004: ARM Skia NEON patches - 04 - Clean SkFixed / SkLONGLONG (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Remove SkLONGLONG + use int64_t where there was an existing long long SkFixed implementation Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/Sk64.cpp ('k') | tests/MathTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMath.cpp
diff --git a/src/core/SkMath.cpp b/src/core/SkMath.cpp
index 2693e5c13c15389fb2de10e75c52bc316e7259b5..6c6c6d56700d102e1d0e695fe092999883693c95 100644
--- a/src/core/SkMath.cpp
+++ b/src/core/SkMath.cpp
@@ -105,71 +105,6 @@ int32_t SkMulShift(int32_t a, int32_t b, unsigned shift) {
}
}
-SkFixed SkFixedMul_portable(SkFixed a, SkFixed b) {
-#if 0
- Sk64 tmp;
-
- tmp.setMul(a, b);
- tmp.shiftRight(16);
- return tmp.fLo;
-#elif defined(SkLONGLONG)
- return static_cast<SkFixed>((SkLONGLONG)a * b >> 16);
-#else
- int sa = SkExtractSign(a);
- int sb = SkExtractSign(b);
- // now make them positive
- a = SkApplySign(a, sa);
- b = SkApplySign(b, sb);
-
- uint32_t ah = a >> 16;
- uint32_t al = a & 0xFFFF;
- uint32_t bh = b >> 16;
- uint32_t bl = b & 0xFFFF;
-
- uint32_t R = ah * b + al * bh + (al * bl >> 16);
-
- return SkApplySign(R, sa ^ sb);
-#endif
-}
-
-SkFract SkFractMul_portable(SkFract a, SkFract b) {
-#if 0
- Sk64 tmp;
- tmp.setMul(a, b);
- return tmp.getFract();
-#elif defined(SkLONGLONG)
- return static_cast<SkFract>((SkLONGLONG)a * b >> 30);
-#else
- int sa = SkExtractSign(a);
- int sb = SkExtractSign(b);
- // now make them positive
- a = SkApplySign(a, sa);
- b = SkApplySign(b, sb);
-
- uint32_t ah = a >> 16;
- uint32_t al = a & 0xFFFF;
- uint32_t bh = b >> 16;
- uint32_t bl = b & 0xFFFF;
-
- uint32_t A = ah * bh;
- uint32_t B = ah * bl + al * bh;
- uint32_t C = al * bl;
-
- /* [ A ]
- [ B ]
- [ C ]
- */
- uint32_t Lo = C + (B << 16);
- uint32_t Hi = A + (B >>16) + (Lo < C);
-
- SkASSERT((Hi >> 29) == 0); // else overflow
-
- int32_t R = (Hi << 2) + (Lo >> 30);
-
- return SkApplySign(R, sa ^ sb);
-#endif
-}
-
int SkFixedMulCommon(SkFixed a, int b, int bias) {
// this function only works if b is 16bits
SkASSERT(b == (int16_t)b);
« no previous file with comments | « src/core/Sk64.cpp ('k') | tests/MathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698