summaryrefslogtreecommitdiff
path: root/core/riscv-rv32i/math.c
blob: 591a67eb8f9312cfdc0043a342359510311d0831 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* Copyright 2020 The Chromium OS Authors. All rights reserved.
 * 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