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

Unified Diff: src/IceInstX8632.cpp

Issue 413053002: Lower the fcmp instruction for <4 x float> operands. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Improve table formatting and X macro parameter names Created 6 years, 5 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
« no previous file with comments | « src/IceInstX8632.h ('k') | src/IceInstX8632.def » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstX8632.cpp
diff --git a/src/IceInstX8632.cpp b/src/IceInstX8632.cpp
index 93a872ca2475548c1fe5c31a63a0ba57b3594856..1698dfe9e5b6c25acd2b03c8e8dd8b08bcabb224 100644
--- a/src/IceInstX8632.cpp
+++ b/src/IceInstX8632.cpp
@@ -36,6 +36,18 @@ const struct InstX8632BrAttributes_ {
const size_t InstX8632BrAttributesSize =
llvm::array_lengthof(InstX8632BrAttributes);
+const struct InstX8632CmppsAttributes_ {
+ const char *EmitString;
+} InstX8632CmppsAttributes[] = {
+#define X(tag, emit) \
+ { emit } \
+ ,
+ ICEINSTX8632CMPPS_TABLE
+#undef X
+ };
+const size_t InstX8632CmppsAttributesSize =
+ llvm::array_lengthof(InstX8632CmppsAttributes);
+
const struct TypeX8632Attributes_ {
const char *CvtString; // i (integer), s (single FP), d (double FP)
const char *SdSsString; // ss, sd, or <blank>
@@ -149,6 +161,13 @@ InstX8632Cmov::InstX8632Cmov(Cfg *Func, Variable *Dest, Operand *Source,
addSource(Source);
}
+InstX8632Cmpps::InstX8632Cmpps(Cfg *Func, Variable *Dest, Operand *Source,
+ InstX8632Cmpps::CmppsCond Condition)
+ : InstX8632(Func, InstX8632::Cmpps, 2, Dest), Condition(Condition) {
+ addSource(Dest);
+ addSource(Source);
+}
+
InstX8632Cmpxchg::InstX8632Cmpxchg(Cfg *Func, Operand *DestOrAddr,
Variable *Eax, Variable *Desired,
bool Locked)
@@ -695,6 +714,28 @@ void InstX8632Cmov::dump(const Cfg *Func) const {
dumpSources(Func);
}
+void InstX8632Cmpps::emit(const Cfg *Func) const {
+ Ostream &Str = Func->getContext()->getStrEmit();
+ assert(getSrcSize() == 2);
+ assert(Condition < InstX8632CmppsAttributesSize);
+ Str << "\t";
+ Str << "cmp" << InstX8632CmppsAttributes[Condition].EmitString << "ps"
+ << "\t";
+ getDest()->emit(Func);
+ Str << ", ";
+ getSrc(1)->emit(Func);
+ Str << "\n";
+}
+
+void InstX8632Cmpps::dump(const Cfg *Func) const {
+ Ostream &Str = Func->getContext()->getStrDump();
+ assert(Condition < InstX8632CmppsAttributesSize);
+ dumpDest(Func);
+ Str << " = cmp" << InstX8632CmppsAttributes[Condition].EmitString << "ps"
+ << "\t";
+ dumpSources(Func);
+}
+
void InstX8632Cmpxchg::emit(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrEmit();
assert(getSrcSize() == 3);
« no previous file with comments | « src/IceInstX8632.h ('k') | src/IceInstX8632.def » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698