merge 0,1,2,3,... and 0.5f

Because floats are fun, the compiler cannot merge x + 0.5f +
[0,1,2,3,4...] into x + [0.5,1.5,2.5,3.5,4.5,...].  But we can.

Change-Id: I03b46c1ea0653877f35f6c888f29371b5f73d813
Reviewed-on: https://skia-review.googlesource.com/42480
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
This commit is contained in:
Mike Klein 2017-09-05 11:55:01 -04:00 committed by Skia Commit-Bot
parent 91f9a2c2bb
commit 16e357c711
3 changed files with 8613 additions and 8611 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -221,8 +221,8 @@ STAGE(seed_shader) {
// It's important for speed to explicitly cast(x) and cast(y),
// which has the effect of splatting them to vectors before converting to floats.
// On Intel this breaks a data dependency on previous loop iterations' registers.
float iota[] = { 0,1,2,3,4,5,6,7 };
r = cast(x) + 0.5f + unaligned_load<F>(iota);
float iota[] = { 0.5f,1.5f,2.5f,3.5f,4.5f,5.5f,6.5f,7.5f };
r = cast(x) + unaligned_load<F>(iota);
g = cast(y) + 0.5f;
b = 1.0f;
a = 0;