WebAssembly: floating-point comparisons
authorJF Bastien <jfb@google.com>
Wed, 12 Aug 2015 17:53:29 +0000 (17:53 +0000)
committerJF Bastien <jfb@google.com>
Wed, 12 Aug 2015 17:53:29 +0000 (17:53 +0000)
commit5f53aadd9c9fa073ce5eabc630002b77f9663cf9
tree8c7dad11926485c96d1b10c04c616f51e839552a
parent0ba0118816bb7b1fc361215b382578ac130df23b
WebAssembly: floating-point comparisons

Summary:
D11924 implemented part of the floating-point comparisons, this patch implements the rest:
 * Tell ISelLowering that all booleans are either 0 or 1.
 * Expand the eq/ne/lt/le/gt/ge floating-point comparisons to the canonical ones (similar to what Mips32r6InstrInfo.td does).
 * Add tests for ord/uno.
 * Add tests for ueq/one/ult/ule/ugt/uge.
 * Fix existing comparison tests to remove the (res & 1) code, which setBooleanContents stops from generating.

Reviewers: sunfish

Subscribers: llvm-commits, jfb

Differential Revision: http://reviews.llvm.org/D11970

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244779 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
lib/Target/WebAssembly/WebAssemblyInstrFloat.td
test/CodeGen/WebAssembly/comparisons_f32.ll
test/CodeGen/WebAssembly/comparisons_f64.ll
test/CodeGen/WebAssembly/comparisons_i32.ll
test/CodeGen/WebAssembly/comparisons_i64.ll