Mercurial > hg > truffle
diff graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiValueUtil.java @ 4254:1cf920630944
Canonicalize parameter lists and names
author | Christian Wimmer <Christian.Wimmer@Oracle.com> |
---|---|
date | Tue, 10 Jan 2012 08:50:07 -0800 |
parents | 75c620f90ab9 |
children | 9ce8594bedaf |
line wrap: on
line diff
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiValueUtil.java Mon Jan 09 22:01:39 2012 +0100 +++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiValueUtil.java Tue Jan 10 08:50:07 2012 -0800 @@ -98,4 +98,27 @@ assert value.kind == CiKind.Double; return asRegister(value); } + + + public static boolean sameRegister(CiValue...values) { + for (int i = 0; i < values.length; i++) { + for (int j = i + 1; j < values.length; j++) { + if (isRegister(values[i]) && isRegister(values[j]) && asRegister(values[i]) != asRegister(values[j])) { + return false; + } + } + } + return true; + } + + public static boolean differentRegisters(CiValue...values) { + for (int i = 0; i < values.length; i++) { + for (int j = i + 1; j < values.length; j++) { + if (isRegister(values[i]) && isRegister(values[j]) && asRegister(values[i]) == asRegister(values[j])) { + return false; + } + } + } + return true; + } }