Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/replacements/HSAILDirectStoreReleaseNode.java @ 16919:0fe4732e5181
made use of generated Node classes predicated on value of graal.useGeneratedNodes system property (default is false)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 25 Aug 2014 13:45:12 +0200 |
parents | 06c15e88d383 |
children | ffb974bef674 |
rev | line source |
---|---|
16076
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 /* |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16076
diff
changeset
|
2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. |
16076
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
4 * |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
8 * |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
14 * |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
18 * |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
21 * questions. |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
22 */ |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
23 package com.oracle.graal.hotspot.hsail.replacements; |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
24 |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
25 import com.oracle.graal.api.meta.*; |
16811
5d468add216f
added @NodeInfo annotations to all Node classes
Doug Simon <doug.simon@oracle.com>
parents:
16094
diff
changeset
|
26 import com.oracle.graal.hotspot.hsail.*; |
16841
cbd42807a31f
moved NodeInfo and friends into separate com.oracle.graal.nodeinfo project so that annotation processor can be applied to the base Node class
Doug Simon <doug.simon@oracle.com>
parents:
16811
diff
changeset
|
27 import com.oracle.graal.nodeinfo.*; |
16076
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
28 import com.oracle.graal.nodes.*; |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
29 import com.oracle.graal.nodes.spi.*; |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
30 import com.oracle.graal.replacements.nodes.*; |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
31 import com.oracle.graal.word.*; |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
32 |
16811
5d468add216f
added @NodeInfo annotations to all Node classes
Doug Simon <doug.simon@oracle.com>
parents:
16094
diff
changeset
|
33 @NodeInfo |
16076
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
34 public class HSAILDirectStoreReleaseNode extends DirectStoreNode { |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
35 |
16895
06c15e88d383
added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents:
16841
diff
changeset
|
36 public static HSAILDirectStoreReleaseNode create(ValueNode address, ValueNode value, Kind kind) { |
16919
0fe4732e5181
made use of generated Node classes predicated on value of graal.useGeneratedNodes system property (default is false)
Doug Simon <doug.simon@oracle.com>
parents:
16895
diff
changeset
|
37 return USE_GENERATED_NODES ? new HSAILDirectStoreReleaseNodeGen(address, value, kind) : new HSAILDirectStoreReleaseNode(address, value, kind); |
16895
06c15e88d383
added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents:
16841
diff
changeset
|
38 } |
06c15e88d383
added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents:
16841
diff
changeset
|
39 |
06c15e88d383
added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents:
16841
diff
changeset
|
40 protected HSAILDirectStoreReleaseNode(ValueNode address, ValueNode value, Kind kind) { |
16076
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
41 super(address, value, kind); |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
42 } |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
43 |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
44 @Override |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
45 public void generate(NodeLIRBuilderTool gen) { |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
46 HSAILHotSpotLIRGenerator hsailgen = (HSAILHotSpotLIRGenerator) (gen.getLIRGeneratorTool()); |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
47 Value v = gen.operand(getValue()); |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16076
diff
changeset
|
48 LIRKind kind = hsailgen.getLIRKind(getValue().stamp()); |
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16076
diff
changeset
|
49 hsailgen.emitStoreRelease(kind, gen.operand(getAddress()), v, null); |
16076
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
50 } |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
51 |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
52 @NodeIntrinsic |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
53 public static native void storeRelease(long address, long value, @ConstantNodeParameter Kind kind); |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
54 |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
55 public static void storeReleaseLong(Word address, long value) { |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
56 storeRelease(address.rawValue(), value, Kind.Long); |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
57 } |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
58 |
06eedda53e14
HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
59 } |