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

Unified Diff: src/opts/SkNx_neon.h

Issue 1255913004: NEON has a ternary instruction. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkNx_neon.h
diff --git a/src/opts/SkNx_neon.h b/src/opts/SkNx_neon.h
index 1cae223b6c1413eba6e6fa5910f95b046f8ceff9..660b92c6b0c48511e53d1da57450d917eeaf2371 100644
--- a/src/opts/SkNx_neon.h
+++ b/src/opts/SkNx_neon.h
@@ -298,10 +298,7 @@ public:
}
SkNf thenElse(const SkNf& t, const SkNf& e) const {
- uint32x4_t ci = vreinterpretq_u32_f32(fVec),
- ti = vreinterpretq_u32_f32(t.fVec),
- ei = vreinterpretq_u32_f32(e.fVec);
- return vreinterpretq_f32_u32(vorrq_u32(vandq_u32(ti, ci), vbicq_u32(ei, ci)));
+ return vbslq_f32(vreinterpretq_u32_f32(fVec), t.fVec, e.fVec);
}
float32x4_t fVec;
@@ -338,8 +335,7 @@ public:
}
SkNi thenElse(const SkNi& t, const SkNi& e) const {
- return vorrq_u16(vandq_u16(t.fVec, fVec),
- vbicq_u16(e.fVec, fVec));
+ return vbslq_u16(fVec, t.fVec, e.fVec);
}
uint16x8_t fVec;
@@ -377,8 +373,7 @@ public:
}
SkNi thenElse(const SkNi& t, const SkNi& e) const {
- return vorrq_u8(vandq_u8(t.fVec, fVec),
- vbicq_u8(e.fVec, fVec));
+ return vbslq_u8(fVec, t.fVec, e.fVec);
}
uint8x16_t fVec;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698