Browsing index pages (3 articles)
↧
Signed integer comparison without comparison operators or widening
I am looking for a signed integer comparison function cmp(x: Int, y: Int) -> Int which does not use any comparison operators (<, <=, >, >=, <=>, etc.), does not use widening to a...
View ArticleAnswer by Falk Hüffner for Signed integer comparison without comparison...
You didn't specify what cmp is actually supposed to do. I'm assuming it should calculate x > y as in the test code you link to, that is, this is not a three-way comparison as in some of the other...
View ArticleAnswer by njuffa for Signed integer comparison without comparison operators...
Here is a complete set of signed comparison primitives for int that I backported from corresponding SIMD primitives. Some inefficiencies are therefore likely, however gcc and clang optimize the code...
View Article
Browsing index pages (3 articles)