Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiValueUtil.java @ 4323:df5547057954
Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
author | Christian Wimmer <Christian.Wimmer@Oracle.com> |
---|---|
date | Wed, 25 Jan 2012 14:34:53 -0800 |
parents | 9ce8594bedaf |
children | d89b20486d87 |
comparison
equal
deleted
inserted
replaced
4322:49b33f8fcad7 | 4323:df5547057954 |
---|---|
108 assert value.kind == CiKind.Double; | 108 assert value.kind == CiKind.Double; |
109 return asRegister(value); | 109 return asRegister(value); |
110 } | 110 } |
111 | 111 |
112 | 112 |
113 public static boolean sameRegister(CiValue...values) { | 113 public static boolean sameRegister(CiValue v1, CiValue v2) { |
114 for (int i = 0; i < values.length; i++) { | 114 return isRegister(v1) && isRegister(v2) && asRegister(v1) == asRegister(v2); |
115 for (int j = i + 1; j < values.length; j++) { | |
116 if (isRegister(values[i]) && isRegister(values[j]) && asRegister(values[i]) != asRegister(values[j])) { | |
117 return false; | |
118 } | |
119 } | |
120 } | |
121 return true; | |
122 } | 115 } |
123 | 116 |
124 public static boolean differentRegisters(CiValue...values) { | 117 public static boolean sameRegister(CiValue v1, CiValue v2, CiValue v3) { |
125 for (int i = 0; i < values.length; i++) { | 118 return sameRegister(v1, v2) && sameRegister(v1, v3); |
126 for (int j = i + 1; j < values.length; j++) { | 119 } |
127 if (isRegister(values[i]) && isRegister(values[j]) && asRegister(values[i]) == asRegister(values[j])) { | 120 |
128 return false; | 121 public static boolean differentRegisters(CiValue v1, CiValue v2) { |
129 } | 122 return !isRegister(v1) || !isRegister(v2) || asRegister(v1) != asRegister(v2); |
130 } | 123 } |
131 } | 124 |
132 return true; | 125 public static boolean differentRegisters(CiValue v1, CiValue v2, CiValue v3) { |
126 return differentRegisters(v1, v2) && differentRegisters(v1, v3) && differentRegisters(v2, v3); | |
133 } | 127 } |
134 } | 128 } |