Implement V_READFIRSTLANE_B32 (#681)

* Implement V_READFIRSTLANE_B32

* refactor
This commit is contained in:
Grégoire Hage 2024-09-01 20:49:42 +02:00 committed by GitHub
parent e4d8857eb5
commit 1bd9317509
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 4 deletions

View file

@ -167,8 +167,14 @@ void Translator::S_BARRIER() {
}
void Translator::V_READFIRSTLANE_B32(const GcnInst& inst) {
ASSERT(info.stage != Stage::Compute);
SetDst(inst.dst[0], GetSrc(inst.src[0]));
const IR::ScalarReg dst{inst.dst[0].code};
const IR::U32 value{GetSrc(inst.src[0])};
if (info.stage != Stage::Compute) {
ir.SetScalarReg(dst, value);
} else {
ir.SetScalarReg(dst, ir.ReadFirstLane(value));
}
}
void Translator::V_READLANE_B32(const GcnInst& inst) {