Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1544)

Unified Diff: runtime/vm/intermediate_language.h

Issue 13818006: Unboxed load/store indexed of Float32x4 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index ac497ff5ea74f2a71dbaff1d97f2598fa80b0f54..7271f43fb18ff0a09b0cb632dd3fcb3238de1f85 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -46,6 +46,7 @@ class Range;
V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 380843687) \
V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 979971573) \
V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 979971573) \
+ V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 690339584) \
V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 287047804) \
V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 287047804) \
V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 287047804) \
@@ -54,6 +55,7 @@ class Range;
V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 287047804) \
V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 1032541114) \
V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 1032541114) \
+ V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 1016704782) \
V(_GrowableObjectArray, get:length, GrowableArrayLength, 725548050) \
V(_GrowableObjectArray, get:_capacity, GrowableArrayCapacity, 725548050) \
V(_StringBase, get:length, StringBaseLength, 320803993) \
@@ -489,6 +491,8 @@ class EmbeddedArray<T, 0> {
M(MathSqrt) \
M(UnboxDouble) \
M(BoxDouble) \
+ M(BoxFloat32x4) \
+ M(UnboxFloat32x4) \
M(UnboxInteger) \
M(BoxInteger) \
M(BinaryMintOp) \
@@ -740,6 +744,7 @@ FOR_EACH_INSTRUCTION(INSTRUCTION_TYPE_CHECK)
// Classes that set deopt_id_.
friend class UnboxIntegerInstr;
friend class UnboxDoubleInstr;
+ friend class UnboxFloat32x4Instr;
friend class BinaryDoubleOpInstr;
friend class BinaryMintOpInstr;
friend class BinarySmiOpInstr;
@@ -3677,15 +3682,12 @@ class CheckEitherNonSmiInstr : public TemplateInstruction<2> {
class BoxDoubleInstr : public TemplateDefinition<1> {
public:
- BoxDoubleInstr(Value* value, InstanceCallInstr* instance_call)
- : token_pos_((instance_call != NULL) ? instance_call->token_pos() : 0) {
+ explicit BoxDoubleInstr(Value* value) {
SetInputAt(0, value);
}
Value* value() const { return inputs_[0]; }
- intptr_t token_pos() const { return token_pos_; }
-
virtual bool CanDeoptimize() const { return false; }
virtual bool HasSideEffect() const { return false; }
@@ -3702,12 +3704,38 @@ class BoxDoubleInstr : public TemplateDefinition<1> {
virtual CompileType ComputeType() const;
private:
- const intptr_t token_pos_;
-
DISALLOW_COPY_AND_ASSIGN(BoxDoubleInstr);
};
+class BoxFloat32x4Instr : public TemplateDefinition<1> {
+ public:
+ explicit BoxFloat32x4Instr(Value* value) {
+ SetInputAt(0, value);
+ }
+
+ Value* value() const { return inputs_[0]; }
+
+ virtual bool CanDeoptimize() const { return false; }
+
+ virtual bool HasSideEffect() const { return false; }
+
+ virtual bool AffectedBySideEffect() const { return false; }
+ virtual bool AttributesEqual(Instruction* other) const { return true; }
+
+ virtual Representation RequiredInputRepresentation(intptr_t idx) const {
+ ASSERT(idx == 0);
+ return kUnboxedFloat32x4;
+ }
+
+ DECLARE_INSTRUCTION(BoxFloat32x4)
+ virtual CompileType ComputeType() const;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BoxFloat32x4Instr);
+};
+
+
class BoxIntegerInstr : public TemplateDefinition<1> {
public:
explicit BoxIntegerInstr(Value* value) {
@@ -3767,6 +3795,36 @@ class UnboxDoubleInstr : public TemplateDefinition<1> {
};
+class UnboxFloat32x4Instr : public TemplateDefinition<1> {
+ public:
+ UnboxFloat32x4Instr(Value* value, intptr_t deopt_id) {
+ SetInputAt(0, value);
+ deopt_id_ = deopt_id;
+ }
+
+ Value* value() const { return inputs_[0]; }
+
+ virtual bool CanDeoptimize() const {
+ return (value()->Type()->ToCid() != kFloat32x4Cid);
+ }
+
+ virtual bool HasSideEffect() const { return false; }
+
+ virtual Representation representation() const {
+ return kUnboxedFloat32x4;
+ }
+
+ virtual bool AffectedBySideEffect() const { return false; }
+ virtual bool AttributesEqual(Instruction* other) const { return true; }
+
+ DECLARE_INSTRUCTION(UnboxFloat32x4)
+ virtual CompileType ComputeType() const;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnboxFloat32x4Instr);
+};
+
+
class UnboxIntegerInstr : public TemplateDefinition<1> {
public:
UnboxIntegerInstr(Value* value, intptr_t deopt_id) {

Powered by Google App Engine
This is Rietveld 408576698