]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | // SPDX-License-Identifier: GPL-2.0+ |
b4489621 SP |
2 | /* |
3 | * Copyright (C) 2007 | |
4 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | |
b4489621 SP |
5 | */ |
6 | /* | |
7 | * This file is originally a part of the GCC testsuite. | |
8 | */ | |
9 | ||
d678a59d | 10 | #include <common.h> |
b4489621 | 11 | |
b4489621 SP |
12 | #include <post.h> |
13 | ||
ce82ff05 YT |
14 | GNU_FPOST_ATTR |
15 | ||
1e019503 | 16 | #if CFG_POST & CFG_SYS_POST_FPU |
e009cdeb | 17 | |
b4489621 SP |
18 | int fpu_post_test_math3 (void) |
19 | { | |
20 | volatile long double dfrom = 1.1; | |
21 | volatile long double m1; | |
22 | volatile long double m2; | |
23 | volatile unsigned long mant_long; | |
24 | ||
25 | m1 = dfrom / 2.0; | |
26 | m2 = m1 * 4294967296.0; | |
27 | mant_long = ((unsigned long) m2) & 0xffffffff; | |
28 | ||
29 | if (mant_long != 0x8ccccccc) { | |
30 | post_log ("Error in FPU math3 test\n"); | |
31 | return -1; | |
32 | } | |
33 | return 0; | |
34 | } | |
35 | ||
1e019503 | 36 | #endif /* CFG_POST & CFG_SYS_POST_FPU */ |