summaryrefslogtreecommitdiff
path: root/core/riscv-rv32i/math.c
blob: 425814f1853f3b18017c1278ea5a6ed1b08ed792 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* Copyright 2020 The ChromiumOS Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "common.h"

#ifdef CONFIG_FPU
/* Single precision floating point square root. */
float sqrtf(float x)
{
	asm volatile("fsqrt.s %0, %1" : "=f"(x) : "f"(x));

	return x;
}
#endif