comparison graal/com.oracle.max.asmdis/src/com/sun/max/asm/gen/risc/ppc/PPCAssembly.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.risc.ppc;
24
25 import java.util.*;
26
27 import com.sun.max.asm.gen.risc.*;
28 import com.sun.max.asm.gen.risc.bitRange.*;
29 import com.sun.max.lang.*;
30
31 /**
32 */
33 public final class PPCAssembly extends RiscAssembly {
34
35 private static final boolean GENERATING_DEPRECATED_INSTRUCTIONS = true;
36 private static final boolean GENERATING_64BIT_INSTRUCTIONS = true;
37 private static final boolean GENERATING_POWER5_INSTRUCTIONS = false;
38
39 private PPCAssembly() {
40 super(ISA.PPC, RiscTemplate.class);
41 }
42
43 public boolean generatingDeprecatedInstructions() {
44 return GENERATING_DEPRECATED_INSTRUCTIONS;
45 }
46
47 public boolean generating64BitInstructions() {
48 return GENERATING_64BIT_INSTRUCTIONS;
49 }
50
51 public boolean generatingPower5Instructions() {
52 return GENERATING_POWER5_INSTRUCTIONS;
53 }
54
55 /**
56 * The existence of this method documents a bug in the Apple version of GNU 'as' where bit 11
57 * in an mtcrf instruction is encoded as 1 but specified as 0 in the architecture manual.
58 *
59 * This will have to be a non-constant method should another non-broken external assembler
60 * be used for testing.
61 */
62 public boolean isExternalMTCRFEncodingBroken() {
63 return true;
64 }
65
66 @Override
67 public BitRangeOrder bitRangeEndianness() {
68 return BitRangeOrder.ASCENDING;
69 }
70
71 @Override
72 protected List<RiscTemplate> createTemplates() {
73 final RiscTemplateCreator creator = new RiscTemplateCreator();
74 creator.createTemplates(new RawInstructions(creator));
75 creator.createTemplates(new SyntheticInstructions(creator));
76 return creator.templates();
77 }
78
79 public static final PPCAssembly ASSEMBLY = new PPCAssembly();
80 }