You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
1.9 KiB

  1. --- a/src/mips/o32.S
  2. +++ b/src/mips/o32.S
  3. @@ -82,13 +82,16 @@ sixteen:
  4. ADDU $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args
  5. +#ifndef __mips_soft_float
  6. bnez t0, pass_d # make it quick for int
  7. +#endif
  8. REG_L a0, 0*FFI_SIZEOF_ARG($sp) # just go ahead and load the
  9. REG_L a1, 1*FFI_SIZEOF_ARG($sp) # four regs.
  10. REG_L a2, 2*FFI_SIZEOF_ARG($sp)
  11. REG_L a3, 3*FFI_SIZEOF_ARG($sp)
  12. b call_it
  13. +#ifndef __mips_soft_float
  14. pass_d:
  15. bne t0, FFI_ARGS_D, pass_f
  16. l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
  17. @@ -130,6 +133,7 @@ pass_f_d:
  18. # bne t0, FFI_ARGS_F_D, call_it
  19. l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
  20. l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float
  21. +#endif
  22. call_it:
  23. # Load the function pointer
  24. @@ -158,14 +162,23 @@ retfloat:
  25. bne t2, FFI_TYPE_FLOAT, retdouble
  26. jalr t9
  27. REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
  28. +#ifndef __mips_soft_float
  29. s.s $f0, 0(t0)
  30. +#else
  31. + REG_S v0, 0(t0)
  32. +#endif
  33. b epilogue
  34. retdouble:
  35. bne t2, FFI_TYPE_DOUBLE, noretval
  36. jalr t9
  37. REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
  38. +#ifndef __mips_soft_float
  39. s.d $f0, 0(t0)
  40. +#else
  41. + REG_S v1, 4(t0)
  42. + REG_S v0, 0(t0)
  43. +#endif
  44. b epilogue
  45. noretval:
  46. @@ -261,9 +274,11 @@ $LCFI7:
  47. li $13, 1 # FFI_O32
  48. bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT
  49. +#ifndef __mips_soft_float
  50. # Store all possible float/double registers.
  51. s.d $f12, FA_0_0_OFF2($fp)
  52. s.d $f14, FA_1_0_OFF2($fp)
  53. +#endif
  54. 1:
  55. # Call ffi_closure_mips_inner_O32 to do the work.
  56. la t9, ffi_closure_mips_inner_O32
  57. @@ -281,6 +296,7 @@ $LCFI7:
  58. li $13, 1 # FFI_O32
  59. bne $16, $13, 1f # Skip fp restore if FFI_O32_SOFT_FLOAT
  60. +#ifndef __mips_soft_float
  61. li $9, FFI_TYPE_FLOAT
  62. l.s $f0, V0_OFF2($fp)
  63. beq $8, $9, closure_done
  64. @@ -288,6 +304,7 @@ $LCFI7:
  65. li $9, FFI_TYPE_DOUBLE
  66. l.d $f0, V0_OFF2($fp)
  67. beq $8, $9, closure_done
  68. +#endif
  69. 1:
  70. REG_L $3, V1_OFF2($fp)
  71. REG_L $2, V0_OFF2($fp)