Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undocumented Instructions from GCN ISA used in RDNA2 #93

Open
AquaGeneral opened this issue Apr 25, 2022 · 0 comments
Open

Undocumented Instructions from GCN ISA used in RDNA2 #93

AquaGeneral opened this issue Apr 25, 2022 · 0 comments

Comments

@AquaGeneral
Copy link

Both S_SETVSKIP and S_SET_GPR_IDX_ON seem to still exist in RDNA 2, and the RGA command line tool at the very least reports these instructions as ENC_SOPC_invalid_16. I've managed to create a small reproducible OpenGL compute shader that only produces two instances of S_SETVSKIP (targeting gfx1031):

#version 430 core

#ifdef GL_AMD_gpu_shader_half_float
#extension GL_AMD_gpu_shader_half_float : require
#else
#extension GL_NV_gpu_shader5 : require
#endif

layout(local_size_x = 8, local_size_y = 8, local_size_z = 8) in;

layout(binding = 0)           uniform usampler3D samp;
layout(binding = 0) writeonly uniform uimage3D   img;

// Total 17408 bytes per work group
shared float16_t b[16*16*16]; // 8192 bytes

void main() {
    uint lindex = gl_LocalInvocationIndex;
    uvec4 b_xyzw = texelFetchOffset(samp, ivec3(gl_WorkGroupID), 0, ivec3(0));
    f16vec2 b011_111 = unpackFloat2x16(b_xyzw.w);

    b[lindex + 500] = b011_111.y;

    memoryBarrierShared();
    barrier();
    
    imageStore(img, ivec3(gl_GlobalInvocationID), uvec4(1, 2, 3, 4));
}

And the binary representation of these two invalid instructions is 0xBF109F07 and 0xBF108080 respectively which looking at the GCN ISA, seem to map directly to S_SETVSKIP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant