blob: dda5caaef66581fd67e2ac19f74c997e552e62b6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// ------------------------------------------------------------------------------
//
// Enable FPU for RISC-V
//
// Copyright (c) 2024, Canonical Services Ltd.<BR>
// Copyright (c) 2025, Ventana Micro Systems Inc. All rights reserved.<BR>
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
// ------------------------------------------------------------------------------
#include <Register/RiscV64/RiscVImpl.h>
.global ASM_PFX(InitializeFloatingPointUnits)
ASM_PFX(InitializeFloatingPointUnits):
csrr a0, CSR_SSTATUS
li a1, MSTATUS_FS
or a0, a0, a1
csrw CSR_SSTATUS, a0
csrw CSR_FCSR, x0
li a0, 0
ret
|