src/share/vm/opto/regmask.hpp

changeset 3882
8c92982cbbc4
parent 2708
1d1603768966
child 4478
a7114d3d712e
     1.1 --- a/src/share/vm/opto/regmask.hpp	Thu Jun 14 14:59:52 2012 -0700
     1.2 +++ b/src/share/vm/opto/regmask.hpp	Fri Jun 15 01:25:19 2012 -0700
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -113,7 +113,11 @@
    1.11    // the controlling alignment constraint.  Note that this alignment
    1.12    // requirement is internal to the allocator, and independent of any
    1.13    // particular platform.
    1.14 -  enum { SlotsPerLong = 2 };
    1.15 +  enum { SlotsPerLong = 2,
    1.16 +         SlotsPerVecS = 1,
    1.17 +         SlotsPerVecD = 2,
    1.18 +         SlotsPerVecX = 4,
    1.19 +         SlotsPerVecY = 8 };
    1.20  
    1.21    // A constructor only used by the ADLC output.  All mask fields are filled
    1.22    // in directly.  Calls to this look something like RM(1,2,3,4);
    1.23 @@ -193,20 +197,53 @@
    1.24    OptoReg::Name find_first_pair() const;
    1.25  
    1.26    // Clear out partial bits; leave only aligned adjacent bit pairs.
    1.27 -  void ClearToPairs();
    1.28 +  void clear_to_pairs();
    1.29    // Smear out partial bits; leave only aligned adjacent bit pairs.
    1.30 -  void SmearToPairs();
    1.31 +  void smear_to_pairs();
    1.32    // Verify that the mask contains only aligned adjacent bit pairs
    1.33 -  void VerifyPairs() const { assert( is_aligned_Pairs(), "mask is not aligned, adjacent pairs" ); }
    1.34 +  void verify_pairs() const { assert( is_aligned_pairs(), "mask is not aligned, adjacent pairs" ); }
    1.35    // Test that the mask contains only aligned adjacent bit pairs
    1.36 -  bool is_aligned_Pairs() const;
    1.37 +  bool is_aligned_pairs() const;
    1.38  
    1.39    // mask is a pair of misaligned registers
    1.40 -  bool is_misaligned_Pair() const { return Size()==2 && !is_aligned_Pairs();}
    1.41 +  bool is_misaligned_pair() const { return Size()==2 && !is_aligned_pairs(); }
    1.42    // Test for single register
    1.43    int is_bound1() const;
    1.44    // Test for a single adjacent pair
    1.45 -  int is_bound2() const;
    1.46 +  int is_bound_pair() const;
    1.47 +  // Test for a single adjacent set of ideal register's size.
    1.48 +  int is_bound(uint ireg) const {
    1.49 +    if (is_vector(ireg)) {
    1.50 +      if (is_bound_set(num_registers(ireg)))
    1.51 +        return true;
    1.52 +    } else if (is_bound1() || is_bound_pair()) {
    1.53 +      return true;
    1.54 +    }
    1.55 +    return false;
    1.56 +  }
    1.57 +
    1.58 +  // Find the lowest-numbered register set in the mask.  Return the
    1.59 +  // HIGHEST register number in the set, or BAD if no sets.
    1.60 +  // Assert that the mask contains only bit sets.
    1.61 +  OptoReg::Name find_first_set(int size) const;
    1.62 +
    1.63 +  // Clear out partial bits; leave only aligned adjacent bit sets of size.
    1.64 +  void clear_to_sets(int size);
    1.65 +  // Smear out partial bits to aligned adjacent bit sets.
    1.66 +  void smear_to_sets(int size);
    1.67 +  // Verify that the mask contains only aligned adjacent bit sets
    1.68 +  void verify_sets(int size) const { assert(is_aligned_sets(size), "mask is not aligned, adjacent sets"); }
    1.69 +  // Test that the mask contains only aligned adjacent bit sets
    1.70 +  bool is_aligned_sets(int size) const;
    1.71 +
    1.72 +  // mask is a set of misaligned registers
    1.73 +  bool is_misaligned_set(int size) const { return (int)Size()==size && !is_aligned_sets(size);}
    1.74 +
    1.75 +  // Test for a single adjacent set
    1.76 +  int is_bound_set(int size) const;
    1.77 +
    1.78 +  static bool is_vector(uint ireg);
    1.79 +  static int num_registers(uint ireg);
    1.80  
    1.81    // Fast overlap test.  Non-zero if any registers in common.
    1.82    int overlap( const RegMask &rm ) const {
    1.83 @@ -280,9 +317,15 @@
    1.84  
    1.85    static bool can_represent(OptoReg::Name reg) {
    1.86      // NOTE: -1 in computation reflects the usage of the last
    1.87 -    //       bit of the regmask as an infinite stack flag.
    1.88 +    //       bit of the regmask as an infinite stack flag and
    1.89 +    //       -7 is to keep mask aligned for largest value (VecY).
    1.90      return (int)reg < (int)(CHUNK_SIZE-1);
    1.91    }
    1.92 +  static bool can_represent_arg(OptoReg::Name reg) {
    1.93 +    // NOTE: -SlotsPerVecY in computation reflects the need
    1.94 +    //       to keep mask aligned for largest value (VecY).
    1.95 +    return (int)reg < (int)(CHUNK_SIZE-SlotsPerVecY);
    1.96 +  }
    1.97  };
    1.98  
    1.99  // Do not use this constant directly in client code!

mercurial