cswap_amd64.s 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. // +build amd64,!gccgo,!appengine
  5. // func cswap(inout *[4][5]uint64, v uint64)
  6. TEXT ·cswap(SB),7,$0
  7. MOVQ inout+0(FP),DI
  8. MOVQ v+8(FP),SI
  9. SUBQ $1, SI
  10. NOTQ SI
  11. MOVQ SI, X15
  12. PSHUFD $0x44, X15, X15
  13. MOVOU 0(DI), X0
  14. MOVOU 16(DI), X2
  15. MOVOU 32(DI), X4
  16. MOVOU 48(DI), X6
  17. MOVOU 64(DI), X8
  18. MOVOU 80(DI), X1
  19. MOVOU 96(DI), X3
  20. MOVOU 112(DI), X5
  21. MOVOU 128(DI), X7
  22. MOVOU 144(DI), X9
  23. MOVO X1, X10
  24. MOVO X3, X11
  25. MOVO X5, X12
  26. MOVO X7, X13
  27. MOVO X9, X14
  28. PXOR X0, X10
  29. PXOR X2, X11
  30. PXOR X4, X12
  31. PXOR X6, X13
  32. PXOR X8, X14
  33. PAND X15, X10
  34. PAND X15, X11
  35. PAND X15, X12
  36. PAND X15, X13
  37. PAND X15, X14
  38. PXOR X10, X0
  39. PXOR X10, X1
  40. PXOR X11, X2
  41. PXOR X11, X3
  42. PXOR X12, X4
  43. PXOR X12, X5
  44. PXOR X13, X6
  45. PXOR X13, X7
  46. PXOR X14, X8
  47. PXOR X14, X9
  48. MOVOU X0, 0(DI)
  49. MOVOU X2, 16(DI)
  50. MOVOU X4, 32(DI)
  51. MOVOU X6, 48(DI)
  52. MOVOU X8, 64(DI)
  53. MOVOU X1, 80(DI)
  54. MOVOU X3, 96(DI)
  55. MOVOU X5, 112(DI)
  56. MOVOU X7, 128(DI)
  57. MOVOU X9, 144(DI)
  58. RET