[PATCH] D11924: WebAssembly: implement comparison.

Dan Gohman via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 19:05:37 PDT 2015


sunfish accepted this revision.
This revision is now accepted and ready to land.

================
Comment at: lib/Target/WebAssembly/WebAssemblyInstrFloat.td:27
@@ -26,10 +26,3 @@
 
-/*
- * 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>;
----------------
The unordered comparisons (except "une") will be legalized. The optimization to do here is to fold the "don't care" comparisons to supported comparisons.

================
Comment at: lib/Target/WebAssembly/WebAssemblyInstrFloat.td:29
@@ +28,3 @@
+defm EQ : ComparisonFP<setoeq>;
+defm NE : ComparisonFP<setone>;
+defm LT : ComparisonFP<setolt>;
----------------
The NE operator is "une" rather than "one".

================
Comment at: lib/Target/WebAssembly/WebAssemblyInstrFloat.td:33
@@ -36,1 +32,3 @@
+defm GT : ComparisonFP<setogt>;
+defm GE : ComparisonFP<setoge>;
 
----------------
This patch lacks tests for the floating point comparisons.


http://reviews.llvm.org/D11924





More information about the llvm-commits mailing list