xref: /kernel/linux/linux-5.10/arch/nds32/math-emu/fcmps.c
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-5.10/arch/nds32/math-emu/
18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci// Copyright (C) 2005-2018 Andes Technology Corporation
38c2ecf20Sopenharmony_ci#include <asm/sfp-machine.h>
48c2ecf20Sopenharmony_ci#include <math-emu/soft-fp.h>
58c2ecf20Sopenharmony_ci#include <math-emu/single.h>
68c2ecf20Sopenharmony_ciint fcmps(void *ft, void *fa, void *fb, int cmpop)
78c2ecf20Sopenharmony_ci{
88c2ecf20Sopenharmony_ci	FP_DECL_S(A);
98c2ecf20Sopenharmony_ci	FP_DECL_S(B);
108c2ecf20Sopenharmony_ci	FP_DECL_EX;
118c2ecf20Sopenharmony_ci	long cmp;
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci	FP_UNPACK_SP(A, fa);
148c2ecf20Sopenharmony_ci	FP_UNPACK_SP(B, fb);
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci	FP_CMP_S(cmp, A, B, SF_CUN);
178c2ecf20Sopenharmony_ci	cmp += 2;
188c2ecf20Sopenharmony_ci	if (cmp == SF_CGT)
198c2ecf20Sopenharmony_ci		*(int *)ft = 0x0;
208c2ecf20Sopenharmony_ci	else
218c2ecf20Sopenharmony_ci		*(int *)ft = (cmp & cmpop) ? 0x1 : 0x0;
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci	return 0;
248c2ecf20Sopenharmony_ci}
25

Indexes created Thu Nov 07 10:32:03 CST 2024