diff options
author | Logan Chien <loganchien@google.com> | 2011-12-27 18:11:52 +0800 |
---|---|---|
committer | Shih-wei Liao <sliao@google.com> | 2012-02-16 21:47:33 -0800 |
commit | 927744f18fc933df009d5af259422db51d116e26 (patch) | |
tree | 1f2a9f27f6def09b58a060bf49b489cbf9db1935 | |
parent | c56ded9cb9ff1b94fae58c4017014c8d358719bd (diff) | |
download | art-927744f18fc933df009d5af259422db51d116e26.zip art-927744f18fc933df009d5af259422db51d116e26.tar.gz art-927744f18fc933df009d5af259422db51d116e26.tar.bz2 |
Implement floating-point truncation.
Change-Id: Id14a447fc4c3ce78126f0cba8f63273124938b13
-rw-r--r-- | src/compiler_llvm/method_compiler.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc index bc47a8d..37da618 100644 --- a/src/compiler_llvm/method_compiler.cc +++ b/src/compiler_llvm/method_compiler.cc @@ -1823,7 +1823,13 @@ void MethodCompiler::EmitInsn_FExt(uint32_t dex_pc, void MethodCompiler::EmitInsn_FTrunc(uint32_t dex_pc, Instruction const* insn) { - // UNIMPLEMENTED(WARNING); + + Instruction::DecodedInstruction dec_insn(insn); + + llvm::Value* src_value = EmitLoadDalvikReg(dec_insn.vB_, kDouble, kAccurate); + llvm::Value* result_value = irb_.CreateFPTrunc(src_value, irb_.getJFloatTy()); + EmitStoreDalvikReg(dec_insn.vA_, kFloat, kAccurate, result_value); + irb_.CreateBr(GetNextBasicBlock(dex_pc)); } |