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.

94 lines
1.5 KiB

  1. // Copyright 2012 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // This code was translated into a form compatible with 6a from the public
  5. // domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html
  6. // +build amd64,!gccgo,!appengine
  7. // func freeze(inout *[5]uint64)
  8. TEXT ·freeze(SB),7,$96-8
  9. MOVQ inout+0(FP), DI
  10. MOVQ SP,R11
  11. MOVQ $31,CX
  12. NOTQ CX
  13. ANDQ CX,SP
  14. ADDQ $32,SP
  15. MOVQ R11,0(SP)
  16. MOVQ R12,8(SP)
  17. MOVQ R13,16(SP)
  18. MOVQ R14,24(SP)
  19. MOVQ R15,32(SP)
  20. MOVQ BX,40(SP)
  21. MOVQ BP,48(SP)
  22. MOVQ 0(DI),SI
  23. MOVQ 8(DI),DX
  24. MOVQ 16(DI),CX
  25. MOVQ 24(DI),R8
  26. MOVQ 32(DI),R9
  27. MOVQ ·REDMASK51(SB),AX
  28. MOVQ AX,R10
  29. SUBQ $18,R10
  30. MOVQ $3,R11
  31. REDUCELOOP:
  32. MOVQ SI,R12
  33. SHRQ $51,R12
  34. ANDQ AX,SI
  35. ADDQ R12,DX
  36. MOVQ DX,R12
  37. SHRQ $51,R12
  38. ANDQ AX,DX
  39. ADDQ R12,CX
  40. MOVQ CX,R12
  41. SHRQ $51,R12
  42. ANDQ AX,CX
  43. ADDQ R12,R8
  44. MOVQ R8,R12
  45. SHRQ $51,R12
  46. ANDQ AX,R8
  47. ADDQ R12,R9
  48. MOVQ R9,R12
  49. SHRQ $51,R12
  50. ANDQ AX,R9
  51. IMUL3Q $19,R12,R12
  52. ADDQ R12,SI
  53. SUBQ $1,R11
  54. JA REDUCELOOP
  55. MOVQ $1,R12
  56. CMPQ R10,SI
  57. CMOVQLT R11,R12
  58. CMPQ AX,DX
  59. CMOVQNE R11,R12
  60. CMPQ AX,CX
  61. CMOVQNE R11,R12
  62. CMPQ AX,R8
  63. CMOVQNE R11,R12
  64. CMPQ AX,R9
  65. CMOVQNE R11,R12
  66. NEGQ R12
  67. ANDQ R12,AX
  68. ANDQ R12,R10
  69. SUBQ R10,SI
  70. SUBQ AX,DX
  71. SUBQ AX,CX
  72. SUBQ AX,R8
  73. SUBQ AX,R9
  74. MOVQ SI,0(DI)
  75. MOVQ DX,8(DI)
  76. MOVQ CX,16(DI)
  77. MOVQ R8,24(DI)
  78. MOVQ R9,32(DI)
  79. MOVQ 0(SP),R11
  80. MOVQ 8(SP),R12
  81. MOVQ 16(SP),R13
  82. MOVQ 24(SP),R14
  83. MOVQ 32(SP),R15
  84. MOVQ 40(SP),BX
  85. MOVQ 48(SP),BP
  86. MOVQ R11,SP
  87. MOVQ DI,AX
  88. MOVQ SI,DX
  89. RET