annotate graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/AccessVectorNode.java @ 3146:a8db5b0e499f

Intrinsify arraycopy of primitive types to vector instructions.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Mon, 04 Jul 2011 18:54:54 +0200
parents
children d95db56f8deb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3146
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
1 /*
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
4 *
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
7 * published by the Free Software Foundation.
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
8 *
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
13 * accompanied this code).
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
14 *
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
18 *
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
21 * questions.
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
22 */
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
23 package com.oracle.max.graal.compiler.ir;
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
24
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
25 import com.oracle.max.graal.graph.*;
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
26 import com.sun.cri.ci.*;
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
27
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
28
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
29 public abstract class AccessVectorNode extends AbstractVectorNode {
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
30 private static final int INPUT_COUNT = 2;
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
31 private static final int INPUT_OBJECT = 0;
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
32 private static final int INPUT_LOCATION = 1;
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
33 private static final int SUCCESSOR_COUNT = 0;
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
34
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
35 @Override
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
36 protected int inputCount() {
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
37 return super.inputCount() + INPUT_COUNT;
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
38 }
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
39
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
40 @Override
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
41 protected int successorCount() {
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
42 return super.successorCount() + SUCCESSOR_COUNT;
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
43 }
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
44
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
45 public void setObject(Value object) {
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
46 inputs().set(super.inputCount() + INPUT_OBJECT, object);
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
47 }
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
48
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
49 public Value object() {
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
50 return (Value) inputs().get(super.inputCount() + INPUT_OBJECT);
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
51 }
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
52
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
53 public void setLocation(LocationNode object) {
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
54 inputs().set(super.inputCount() + INPUT_LOCATION, object);
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
55 }
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
56
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
57 public LocationNode location() {
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
58 return (LocationNode) inputs().get(super.inputCount() + INPUT_LOCATION);
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
59 }
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
60
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
61 public AccessVectorNode(CiKind kind, int inputCount, int successorCount, AbstractVectorNode vector, Value object, LocationNode location, Graph graph) {
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
62 super(kind, inputCount + INPUT_COUNT, successorCount + SUCCESSOR_COUNT, vector, graph);
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
63 setObject(object);
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
64 setLocation(location);
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
65 }
a8db5b0e499f Intrinsify arraycopy of primitive types to vector instructions.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
66 }