mips_b.s 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * QuickThreads -- Threads-building toolkit.
  3. * Copyright (c) 1993 by David Keppel
  4. *
  5. * Permission to use, copy, modify and distribute this software and
  6. * its documentation for any purpose and without fee is hereby
  7. * granted, provided that the above copyright notice and this notice
  8. * appear in all copies. This software is provided as a
  9. * proof-of-concept and for demonstration purposes; there is no
  10. * representation about the suitability of this software for any
  11. * purpose.
  12. */
  13. .globl b_call_reg
  14. .globl b_call_imm
  15. .globl b_add
  16. .globl b_load
  17. .ent b_null
  18. b_null:
  19. j $31
  20. .end b_null
  21. .ent b_call_reg
  22. b_call_reg:
  23. la $5,b_null
  24. add $6, $31,0
  25. $L0:
  26. jal $5
  27. jal $5
  28. jal $5
  29. jal $5
  30. jal $5
  31. sub $4, $4,5
  32. bgtz $4,$L0
  33. j $6
  34. .end
  35. .ent b_call_imm
  36. b_call_imm:
  37. add $6, $31,0
  38. $L1:
  39. jal b_null
  40. jal b_null
  41. jal b_null
  42. jal b_null
  43. jal b_null
  44. sub $4, $4,5
  45. bgtz $4,$L1
  46. j $6
  47. .end
  48. .ent b_add
  49. b_add:
  50. add $5, $0,$4
  51. add $6, $0,$4
  52. add $7, $0,$4
  53. add $8, $0,$4
  54. $L2:
  55. sub $4, $4,5
  56. sub $5, $5,5
  57. sub $6, $6,5
  58. sub $7, $7,5
  59. sub $8, $8,5
  60. sub $4, $4,5
  61. sub $5, $5,5
  62. sub $6, $6,5
  63. sub $7, $7,5
  64. sub $8, $8,5
  65. bgtz $4,$L2
  66. j $31
  67. .end
  68. .ent b_load
  69. b_load:
  70. $L3:
  71. ld $0, 0($sp)
  72. ld $0, 4($sp)
  73. ld $0, 8($sp)
  74. ld $0, 12($sp)
  75. ld $0, 16($sp)
  76. ld $0, 20($sp)
  77. ld $0, 24($sp)
  78. ld $0, 28($sp)
  79. ld $0, 32($sp)
  80. ld $0, 36($sp)
  81. sub $4, $4,10
  82. bgtz $4,$L3
  83. j $31
  84. .end