[PATCH] D11924: WebAssembly: implement comparison.
JF Bastien via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 10 20:54:07 PDT 2015
jfb marked an inline comment as done.
================
Comment at: lib/Target/WebAssembly/WebAssemblyInstrFloat.td:31-37
@@ -30,11 +30,9 @@
-/*
- * TODO(jfb): Add the following for 32-bit and 64-bit.
- *
- * float32.eq: compare equal
- * float32.lt: less than
- * float32.le: less than or equal
- * float32.gt: greater than
- * float32.ge: greater than or equal
- */
+// FIXME: fold unordered operations to ordered.
+defm EQ : ComparisonFP<setoeq>;
+defm NE : ComparisonFP<setune>;
+defm LT : ComparisonFP<setolt>;
+defm LE : ComparisonFP<setole>;
+defm GT : ComparisonFP<setogt>;
+defm GE : ComparisonFP<setoge>;
----------------
I'm not sure I get what you mean about the "don't care" comparisons. You mean `TRUE` and `FALSE`?
================
Comment at: lib/Target/WebAssembly/WebAssemblyInstrFloat.td:33
@@ +32,3 @@
+defm EQ : ComparisonFP<setoeq>;
+defm NE : ComparisonFP<setune>;
+defm LT : ComparisonFP<setolt>;
----------------
I've been reading the DAG legalization code... I'm not sure I get it yet. I uploaded an intermediate update which is broken for now (and the `CHECK` are wrong, because I haven't settled on which expansions are needed)... I'm not sure I get the expansion order. Right now it says it can't select `ueq`, but it should have been expanded.
================
Comment at: lib/Target/WebAssembly/WebAssemblyInstrFloat.td:37
@@ -40,1 +36,3 @@
+defm GT : ComparisonFP<setogt>;
+defm GE : ComparisonFP<setoge>;
----------------
I'll add f64 when f32 works.
http://reviews.llvm.org/D11924
More information about the llvm-commits
mailing list