[X86] Change the masked FPCLASS implementation to use AND instead of OR to combine...
authorCraig Topper <craig.topper@intel.com>
Wed, 28 Feb 2018 06:19:55 +0000 (06:19 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 28 Feb 2018 06:19:55 +0000 (06:19 +0000)
commitac799b05d42fee69a91bf35beb7f87c548827a42
tree661c48f18385b72d7270652dbc2e0f0a8601c1fe
parentc844524e46555737fd0870e78fcfcb93925ad723
[X86] Change the masked FPCLASS implementation to use AND instead of OR to combine the mask results.

While the description for the instruction does mention OR, its talking about how the individual classification test results are ORed together.

The incoming mask is used as a zeroing write mask. If the bit is 1 the classification is written to the output. The bit is 0 the output is 0. This equivalent to an AND.

Here is pseudocode from the intrinsics guide

FOR j := 0 to 1
        i := j*64
        IF k1[j]
                k[j] := CheckFPClass_FP64(a[i+63:i], imm8[7:0])
        ELSE
                k[j] := 0
        FI
ENDFOR
k[MAX:2] := 0

llvm-svn: 326306
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86InstrAVX512.td