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

Side by Side Diff: src/core/Sk64.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/core/SkPostConfig.h ('k') | src/core/SkMath.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Sk64.h" 8 #include "Sk64.h"
9 #include "SkMathPriv.h" 9 #include "SkMathPriv.h"
10 10
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 { 292 {
293 sqr -= testDiv; 293 sqr -= testDiv;
294 root++; 294 root++;
295 } 295 }
296 } while (--count >= 0); 296 } while (--count >= 0);
297 SkASSERT((int32_t)root >= 0); 297 SkASSERT((int32_t)root >= 0);
298 298
299 return root; 299 return root;
300 } 300 }
301 301
302 #ifdef SkLONGLONG
303 SkLONGLONG Sk64::getLongLong() const
304 {
305 SkLONGLONG value = fHi;
306 value <<= 32;
307 return value | fLo;
308 }
309 #endif
310
311 SkFixed Sk64::getFixedDiv(const Sk64& denom) const 302 SkFixed Sk64::getFixedDiv(const Sk64& denom) const
312 { 303 {
313 Sk64 N = *this; 304 Sk64 N = *this;
314 Sk64 D = denom; 305 Sk64 D = denom;
315 int32_t sign = SkExtractSign(N.fHi ^ D.fHi); 306 int32_t sign = SkExtractSign(N.fHi ^ D.fHi);
316 SkFixed result; 307 SkFixed result;
317 308
318 N.abs(); 309 N.abs();
319 D.abs(); 310 D.abs();
320 311
(...skipping 24 matching lines...) Expand all
345 else 336 else
346 N.roundRight(-shiftN); 337 N.roundRight(-shiftN);
347 N.div(D.get32(), Sk64::kTrunc_DivOption); 338 N.div(D.get32(), Sk64::kTrunc_DivOption);
348 if (N.is32()) 339 if (N.is32())
349 result = N.get32(); 340 result = N.get32();
350 else 341 else
351 result = SK_MaxS32; 342 result = SK_MaxS32;
352 } 343 }
353 return SkApplySign(result, sign); 344 return SkApplySign(result, sign);
354 } 345 }
OLDNEW
« no previous file with comments | « include/core/SkPostConfig.h ('k') | src/core/SkMath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698