Re: [PATCH v5 04/14] rewrite compare_opcode() like swap_compare_opcode()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Mar 25, 2017 at 12:24 AM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Fri, Mar 24, 2017 at 4:14 PM, Luc Van Oostenryck
> <luc.vanoostenryck@xxxxxxxxx> wrote:
>> More precisely, use a table to get the opcdoe corresponding
>> to the negated compare and use a more explicit name for the
>> function.
>
> Side note: this code should verify that it doesn't operate on a
> floating point compare.
>
> You can't negate a FP compare, because the negation doesn't
> necessarily have the opposite value.
>
> For example, "a < b" is *not* the same as "!(a >= b)" for floating
> point values when one of them is a NaN. Both < and >= will compare as
> false, so "negating" the op won't actually negate the resulting
> logical operation.
>
>              Linus

Yes, indeed.
I've some plan to add better handling of floating-point and the compare
is part of it. It'll need a new set of instructions to do it correctly
(precisely
because for fp numbers once you care about NaNs/unordered "a < b" is *not*
the same as "!(a >= b)").
But there is also a number of bugs I want to solve, especially one related to
the misplacement of phi-node and another about missing reloads. For the moment
I think we can pretend that all the fp values we deal with are ordered ones.

-- Luc
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux