Fix v_mad_u64_u32 (#4466)

This commit is contained in:
Marcin Mikołajczyk
2026-05-23 20:41:18 +02:00
committed by GitHub
parent d7eacc8a17
commit 65ab88dd11
3 changed files with 9 additions and 3 deletions
@@ -1598,9 +1598,7 @@ void Translator::V_MAD_U64_U32(const GcnInst& inst) {
const auto src1 = GetSrc<IR::U32>(inst.src[1]);
const auto src2 = GetSrc64<IR::U64>(inst.src[2]);
// const IR::U64 mul_result = ir.UConvert(64, ir.IMul(src0, src1));
const IR::U64 mul_result =
ir.PackUint2x32(ir.CompositeConstruct(ir.IMul(src0, src1), ir.Imm32(0U)));
const IR::U64 mul_result = ir.IMul(ir.UConvert(64, src0), ir.UConvert(64, src1));
const IR::U64 sum_result = ir.IAdd(mul_result, src2);
SetDst64(inst.dst[0], sum_result);
+7
View File
@@ -1923,6 +1923,13 @@ U8U16U32U64 IREmitter::UConvert(size_t result_bitsize, const U8U16U32U64& value)
default:
break;
}
case 64:
switch (value.Type()) {
case Type::U32:
return Inst<U64>(Opcode::ConvertU64U32, value);
default:
break;
}
default:
break;
}
+1
View File
@@ -404,6 +404,7 @@ OPCODE(ConvertF64U32, F64, U32,
OPCODE(ConvertF32U16, F32, U16, )
OPCODE(ConvertU16U32, U16, U32, )
OPCODE(ConvertU32U16, U32, U16, )
OPCODE(ConvertU64U32, U64, U32, )
OPCODE(ConvertU8U32, U8, U32, )
OPCODE(ConvertU32U8, U32, U8, )
OPCODE(ConvertS32S8, U32, U8, )