Thread (10 messages) flat view 10 messages, 5 authors, 2008-03-04

Re: V4L2: __ucmpdi2 undefined on ppc

From: Segher Boessenkool <hidden>
Date: 2008-03-02 21:53:37

quoted
+/*
+ * __ucmpdi2: 64-bit comparison
+ *
+ * R3/R4 has 64 bit value A
+ * R5/R6 has 64 bit value B
+ * result in R3: 0 for A < B
+ *              1 for A == B
+ *              2 for A > B
+ */
+_GLOBAL(__ucmpdi2)
+       cmplw   r7,r3,r5        # compare high words
+       li      r3,0
+       blt     r7,2f           # a < b ... return 0
+       bgt     r7,1f           # a > b ... return 2
+       cmplw   r6,r4,r6        # compare low words
+       blt     r6,2f           # a < b ... return 0
+       li      r3,1
+       ble     r6,2f           # a = b ... return 1
+1:     li      r3,2
+2:     blr
Every occurrence of r7 here is wrong (and some of the r6).  Is there
any reason to do this in assembler code at all?


Segher
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help