MIPS64: Add soft-float support to JIT compiler backend.
Contributed by Djordje Kovacevic and Stefan Pejic from RT-RK.com. Sponsored by Cisco Systems, Inc.
This commit is contained in:
@@ -1980,6 +1980,38 @@ static void build_subroutines(BuildCtx *ctx)
|
||||
|1:
|
||||
| jr ra
|
||||
|. move CRET1, r0
|
||||
|
|
||||
|// FP number to int conversion with a check for soft-float.
|
||||
|// Modifies CARG1, CRET1, CRET2, TMP0, AT.
|
||||
|->vm_tointg:
|
||||
|.if JIT
|
||||
| dsll CRET2, CARG1, 1
|
||||
| beqz CRET2, >2
|
||||
|. li TMP0, 1076
|
||||
| dsrl AT, CRET2, 53
|
||||
| dsubu TMP0, TMP0, AT
|
||||
| sltiu AT, TMP0, 54
|
||||
| beqz AT, >1
|
||||
|. dextm CRET2, CRET2, 0, 20
|
||||
| dinsu CRET2, AT, 21, 21
|
||||
| slt AT, CARG1, r0
|
||||
| dsrlv CRET1, CRET2, TMP0
|
||||
| dsubu CARG1, r0, CRET1
|
||||
| movn CRET1, CARG1, AT
|
||||
| li CARG1, 64
|
||||
| subu TMP0, CARG1, TMP0
|
||||
| dsllv CRET2, CRET2, TMP0 // Integer check.
|
||||
| sextw AT, CRET1
|
||||
| xor AT, CRET1, AT // Range check.
|
||||
| jr ra
|
||||
|. movz CRET2, AT, CRET2
|
||||
|1:
|
||||
| jr ra
|
||||
|. li CRET2, 1
|
||||
|2:
|
||||
| jr ra
|
||||
|. move CRET1, r0
|
||||
|.endif
|
||||
|.endif
|
||||
|
|
||||
|.macro .ffunc_bit, name
|
||||
@@ -2665,6 +2697,23 @@ static void build_subroutines(BuildCtx *ctx)
|
||||
|. li CRET1, 0
|
||||
|.endif
|
||||
|
|
||||
|.macro sfmin_max, name, intins
|
||||
|->vm_sf .. name:
|
||||
|.if JIT and not FPU
|
||||
| move TMP2, ra
|
||||
| bal ->vm_sfcmpolt
|
||||
|. nop
|
||||
| move ra, TMP2
|
||||
| move TMP0, CRET1
|
||||
| move CRET1, CARG1
|
||||
| jr ra
|
||||
|. intins CRET1, CARG2, TMP0
|
||||
|.endif
|
||||
|.endmacro
|
||||
|
|
||||
| sfmin_max min, movz
|
||||
| sfmin_max max, movn
|
||||
|
|
||||
|//-----------------------------------------------------------------------
|
||||
|//-- Miscellaneous functions --------------------------------------------
|
||||
|//-----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user