#ifndef __loongarch_soft_float .global feclearexcept .type feclearexcept,@function feclearexcept: li.w $a1, 0x1f0000 and $a0, $a0, $a1 movfcsr2gr $a1, $r0 or $a1, $a1, $a0 xor $a1, $a1, $a0 movgr2fcsr $r0, $a1 li.w $a0, 0 jr $ra .global feraiseexcept .type feraiseexcept,@function feraiseexcept: li.w $a1, 0x1f0000 and $a0, $a0, $a1 movfcsr2gr $a1, $r0 or $a1, $a1, $a0 movgr2fcsr $r0, $a1 li.w $a0, 0 jr $ra .global fetestexcept .type fetestexcept,@function fetestexcept: li.w $a1, 0x1f0000 and $a0, $a0, $a1 movfcsr2gr $a1, $r0 and $a0, $a1, $a0 jr $ra .global fegetround .type fegetround,@function fegetround: movfcsr2gr $a0, $r0 andi $a0, $a0, 0x300 //fcsr0.RM jr $ra .global __fesetround .hidden __fesetround .type __fesetround,@function __fesetround: movfcsr2gr $a1, $r0 li.w $a2, -769 //0xfffffcff and $a1, $a1, $a2 or $a1, $a1, $a0 movgr2fcsr $r0, $a1 li.w $a0, 0 jr $ra .global fegetenv .type fegetenv,@function fegetenv: movfcsr2gr $a1, $r0 st.w $a1, $a0, 0 li.w $a0, 0 jr $ra .global fesetenv .type fesetenv,@function fesetenv: addi.d $a1, $a0, 1 beq $a1, $r0, 1f ld.w $a1, $a0, 0 1: movgr2fcsr $r0, $a1 li.w $a0, 0 jr $ra #endif