comparison graal/com.oracle.max.asmdis/src/com/sun/max/asm/gen/cisc/x86/OperandCode.java @ 3733:e233f5660da4

Added Java files from Maxine project.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 17 Dec 2011 19:59:18 +0100
parents
children bc8527f3071c
comparison
equal deleted inserted replaced
3732:3e2e8b8abdaf 3733:e233f5660da4
1 /*
2 * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23 package com.sun.max.asm.gen.cisc.x86;
24
25 import static com.sun.max.asm.gen.cisc.x86.AddressingMethodCode.*;
26 import static com.sun.max.asm.gen.cisc.x86.OperandTypeCode.*;
27
28 import java.util.*;
29
30 import com.sun.max.asm.*;
31 import com.sun.max.asm.gen.*;
32 import com.sun.max.util.*;
33
34 /**
35 */
36 public enum OperandCode implements WrappableSpecification {
37
38 Ap(A, p),
39 Cd(C, d),
40 Cq(C, q),
41 Dd(D, d),
42 Dq(D, q),
43 Eb(E, b),
44 Ed(E, d),
45 Ed_q(E, d_q),
46 Ev(E, v),
47 Ew(E, w),
48 Fv(F, v),
49 Gb(G, b),
50 Gd(G, d),
51 Gd_q(G, d_q),
52 Gv(G, v),
53 Gw(G, w),
54 Gq(G, q),
55 Gz(G, z),
56 Ib(I, b),
57 ICb(IC, b),
58 Iv(I, v),
59 Iw(I, w),
60 Iz(I, z),
61 Jb(J, b),
62 Jv(J, v),
63 Jz(J, z),
64 Ma(M, a),
65 Mb(M, b),
66 Md(M, d),
67 Md_q(M, d_q),
68 Mp(M, p),
69 Mq(M, q),
70 Mdq(M, dq),
71 Ms(M, s),
72 Mv(M, v),
73 Mw(M, w),
74 Nb(N, b),
75 Nd(N, d),
76 Nd_q(N, d_q),
77 Nv(N, v),
78 Ob(O, b),
79 Ov(O, v),
80 Pd(P, d),
81 Pdq(P, dq),
82 Pq(P, q),
83 PRq(PR, q),
84 Qd(Q, d),
85 Qq(Q, q),
86 Rd(R, d),
87 Rq(R, q),
88 Rv(R, v),
89 Sw(S, w),
90 Vdq(V, dq),
91 Vpd(V, pd),
92 Vps(V, ps),
93 Vq(V, q),
94 Vsd(V, sd),
95 Vss(V, ss),
96 VRdq(VR, dq),
97 VRpd(VR, pd),
98 VRps(VR, ps),
99 VRq(VR, q),
100 Wdq(W, dq),
101 Wpd(W, pd),
102 Wps(W, ps),
103 Wq(W, q),
104 Wsd(W, sd),
105 Wss(W, ss),
106 Xb(X, b),
107 Xv(X, v),
108 Xz(X, z),
109 Yb(Y, b),
110 Yv(Y, v),
111 Yz(Y, z);
112
113 private final AddressingMethodCode addressingMethodCode;
114 private final OperandTypeCode operandTypeCode;
115
116 private OperandCode(AddressingMethodCode addressingMethodCode, OperandTypeCode operandTypeCode) {
117 this.addressingMethodCode = addressingMethodCode;
118 this.operandTypeCode = operandTypeCode;
119 }
120
121 public AddressingMethodCode addressingMethodCode() {
122 return addressingMethodCode;
123 }
124
125 public OperandTypeCode operandTypeCode() {
126 return operandTypeCode;
127 }
128
129 public TestArgumentExclusion excludeDisassemblerTestArguments(Argument... arguments) {
130 return new TestArgumentExclusion(AssemblyTestComponent.DISASSEMBLER, this, new HashSet<Argument>(Arrays.asList(arguments)));
131 }
132
133 public TestArgumentExclusion excludeExternalTestArguments(Argument... arguments) {
134 return new TestArgumentExclusion(AssemblyTestComponent.EXTERNAL_ASSEMBLER, this, new HashSet<Argument>(Arrays.asList(arguments)));
135 }
136
137 public TestArgumentExclusion excludeExternalTestArguments(Enumerator... argumentEnumerators) {
138 final Set<Argument> arguments = new HashSet<Argument>();
139 for (Enumerator argumentEnumerator : argumentEnumerators) {
140 for (Object e : argumentEnumerator) {
141 arguments.add((Argument) e);
142 }
143 }
144 return new TestArgumentExclusion(AssemblyTestComponent.EXTERNAL_ASSEMBLER, this, arguments);
145 }
146
147 public ArgumentRange range(long minValue, long maxValue) {
148 return new ArgumentRange(this, minValue, maxValue);
149 }
150
151 public ArgumentRange externalRange(long minValue, long maxValue) {
152 final ArgumentRange argumentRange = new ArgumentRange(this, minValue, maxValue);
153 argumentRange.doNotApplyInternally();
154 return argumentRange;
155 }
156 }