Skip to content

[AMDGPU][MC] Inconsistent behavior of "no*" modifiers #48187

@dpreobra

Description

@dpreobra
Bugzilla Link 48843
Version trunk
OS All

Extended Description

These modifiers are supported for the sake of compatibility with sp3. However use of "no*" modifiers in llvm results in invalid code or counterintuitive behavior.

Examples:

  1. GFX8 buffer_store_lds_dword requires "lds" modifier:

    buffer_store_lds_dword s[4:7], s0 offset:4095 lds // ok
    buffer_store_lds_dword s[4:7], s0 offset:4095 // error

However "nolds" is also accepted and results in the same code as "lds" variant.

buffer_store_lds_dword s[4:7], s0 offset:4095 nolds  // ok?

There is a similar issue with buffer_load_* opcodes which support "lds" as an optional modifier. These instruction accept "nolds" but handle it as if it were "lds".

  1. exp "done" modifier is optional:

    exp mrt0 v0, v0, v0, v0 done // ok
    exp mrt0 v0, v0, v0, v0 // ok

However "nodone" is not supported.

  1. ds_gws_* opcodes accept both "gds" and "nogds" but produce the same code. Actually these opcodes have no lds variants so "nogds" should be illegal.

  2. Most modifiers which affect operand size ("offen", "idxen", "glc", etc) can be omitted, but "no*" variants trigger an error.

    buffer_load_format_x v5, off, s[8:11], s3 // ok
    buffer_load_format_x v5, off, s[8:11], s3 noidxen // error

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions