comparison src/share/vm/opto/regmask.hpp @ 6179:8c92982cbbc4

7119644: Increase superword's vector size up to 256 bits Summary: Increase vector size up to 256-bits for YMM AVX registers on x86. Reviewed-by: never, twisti, roland
author kvn
date Fri, 15 Jun 2012 01:25:19 -0700
parents 1d1603768966
children a7114d3d712e
comparison
equal deleted inserted replaced
6146:eba1d5bce9e8 6179:8c92982cbbc4
1 /* 1 /*
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, 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.
111 // Matcher::_new_SP to keep allocated pairs aligned properly. 111 // Matcher::_new_SP to keep allocated pairs aligned properly.
112 // If we ever go to quad-word allocations, SlotsPerQuad will become 112 // If we ever go to quad-word allocations, SlotsPerQuad will become
113 // the controlling alignment constraint. Note that this alignment 113 // the controlling alignment constraint. Note that this alignment
114 // requirement is internal to the allocator, and independent of any 114 // requirement is internal to the allocator, and independent of any
115 // particular platform. 115 // particular platform.
116 enum { SlotsPerLong = 2 }; 116 enum { SlotsPerLong = 2,
117 SlotsPerVecS = 1,
118 SlotsPerVecD = 2,
119 SlotsPerVecX = 4,
120 SlotsPerVecY = 8 };
117 121
118 // A constructor only used by the ADLC output. All mask fields are filled 122 // A constructor only used by the ADLC output. All mask fields are filled
119 // in directly. Calls to this look something like RM(1,2,3,4); 123 // in directly. Calls to this look something like RM(1,2,3,4);
120 RegMask( 124 RegMask(
121 # define BODY(I) int a##I, 125 # define BODY(I) int a##I,
191 // HIGHEST register number in the pair, or BAD if no pairs. 195 // HIGHEST register number in the pair, or BAD if no pairs.
192 // Assert that the mask contains only bit pairs. 196 // Assert that the mask contains only bit pairs.
193 OptoReg::Name find_first_pair() const; 197 OptoReg::Name find_first_pair() const;
194 198
195 // Clear out partial bits; leave only aligned adjacent bit pairs. 199 // Clear out partial bits; leave only aligned adjacent bit pairs.
196 void ClearToPairs(); 200 void clear_to_pairs();
197 // Smear out partial bits; leave only aligned adjacent bit pairs. 201 // Smear out partial bits; leave only aligned adjacent bit pairs.
198 void SmearToPairs(); 202 void smear_to_pairs();
199 // Verify that the mask contains only aligned adjacent bit pairs 203 // Verify that the mask contains only aligned adjacent bit pairs
200 void VerifyPairs() const { assert( is_aligned_Pairs(), "mask is not aligned, adjacent pairs" ); } 204 void verify_pairs() const { assert( is_aligned_pairs(), "mask is not aligned, adjacent pairs" ); }
201 // Test that the mask contains only aligned adjacent bit pairs 205 // Test that the mask contains only aligned adjacent bit pairs
202 bool is_aligned_Pairs() const; 206 bool is_aligned_pairs() const;
203 207
204 // mask is a pair of misaligned registers 208 // mask is a pair of misaligned registers
205 bool is_misaligned_Pair() const { return Size()==2 && !is_aligned_Pairs();} 209 bool is_misaligned_pair() const { return Size()==2 && !is_aligned_pairs(); }
206 // Test for single register 210 // Test for single register
207 int is_bound1() const; 211 int is_bound1() const;
208 // Test for a single adjacent pair 212 // Test for a single adjacent pair
209 int is_bound2() const; 213 int is_bound_pair() const;
214 // Test for a single adjacent set of ideal register's size.
215 int is_bound(uint ireg) const {
216 if (is_vector(ireg)) {
217 if (is_bound_set(num_registers(ireg)))
218 return true;
219 } else if (is_bound1() || is_bound_pair()) {
220 return true;
221 }
222 return false;
223 }
224
225 // Find the lowest-numbered register set in the mask. Return the
226 // HIGHEST register number in the set, or BAD if no sets.
227 // Assert that the mask contains only bit sets.
228 OptoReg::Name find_first_set(int size) const;
229
230 // Clear out partial bits; leave only aligned adjacent bit sets of size.
231 void clear_to_sets(int size);
232 // Smear out partial bits to aligned adjacent bit sets.
233 void smear_to_sets(int size);
234 // Verify that the mask contains only aligned adjacent bit sets
235 void verify_sets(int size) const { assert(is_aligned_sets(size), "mask is not aligned, adjacent sets"); }
236 // Test that the mask contains only aligned adjacent bit sets
237 bool is_aligned_sets(int size) const;
238
239 // mask is a set of misaligned registers
240 bool is_misaligned_set(int size) const { return (int)Size()==size && !is_aligned_sets(size);}
241
242 // Test for a single adjacent set
243 int is_bound_set(int size) const;
244
245 static bool is_vector(uint ireg);
246 static int num_registers(uint ireg);
210 247
211 // Fast overlap test. Non-zero if any registers in common. 248 // Fast overlap test. Non-zero if any registers in common.
212 int overlap( const RegMask &rm ) const { 249 int overlap( const RegMask &rm ) const {
213 return 250 return
214 # define BODY(I) (_A[I] & rm._A[I]) | 251 # define BODY(I) (_A[I] & rm._A[I]) |
278 315
279 static const RegMask Empty; // Common empty mask 316 static const RegMask Empty; // Common empty mask
280 317
281 static bool can_represent(OptoReg::Name reg) { 318 static bool can_represent(OptoReg::Name reg) {
282 // NOTE: -1 in computation reflects the usage of the last 319 // NOTE: -1 in computation reflects the usage of the last
283 // bit of the regmask as an infinite stack flag. 320 // bit of the regmask as an infinite stack flag and
321 // -7 is to keep mask aligned for largest value (VecY).
284 return (int)reg < (int)(CHUNK_SIZE-1); 322 return (int)reg < (int)(CHUNK_SIZE-1);
323 }
324 static bool can_represent_arg(OptoReg::Name reg) {
325 // NOTE: -SlotsPerVecY in computation reflects the need
326 // to keep mask aligned for largest value (VecY).
327 return (int)reg < (int)(CHUNK_SIZE-SlotsPerVecY);
285 } 328 }
286 }; 329 };
287 330
288 // Do not use this constant directly in client code! 331 // Do not use this constant directly in client code!
289 #undef RM_SIZE 332 #undef RM_SIZE