Thomas Gleixner | d2912cb | 2019-06-04 10:11:33 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Nicolas Pitre | f741a1a | 2005-10-30 23:08:03 +0000 | [diff] [blame] | 2 | /* |
| 3 | * linux/arch/arm/lib/ucmpdi2.S |
| 4 | * |
| 5 | * Author: Nicolas Pitre |
| 6 | * Created: Oct 19, 2005 |
| 7 | * Copyright: Monta Vista Software, Inc. |
Nicolas Pitre | f741a1a | 2005-10-30 23:08:03 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #include <linux/linkage.h> |
Russell King | 6ebbf2c | 2014-06-30 16:29:12 +0100 | [diff] [blame] | 11 | #include <asm/assembler.h> |
Nicolas Pitre | f741a1a | 2005-10-30 23:08:03 +0000 | [diff] [blame] | 12 | |
| 13 | #ifdef __ARMEB__ |
| 14 | #define xh r0 |
| 15 | #define xl r1 |
| 16 | #define yh r2 |
| 17 | #define yl r3 |
| 18 | #else |
| 19 | #define xl r0 |
| 20 | #define xh r1 |
| 21 | #define yl r2 |
| 22 | #define yh r3 |
| 23 | #endif |
| 24 | |
| 25 | ENTRY(__ucmpdi2) |
| 26 | |
| 27 | cmp xh, yh |
| 28 | cmpeq xl, yl |
| 29 | movlo r0, #0 |
| 30 | moveq r0, #1 |
| 31 | movhi r0, #2 |
Russell King | 6ebbf2c | 2014-06-30 16:29:12 +0100 | [diff] [blame] | 32 | ret lr |
Nicolas Pitre | f741a1a | 2005-10-30 23:08:03 +0000 | [diff] [blame] | 33 | |
Catalin Marinas | 93ed397 | 2008-08-28 11:22:32 +0100 | [diff] [blame] | 34 | ENDPROC(__ucmpdi2) |
| 35 | |
Nicolas Pitre | ba95e4e | 2006-01-14 16:18:29 +0000 | [diff] [blame] | 36 | #ifdef CONFIG_AEABI |
| 37 | |
| 38 | ENTRY(__aeabi_ulcmp) |
| 39 | |
| 40 | cmp xh, yh |
| 41 | cmpeq xl, yl |
| 42 | movlo r0, #-1 |
| 43 | moveq r0, #0 |
| 44 | movhi r0, #1 |
Russell King | 6ebbf2c | 2014-06-30 16:29:12 +0100 | [diff] [blame] | 45 | ret lr |
Nicolas Pitre | ba95e4e | 2006-01-14 16:18:29 +0000 | [diff] [blame] | 46 | |
Catalin Marinas | 93ed397 | 2008-08-28 11:22:32 +0100 | [diff] [blame] | 47 | ENDPROC(__aeabi_ulcmp) |
| 48 | |
Nicolas Pitre | ba95e4e | 2006-01-14 16:18:29 +0000 | [diff] [blame] | 49 | #endif |
| 50 | |