From cd5e7d75e96922d041cca9f10486e4f02974a545 Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Mon, 31 Oct 2016 10:08:55 -0400 Subject: update SkFixed15 float conversion notes. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4181 Change-Id: Iec7ec71340a2b17db067b5e7fc0c34f3a2d313b2 Reviewed-on: https://skia-review.googlesource.com/4181 Reviewed-by: Mike Klein Commit-Queue: Mike Klein --- src/core/SkFixed15.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/SkFixed15.h b/src/core/SkFixed15.h index 69502434bf..43a9fae773 100644 --- a/src/core/SkFixed15.h +++ b/src/core/SkFixed15.h @@ -63,7 +63,9 @@ private: // vandq_s16(x,y), 15); // - Conversion to and from float can be done manually with bit masks and float add/subtract, // rather than the naive version here involving int<->float conversion and float multiply. -// - On ARM, we can alternatively use the vcvtq_n_f32_u32(vmovl_u16(x), 15) to convert 4 at a -// time to float, and vcvtq_n_u32_f32(..., 15) for the other way around. +// - On x86, conversion to float is _mm_sub_ps(_mm_unpacklo_epi16(x, _mm_set1_epi16(0x4380)), +// _mm_set1_ps(256.0f)). // 0x43800000 +// - On ARM, we can use the vcvtq_n_f32_u32(vmovl_u16(x), 15) to convert to float, +// and vcvtq_n_u32_f32(..., 15) for the other way around. #endif//SkFixed15_DEFINED -- cgit v1.2.3