annotate src/cpu/x86/vm/c1_FrameMap_x86.hpp @ 71:3d62cb85208d

6662967: Optimize I2D conversion on new x86 Summary: Use CVTDQ2PS and CVTDQ2PD for integer values conversions to float and double values on new AMD cpu. Reviewed-by: sgoldman, never
author kvn
date Wed, 19 Mar 2008 15:33:25 -0700
parents a61af66fc99e
children dc7f315e41f7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
2 * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved.
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 * have any questions.
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 // On i486 the frame looks as follows:
a61af66fc99e Initial load
duke
parents:
diff changeset
26 //
a61af66fc99e Initial load
duke
parents:
diff changeset
27 // +-----------------------------+---------+----------------------------------------+----------------+-----------
a61af66fc99e Initial load
duke
parents:
diff changeset
28 // | size_arguments-nof_reg_args | 2 words | size_locals-size_arguments+numreg_args | _size_monitors | spilling .
a61af66fc99e Initial load
duke
parents:
diff changeset
29 // +-----------------------------+---------+----------------------------------------+----------------+-----------
a61af66fc99e Initial load
duke
parents:
diff changeset
30 //
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // The FPU registers are mapped with their offset from TOS; therefore the
a61af66fc99e Initial load
duke
parents:
diff changeset
32 // status of FPU stack must be updated during code emission.
a61af66fc99e Initial load
duke
parents:
diff changeset
33
a61af66fc99e Initial load
duke
parents:
diff changeset
34 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
35 static const int pd_c_runtime_reserved_arg_size;
a61af66fc99e Initial load
duke
parents:
diff changeset
36
a61af66fc99e Initial load
duke
parents:
diff changeset
37 enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
38 nof_xmm_regs = pd_nof_xmm_regs_frame_map,
a61af66fc99e Initial load
duke
parents:
diff changeset
39 nof_caller_save_xmm_regs = pd_nof_caller_save_xmm_regs_frame_map,
a61af66fc99e Initial load
duke
parents:
diff changeset
40 first_available_sp_in_frame = 0,
a61af66fc99e Initial load
duke
parents:
diff changeset
41 frame_pad_in_bytes = 8,
a61af66fc99e Initial load
duke
parents:
diff changeset
42 nof_reg_args = 2
a61af66fc99e Initial load
duke
parents:
diff changeset
43 };
a61af66fc99e Initial load
duke
parents:
diff changeset
44
a61af66fc99e Initial load
duke
parents:
diff changeset
45 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
46 static LIR_Opr _caller_save_xmm_regs [nof_caller_save_xmm_regs];
a61af66fc99e Initial load
duke
parents:
diff changeset
47
a61af66fc99e Initial load
duke
parents:
diff changeset
48 static XMMRegister _xmm_regs[nof_xmm_regs];
a61af66fc99e Initial load
duke
parents:
diff changeset
49
a61af66fc99e Initial load
duke
parents:
diff changeset
50 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
51 static LIR_Opr receiver_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 static LIR_Opr rsi_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
54 static LIR_Opr rdi_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
55 static LIR_Opr rbx_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
56 static LIR_Opr rax_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
57 static LIR_Opr rdx_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
58 static LIR_Opr rcx_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 static LIR_Opr rsp_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 static LIR_Opr rbp_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
61
a61af66fc99e Initial load
duke
parents:
diff changeset
62 static LIR_Opr rsi_oop_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
63 static LIR_Opr rdi_oop_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
64 static LIR_Opr rbx_oop_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 static LIR_Opr rax_oop_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
66 static LIR_Opr rdx_oop_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
67 static LIR_Opr rcx_oop_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
68
a61af66fc99e Initial load
duke
parents:
diff changeset
69 static LIR_Opr rax_rdx_long_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
70 static LIR_Opr rbx_rcx_long_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 static LIR_Opr fpu0_float_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 static LIR_Opr fpu0_double_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
73 static LIR_Opr xmm0_float_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
74 static LIR_Opr xmm0_double_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 static LIR_Opr as_long_opr(Register r, Register r2) {
a61af66fc99e Initial load
duke
parents:
diff changeset
77 return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r2));
a61af66fc99e Initial load
duke
parents:
diff changeset
78 }
a61af66fc99e Initial load
duke
parents:
diff changeset
79
a61af66fc99e Initial load
duke
parents:
diff changeset
80 // VMReg name for spilled physical FPU stack slot n
a61af66fc99e Initial load
duke
parents:
diff changeset
81 static VMReg fpu_regname (int n);
a61af66fc99e Initial load
duke
parents:
diff changeset
82
a61af66fc99e Initial load
duke
parents:
diff changeset
83 static XMMRegister nr2xmmreg(int rnr);
a61af66fc99e Initial load
duke
parents:
diff changeset
84
a61af66fc99e Initial load
duke
parents:
diff changeset
85 static bool is_caller_save_register (LIR_Opr opr) { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
86 static bool is_caller_save_register (Register r) { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
87
a61af66fc99e Initial load
duke
parents:
diff changeset
88 static LIR_Opr caller_save_xmm_reg_at(int i) {
a61af66fc99e Initial load
duke
parents:
diff changeset
89 assert(i >= 0 && i < nof_caller_save_xmm_regs, "out of bounds");
a61af66fc99e Initial load
duke
parents:
diff changeset
90 return _caller_save_xmm_regs[i];
a61af66fc99e Initial load
duke
parents:
diff changeset
91 }