1 // SPDX-License-Identifier: GPL-2.0-only
3 * IEEE754 floating point arithmetic
4 * single precision: CLASS.f
5 * FPR[fd] = class(FPR[fs])
7 * MIPS floating point support
8 * Copyright (C) 2015 Imagination Technologies, Ltd.
9 * Author: Markos Chandras <markos.chandras@imgtec.com>
12 #include "ieee754sp.h"
14 int ieee754sp_2008class(union ieee754sp x
)
21 * 10 bit mask as follows:
36 case IEEE754_CLASS_SNAN
:
38 case IEEE754_CLASS_QNAN
:
40 case IEEE754_CLASS_INF
:
41 return 0x04 << (xs
? 0 : 4);
42 case IEEE754_CLASS_NORM
:
43 return 0x08 << (xs
? 0 : 4);
44 case IEEE754_CLASS_DNORM
:
45 return 0x10 << (xs
? 0 : 4);
46 case IEEE754_CLASS_ZERO
:
47 return 0x20 << (xs
? 0 : 4);
49 pr_err("Unknown class: %d\n", xc
);