r3000.s 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. .file 1 "../bn_mulw.c"
  2. .set nobopt
  3. .option pic2
  4. # GNU C 2.6.3 [AL 1.1, MM 40] SGI running IRIX 5.0 compiled by GNU C
  5. # Cc1 defaults:
  6. # -mabicalls
  7. # Cc1 arguments (-G value = 0, Cpu = 3000, ISA = 1):
  8. # -quiet -dumpbase -O2 -o
  9. gcc2_compiled.:
  10. __gnu_compiled_c:
  11. .rdata
  12. .byte 0x24,0x52,0x65,0x76,0x69,0x73,0x69,0x6f
  13. .byte 0x6e,0x3a,0x20,0x31,0x2e,0x34,0x39,0x20
  14. .byte 0x24,0x0
  15. .byte 0x24,0x52,0x65,0x76,0x69,0x73,0x69,0x6f
  16. .byte 0x6e,0x3a,0x20,0x31,0x2e,0x33,0x34,0x20
  17. .byte 0x24,0x0
  18. .byte 0x24,0x52,0x65,0x76,0x69,0x73,0x69,0x6f
  19. .byte 0x6e,0x3a,0x20,0x31,0x2e,0x35,0x20,0x24
  20. .byte 0x0
  21. .byte 0x24,0x52,0x65,0x76,0x69,0x73,0x69,0x6f
  22. .byte 0x6e,0x3a,0x20,0x31,0x2e,0x38,0x20,0x24
  23. .byte 0x0
  24. .byte 0x24,0x52,0x65,0x76,0x69,0x73,0x69,0x6f
  25. .byte 0x6e,0x3a,0x20,0x31,0x2e,0x32,0x33,0x20
  26. .byte 0x24,0x0
  27. .byte 0x24,0x52,0x65,0x76,0x69,0x73,0x69,0x6f
  28. .byte 0x6e,0x3a,0x20,0x31,0x2e,0x37,0x38,0x20
  29. .byte 0x24,0x0
  30. .byte 0x24,0x52,0x65,0x76,0x69,0x73,0x69,0x6f
  31. .byte 0x6e,0x3a,0x20,0x33,0x2e,0x37,0x30,0x20
  32. .byte 0x24,0x0
  33. .byte 0x24,0x52,0x65,0x76,0x69,0x73,0x69,0x6f
  34. .byte 0x6e,0x3a,0x20,0x31,0x2e,0x32,0x20,0x24
  35. .byte 0x0
  36. .byte 0x24,0x52,0x65,0x76,0x69,0x73,0x69,0x6f
  37. .byte 0x6e,0x3a,0x20,0x31,0x2e,0x34,0x20,0x24
  38. .byte 0x0
  39. .byte 0x24,0x52,0x65,0x76,0x69,0x73,0x69,0x6f
  40. .byte 0x6e,0x3a,0x20,0x31,0x2e,0x38,0x20,0x24
  41. .byte 0x0
  42. .text
  43. .align 2
  44. .globl bn_mul_add_words
  45. .ent bn_mul_add_words
  46. bn_mul_add_words:
  47. .frame $sp,0,$31 # vars= 0, regs= 0/0, args= 0, extra= 0
  48. .mask 0x00000000,0
  49. .fmask 0x00000000,0
  50. .set noreorder
  51. .cpload $25
  52. .set reorder
  53. move $12,$4
  54. move $14,$5
  55. move $9,$6
  56. move $13,$7
  57. move $8,$0
  58. addu $10,$12,12
  59. addu $11,$14,12
  60. $L2:
  61. lw $6,0($14)
  62. #nop
  63. multu $13,$6
  64. mfhi $6
  65. mflo $7
  66. #nop
  67. move $5,$8
  68. move $4,$0
  69. lw $3,0($12)
  70. addu $9,$9,-1
  71. move $2,$0
  72. addu $7,$7,$3
  73. sltu $8,$7,$3
  74. addu $6,$6,$2
  75. addu $6,$6,$8
  76. addu $7,$7,$5
  77. sltu $2,$7,$5
  78. addu $6,$6,$4
  79. addu $6,$6,$2
  80. srl $3,$6,0
  81. move $2,$0
  82. move $8,$3
  83. .set noreorder
  84. .set nomacro
  85. beq $9,$0,$L3
  86. sw $7,0($12)
  87. .set macro
  88. .set reorder
  89. lw $6,-8($11)
  90. #nop
  91. multu $13,$6
  92. mfhi $6
  93. mflo $7
  94. #nop
  95. move $5,$8
  96. move $4,$0
  97. lw $3,-8($10)
  98. addu $9,$9,-1
  99. move $2,$0
  100. addu $7,$7,$3
  101. sltu $8,$7,$3
  102. addu $6,$6,$2
  103. addu $6,$6,$8
  104. addu $7,$7,$5
  105. sltu $2,$7,$5
  106. addu $6,$6,$4
  107. addu $6,$6,$2
  108. srl $3,$6,0
  109. move $2,$0
  110. move $8,$3
  111. .set noreorder
  112. .set nomacro
  113. beq $9,$0,$L3
  114. sw $7,-8($10)
  115. .set macro
  116. .set reorder
  117. lw $6,-4($11)
  118. #nop
  119. multu $13,$6
  120. mfhi $6
  121. mflo $7
  122. #nop
  123. move $5,$8
  124. move $4,$0
  125. lw $3,-4($10)
  126. addu $9,$9,-1
  127. move $2,$0
  128. addu $7,$7,$3
  129. sltu $8,$7,$3
  130. addu $6,$6,$2
  131. addu $6,$6,$8
  132. addu $7,$7,$5
  133. sltu $2,$7,$5
  134. addu $6,$6,$4
  135. addu $6,$6,$2
  136. srl $3,$6,0
  137. move $2,$0
  138. move $8,$3
  139. .set noreorder
  140. .set nomacro
  141. beq $9,$0,$L3
  142. sw $7,-4($10)
  143. .set macro
  144. .set reorder
  145. lw $6,0($11)
  146. #nop
  147. multu $13,$6
  148. mfhi $6
  149. mflo $7
  150. #nop
  151. move $5,$8
  152. move $4,$0
  153. lw $3,0($10)
  154. addu $9,$9,-1
  155. move $2,$0
  156. addu $7,$7,$3
  157. sltu $8,$7,$3
  158. addu $6,$6,$2
  159. addu $6,$6,$8
  160. addu $7,$7,$5
  161. sltu $2,$7,$5
  162. addu $6,$6,$4
  163. addu $6,$6,$2
  164. srl $3,$6,0
  165. move $2,$0
  166. move $8,$3
  167. .set noreorder
  168. .set nomacro
  169. beq $9,$0,$L3
  170. sw $7,0($10)
  171. .set macro
  172. .set reorder
  173. addu $11,$11,16
  174. addu $14,$14,16
  175. addu $10,$10,16
  176. .set noreorder
  177. .set nomacro
  178. j $L2
  179. addu $12,$12,16
  180. .set macro
  181. .set reorder
  182. $L3:
  183. .set noreorder
  184. .set nomacro
  185. j $31
  186. move $2,$8
  187. .set macro
  188. .set reorder
  189. .end bn_mul_add_words
  190. .align 2
  191. .globl bn_mul_words
  192. .ent bn_mul_words
  193. bn_mul_words:
  194. .frame $sp,0,$31 # vars= 0, regs= 0/0, args= 0, extra= 0
  195. .mask 0x00000000,0
  196. .fmask 0x00000000,0
  197. .set noreorder
  198. .cpload $25
  199. .set reorder
  200. move $11,$4
  201. move $12,$5
  202. move $8,$6
  203. move $6,$0
  204. addu $10,$11,12
  205. addu $9,$12,12
  206. $L10:
  207. lw $4,0($12)
  208. #nop
  209. multu $7,$4
  210. mfhi $4
  211. mflo $5
  212. #nop
  213. move $3,$6
  214. move $2,$0
  215. addu $8,$8,-1
  216. addu $5,$5,$3
  217. sltu $6,$5,$3
  218. addu $4,$4,$2
  219. addu $4,$4,$6
  220. srl $3,$4,0
  221. move $2,$0
  222. move $6,$3
  223. .set noreorder
  224. .set nomacro
  225. beq $8,$0,$L11
  226. sw $5,0($11)
  227. .set macro
  228. .set reorder
  229. lw $4,-8($9)
  230. #nop
  231. multu $7,$4
  232. mfhi $4
  233. mflo $5
  234. #nop
  235. move $3,$6
  236. move $2,$0
  237. addu $8,$8,-1
  238. addu $5,$5,$3
  239. sltu $6,$5,$3
  240. addu $4,$4,$2
  241. addu $4,$4,$6
  242. srl $3,$4,0
  243. move $2,$0
  244. move $6,$3
  245. .set noreorder
  246. .set nomacro
  247. beq $8,$0,$L11
  248. sw $5,-8($10)
  249. .set macro
  250. .set reorder
  251. lw $4,-4($9)
  252. #nop
  253. multu $7,$4
  254. mfhi $4
  255. mflo $5
  256. #nop
  257. move $3,$6
  258. move $2,$0
  259. addu $8,$8,-1
  260. addu $5,$5,$3
  261. sltu $6,$5,$3
  262. addu $4,$4,$2
  263. addu $4,$4,$6
  264. srl $3,$4,0
  265. move $2,$0
  266. move $6,$3
  267. .set noreorder
  268. .set nomacro
  269. beq $8,$0,$L11
  270. sw $5,-4($10)
  271. .set macro
  272. .set reorder
  273. lw $4,0($9)
  274. #nop
  275. multu $7,$4
  276. mfhi $4
  277. mflo $5
  278. #nop
  279. move $3,$6
  280. move $2,$0
  281. addu $8,$8,-1
  282. addu $5,$5,$3
  283. sltu $6,$5,$3
  284. addu $4,$4,$2
  285. addu $4,$4,$6
  286. srl $3,$4,0
  287. move $2,$0
  288. move $6,$3
  289. .set noreorder
  290. .set nomacro
  291. beq $8,$0,$L11
  292. sw $5,0($10)
  293. .set macro
  294. .set reorder
  295. addu $9,$9,16
  296. addu $12,$12,16
  297. addu $10,$10,16
  298. .set noreorder
  299. .set nomacro
  300. j $L10
  301. addu $11,$11,16
  302. .set macro
  303. .set reorder
  304. $L11:
  305. .set noreorder
  306. .set nomacro
  307. j $31
  308. move $2,$6
  309. .set macro
  310. .set reorder
  311. .end bn_mul_words
  312. .align 2
  313. .globl bn_sqr_words
  314. .ent bn_sqr_words
  315. bn_sqr_words:
  316. .frame $sp,0,$31 # vars= 0, regs= 0/0, args= 0, extra= 0
  317. .mask 0x00000000,0
  318. .fmask 0x00000000,0
  319. .set noreorder
  320. .cpload $25
  321. .set reorder
  322. move $9,$4
  323. addu $7,$9,28
  324. addu $8,$5,12
  325. $L18:
  326. lw $2,0($5)
  327. #nop
  328. multu $2,$2
  329. mfhi $2
  330. mflo $3
  331. #nop
  332. addu $6,$6,-1
  333. sw $3,0($9)
  334. srl $3,$2,0
  335. move $2,$0
  336. .set noreorder
  337. .set nomacro
  338. beq $6,$0,$L19
  339. sw $3,-24($7)
  340. .set macro
  341. .set reorder
  342. lw $2,-8($8)
  343. #nop
  344. multu $2,$2
  345. mfhi $2
  346. mflo $3
  347. #nop
  348. addu $6,$6,-1
  349. sw $3,-20($7)
  350. srl $3,$2,0
  351. move $2,$0
  352. .set noreorder
  353. .set nomacro
  354. beq $6,$0,$L19
  355. sw $3,-16($7)
  356. .set macro
  357. .set reorder
  358. lw $2,-4($8)
  359. #nop
  360. multu $2,$2
  361. mfhi $2
  362. mflo $3
  363. #nop
  364. addu $6,$6,-1
  365. sw $3,-12($7)
  366. srl $3,$2,0
  367. move $2,$0
  368. .set noreorder
  369. .set nomacro
  370. beq $6,$0,$L19
  371. sw $3,-8($7)
  372. .set macro
  373. .set reorder
  374. lw $2,0($8)
  375. #nop
  376. multu $2,$2
  377. mfhi $2
  378. mflo $3
  379. #nop
  380. addu $6,$6,-1
  381. sw $3,-4($7)
  382. srl $3,$2,0
  383. move $2,$0
  384. .set noreorder
  385. .set nomacro
  386. beq $6,$0,$L19
  387. sw $3,0($7)
  388. .set macro
  389. .set reorder
  390. addu $8,$8,16
  391. addu $5,$5,16
  392. addu $7,$7,32
  393. .set noreorder
  394. .set nomacro
  395. j $L18
  396. addu $9,$9,32
  397. .set macro
  398. .set reorder
  399. $L19:
  400. j $31
  401. .end bn_sqr_words
  402. .rdata
  403. .align 2
  404. $LC0:
  405. .byte 0x44,0x69,0x76,0x69,0x73,0x69,0x6f,0x6e
  406. .byte 0x20,0x77,0x6f,0x75,0x6c,0x64,0x20,0x6f
  407. .byte 0x76,0x65,0x72,0x66,0x6c,0x6f,0x77,0xa
  408. .byte 0x0
  409. .text
  410. .align 2
  411. .globl bn_div64
  412. .ent bn_div64
  413. bn_div64:
  414. .frame $sp,56,$31 # vars= 0, regs= 7/0, args= 16, extra= 8
  415. .mask 0x901f0000,-8
  416. .fmask 0x00000000,0
  417. .set noreorder
  418. .cpload $25
  419. .set reorder
  420. subu $sp,$sp,56
  421. .cprestore 16
  422. sw $16,24($sp)
  423. move $16,$4
  424. sw $17,28($sp)
  425. move $17,$5
  426. sw $18,32($sp)
  427. move $18,$6
  428. sw $20,40($sp)
  429. move $20,$0
  430. sw $19,36($sp)
  431. li $19,0x00000002 # 2
  432. sw $31,48($sp)
  433. .set noreorder
  434. .set nomacro
  435. bne $18,$0,$L26
  436. sw $28,44($sp)
  437. .set macro
  438. .set reorder
  439. .set noreorder
  440. .set nomacro
  441. j $L43
  442. li $2,-1 # 0xffffffff
  443. .set macro
  444. .set reorder
  445. $L26:
  446. move $4,$18
  447. jal BN_num_bits_word
  448. move $4,$2
  449. li $2,0x00000020 # 32
  450. .set noreorder
  451. .set nomacro
  452. beq $4,$2,$L27
  453. li $2,0x00000001 # 1
  454. .set macro
  455. .set reorder
  456. sll $2,$2,$4
  457. sltu $2,$2,$16
  458. .set noreorder
  459. .set nomacro
  460. beq $2,$0,$L44
  461. li $5,0x00000020 # 32
  462. .set macro
  463. .set reorder
  464. la $4,__iob+32
  465. la $5,$LC0
  466. jal fprintf
  467. jal abort
  468. $L27:
  469. li $5,0x00000020 # 32
  470. $L44:
  471. sltu $2,$16,$18
  472. .set noreorder
  473. .set nomacro
  474. bne $2,$0,$L28
  475. subu $4,$5,$4
  476. .set macro
  477. .set reorder
  478. subu $16,$16,$18
  479. $L28:
  480. .set noreorder
  481. .set nomacro
  482. beq $4,$0,$L29
  483. li $10,-65536 # 0xffff0000
  484. .set macro
  485. .set reorder
  486. sll $18,$18,$4
  487. sll $3,$16,$4
  488. subu $2,$5,$4
  489. srl $2,$17,$2
  490. or $16,$3,$2
  491. sll $17,$17,$4
  492. $L29:
  493. srl $7,$18,16
  494. andi $9,$18,0xffff
  495. $L30:
  496. srl $2,$16,16
  497. .set noreorder
  498. .set nomacro
  499. beq $2,$7,$L34
  500. li $6,0x0000ffff # 65535
  501. .set macro
  502. .set reorder
  503. divu $6,$16,$7
  504. $L34:
  505. mult $6,$9
  506. mflo $5
  507. #nop
  508. #nop
  509. mult $6,$7
  510. and $2,$17,$10
  511. srl $8,$2,16
  512. mflo $4
  513. $L35:
  514. subu $3,$16,$4
  515. and $2,$3,$10
  516. .set noreorder
  517. .set nomacro
  518. bne $2,$0,$L36
  519. sll $2,$3,16
  520. .set macro
  521. .set reorder
  522. addu $2,$2,$8
  523. sltu $2,$2,$5
  524. .set noreorder
  525. .set nomacro
  526. beq $2,$0,$L36
  527. subu $5,$5,$9
  528. .set macro
  529. .set reorder
  530. subu $4,$4,$7
  531. .set noreorder
  532. .set nomacro
  533. j $L35
  534. addu $6,$6,-1
  535. .set macro
  536. .set reorder
  537. $L36:
  538. mult $6,$7
  539. mflo $5
  540. #nop
  541. #nop
  542. mult $6,$9
  543. mflo $4
  544. #nop
  545. #nop
  546. srl $3,$4,16
  547. sll $2,$4,16
  548. and $4,$2,$10
  549. sltu $2,$17,$4
  550. .set noreorder
  551. .set nomacro
  552. beq $2,$0,$L40
  553. addu $5,$5,$3
  554. .set macro
  555. .set reorder
  556. addu $5,$5,1
  557. $L40:
  558. sltu $2,$16,$5
  559. .set noreorder
  560. .set nomacro
  561. beq $2,$0,$L41
  562. subu $17,$17,$4
  563. .set macro
  564. .set reorder
  565. addu $16,$16,$18
  566. addu $6,$6,-1
  567. $L41:
  568. addu $19,$19,-1
  569. .set noreorder
  570. .set nomacro
  571. beq $19,$0,$L31
  572. subu $16,$16,$5
  573. .set macro
  574. .set reorder
  575. sll $20,$6,16
  576. sll $3,$16,16
  577. srl $2,$17,16
  578. or $16,$3,$2
  579. .set noreorder
  580. .set nomacro
  581. j $L30
  582. sll $17,$17,16
  583. .set macro
  584. .set reorder
  585. $L31:
  586. or $2,$20,$6
  587. $L43:
  588. lw $31,48($sp)
  589. lw $20,40($sp)
  590. lw $19,36($sp)
  591. lw $18,32($sp)
  592. lw $17,28($sp)
  593. lw $16,24($sp)
  594. addu $sp,$sp,56
  595. j $31
  596. .end bn_div64
  597. .globl abort .text
  598. .globl fprintf .text
  599. .globl BN_num_bits_word .text