[ctf] Simplify the logic of the unsigned long comparator.
To understand this modification, let assume the "char 8-bits" domain.
unsigned [0 .. 255]
signed [-128 .. 127]
By receiving the parameters encoded in a signed number, the method receives
left: [0..127,-128..-1] (which represents [0..127,128..255])
right: [0..127,-128..-1] (which represents [0..127,128..255])
By definition (on an unconstrained domain), this assertion holds
left < right <==> left + k < right + k
Thus, the idea is to rotate the domain by k to allow a signed operator to
be able to compare to full domain.
In this case k must be -128.
By rotating the domain, left and right range become [-128..-1,0..127],
and are now comparable with the signed operator.
Change-Id: I92b27ab00e8f14102a04e085ef807e211e39a7f0
Signed-off-by: Etienne Bergeron <etienne.bergeron@gmail.com>
Reviewed-on: https://git.eclipse.org/r/18784
Tested-by: Hudson CI
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Reviewed-by: Xavier Raynaud <xavier.raynaud@kalray.eu>
IP-Clean: Xavier Raynaud <xavier.raynaud@kalray.eu>
Tested-by: Xavier Raynaud <xavier.raynaud@kalray.eu>
This page took 0.026492 seconds and 5 git commands to generate.