acpica update. (NicJA)
[AROS.git] / arch / m68k-all / mathffp / spcmp.S
blobf3ff26e701c9dd310b9b7c0d508bcf392cb04ee1
1 /*
2     Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3     $Id: SPCmp.S
5     Desc: mathffp/SPCmp m68k version. Generates correct 680x0 flags.
6     Lang: english
7 */
9     #include "aros/m68k/asm.h"
11     .text
12     .balign 4
13     .globl  AROS_SLIB_ENTRY(SPCmp,Mathffp,7)
14 AROS_SLIB_ENTRY(SPCmp,Mathffp,7):
16         movem.l %d2,-(%sp)
17         move.l  %d0,%d2
19         tst.b   %d1
20         bpl.s   .pos
21         tst.b   %d2
22         bpl.s   .pos
23         /* both negative, invert comparisons */
24         exg             %d1,%d2
25 .pos:
27         moveq   #-1,%d0
28         cmp.b   %d1,%d2
29         bgt.s   .done           /* d0 > d1 */
30         moveq   #1,%d0
31         cmp.b   %d1,%d2
32         blt.s   .done           /* d0 < d1 */
33         moveq   #0,%d0
34         cmp.l   %d1,%d2
35         beq.s   .done
37         moveq   #-1,%d0
38         cmp.l   %d1,%d2
39         bgt.s   .done           /* d0 > d1 */
40         moveq   #1,%d0
41         cmp.l   %d1,%d2
42                                                 /* d0 < d1 */
43 .done:
44         movem.l (%sp)+,%d2      /* must be MOVEM! Must not modify flags. */
45         rts