Add V_CVT_F64_I32 (#1219)

This commit is contained in:
dbz400 2024-10-04 00:48:28 +08:00 committed by GitHub
parent 5e26294e27
commit 54dafce541
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

@ -170,6 +170,7 @@ public:
void V_CVT_FLR_I32_F32(const GcnInst& inst);
void V_CVT_OFF_F32_I4(const GcnInst& inst);
void V_CVT_F32_UBYTE(u32 index, const GcnInst& inst);
void V_CVT_F64_I32(const GcnInst& inst);
void V_FRACT_F32(const GcnInst& inst);
void V_TRUNC_F32(const GcnInst& inst);
void V_CEIL_F32(const GcnInst& inst);

View file

@ -123,6 +123,8 @@ void Translator::EmitVectorAlu(const GcnInst& inst) {
return V_CVT_F32_UBYTE(2, inst);
case Opcode::V_CVT_F32_UBYTE3:
return V_CVT_F32_UBYTE(3, inst);
case Opcode::V_CVT_F64_I32:
return V_CVT_F64_I32(inst);
case Opcode::V_FRACT_F32:
return V_FRACT_F32(inst);
case Opcode::V_TRUNC_F32:
@ -662,6 +664,11 @@ void Translator::V_CVT_F32_UBYTE(u32 index, const GcnInst& inst) {
SetDst(inst.dst[0], ir.ConvertUToF(32, 32, byte));
}
void Translator::V_CVT_F64_I32(const GcnInst& inst) {
const IR::U32 src0{GetSrc(inst.src[0])};
SetDst64(inst.dst[0], ir.ConvertSToF(64, 32, src0));
}
void Translator::V_FRACT_F32(const GcnInst& inst) {
const IR::F32 src0{GetSrc<IR::F32>(inst.src[0])};
SetDst(inst.dst[0], ir.Fract(src0));