1 /* |
1 /* |
2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
204 inline void Assembler::ldx( Register s1, RegisterOrConstant s2, Register d) { ldx( Address(s1, s2), d); } |
204 inline void Assembler::ldx( Register s1, RegisterOrConstant s2, Register d) { ldx( Address(s1, s2), d); } |
205 inline void Assembler::ld( Register s1, RegisterOrConstant s2, Register d) { ld( Address(s1, s2), d); } |
205 inline void Assembler::ld( Register s1, RegisterOrConstant s2, Register d) { ld( Address(s1, s2), d); } |
206 inline void Assembler::ldd( Register s1, RegisterOrConstant s2, Register d) { ldd( Address(s1, s2), d); } |
206 inline void Assembler::ldd( Register s1, RegisterOrConstant s2, Register d) { ldd( Address(s1, s2), d); } |
207 |
207 |
208 // form effective addresses this way: |
208 // form effective addresses this way: |
|
209 inline void Assembler::add(const Address& a, Register d, int offset) { |
|
210 if (a.has_index()) add(a.base(), a.index(), d); |
|
211 else { add(a.base(), a.disp() + offset, d, a.rspec(offset)); offset = 0; } |
|
212 if (offset != 0) add(d, offset, d); |
|
213 } |
209 inline void Assembler::add(Register s1, RegisterOrConstant s2, Register d, int offset) { |
214 inline void Assembler::add(Register s1, RegisterOrConstant s2, Register d, int offset) { |
210 if (s2.is_register()) add(s1, s2.as_register(), d); |
215 if (s2.is_register()) add(s1, s2.as_register(), d); |
211 else { add(s1, s2.as_constant() + offset, d); offset = 0; } |
216 else { add(s1, s2.as_constant() + offset, d); offset = 0; } |
212 if (offset != 0) add(d, offset, d); |
217 if (offset != 0) add(d, offset, d); |
213 } |
218 } |