2016-11-04 01:16:01 +03:00
/ / Copyright 2 0 1 2 T h e G o A u t h o r s . A l l r i g h t s r e s e r v e d .
/ / Use o f t h i s s o u r c e c o d e i s g o v e r n e d b y a B S D - s t y l e
/ / license t h a t c a n b e f o u n d i n t h e L I C E N S E f i l e .
/ / This c o d e w a s t r a n s l a t e d i n t o a f o r m c o m p a t i b l e w i t h 6 a f r o m t h e p u b l i c
2017-11-16 08:53:23 +03:00
/ / domain s o u r c e s i n S U P E R C O P : h t t p s : / / b e n c h . c r . y p . t o / s u p e r c o p . h t m l
2016-11-04 01:16:01 +03:00
/ / + build a m d64 ,! g c c g o ,! a p p e n g i n e
2017-11-16 08:53:23 +03:00
# include " c o n s t _ a m d64 . h "
2016-11-04 01:16:01 +03:00
/ / func m u l ( d e s t , a , b * [ 5 ] u i n t 6 4 )
TEXT · m u l ( S B ) ,0 ,$ 1 6 - 2 4
MOVQ d e s t + 0 ( F P ) , D I
MOVQ a + 8 ( F P ) , S I
MOVQ b + 1 6 ( F P ) , D X
MOVQ D X ,C X
MOVQ 2 4 ( S I ) ,D X
IMUL3 Q $ 1 9 ,D X ,A X
MOVQ A X ,0 ( S P )
MULQ 1 6 ( C X )
MOVQ A X ,R 8
MOVQ D X ,R 9
MOVQ 3 2 ( S I ) ,D X
IMUL3 Q $ 1 9 ,D X ,A X
MOVQ A X ,8 ( S P )
MULQ 8 ( C X )
ADDQ A X ,R 8
ADCQ D X ,R 9
MOVQ 0 ( S I ) ,A X
MULQ 0 ( C X )
ADDQ A X ,R 8
ADCQ D X ,R 9
MOVQ 0 ( S I ) ,A X
MULQ 8 ( C X )
MOVQ A X ,R 1 0
MOVQ D X ,R 1 1
MOVQ 0 ( S I ) ,A X
MULQ 1 6 ( C X )
MOVQ A X ,R 1 2
MOVQ D X ,R 1 3
MOVQ 0 ( S I ) ,A X
MULQ 2 4 ( C X )
MOVQ A X ,R 1 4
MOVQ D X ,R 1 5
MOVQ 0 ( S I ) ,A X
MULQ 3 2 ( C X )
MO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MOVQ 8 ( S P ) ,A X
MULQ 1 6 ( C X )
ADDQ A X ,R 1 0
ADCQ D X ,R 1 1
MOVQ 8 ( S P ) ,A X
MULQ 2 4 ( C X )
ADDQ A X ,R 1 2
ADCQ D X ,R 1 3
MOVQ 8 ( S P ) ,A X
MULQ 3 2 ( C X )
ADDQ A X ,R 1 4
ADCQ D X ,R 1 5
2017-11-16 08:53:23 +03:00
MOVQ $ R E D M A S K 5 1 ,S I
2019-05-13 18:38:53 +03:00
SHLQ $ 1 3 ,R 8 ,R 9
2016-11-04 01:16:01 +03:00
ANDQ S I ,R 8
2019-05-13 18:38:53 +03:00
SHLQ $ 1 3 ,R 1 0 ,R 1 1
2016-11-04 01:16:01 +03:00
ANDQ S I ,R 1 0
ADDQ R 9 ,R 1 0
2019-05-13 18:38:53 +03:00
SHLQ $ 1 3 ,R 1 2 ,R 1 3
2016-11-04 01:16:01 +03:00
ANDQ S I ,R 1 2
ADDQ R 1 1 ,R 1 2
2019-05-13 18:38:53 +03:00
SHLQ $ 1 3 ,R 1 4 ,R 1 5
2016-11-04 01:16:01 +03:00
ANDQ S I ,R 1 4
ADDQ R 1 3 ,R 1 4
2019-05-13 18:38:53 +03:00
SHLQ $ 1 3 ,B X ,B P
2016-11-04 01:16:01 +03:00
ANDQ S I ,B X
ADDQ R 1 5 ,B X
IMUL3 Q $ 1 9 ,B P ,D X
ADDQ D X ,R 8
MOVQ R 8 ,D X
SHRQ $ 5 1 ,D X
ADDQ R 1 0 ,D X
MOVQ D X ,C X
SHRQ $ 5 1 ,D X
ANDQ S I ,R 8
ADDQ R 1 2 ,D X
MOVQ D X ,R 9
SHRQ $ 5 1 ,D X
ANDQ S I ,C X
ADDQ R 1 4 ,D X
MOVQ D X ,A X
SHRQ $ 5 1 ,D X
ANDQ S I ,R 9
ADDQ B X ,D X
MOVQ D X ,R 1 0
SHRQ $ 5 1 ,D X
ANDQ S I ,A X
IMUL3 Q $ 1 9 ,D X ,D X
ADDQ D X ,R 8
ANDQ S I ,R 1 0
MOVQ R 8 ,0 ( D I )
MOVQ C X ,8 ( D I )
MOVQ R 9 ,1 6 ( D I )
MOVQ A X ,2 4 ( D I )
MOVQ R 1 0 ,3 2 ( D I )
RET