Skip to content

Commit

Permalink
Merge pull request #113 from XavierAubert/cv32e40p/dev_dd_pgo
Browse files Browse the repository at this point in the history
Temporary workaround for GNU GCC issue #36
  • Loading branch information
pascalgouedo authored Dec 21, 2023
2 parents 932bf97 + 33f6f8c commit e47cbdb
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,29 @@ __attribute__((interrupt ("machine"))) void u_sw_direct_irq_handler(void) {
"j u_sw_irq_handler\n"
);

#ifdef FPU
#define MSTATUS_FS_INITIAL 0x00002000

void fp_enable ()
{
unsigned int fs = MSTATUS_FS_INITIAL;

asm volatile("csrs mstatus, %0;"
"csrwi fcsr, 0;"
"csrs mstatus, %0;"
: : "r"(fs)
);
}
#endif

int main(int argc, char *argv[]) {
int retval;

#ifdef FPU
// Floating Point enable
fp_enable();
#endif

// Test 1
retval = test1();
if (retval != EXIT_SUCCESS)
Expand Down

0 comments on commit e47cbdb

Please sign in to comment.