1 /*
2 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2016 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #include "precompiled.hpp"
27 #include "asm/register.hpp"
28 #include "c1/c1_FrameMap.hpp"
29 #include "c1/c1_LIR.hpp"
30
31
as_float_reg() const32 FloatRegister LIR_OprDesc::as_float_reg() const {
33 return FrameMap::nr2floatreg(fpu_regnr());
34 }
35
as_double_reg() const36 FloatRegister LIR_OprDesc::as_double_reg() const {
37 return FrameMap::nr2floatreg(fpu_regnrHi());
38 }
39
40 // Reg2 unused.
double_fpu(int reg1,int reg2)41 LIR_Opr LIR_OprFact::double_fpu(int reg1, int reg2) {
42 assert(!as_FloatRegister(reg2)->is_valid(), "Not used on this platform");
43 return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) |
44 (reg1 << LIR_OprDesc::reg2_shift) |
45 LIR_OprDesc::double_type |
46 LIR_OprDesc::fpu_register |
47 LIR_OprDesc::double_size);
48 }
49
50 #ifndef PRODUCT
verify() const51 void LIR_Address::verify() const {
52 assert(base()->is_cpu_register(), "wrong base operand");
53 assert(index()->is_illegal() || index()->is_double_cpu(), "wrong index operand");
54 assert(base()->type() == T_OBJECT || base()->type() == T_LONG || base()->type() == T_METADATA,
55 "wrong type for addresses");
56 }
57 #endif // PRODUCT
58
59