blob: cc4aa0dca645901184222e4bad57e16131c81911 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Sergei Poselenov3190dbe2007-07-05 08:17:37 +02002/*
3 * Copyright (C) 2007
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
Sergei Poselenov3190dbe2007-07-05 08:17:37 +02005 */
6/*
7 * This file is originally a part of the GCC testsuite.
8 */
9
Tom Riniabb9a042024-05-18 20:20:43 -060010#include <common.h>
Sergei Poselenov3190dbe2007-07-05 08:17:37 +020011
Sergei Poselenov3190dbe2007-07-05 08:17:37 +020012#include <post.h>
13
Yuri Tikhonov7ed66f72008-12-20 14:54:21 +030014GNU_FPOST_ATTR
15
Tom Rini3dd5d4a2022-12-04 10:14:17 -050016#if CFG_POST & CFG_SYS_POST_FPU
Kumar Galafe6555b2011-01-25 03:00:08 -060017
Sergei Poselenov3190dbe2007-07-05 08:17:37 +020018int 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
Tom Rini3dd5d4a2022-12-04 10:14:17 -050036#endif /* CFG_POST & CFG_SYS_POST_FPU */