2021-01-06 02:38:59 +00:00
|
|
|
8 registers, 22 instructions:
|
2021-01-08 19:45:42 +00:00
|
|
|
0 r0 = uniform32 ptr0 4
|
|
|
|
1 r1 = uniform32 ptr0 8
|
|
|
|
2 r2 = uniform32 ptr0 C
|
always init function fReturnValue
It's not sound to pass undefined (skvm::NA) values into select(),
but this is working today because the F32a argument is 'fixing' it.
The first time through this snippet updating fReturn value,
int i = 0;
for (skvm::Val& slot : currentFunction().fReturnValue) {
slot = select(returnsHere, f32(val[i]), f32(slot)).id;
i++;
}
the call to f32(slot) creates an F32{builder, NA}. We pass that to
select() and that argument's F32a(F32) constructor, resulting in
F32a{builder, NA, 0.0f}. Then when we need that as an F32, we resolve
it as splat(0.0f) because the F32a's id field is NA.
In short, best to remove F32a. :)
Added some SkASSERTs that would have caught this.
Change-Id: I67324cf20ad39ca555e69b9c407f379d14046043
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353838
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-14 16:15:00 +00:00
|
|
|
3 r3 = splat 0 (0)
|
|
|
|
4 r4 = splat FFFFFFFF (nan)
|
|
|
|
5 r5 = neq_f32 r0 r3
|
2021-01-06 02:38:59 +00:00
|
|
|
6 r6 = splat 3F800000 (1)
|
|
|
|
7 r6 = bit_and r6 r2
|
|
|
|
8 r7 = to_f32 r1
|
|
|
|
9 r7 = select r5 r6 r7
|
always init function fReturnValue
It's not sound to pass undefined (skvm::NA) values into select(),
but this is working today because the F32a argument is 'fixing' it.
The first time through this snippet updating fReturn value,
int i = 0;
for (skvm::Val& slot : currentFunction().fReturnValue) {
slot = select(returnsHere, f32(val[i]), f32(slot)).id;
i++;
}
the call to f32(slot) creates an F32{builder, NA}. We pass that to
select() and that argument's F32a(F32) constructor, resulting in
F32a{builder, NA, 0.0f}. Then when we need that as an F32, we resolve
it as splat(0.0f) because the F32a's id field is NA.
In short, best to remove F32a. :)
Added some SkASSERTs that would have caught this.
Change-Id: I67324cf20ad39ca555e69b9c407f379d14046043
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353838
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-14 16:15:00 +00:00
|
|
|
10 r3 = eq_i32 r1 r3
|
|
|
|
11 r3 = bit_xor r4 r3
|
|
|
|
12 r4 = splat 1 (1.4012985e-45)
|
2021-01-14 18:11:48 +00:00
|
|
|
13 r2 = bit_and r4 r2
|
2021-01-06 02:38:59 +00:00
|
|
|
14 r0 = trunc r0
|
2021-01-14 18:11:48 +00:00
|
|
|
15 r0 = select r3 r2 r0
|
2021-01-06 02:38:59 +00:00
|
|
|
16 r0 = to_f32 r0
|
|
|
|
17 r0 = mul_f32 r7 r0
|
|
|
|
loop:
|
2021-01-08 19:45:42 +00:00
|
|
|
18 store32 ptr1 r0
|
|
|
|
19 store32 ptr2 r0
|
|
|
|
20 store32 ptr3 r0
|
|
|
|
21 store32 ptr4 r0
|