diff options
| author | 2012-04-11 23:48:55 -0700 | |
|---|---|---|
| committer | 2012-04-12 11:16:33 -0700 | |
| commit | a47468765b3c314b4b76959e3976af4f012bc533 (patch) | |
| tree | db7c38d2b2f0aa080e56f7211de1292fb278c1f6 /src/compiler_llvm/method_compiler.cc | |
| parent | 4cacde827074c2d116aca47d50c2fd92d681ae8a (diff) | |
Fix 041. Float to int.
Change-Id: I916f2a27c4bf515b4f8163f8f9da03425b61ff4b
Diffstat (limited to 'src/compiler_llvm/method_compiler.cc')
| -rw-r--r-- | src/compiler_llvm/method_compiler.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc index 7a47c89170..e044c54b44 100644 --- a/src/compiler_llvm/method_compiler.cc +++ b/src/compiler_llvm/method_compiler.cc @@ -796,11 +796,11 @@ void MethodCompiler::EmitInstruction(uint32_t dex_pc, break; case Instruction::FLOAT_TO_INT: - EmitInsn_FPToInt(ARGS, kFloat, kInt); + EmitInsn_FPToInt(ARGS, kFloat, kInt, F2I); break; case Instruction::FLOAT_TO_LONG: - EmitInsn_FPToInt(ARGS, kFloat, kLong); + EmitInsn_FPToInt(ARGS, kFloat, kLong, F2L); break; case Instruction::FLOAT_TO_DOUBLE: @@ -808,11 +808,11 @@ void MethodCompiler::EmitInstruction(uint32_t dex_pc, break; case Instruction::DOUBLE_TO_INT: - EmitInsn_FPToInt(ARGS, kDouble, kInt); + EmitInsn_FPToInt(ARGS, kDouble, kInt, D2I); break; case Instruction::DOUBLE_TO_LONG: - EmitInsn_FPToInt(ARGS, kDouble, kLong); + EmitInsn_FPToInt(ARGS, kDouble, kLong, D2L); break; case Instruction::DOUBLE_TO_FLOAT: @@ -3207,7 +3207,8 @@ void MethodCompiler::EmitInsn_IntToFP(uint32_t dex_pc, void MethodCompiler::EmitInsn_FPToInt(uint32_t dex_pc, Instruction const* insn, JType src_jty, - JType dest_jty) { + JType dest_jty, + runtime_support::RuntimeId runtime_func_id) { DecodedInstruction dec_insn(insn); @@ -3215,8 +3216,7 @@ void MethodCompiler::EmitInsn_FPToInt(uint32_t dex_pc, DCHECK(dest_jty == kInt || dest_jty == kLong) << dest_jty; llvm::Value* src_value = EmitLoadDalvikReg(dec_insn.vB, src_jty, kAccurate); - llvm::Type* dest_type = irb_.getJType(dest_jty, kAccurate); - llvm::Value* dest_value = irb_.CreateFPToSI(src_value, dest_type); + llvm::Value* dest_value = irb_.CreateCall(irb_.GetRuntime(runtime_func_id), src_value); EmitStoreDalvikReg(dec_insn.vA, dest_jty, kAccurate, dest_value); irb_.CreateBr(GetNextBasicBlock(dex_pc)); |