[libre-riscv-dev] [Bug 139] Add LD.X and ST.X? Strided

bugzilla-daemon at libre-riscv.org bugzilla-daemon at libre-riscv.org
Fri Oct 4 11:10:28 BST 2019


http://bugs.libre-riscv.org/show_bug.cgi?id=139

--- Comment #22 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #21)
> worked it out - i got it confused with shuffle2, here:
> https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/shuffle.html
> 
> more in a mo - twin-SUBVL doesn't sound right.  SUBVL is intended to
> be applied globally.  the CSRs would need a total redesign to cope.

Well, we should redesign them then, since we need multiple SUBVLs to handle
code like the following (from SuperTuxKart):

https://github.com/supertuxkart/stk-code/blob/adc6b2a1764863fce17b63fec1f5bb0453ae275a/data/shaders/sp_grass.frag#L35

    vec4 layer_2 = sampleTextureLayer2(uv);
    o_diffuse_color = vec4(col.xyz, layer_2.z);

    o_normal_color.xy = 0.5 * EncodeNormal(normalize(normal)) + 0.5;
    o_normal_color.zw = layer_2.xy;

Note how only 2 elements of layer_2 are split off even though layer_2 has
SUBVL=4 (vec4)

shuffle2 can be used to calculate o_normal_color (which is a vec4) by combining
the result of EncodeNormal (vec2) with layer_2.xy (vec2 split off from vec4)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-riscv-dev mailing list