MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / Square4

Method Square4

extra/yassl/taocrypt/src/integer.cpp:777–813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

775}
776
777void Portable::Square4(word *R, const word *A)
778{
779#ifdef _MSC_VER
780 // VC60 workaround: MSVC 6.0 has an optimization bug that makes
781 // (dword)A*B where either A or B has been cast to a dword before
782 // very expensive. Revisit this function when this
783 // bug is fixed.
784 Multiply4(R, A, A);
785#else
786 const word *B = A;
787 DWord p, q;
788 word c, d, e;
789
790 p = DWord::Multiply(A[0], A[0]);
791 R[0] = p.GetLowHalf();
792 c = p.GetHighHalf();
793 d = e = 0;
794
795 SquAcc(0, 1);
796
797 SaveSquAcc(1, 2, 0);
798 MulAcc(1, 1);
799
800 SaveSquAcc(2, 0, 3);
801 SquAcc(1, 2);
802
803 SaveSquAcc(3, 3, 1);
804 MulAcc(2, 2);
805
806 SaveSquAcc(4, 2, 3);
807
808 R[5] = c;
809 p = DWord::MultiplyAndAdd(A[3], A[3], d);
810 R[6] = p.GetLowHalf();
811 R[7] = e + p.GetHighHalf();
812#endif
813}
814
815void Portable::Multiply8(word *R, const word *A, const word *B)
816{

Callers

nothing calls this directly

Calls 2

GetLowHalfMethod · 0.45
GetHighHalfMethod · 0.45

Tested by

no test coverage detected