Index: lib/Target/Sparc/SparcISelLowering.cpp =================================================================== --- lib/Target/Sparc/SparcISelLowering.cpp +++ lib/Target/Sparc/SparcISelLowering.cpp @@ -3488,23 +3488,23 @@ else return std::make_pair(0U, &SP::IntRegsRegClass); case 'f': - if (VT == MVT::f32) + if (VT == MVT::f32 || VT == MVT::i32) return std::make_pair(0U, &SP::FPRegsRegClass); - else if (VT == MVT::f64) + else if (VT == MVT::f64 || VT == MVT::i64) return std::make_pair(0U, &SP::LowDFPRegsRegClass); else if (VT == MVT::f128) return std::make_pair(0U, &SP::LowQFPRegsRegClass); - llvm_unreachable("Unknown ValueType for f-register-type!"); - break; + // This will generate an error message + return std::make_pair(0U, nullptr); case 'e': - if (VT == MVT::f32) + if (VT == MVT::f32 || VT == MVT::i32) return std::make_pair(0U, &SP::FPRegsRegClass); - else if (VT == MVT::f64) + else if (VT == MVT::f64 || VT == MVT::i64 ) return std::make_pair(0U, &SP::DFPRegsRegClass); else if (VT == MVT::f128) return std::make_pair(0U, &SP::QFPRegsRegClass); - llvm_unreachable("Unknown ValueType for e-register-type!"); - break; + // This will generate an error message + return std::make_pair(0U, nullptr); } } else if (!Constraint.empty() && Constraint.size() <= 5 && Constraint[0] == '{' && *(Constraint.end()-1) == '}') { Index: test/CodeGen/SPARC/inlineasm.ll =================================================================== --- test/CodeGen/SPARC/inlineasm.ll +++ test/CodeGen/SPARC/inlineasm.ll @@ -130,3 +130,16 @@ tail call void asm sideeffect "faddd $0,$1,$2", "{f20},{f20},{f20}"(double 9.0, double 10.0, double 11.0) ret void } + +; CHECK-LABEL: test_constraint_f_e_i32_i64: +; CHECK: ld [%o0+%lo(.LCPI13_0)], %f0 +; CHECK: ldd [%o0+%lo(.LCPI13_1)], %f2 +; CHECK: fadds %f0, %f0, %f0 +; CHECK: faddd %f2, %f2, %f0 + +define void @test_constraint_f_e_i32_i64() { +entry: + %0 = call float asm sideeffect "fadds $1, $2, $0", "=f,f,e"(i32 0, i32 0) + %1 = call double asm sideeffect "faddd $1, $2, $0", "=f,f,e"(i64 0, i64 0) + ret void +}