Mercurial > hg > truffle
comparison graal/com.oracle.graal.word/src/com/oracle/graal/word/Signed.java @ 19507:1cde96b96673
Fixed code format issues.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Thu, 19 Feb 2015 16:15:56 +0100 |
parents | 103a0003db01 |
children |
comparison
equal
deleted
inserted
replaced
19506:8c7536965c95 | 19507:1cde96b96673 |
---|---|
24 | 24 |
25 public interface Signed extends ComparableWord { | 25 public interface Signed extends ComparableWord { |
26 | 26 |
27 /** | 27 /** |
28 * Returns a Signed whose value is {@code (this + val)}. | 28 * Returns a Signed whose value is {@code (this + val)}. |
29 * | 29 * |
30 * @param val value to be added to this Signed. | 30 * @param val value to be added to this Signed. |
31 * @return {@code this + val} | 31 * @return {@code this + val} |
32 */ | 32 */ |
33 Signed add(Signed val); | 33 Signed add(Signed val); |
34 | 34 |
35 /** | 35 /** |
36 * Returns a Signed whose value is {@code (this - val)}. | 36 * Returns a Signed whose value is {@code (this - val)}. |
37 * | 37 * |
38 * @param val value to be subtracted from this Signed. | 38 * @param val value to be subtracted from this Signed. |
39 * @return {@code this - val} | 39 * @return {@code this - val} |
40 */ | 40 */ |
41 Signed subtract(Signed val); | 41 Signed subtract(Signed val); |
42 | 42 |
43 /** | 43 /** |
44 * Returns a Signed whose value is {@code (this * val)}. | 44 * Returns a Signed whose value is {@code (this * val)}. |
45 * | 45 * |
46 * @param val value to be multiplied by this Signed. | 46 * @param val value to be multiplied by this Signed. |
47 * @return {@code this * val} | 47 * @return {@code this * val} |
48 */ | 48 */ |
49 Signed multiply(Signed val); | 49 Signed multiply(Signed val); |
50 | 50 |
51 /** | 51 /** |
52 * Returns a Signed whose value is {@code (this / val)}. | 52 * Returns a Signed whose value is {@code (this / val)}. |
53 * | 53 * |
54 * @param val value by which this Signed is to be divided. | 54 * @param val value by which this Signed is to be divided. |
55 * @return {@code this / val} | 55 * @return {@code this / val} |
56 */ | 56 */ |
57 Signed signedDivide(Signed val); | 57 Signed signedDivide(Signed val); |
58 | 58 |
59 /** | 59 /** |
60 * Returns a Signed whose value is {@code (this % val)}. | 60 * Returns a Signed whose value is {@code (this % val)}. |
61 * | 61 * |
62 * @param val value by which this Signed is to be divided, and the remainder computed. | 62 * @param val value by which this Signed is to be divided, and the remainder computed. |
63 * @return {@code this % val} | 63 * @return {@code this % val} |
64 */ | 64 */ |
65 Signed signedRemainder(Signed val); | 65 Signed signedRemainder(Signed val); |
66 | 66 |
67 /** | 67 /** |
68 * Returns a Signed whose value is {@code (this << n)}. | 68 * Returns a Signed whose value is {@code (this << n)}. |
69 * | 69 * |
70 * @param n shift distance, in bits. | 70 * @param n shift distance, in bits. |
71 * @return {@code this << n} | 71 * @return {@code this << n} |
72 */ | 72 */ |
73 Signed shiftLeft(Unsigned n); | 73 Signed shiftLeft(Unsigned n); |
74 | 74 |
75 /** | 75 /** |
76 * Returns a Signed whose value is {@code (this >> n)}. Sign extension is performed. | 76 * Returns a Signed whose value is {@code (this >> n)}. Sign extension is performed. |
77 * | 77 * |
78 * @param n shift distance, in bits. | 78 * @param n shift distance, in bits. |
79 * @return {@code this >> n} | 79 * @return {@code this >> n} |
80 */ | 80 */ |
81 Signed signedShiftRight(Unsigned n); | 81 Signed signedShiftRight(Unsigned n); |
82 | 82 |
83 /** | 83 /** |
84 * Returns a Signed whose value is {@code (this & val)}. (This method returns a negative Signed | 84 * Returns a Signed whose value is {@code (this & val)}. (This method returns a negative Signed |
85 * if and only if this and val are both negative.) | 85 * if and only if this and val are both negative.) |
86 * | 86 * |
87 * @param val value to be AND'ed with this Signed. | 87 * @param val value to be AND'ed with this Signed. |
88 * @return {@code this & val} | 88 * @return {@code this & val} |
89 */ | 89 */ |
90 Signed and(Signed val); | 90 Signed and(Signed val); |
91 | 91 |
92 /** | 92 /** |
93 * Returns a Signed whose value is {@code (this | val)}. (This method returns a negative Signed | 93 * Returns a Signed whose value is {@code (this | val)}. (This method returns a negative Signed |
94 * if and only if either this or val is negative.) | 94 * if and only if either this or val is negative.) |
95 * | 95 * |
96 * @param val value to be OR'ed with this Signed. | 96 * @param val value to be OR'ed with this Signed. |
97 * @return {@code this | val} | 97 * @return {@code this | val} |
98 */ | 98 */ |
99 Signed or(Signed val); | 99 Signed or(Signed val); |
100 | 100 |
101 /** | 101 /** |
102 * Returns a Signed whose value is {@code (this ^ val)}. (This method returns a negative Signed | 102 * Returns a Signed whose value is {@code (this ^ val)}. (This method returns a negative Signed |
103 * if and only if exactly one of this and val are negative.) | 103 * if and only if exactly one of this and val are negative.) |
104 * | 104 * |
105 * @param val value to be XOR'ed with this Signed. | 105 * @param val value to be XOR'ed with this Signed. |
106 * @return {@code this ^ val} | 106 * @return {@code this ^ val} |
107 */ | 107 */ |
108 Signed xor(Signed val); | 108 Signed xor(Signed val); |
109 | 109 |
110 /** | 110 /** |
111 * Returns a Signed whose value is {@code (~this)}. (This method returns a negative value if and | 111 * Returns a Signed whose value is {@code (~this)}. (This method returns a negative value if and |
112 * only if this Signed is non-negative.) | 112 * only if this Signed is non-negative.) |
113 * | 113 * |
114 * @return {@code ~this} | 114 * @return {@code ~this} |
115 */ | 115 */ |
116 Signed not(); | 116 Signed not(); |
117 | 117 |
118 /** | 118 /** |
119 * Compares this Signed with the specified value. | 119 * Compares this Signed with the specified value. |
120 * | 120 * |
121 * @param val value to which this Signed is to be compared. | 121 * @param val value to which this Signed is to be compared. |
122 * @return {@code this == val} | 122 * @return {@code this == val} |
123 */ | 123 */ |
124 boolean equal(Signed val); | 124 boolean equal(Signed val); |
125 | 125 |
126 /** | 126 /** |
127 * Compares this Signed with the specified value. | 127 * Compares this Signed with the specified value. |
128 * | 128 * |
129 * @param val value to which this Signed is to be compared. | 129 * @param val value to which this Signed is to be compared. |
130 * @return {@code this != val} | 130 * @return {@code this != val} |
131 */ | 131 */ |
132 boolean notEqual(Signed val); | 132 boolean notEqual(Signed val); |
133 | 133 |
134 /** | 134 /** |
135 * Compares this Signed with the specified value. | 135 * Compares this Signed with the specified value. |
136 * | 136 * |
137 * @param val value to which this Signed is to be compared. | 137 * @param val value to which this Signed is to be compared. |
138 * @return {@code this < val} | 138 * @return {@code this < val} |
139 */ | 139 */ |
140 boolean lessThan(Signed val); | 140 boolean lessThan(Signed val); |
141 | 141 |
142 /** | 142 /** |
143 * Compares this Signed with the specified value. | 143 * Compares this Signed with the specified value. |
144 * | 144 * |
145 * @param val value to which this Signed is to be compared. | 145 * @param val value to which this Signed is to be compared. |
146 * @return {@code this <= val} | 146 * @return {@code this <= val} |
147 */ | 147 */ |
148 boolean lessOrEqual(Signed val); | 148 boolean lessOrEqual(Signed val); |
149 | 149 |
150 /** | 150 /** |
151 * Compares this Signed with the specified value. | 151 * Compares this Signed with the specified value. |
152 * | 152 * |
153 * @param val value to which this Signed is to be compared. | 153 * @param val value to which this Signed is to be compared. |
154 * @return {@code this > val} | 154 * @return {@code this > val} |
155 */ | 155 */ |
156 boolean greaterThan(Signed val); | 156 boolean greaterThan(Signed val); |
157 | 157 |
158 /** | 158 /** |
159 * Compares this Signed with the specified value. | 159 * Compares this Signed with the specified value. |
160 * | 160 * |
161 * @param val value to which this Signed is to be compared. | 161 * @param val value to which this Signed is to be compared. |
162 * @return {@code this >= val} | 162 * @return {@code this >= val} |
163 */ | 163 */ |
164 boolean greaterOrEqual(Signed val); | 164 boolean greaterOrEqual(Signed val); |
165 | 165 |
166 /** | 166 /** |
167 * Returns a Signed whose value is {@code (this + val)}. | 167 * Returns a Signed whose value is {@code (this + val)}. |
168 * | 168 * |
169 * @param val value to be added to this Signed. | 169 * @param val value to be added to this Signed. |
170 * @return {@code this + val} | 170 * @return {@code this + val} |
171 */ | 171 */ |
172 Signed add(int val); | 172 Signed add(int val); |
173 | 173 |
174 /** | 174 /** |
175 * Returns a Signed whose value is {@code (this - val)}. | 175 * Returns a Signed whose value is {@code (this - val)}. |
176 * | 176 * |
177 * @param val value to be subtracted from this Signed. | 177 * @param val value to be subtracted from this Signed. |
178 * @return {@code this - val} | 178 * @return {@code this - val} |
179 */ | 179 */ |
180 Signed subtract(int val); | 180 Signed subtract(int val); |
181 | 181 |
182 /** | 182 /** |
183 * Returns a Signed whose value is {@code (this * val)}. | 183 * Returns a Signed whose value is {@code (this * val)}. |
184 * | 184 * |
185 * @param val value to be multiplied by this Signed. | 185 * @param val value to be multiplied by this Signed. |
186 * @return {@code this * val} | 186 * @return {@code this * val} |
187 */ | 187 */ |
188 Signed multiply(int val); | 188 Signed multiply(int val); |
189 | 189 |
190 /** | 190 /** |
191 * Returns a Signed whose value is {@code (this / val)}. | 191 * Returns a Signed whose value is {@code (this / val)}. |
192 * | 192 * |
193 * @param val value by which this Signed is to be divided. | 193 * @param val value by which this Signed is to be divided. |
194 * @return {@code this / val} | 194 * @return {@code this / val} |
195 */ | 195 */ |
196 Signed signedDivide(int val); | 196 Signed signedDivide(int val); |
197 | 197 |
198 /** | 198 /** |
199 * Returns a Signed whose value is {@code (this % val)}. | 199 * Returns a Signed whose value is {@code (this % val)}. |
200 * | 200 * |
201 * @param val value by which this Signed is to be divided, and the remainder computed. | 201 * @param val value by which this Signed is to be divided, and the remainder computed. |
202 * @return {@code this % val} | 202 * @return {@code this % val} |
203 */ | 203 */ |
204 Signed signedRemainder(int val); | 204 Signed signedRemainder(int val); |
205 | 205 |
206 /** | 206 /** |
207 * Returns a Signed whose value is {@code (this << n)}. | 207 * Returns a Signed whose value is {@code (this << n)}. |
208 * | 208 * |
209 * @param n shift distance, in bits. | 209 * @param n shift distance, in bits. |
210 * @return {@code this << n} | 210 * @return {@code this << n} |
211 */ | 211 */ |
212 Signed shiftLeft(int n); | 212 Signed shiftLeft(int n); |
213 | 213 |
214 /** | 214 /** |
215 * Returns a Signed whose value is {@code (this >> n)}. Sign extension is performed. | 215 * Returns a Signed whose value is {@code (this >> n)}. Sign extension is performed. |
216 * | 216 * |
217 * @param n shift distance, in bits. | 217 * @param n shift distance, in bits. |
218 * @return {@code this >> n} | 218 * @return {@code this >> n} |
219 */ | 219 */ |
220 Signed signedShiftRight(int n); | 220 Signed signedShiftRight(int n); |
221 | 221 |
222 /** | 222 /** |
223 * Returns a Signed whose value is {@code (this & val)}. (This method returns a negative Signed | 223 * Returns a Signed whose value is {@code (this & val)}. (This method returns a negative Signed |
224 * if and only if this and val are both negative.) | 224 * if and only if this and val are both negative.) |
225 * | 225 * |
226 * @param val value to be AND'ed with this Signed. | 226 * @param val value to be AND'ed with this Signed. |
227 * @return {@code this & val} | 227 * @return {@code this & val} |
228 */ | 228 */ |
229 Signed and(int val); | 229 Signed and(int val); |
230 | 230 |
231 /** | 231 /** |
232 * Returns a Signed whose value is {@code (this | val)}. (This method returns a negative Signed | 232 * Returns a Signed whose value is {@code (this | val)}. (This method returns a negative Signed |
233 * if and only if either this or val is negative.) | 233 * if and only if either this or val is negative.) |
234 * | 234 * |
235 * @param val value to be OR'ed with this Signed. | 235 * @param val value to be OR'ed with this Signed. |
236 * @return {@code this | val} | 236 * @return {@code this | val} |
237 */ | 237 */ |
238 Signed or(int val); | 238 Signed or(int val); |
239 | 239 |
240 /** | 240 /** |
241 * Returns a Signed whose value is {@code (this ^ val)}. (This method returns a negative Signed | 241 * Returns a Signed whose value is {@code (this ^ val)}. (This method returns a negative Signed |
242 * if and only if exactly one of this and val are negative.) | 242 * if and only if exactly one of this and val are negative.) |
243 * | 243 * |
244 * @param val value to be XOR'ed with this Signed. | 244 * @param val value to be XOR'ed with this Signed. |
245 * @return {@code this ^ val} | 245 * @return {@code this ^ val} |
246 */ | 246 */ |
247 Signed xor(int val); | 247 Signed xor(int val); |
248 | 248 |
249 /** | 249 /** |
250 * Compares this Signed with the specified value. | 250 * Compares this Signed with the specified value. |
251 * | 251 * |
252 * @param val value to which this Signed is to be compared. | 252 * @param val value to which this Signed is to be compared. |
253 * @return {@code this == val} | 253 * @return {@code this == val} |
254 */ | 254 */ |
255 boolean equal(int val); | 255 boolean equal(int val); |
256 | 256 |
257 /** | 257 /** |
258 * Compares this Signed with the specified value. | 258 * Compares this Signed with the specified value. |
259 * | 259 * |
260 * @param val value to which this Signed is to be compared. | 260 * @param val value to which this Signed is to be compared. |
261 * @return {@code this != val} | 261 * @return {@code this != val} |
262 */ | 262 */ |
263 boolean notEqual(int val); | 263 boolean notEqual(int val); |
264 | 264 |
265 /** | 265 /** |
266 * Compares this Signed with the specified value. | 266 * Compares this Signed with the specified value. |
267 * | 267 * |
268 * @param val value to which this Signed is to be compared. | 268 * @param val value to which this Signed is to be compared. |
269 * @return {@code this < val} | 269 * @return {@code this < val} |
270 */ | 270 */ |
271 boolean lessThan(int val); | 271 boolean lessThan(int val); |
272 | 272 |
273 /** | 273 /** |
274 * Compares this Signed with the specified value. | 274 * Compares this Signed with the specified value. |
275 * | 275 * |
276 * @param val value to which this Signed is to be compared. | 276 * @param val value to which this Signed is to be compared. |
277 * @return {@code this <= val} | 277 * @return {@code this <= val} |
278 */ | 278 */ |
279 boolean lessOrEqual(int val); | 279 boolean lessOrEqual(int val); |
280 | 280 |
281 /** | 281 /** |
282 * Compares this Signed with the specified value. | 282 * Compares this Signed with the specified value. |
283 * | 283 * |
284 * @param val value to which this Signed is to be compared. | 284 * @param val value to which this Signed is to be compared. |
285 * @return {@code this > val} | 285 * @return {@code this > val} |
286 */ | 286 */ |
287 boolean greaterThan(int val); | 287 boolean greaterThan(int val); |
288 | 288 |
289 /** | 289 /** |
290 * Compares this Signed with the specified value. | 290 * Compares this Signed with the specified value. |
291 * | 291 * |
292 * @param val value to which this Signed is to be compared. | 292 * @param val value to which this Signed is to be compared. |
293 * @return {@code this >= val} | 293 * @return {@code this >= val} |
294 */ | 294 */ |
295 boolean greaterOrEqual(int val); | 295 boolean greaterOrEqual(int val); |
296 } | 296 } |