aboutsummaryrefslogtreecommitdiff
path: root/src/vm_mips64.dasc
diff options
context:
space:
mode:
Diffstat (limited to 'src/vm_mips64.dasc')
-rw-r--r--src/vm_mips64.dasc49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/vm_mips64.dasc b/src/vm_mips64.dasc
index c06270a0..75b38dee 100644
--- a/src/vm_mips64.dasc
+++ b/src/vm_mips64.dasc
@@ -1980,6 +1980,38 @@ static void build_subroutines(BuildCtx *ctx)
1980 |1: 1980 |1:
1981 | jr ra 1981 | jr ra
1982 |. move CRET1, r0 1982 |. move CRET1, r0
1983 |
1984 |// FP number to int conversion with a check for soft-float.
1985 |// Modifies CARG1, CRET1, CRET2, TMP0, AT.
1986 |->vm_tointg:
1987 |.if JIT
1988 | dsll CRET2, CARG1, 1
1989 | beqz CRET2, >2
1990 |. li TMP0, 1076
1991 | dsrl AT, CRET2, 53
1992 | dsubu TMP0, TMP0, AT
1993 | sltiu AT, TMP0, 54
1994 | beqz AT, >1
1995 |. dextm CRET2, CRET2, 0, 20
1996 | dinsu CRET2, AT, 21, 21
1997 | slt AT, CARG1, r0
1998 | dsrlv CRET1, CRET2, TMP0
1999 | dsubu CARG1, r0, CRET1
2000 | movn CRET1, CARG1, AT
2001 | li CARG1, 64
2002 | subu TMP0, CARG1, TMP0
2003 | dsllv CRET2, CRET2, TMP0 // Integer check.
2004 | sextw AT, CRET1
2005 | xor AT, CRET1, AT // Range check.
2006 | jr ra
2007 |. movz CRET2, AT, CRET2
2008 |1:
2009 | jr ra
2010 |. li CRET2, 1
2011 |2:
2012 | jr ra
2013 |. move CRET1, r0
2014 |.endif
1983 |.endif 2015 |.endif
1984 | 2016 |
1985 |.macro .ffunc_bit, name 2017 |.macro .ffunc_bit, name
@@ -2665,6 +2697,23 @@ static void build_subroutines(BuildCtx *ctx)
2665 |. li CRET1, 0 2697 |. li CRET1, 0
2666 |.endif 2698 |.endif
2667 | 2699 |
2700 |.macro sfmin_max, name, intins
2701 |->vm_sf .. name:
2702 |.if JIT and not FPU
2703 | move TMP2, ra
2704 | bal ->vm_sfcmpolt
2705 |. nop
2706 | move ra, TMP2
2707 | move TMP0, CRET1
2708 | move CRET1, CARG1
2709 | jr ra
2710 |. intins CRET1, CARG2, TMP0
2711 |.endif
2712 |.endmacro
2713 |
2714 | sfmin_max min, movz
2715 | sfmin_max max, movn
2716 |
2668 |//----------------------------------------------------------------------- 2717 |//-----------------------------------------------------------------------
2669 |//-- Miscellaneous functions -------------------------------------------- 2718 |//-- Miscellaneous functions --------------------------------------------
2670 |//----------------------------------------------------------------------- 2719 |//-----------------------------------------------------------------------