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

Side by Side Diff: src/IceTypes.h

Issue 1354673002: Fix call instructions to check parameter types for consistency. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: remove typo Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/IceTypes.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTypes.h - Primitive ICE types -------------*- C++ -*-===// 1 //===- subzero/src/IceTypes.h - Primitive ICE types -------------*- C++ -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 bool isVectorIntegerType(Type Ty); 74 bool isVectorIntegerType(Type Ty);
75 bool isIntegerArithmeticType(Type Ty); 75 bool isIntegerArithmeticType(Type Ty);
76 76
77 bool isFloatingType(Type Ty); // scalar or vector 77 bool isFloatingType(Type Ty); // scalar or vector
78 bool isScalarFloatingType(Type Ty); 78 bool isScalarFloatingType(Type Ty);
79 bool isVectorFloatingType(Type Ty); 79 bool isVectorFloatingType(Type Ty);
80 80
81 /// Returns true if the given type can be used in a load instruction. 81 /// Returns true if the given type can be used in a load instruction.
82 bool isLoadStoreType(Type Ty); 82 bool isLoadStoreType(Type Ty);
83 83
84 /// Returns true if the given type can be used as a parameter type in a call.
85 bool isCallParameterType(Type Ty);
86
87 /// Returns true if the given type can be used as the return type of a call.
88 inline bool isCallReturnType(Type Ty) {
89 return Ty == IceType_void || isCallParameterType(Ty);
90 }
91
84 /// Returns type generated by applying the compare instructions (icmp and fcmp) 92 /// Returns type generated by applying the compare instructions (icmp and fcmp)
85 /// to arguments of the given type. Returns IceType_void if compare is not 93 /// to arguments of the given type. Returns IceType_void if compare is not
86 /// allowed. 94 /// allowed.
87 Type getCompareResultType(Type Ty); 95 Type getCompareResultType(Type Ty);
88 96
89 /// Returns the number of bits in a scalar integer type. 97 /// Returns the number of bits in a scalar integer type.
90 SizeT getScalarIntBitWidth(Type Ty); 98 SizeT getScalarIntBitWidth(Type Ty);
91 99
92 /// Check if a type is byte sized (slight optimization over typeWidthInBytes). 100 /// Check if a type is byte sized (slight optimization over typeWidthInBytes).
93 inline bool isByteSizedType(Type Ty) { 101 inline bool isByteSizedType(Type Ty) {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 }; 163 };
156 164
157 inline Ostream &operator<<(Ostream &Stream, const FuncSigType &Sig) { 165 inline Ostream &operator<<(Ostream &Stream, const FuncSigType &Sig) {
158 Sig.dump(Stream); 166 Sig.dump(Stream);
159 return Stream; 167 return Stream;
160 } 168 }
161 169
162 } // end of namespace Ice 170 } // end of namespace Ice
163 171
164 #endif // SUBZERO_SRC_ICETYPES_H 172 #endif // SUBZERO_SRC_ICETYPES_H
OLDNEW
« no previous file with comments | « no previous file | src/IceTypes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698