blob: def4896875fb4d31437e333cbfc137ecf3578240 [file] [log] [blame]
buzbeee88dfbf2012-03-05 11:19:57 -08001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
buzbee1bc37c62012-11-20 13:35:41 -080017#include "x86_lir.h"
18#include "../codegen_util.h"
19#include "../ralloc_util.h"
20
buzbeee88dfbf2012-03-05 11:19:57 -080021namespace art {
22
buzbeefa57c472012-11-21 12:06:18 -080023bool GenArithOpFloat(CompilationUnit *cu, Instruction::Code opcode,
24 RegLocation rl_dest, RegLocation rl_src1, RegLocation rl_src2) {
Ian Rogersb5d09b22012-03-06 22:14:17 -080025 X86OpCode op = kX86Nop;
buzbeefa57c472012-11-21 12:06:18 -080026 RegLocation rl_result;
buzbeee88dfbf2012-03-05 11:19:57 -080027
Ian Rogersb5d09b22012-03-06 22:14:17 -080028 /*
29 * Don't attempt to optimize register usage since these opcodes call out to
30 * the handlers.
31 */
buzbee408ad162012-06-06 16:45:18 -070032 switch (opcode) {
Ian Rogersb5d09b22012-03-06 22:14:17 -080033 case Instruction::ADD_FLOAT_2ADDR:
34 case Instruction::ADD_FLOAT:
35 op = kX86AddssRR;
36 break;
37 case Instruction::SUB_FLOAT_2ADDR:
38 case Instruction::SUB_FLOAT:
39 op = kX86SubssRR;
40 break;
41 case Instruction::DIV_FLOAT_2ADDR:
42 case Instruction::DIV_FLOAT:
43 op = kX86DivssRR;
44 break;
45 case Instruction::MUL_FLOAT_2ADDR:
46 case Instruction::MUL_FLOAT:
47 op = kX86MulssRR;
48 break;
jeffhaobabda952012-08-02 15:55:30 -070049 case Instruction::NEG_FLOAT:
Ian Rogersb5d09b22012-03-06 22:14:17 -080050 case Instruction::REM_FLOAT_2ADDR:
jeffhaobabda952012-08-02 15:55:30 -070051 case Instruction::REM_FLOAT:
buzbeefa57c472012-11-21 12:06:18 -080052 return GenArithOpFloatPortable(cu, opcode, rl_dest, rl_src1, rl_src2);
Ian Rogersb5d09b22012-03-06 22:14:17 -080053 default:
54 return true;
55 }
buzbeefa57c472012-11-21 12:06:18 -080056 rl_src1 = LoadValue(cu, rl_src1, kFPReg);
57 rl_src2 = LoadValue(cu, rl_src2, kFPReg);
58 rl_result = EvalLoc(cu, rl_dest, kFPReg, true);
59 int r_dest = rl_result.low_reg;
60 int r_src1 = rl_src1.low_reg;
61 int r_src2 = rl_src2.low_reg;
62 if (r_dest == r_src2) {
63 r_src2 = AllocTempFloat(cu);
64 OpRegCopy(cu, r_src2, r_dest);
jeffhao4abb1a92012-06-08 17:02:08 -070065 }
buzbeefa57c472012-11-21 12:06:18 -080066 OpRegCopy(cu, r_dest, r_src1);
67 NewLIR2(cu, op, r_dest, r_src2);
68 StoreValue(cu, rl_dest, rl_result);
buzbeee88dfbf2012-03-05 11:19:57 -080069
Ian Rogersb5d09b22012-03-06 22:14:17 -080070 return false;
buzbeee88dfbf2012-03-05 11:19:57 -080071}
72
buzbeefa57c472012-11-21 12:06:18 -080073bool GenArithOpDouble(CompilationUnit *cu, Instruction::Code opcode,
74 RegLocation rl_dest, RegLocation rl_src1, RegLocation rl_src2) {
Ian Rogersb5d09b22012-03-06 22:14:17 -080075 X86OpCode op = kX86Nop;
buzbeefa57c472012-11-21 12:06:18 -080076 RegLocation rl_result;
buzbeee88dfbf2012-03-05 11:19:57 -080077
buzbee408ad162012-06-06 16:45:18 -070078 switch (opcode) {
Ian Rogersb5d09b22012-03-06 22:14:17 -080079 case Instruction::ADD_DOUBLE_2ADDR:
80 case Instruction::ADD_DOUBLE:
81 op = kX86AddsdRR;
82 break;
83 case Instruction::SUB_DOUBLE_2ADDR:
84 case Instruction::SUB_DOUBLE:
85 op = kX86SubsdRR;
86 break;
87 case Instruction::DIV_DOUBLE_2ADDR:
88 case Instruction::DIV_DOUBLE:
89 op = kX86DivsdRR;
90 break;
91 case Instruction::MUL_DOUBLE_2ADDR:
92 case Instruction::MUL_DOUBLE:
93 op = kX86MulsdRR;
94 break;
jeffhaobabda952012-08-02 15:55:30 -070095 case Instruction::NEG_DOUBLE:
Ian Rogersb5d09b22012-03-06 22:14:17 -080096 case Instruction::REM_DOUBLE_2ADDR:
jeffhaobabda952012-08-02 15:55:30 -070097 case Instruction::REM_DOUBLE:
buzbeefa57c472012-11-21 12:06:18 -080098 return GenArithOpDoublePortable(cu, opcode, rl_dest, rl_src1, rl_src2);
Ian Rogersb5d09b22012-03-06 22:14:17 -080099 default:
100 return true;
101 }
buzbeefa57c472012-11-21 12:06:18 -0800102 rl_src1 = LoadValueWide(cu, rl_src1, kFPReg);
103 DCHECK(rl_src1.wide);
104 rl_src2 = LoadValueWide(cu, rl_src2, kFPReg);
105 DCHECK(rl_src2.wide);
106 rl_result = EvalLoc(cu, rl_dest, kFPReg, true);
107 DCHECK(rl_dest.wide);
108 DCHECK(rl_result.wide);
109 int r_dest = S2d(rl_result.low_reg, rl_result.high_reg);
110 int r_src1 = S2d(rl_src1.low_reg, rl_src1.high_reg);
111 int r_src2 = S2d(rl_src2.low_reg, rl_src2.high_reg);
112 if (r_dest == r_src2) {
113 r_src2 = AllocTempDouble(cu) | X86_FP_DOUBLE;
114 OpRegCopy(cu, r_src2, r_dest);
jeffhao4abb1a92012-06-08 17:02:08 -0700115 }
buzbeefa57c472012-11-21 12:06:18 -0800116 OpRegCopy(cu, r_dest, r_src1);
117 NewLIR2(cu, op, r_dest, r_src2);
118 StoreValueWide(cu, rl_dest, rl_result);
Ian Rogersb5d09b22012-03-06 22:14:17 -0800119 return false;
buzbeee88dfbf2012-03-05 11:19:57 -0800120}
121
buzbeefa57c472012-11-21 12:06:18 -0800122bool GenConversion(CompilationUnit *cu, Instruction::Code opcode,
123 RegLocation rl_dest, RegLocation rl_src) {
jeffhao5121e0b2012-05-08 18:23:38 -0700124 RegisterClass rcSrc = kFPReg;
Ian Rogersb5d09b22012-03-06 22:14:17 -0800125 X86OpCode op = kX86Nop;
buzbeefa57c472012-11-21 12:06:18 -0800126 int src_reg;
127 RegLocation rl_result;
Ian Rogersb5d09b22012-03-06 22:14:17 -0800128 switch (opcode) {
129 case Instruction::INT_TO_FLOAT:
jeffhao5121e0b2012-05-08 18:23:38 -0700130 rcSrc = kCoreReg;
Ian Rogersb5d09b22012-03-06 22:14:17 -0800131 op = kX86Cvtsi2ssRR;
132 break;
133 case Instruction::DOUBLE_TO_FLOAT:
jeffhao5121e0b2012-05-08 18:23:38 -0700134 rcSrc = kFPReg;
Ian Rogersb5d09b22012-03-06 22:14:17 -0800135 op = kX86Cvtsd2ssRR;
136 break;
137 case Instruction::FLOAT_TO_DOUBLE:
jeffhao5121e0b2012-05-08 18:23:38 -0700138 rcSrc = kFPReg;
Ian Rogersb5d09b22012-03-06 22:14:17 -0800139 op = kX86Cvtss2sdRR;
140 break;
141 case Instruction::INT_TO_DOUBLE:
jeffhao5121e0b2012-05-08 18:23:38 -0700142 rcSrc = kCoreReg;
Ian Rogersb5d09b22012-03-06 22:14:17 -0800143 op = kX86Cvtsi2sdRR;
144 break;
jeffhao292188d2012-05-17 15:45:04 -0700145 case Instruction::FLOAT_TO_INT: {
buzbeefa57c472012-11-21 12:06:18 -0800146 rl_src = LoadValue(cu, rl_src, kFPReg);
147 src_reg = rl_src.low_reg;
148 ClobberSReg(cu, rl_dest.s_reg_low);
149 rl_result = EvalLoc(cu, rl_dest, kCoreReg, true);
150 int temp_reg = AllocTempFloat(cu);
jeffhao41005dd2012-05-09 17:58:52 -0700151
buzbeefa57c472012-11-21 12:06:18 -0800152 LoadConstant(cu, rl_result.low_reg, 0x7fffffff);
153 NewLIR2(cu, kX86Cvtsi2ssRR, temp_reg, rl_result.low_reg);
154 NewLIR2(cu, kX86ComissRR, src_reg, temp_reg);
155 LIR* branch_pos_overflow = NewLIR2(cu, kX86Jcc8, 0, kX86CondA);
156 LIR* branch_na_n = NewLIR2(cu, kX86Jcc8, 0, kX86CondP);
157 NewLIR2(cu, kX86Cvttss2siRR, rl_result.low_reg, src_reg);
158 LIR* branch_normal = NewLIR1(cu, kX86Jmp8, 0);
159 branch_na_n->target = NewLIR0(cu, kPseudoTargetLabel);
160 NewLIR2(cu, kX86Xor32RR, rl_result.low_reg, rl_result.low_reg);
161 branch_pos_overflow->target = NewLIR0(cu, kPseudoTargetLabel);
162 branch_normal->target = NewLIR0(cu, kPseudoTargetLabel);
163 StoreValue(cu, rl_dest, rl_result);
jeffhao41005dd2012-05-09 17:58:52 -0700164 return false;
jeffhao292188d2012-05-17 15:45:04 -0700165 }
166 case Instruction::DOUBLE_TO_INT: {
buzbeefa57c472012-11-21 12:06:18 -0800167 rl_src = LoadValueWide(cu, rl_src, kFPReg);
168 src_reg = rl_src.low_reg;
169 ClobberSReg(cu, rl_dest.s_reg_low);
170 rl_result = EvalLoc(cu, rl_dest, kCoreReg, true);
171 int temp_reg = AllocTempDouble(cu) | X86_FP_DOUBLE;
jeffhao41005dd2012-05-09 17:58:52 -0700172
buzbeefa57c472012-11-21 12:06:18 -0800173 LoadConstant(cu, rl_result.low_reg, 0x7fffffff);
174 NewLIR2(cu, kX86Cvtsi2sdRR, temp_reg, rl_result.low_reg);
175 NewLIR2(cu, kX86ComisdRR, src_reg, temp_reg);
176 LIR* branch_pos_overflow = NewLIR2(cu, kX86Jcc8, 0, kX86CondA);
177 LIR* branch_na_n = NewLIR2(cu, kX86Jcc8, 0, kX86CondP);
178 NewLIR2(cu, kX86Cvttsd2siRR, rl_result.low_reg, src_reg);
179 LIR* branch_normal = NewLIR1(cu, kX86Jmp8, 0);
180 branch_na_n->target = NewLIR0(cu, kPseudoTargetLabel);
181 NewLIR2(cu, kX86Xor32RR, rl_result.low_reg, rl_result.low_reg);
182 branch_pos_overflow->target = NewLIR0(cu, kPseudoTargetLabel);
183 branch_normal->target = NewLIR0(cu, kPseudoTargetLabel);
184 StoreValue(cu, rl_dest, rl_result);
jeffhao41005dd2012-05-09 17:58:52 -0700185 return false;
jeffhao292188d2012-05-17 15:45:04 -0700186 }
Ian Rogersb5d09b22012-03-06 22:14:17 -0800187 case Instruction::LONG_TO_DOUBLE:
Ian Rogersb5d09b22012-03-06 22:14:17 -0800188 case Instruction::LONG_TO_FLOAT:
jeffhaobabda952012-08-02 15:55:30 -0700189 // TODO: inline by using memory as a 64-bit source. Be careful about promoted registers.
jeffhao41005dd2012-05-09 17:58:52 -0700190 case Instruction::FLOAT_TO_LONG:
Ian Rogersb5d09b22012-03-06 22:14:17 -0800191 case Instruction::DOUBLE_TO_LONG:
buzbeefa57c472012-11-21 12:06:18 -0800192 return GenConversionPortable(cu, opcode, rl_dest, rl_src);
Ian Rogersb5d09b22012-03-06 22:14:17 -0800193 default:
194 return true;
195 }
buzbeefa57c472012-11-21 12:06:18 -0800196 if (rl_src.wide) {
197 rl_src = LoadValueWide(cu, rl_src, rcSrc);
198 src_reg = S2d(rl_src.low_reg, rl_src.high_reg);
Ian Rogersb5d09b22012-03-06 22:14:17 -0800199 } else {
buzbeefa57c472012-11-21 12:06:18 -0800200 rl_src = LoadValue(cu, rl_src, rcSrc);
201 src_reg = rl_src.low_reg;
Ian Rogersb5d09b22012-03-06 22:14:17 -0800202 }
buzbeefa57c472012-11-21 12:06:18 -0800203 if (rl_dest.wide) {
204 rl_result = EvalLoc(cu, rl_dest, kFPReg, true);
205 NewLIR2(cu, op, S2d(rl_result.low_reg, rl_result.high_reg), src_reg);
206 StoreValueWide(cu, rl_dest, rl_result);
Ian Rogersb5d09b22012-03-06 22:14:17 -0800207 } else {
buzbeefa57c472012-11-21 12:06:18 -0800208 rl_result = EvalLoc(cu, rl_dest, kFPReg, true);
209 NewLIR2(cu, op, rl_result.low_reg, src_reg);
210 StoreValue(cu, rl_dest, rl_result);
Ian Rogersb5d09b22012-03-06 22:14:17 -0800211 }
212 return false;
buzbeee88dfbf2012-03-05 11:19:57 -0800213}
214
buzbeefa57c472012-11-21 12:06:18 -0800215bool GenCmpFP(CompilationUnit *cu, Instruction::Code code, RegLocation rl_dest,
216 RegLocation rl_src1, RegLocation rl_src2) {
Ian Rogersb5d09b22012-03-06 22:14:17 -0800217 bool single = (code == Instruction::CMPL_FLOAT) || (code == Instruction::CMPG_FLOAT);
buzbeefa57c472012-11-21 12:06:18 -0800218 bool unordered_gt = (code == Instruction::CMPG_DOUBLE) || (code == Instruction::CMPG_FLOAT);
219 int src_reg1;
220 int src_reg2;
Ian Rogersb5d09b22012-03-06 22:14:17 -0800221 if (single) {
buzbeefa57c472012-11-21 12:06:18 -0800222 rl_src1 = LoadValue(cu, rl_src1, kFPReg);
223 src_reg1 = rl_src1.low_reg;
224 rl_src2 = LoadValue(cu, rl_src2, kFPReg);
225 src_reg2 = rl_src2.low_reg;
Ian Rogersb5d09b22012-03-06 22:14:17 -0800226 } else {
buzbeefa57c472012-11-21 12:06:18 -0800227 rl_src1 = LoadValueWide(cu, rl_src1, kFPReg);
228 src_reg1 = S2d(rl_src1.low_reg, rl_src1.high_reg);
229 rl_src2 = LoadValueWide(cu, rl_src2, kFPReg);
230 src_reg2 = S2d(rl_src2.low_reg, rl_src2.high_reg);
Ian Rogersb5d09b22012-03-06 22:14:17 -0800231 }
buzbeefa57c472012-11-21 12:06:18 -0800232 ClobberSReg(cu, rl_dest.s_reg_low);
233 RegLocation rl_result = EvalLoc(cu, rl_dest, kCoreReg, true);
234 LoadConstantNoClobber(cu, rl_result.low_reg, unordered_gt ? 1 : 0);
Ian Rogersb5d09b22012-03-06 22:14:17 -0800235 if (single) {
buzbeefa57c472012-11-21 12:06:18 -0800236 NewLIR2(cu, kX86UcomissRR, src_reg1, src_reg2);
Ian Rogersb5d09b22012-03-06 22:14:17 -0800237 } else {
buzbeefa57c472012-11-21 12:06:18 -0800238 NewLIR2(cu, kX86UcomisdRR, src_reg1, src_reg2);
Ian Rogersb5d09b22012-03-06 22:14:17 -0800239 }
240 LIR* branch = NULL;
buzbeefa57c472012-11-21 12:06:18 -0800241 if (unordered_gt) {
242 branch = NewLIR2(cu, kX86Jcc8, 0, kX86CondPE);
Ian Rogersb5d09b22012-03-06 22:14:17 -0800243 }
jeffhao703f2cd2012-07-13 17:25:52 -0700244 // If the result reg can't be byte accessed, use a jump and move instead of a set.
buzbeefa57c472012-11-21 12:06:18 -0800245 if (rl_result.low_reg >= 4) {
jeffhao703f2cd2012-07-13 17:25:52 -0700246 LIR* branch2 = NULL;
buzbeefa57c472012-11-21 12:06:18 -0800247 if (unordered_gt) {
248 branch2 = NewLIR2(cu, kX86Jcc8, 0, kX86CondA);
249 NewLIR2(cu, kX86Mov32RI, rl_result.low_reg, 0x0);
jeffhao703f2cd2012-07-13 17:25:52 -0700250 } else {
buzbeefa57c472012-11-21 12:06:18 -0800251 branch2 = NewLIR2(cu, kX86Jcc8, 0, kX86CondBe);
252 NewLIR2(cu, kX86Mov32RI, rl_result.low_reg, 0x1);
jeffhao703f2cd2012-07-13 17:25:52 -0700253 }
buzbeefa57c472012-11-21 12:06:18 -0800254 branch2->target = NewLIR0(cu, kPseudoTargetLabel);
jeffhao703f2cd2012-07-13 17:25:52 -0700255 } else {
buzbeefa57c472012-11-21 12:06:18 -0800256 NewLIR2(cu, kX86Set8R, rl_result.low_reg, kX86CondA /* above - unsigned > */);
jeffhao703f2cd2012-07-13 17:25:52 -0700257 }
buzbeefa57c472012-11-21 12:06:18 -0800258 NewLIR2(cu, kX86Sbb32RI, rl_result.low_reg, 0);
259 if (unordered_gt) {
260 branch->target = NewLIR0(cu, kPseudoTargetLabel);
Ian Rogersb5d09b22012-03-06 22:14:17 -0800261 }
buzbeefa57c472012-11-21 12:06:18 -0800262 StoreValue(cu, rl_dest, rl_result);
Ian Rogersb5d09b22012-03-06 22:14:17 -0800263 return false;
buzbeee88dfbf2012-03-05 11:19:57 -0800264}
265
buzbeefa57c472012-11-21 12:06:18 -0800266void GenFusedFPCmpBranch(CompilationUnit* cu, BasicBlock* bb, MIR* mir,
267 bool gt_bias, bool is_double) {
268 LIR* label_list = cu->block_label_list;
269 LIR* taken = &label_list[bb->taken->id];
270 LIR* not_taken = &label_list[bb->fall_through->id];
jeffhao4b771a02012-07-25 15:07:21 -0700271 LIR* branch = NULL;
buzbeefa57c472012-11-21 12:06:18 -0800272 RegLocation rl_src1;
273 RegLocation rl_src2;
274 if (is_double) {
275 rl_src1 = GetSrcWide(cu, mir, 0);
276 rl_src2 = GetSrcWide(cu, mir, 2);
277 rl_src1 = LoadValueWide(cu, rl_src1, kFPReg);
278 rl_src2 = LoadValueWide(cu, rl_src2, kFPReg);
279 NewLIR2(cu, kX86UcomisdRR, S2d(rl_src1.low_reg, rl_src1.high_reg),
280 S2d(rl_src2.low_reg, rl_src2.high_reg));
jeffhao4b771a02012-07-25 15:07:21 -0700281 } else {
buzbeefa57c472012-11-21 12:06:18 -0800282 rl_src1 = GetSrc(cu, mir, 0);
283 rl_src2 = GetSrc(cu, mir, 1);
284 rl_src1 = LoadValue(cu, rl_src1, kFPReg);
285 rl_src2 = LoadValue(cu, rl_src2, kFPReg);
286 NewLIR2(cu, kX86UcomissRR, rl_src1.low_reg, rl_src2.low_reg);
jeffhao4b771a02012-07-25 15:07:21 -0700287 }
288 ConditionCode ccode = static_cast<ConditionCode>(mir->dalvikInsn.arg[0]);
289 switch (ccode) {
290 case kCondEq:
buzbeefa57c472012-11-21 12:06:18 -0800291 if (!gt_bias) {
292 branch = NewLIR2(cu, kX86Jcc8, 0, kX86CondPE);
293 branch->target = not_taken;
jeffhao4b771a02012-07-25 15:07:21 -0700294 }
295 break;
296 case kCondNe:
buzbeefa57c472012-11-21 12:06:18 -0800297 if (!gt_bias) {
298 branch = NewLIR2(cu, kX86Jcc8, 0, kX86CondPE);
jeffhao4b771a02012-07-25 15:07:21 -0700299 branch->target = taken;
300 }
301 break;
302 case kCondLt:
buzbeefa57c472012-11-21 12:06:18 -0800303 if (gt_bias) {
304 branch = NewLIR2(cu, kX86Jcc8, 0, kX86CondPE);
305 branch->target = not_taken;
jeffhao4b771a02012-07-25 15:07:21 -0700306 }
307 ccode = kCondCs;
308 break;
309 case kCondLe:
buzbeefa57c472012-11-21 12:06:18 -0800310 if (gt_bias) {
311 branch = NewLIR2(cu, kX86Jcc8, 0, kX86CondPE);
312 branch->target = not_taken;
jeffhao4b771a02012-07-25 15:07:21 -0700313 }
314 ccode = kCondLs;
315 break;
316 case kCondGt:
buzbeefa57c472012-11-21 12:06:18 -0800317 if (gt_bias) {
318 branch = NewLIR2(cu, kX86Jcc8, 0, kX86CondPE);
jeffhao4b771a02012-07-25 15:07:21 -0700319 branch->target = taken;
320 }
321 ccode = kCondHi;
322 break;
323 case kCondGe:
buzbeefa57c472012-11-21 12:06:18 -0800324 if (gt_bias) {
325 branch = NewLIR2(cu, kX86Jcc8, 0, kX86CondPE);
jeffhao4b771a02012-07-25 15:07:21 -0700326 branch->target = taken;
327 }
328 ccode = kCondCc;
329 break;
330 default:
buzbeecbd6d442012-11-17 14:11:25 -0800331 LOG(FATAL) << "Unexpected ccode: " << ccode;
jeffhao4b771a02012-07-25 15:07:21 -0700332 }
buzbeefa57c472012-11-21 12:06:18 -0800333 OpCondBranch(cu, ccode, taken);
jeffhao4b771a02012-07-25 15:07:21 -0700334}
335
buzbeefa57c472012-11-21 12:06:18 -0800336void GenNegFloat(CompilationUnit *cu, RegLocation rl_dest, RegLocation rl_src)
buzbeeefc63692012-11-14 16:31:52 -0800337{
buzbeefa57c472012-11-21 12:06:18 -0800338 RegLocation rl_result;
339 rl_src = LoadValue(cu, rl_src, kCoreReg);
340 rl_result = EvalLoc(cu, rl_dest, kCoreReg, true);
341 OpRegRegImm(cu, kOpAdd, rl_result.low_reg, rl_src.low_reg, 0x80000000);
342 StoreValue(cu, rl_dest, rl_result);
buzbeeefc63692012-11-14 16:31:52 -0800343}
344
buzbeefa57c472012-11-21 12:06:18 -0800345void GenNegDouble(CompilationUnit *cu, RegLocation rl_dest, RegLocation rl_src)
buzbeeefc63692012-11-14 16:31:52 -0800346{
buzbeefa57c472012-11-21 12:06:18 -0800347 RegLocation rl_result;
348 rl_src = LoadValueWide(cu, rl_src, kCoreReg);
349 rl_result = EvalLoc(cu, rl_dest, kCoreReg, true);
350 OpRegRegImm(cu, kOpAdd, rl_result.high_reg, rl_src.high_reg, 0x80000000);
351 OpRegCopy(cu, rl_result.low_reg, rl_src.low_reg);
352 StoreValueWide(cu, rl_dest, rl_result);
buzbeeefc63692012-11-14 16:31:52 -0800353}
354
buzbeefa57c472012-11-21 12:06:18 -0800355bool GenInlinedSqrt(CompilationUnit* cu, CallInfo* info) {
356 DCHECK_NE(cu->instruction_set, kThumb2);
buzbeeefc63692012-11-14 16:31:52 -0800357 return false;
358}
359
360
361
buzbeee88dfbf2012-03-05 11:19:57 -0800362} // namespace art