File tree Expand file tree Collapse file tree 2 files changed +562
-7
lines changed
test/CodeGen/RISCV/GlobalISel/irtranslator Expand file tree Collapse file tree 2 files changed +562
-7
lines changed Original file line number Diff line number Diff line change @@ -102,9 +102,14 @@ struct RISCVOutgoingValueHandler : public CallLowering::OutgoingValueHandler {
102102
103103 void assignValueToReg (Register ValVReg, Register PhysReg,
104104 const CCValAssign &VA) override {
105- // If we're passing an f32 value into an i64, anyextend before copying.
106- if (VA.getLocVT () == MVT::i64 && VA.getValVT () == MVT::f32 )
107- ValVReg = MIRBuilder.buildAnyExt (LLT::scalar (64 ), ValVReg).getReg (0 );
105+ // If we're passing a smaller fp value into a larger integer register,
106+ // anyextend before copying.
107+ if ((VA.getLocVT () == MVT::i64 && VA.getValVT () == MVT::f32 ) ||
108+ ((VA.getLocVT () == MVT::i32 || VA.getLocVT () == MVT::i64 ) &&
109+ VA.getValVT () == MVT::f16 )) {
110+ LLT DstTy = LLT::scalar (VA.getLocVT ().getSizeInBits ());
111+ ValVReg = MIRBuilder.buildAnyExt (DstTy, ValVReg).getReg (0 );
112+ }
108113
109114 Register ExtReg = extendRegister (ValVReg, VA);
110115 MIRBuilder.buildCopy (PhysReg, ExtReg);
You can’t perform that action at this time.
0 commit comments