Mercurial > hg > truffle
comparison graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILLIRGenerator.java @ 14945:b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Wed, 02 Apr 2014 15:26:58 +0200 |
parents | 4f5c312d676e |
children | b65036798097 |
comparison
equal
deleted
inserted
replaced
14944:96f8e6b6a81a | 14945:b14cb2d9253d |
---|---|
58 /** | 58 /** |
59 * This class implements the HSAIL specific portion of the LIR generator. | 59 * This class implements the HSAIL specific portion of the LIR generator. |
60 */ | 60 */ |
61 public abstract class HSAILLIRGenerator extends LIRGenerator { | 61 public abstract class HSAILLIRGenerator extends LIRGenerator { |
62 | 62 |
63 public static class HSAILSpillMoveFactory implements LIR.SpillMoveFactory { | 63 public class HSAILSpillMoveFactory implements LIR.SpillMoveFactory { |
64 | 64 |
65 @Override | 65 @Override |
66 public LIRInstruction createMove(AllocatableValue dst, Value src) { | 66 public LIRInstruction createMove(AllocatableValue dst, Value src) { |
67 if (src instanceof HSAILAddressValue) { | 67 return HSAILLIRGenerator.this.createMove(dst, src); |
68 return new LeaOp(dst, (HSAILAddressValue) src); | |
69 } else if (isRegister(src) || isStackSlot(dst)) { | |
70 return new MoveFromRegOp(dst, src); | |
71 } else { | |
72 return new MoveToRegOp(dst, src); | |
73 } | |
74 } | 68 } |
75 } | 69 } |
76 | 70 |
77 public HSAILLIRGenerator(Providers providers, CallingConvention cc, LIRGenerationResult lirGenRes) { | 71 public HSAILLIRGenerator(Providers providers, CallingConvention cc, LIRGenerationResult lirGenRes) { |
78 super(providers, cc, lirGenRes); | 72 super(providers, cc, lirGenRes); |
102 Variable result = newVariable(input.getKind()); | 96 Variable result = newVariable(input.getKind()); |
103 emitMove(result, input); | 97 emitMove(result, input); |
104 return result; | 98 return result; |
105 } | 99 } |
106 | 100 |
101 protected HSAILLIRInstruction createMove(AllocatableValue dst, Value src) { | |
102 if (src instanceof HSAILAddressValue) { | |
103 return new LeaOp(dst, (HSAILAddressValue) src); | |
104 } else if (isRegister(src) || isStackSlot(dst)) { | |
105 return new MoveFromRegOp(dst.getKind(), dst, src); | |
106 } else { | |
107 return new MoveToRegOp(dst.getKind(), dst, src); | |
108 } | |
109 } | |
110 | |
107 @Override | 111 @Override |
108 public void emitMove(AllocatableValue dst, Value src) { | 112 public void emitMove(AllocatableValue dst, Value src) { |
109 if (isRegister(src) || isStackSlot(dst)) { | 113 append(createMove(dst, src)); |
110 append(new MoveFromRegOp(dst, src)); | |
111 } else { | |
112 append(new MoveToRegOp(dst, src)); | |
113 } | |
114 } | 114 } |
115 | 115 |
116 public void emitData(AllocatableValue dst, byte[] data) { | 116 public void emitData(AllocatableValue dst, byte[] data) { |
117 throw GraalInternalError.unimplemented(); | 117 throw GraalInternalError.unimplemented(); |
118 } | 118 } |