Quick compiler: improve ClobberSReg comments
Issue 6501474
Improve the comments describing the usage of ClobberSReg(). Also, desk-checked all current
uses of ClobberSReg() to make sure they are appropriate.
No code changes - only comments.
Change-Id: Ife8419a7e2c2e51b258df7709a7d903d1fd93a44
diff --git a/src/compiler/codegen/x86/fp_x86.cc b/src/compiler/codegen/x86/fp_x86.cc
index 78c737d..6bfe9a2 100644
--- a/src/compiler/codegen/x86/fp_x86.cc
+++ b/src/compiler/codegen/x86/fp_x86.cc
@@ -158,6 +158,7 @@
case Instruction::FLOAT_TO_INT: {
rl_src = LoadValue(cu, rl_src, kFPReg);
src_reg = rl_src.low_reg;
+ // In case result vreg is also src vreg, break association to avoid useless copy by EvalLoc()
ClobberSReg(cu, rl_dest.s_reg_low);
rl_result = EvalLoc(cu, rl_dest, kCoreReg, true);
int temp_reg = AllocTempFloat(cu);
@@ -179,6 +180,7 @@
case Instruction::DOUBLE_TO_INT: {
rl_src = LoadValueWide(cu, rl_src, kFPReg);
src_reg = rl_src.low_reg;
+ // In case result vreg is also src vreg, break association to avoid useless copy by EvalLoc()
ClobberSReg(cu, rl_dest.s_reg_low);
rl_result = EvalLoc(cu, rl_dest, kCoreReg, true);
int temp_reg = AllocTempDouble(cu) | X86_FP_DOUBLE;
@@ -245,6 +247,7 @@
rl_src2 = LoadValueWide(cu, rl_src2, kFPReg);
src_reg2 = S2d(rl_src2.low_reg, rl_src2.high_reg);
}
+ // In case result vreg is also src vreg, break association to avoid useless copy by EvalLoc()
ClobberSReg(cu, rl_dest.s_reg_low);
RegLocation rl_result = EvalLoc(cu, rl_dest, kCoreReg, true);
LoadConstantNoClobber(cu, rl_result.low_reg, unordered_gt ? 1 : 0);