^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) // Copyright (C) 2005-2018 Andes Technology Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #include <asm/sfp-machine.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #include <math-emu/soft-fp.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <math-emu/single.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) int fcmps(void *ft, void *fa, void *fb, int cmpop)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) FP_DECL_S(A);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) FP_DECL_S(B);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) FP_DECL_EX;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) long cmp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) FP_UNPACK_SP(A, fa);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) FP_UNPACK_SP(B, fb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) FP_CMP_S(cmp, A, B, SF_CUN);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) cmp += 2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) if (cmp == SF_CGT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) *(int *)ft = 0x0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) *(int *)ft = (cmp & cmpop) ? 0x1 : 0x0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) }