1 /*
2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
75 // live register masks down to the assembly we could do better
76 // but we don't have any easy way to do that right now. We
77 // could also consider not killing all xmm registers if we
78 // assume that slow paths are uncommon but it's not clear that
79 // would be a good idea.
80 if (UseSSE > 0) {
81 #ifndef PRODUCT
82 if (TraceLinearScanLevel >= 2) {
83 tty->print_cr("killing XMMs for trig");
84 }
85 #endif
86 int num_caller_save_xmm_regs = FrameMap::get_num_caller_save_xmms();
87 int op_id = op->id();
88 for (int xmm = 0; xmm < num_caller_save_xmm_regs; xmm++) {
89 LIR_Opr opr = FrameMap::caller_save_xmm_reg_at(xmm);
90 add_temp(reg_num(opr), op_id, noUse, T_ILLEGAL);
91 }
92 }
93 break;
94 }
95 }
96 }
97
98
99 // Implementation of LinearScanWalker
100
101 inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) {
102 int last_xmm_reg = pd_last_xmm_reg;
103 #ifdef _LP64
104 if (UseAVX < 3) {
105 last_xmm_reg = pd_first_xmm_reg + (pd_nof_xmm_regs_frame_map / 2) - 1;
106 }
107 #endif
108 if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::byte_reg)) {
109 assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only");
110 _first_reg = pd_first_byte_reg;
111 _last_reg = FrameMap::last_byte_reg();
112 return true;
113 } else if ((UseSSE >= 1 && cur->type() == T_FLOAT) || (UseSSE >= 2 && cur->type() == T_DOUBLE)) {
114 _first_reg = pd_first_xmm_reg;
|
1 /*
2 * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
75 // live register masks down to the assembly we could do better
76 // but we don't have any easy way to do that right now. We
77 // could also consider not killing all xmm registers if we
78 // assume that slow paths are uncommon but it's not clear that
79 // would be a good idea.
80 if (UseSSE > 0) {
81 #ifndef PRODUCT
82 if (TraceLinearScanLevel >= 2) {
83 tty->print_cr("killing XMMs for trig");
84 }
85 #endif
86 int num_caller_save_xmm_regs = FrameMap::get_num_caller_save_xmms();
87 int op_id = op->id();
88 for (int xmm = 0; xmm < num_caller_save_xmm_regs; xmm++) {
89 LIR_Opr opr = FrameMap::caller_save_xmm_reg_at(xmm);
90 add_temp(reg_num(opr), op_id, noUse, T_ILLEGAL);
91 }
92 }
93 break;
94 }
95 default:
96 break;
97 }
98 }
99
100
101 // Implementation of LinearScanWalker
102
103 inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) {
104 int last_xmm_reg = pd_last_xmm_reg;
105 #ifdef _LP64
106 if (UseAVX < 3) {
107 last_xmm_reg = pd_first_xmm_reg + (pd_nof_xmm_regs_frame_map / 2) - 1;
108 }
109 #endif
110 if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::byte_reg)) {
111 assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only");
112 _first_reg = pd_first_byte_reg;
113 _last_reg = FrameMap::last_byte_reg();
114 return true;
115 } else if ((UseSSE >= 1 && cur->type() == T_FLOAT) || (UseSSE >= 2 && cur->type() == T_DOUBLE)) {
116 _first_reg = pd_first_xmm_reg;
|