#17890: Remove _(rich)cmp_c_impl
-------------------------------------+-------------------------------------
Reporter: jdemeyer | Owner:
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-6.6
Component: cython | Resolution:
Keywords: | Merged in:
Authors: Jeroen Demeyer | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jdemeyer/ticket/17890 | 313a400146b0fb19d80c31117d44ce735041d4ec
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by jdemeyer):
For the assembly literate: with this new branch,
{{{
return rich_to_bool(op, (c > 0) - (c < 0))
}}}
becomes
{{{
xorl %edx, %edx
testl %eax, %eax # test c
setg %dl # c > 0
shrl $31, %eax # c < 0 computed as ((unsigned int)c) >> 31
subl %eax, %edx # shift = (c > 0) - (c < 0)
movl $184563750, %eax # bits = 184563750
sall $3, %edx # shift *= 8
addl %r12d, %edx # shift += op
btl %edx, %eax # test bit "shift" of "bits"
jnc ...
}}}
----
New commits:
||[http://git.sagemath.org/sage.git/commit/?id=313a400146b0fb19d80c31117d44ce735041d4ec
313a400]||{{{Optimize rich_to_bool_sgn}}}||
--
Ticket URL: <http://trac.sagemath.org/ticket/17890#comment:49>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.