From d0d41c6ebfbfebca8dbb516a1de4107c82b1bc6b Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Mon, 4 Nov 2019 11:59:28 +0000 Subject: [PATCH] math/mpx-mul4-*: Test the `...zc' variants too. --- math/mpx-mul4-amd64-sse2.S | 20 ++++++++++++++++++++ math/mpx-mul4-test.c | 2 ++ math/mpx-mul4-x86-sse2.S | 24 ++++++++++++++++++++++++ math/t/mpx-mul4 | 15 +++++++++++++++ 4 files changed, 61 insertions(+) diff --git a/math/mpx-mul4-amd64-sse2.S b/math/mpx-mul4-amd64-sse2.S index 9146a63f..94befa4d 100644 --- a/math/mpx-mul4-amd64-sse2.S +++ b/math/mpx-mul4-amd64-sse2.S @@ -1529,6 +1529,16 @@ FUNC(test_mul4) testepilogue ENDFUNC +FUNC(test_mul4zc) + testprologue smul + testldcarry + testtop nil + call mul4zc + testtail + testcarryout + testepilogue +ENDFUNC + FUNC(test_mla4) testprologue smul testldcarry @@ -1539,6 +1549,16 @@ FUNC(test_mla4) testepilogue ENDFUNC +FUNC(test_mla4zc) + testprologue smul + testldcarry + testtop nil + call mla4zc + testtail + testcarryout + testepilogue +ENDFUNC + FUNC(test_mmul4) testprologue mmul testtop r11 diff --git a/math/mpx-mul4-test.c b/math/mpx-mul4-test.c index 5d5b4d58..414974bf 100644 --- a/math/mpx-mul4-test.c +++ b/math/mpx-mul4-test.c @@ -80,7 +80,9 @@ typedef struct { mpd w[6]; } carry; _(dmul4, NIL, CARRY, P128, P128, P128, P128, P128, NIL, CARRY) \ _(dmla4, P128, CARRY, P128, P128, P128, P128, P128, NIL, CARRY) \ _(mul4, NIL, CARRY, NIL, P128, NIL, P128, P128, NIL, CARRY) \ + _(mul4zc,NIL, NIL, NIL, P128, NIL, P128, P128, NIL, CARRY) \ _(mla4, P128, CARRY, NIL, P128, NIL, P128, P128, NIL, CARRY) \ + _(mla4zc,P128, NIL, NIL, P128, NIL, P128, P128, NIL, CARRY) \ _(mmul4, NIL, NIL, P128, P128, P128, P128, P128, X128, CARRY) \ _(mmla4, P128, NIL, P128, P128, P128, P128, P128, X128, CARRY) \ _(mont4, P128, NIL, NIL, P128, NIL, P128, P128, X128, CARRY) diff --git a/math/mpx-mul4-x86-sse2.S b/math/mpx-mul4-x86-sse2.S index f6c81673..baf7cc50 100644 --- a/math/mpx-mul4-x86-sse2.S +++ b/math/mpx-mul4-x86-sse2.S @@ -1190,6 +1190,18 @@ FUNC(test_mul4) testepilogue ENDFUNC +FUNC(test_mul4zc) + testprologue [ebp + 36] + testldcarry [ebp + 24] + testexpand nil, [ebp + 32] + mov edi, [ebp + 20] + testtop nil, [ebp + 28] + call mul4zc + testtail [ebp + 40] + testcarryout [ebp + 24] + testepilogue +ENDFUNC + FUNC(test_mla4) testprologue [ebp + 36] testldcarry [ebp + 24] @@ -1202,6 +1214,18 @@ FUNC(test_mla4) testepilogue ENDFUNC +FUNC(test_mla4zc) + testprologue [ebp + 36] + testldcarry [ebp + 24] + testexpand nil, [ebp + 32] + mov edi, [ebp + 20] + testtop nil, [ebp + 28] + call mla4zc + testtail [ebp + 40] + testcarryout [ebp + 24] + testepilogue +ENDFUNC + FUNC(test_mmul4) testprologue [ebp + 48] testexpand [ebp + 40], [ebp + 44] diff --git a/math/t/mpx-mul4 b/math/t/mpx-mul4 index 1373215a..69ea238b 100644 --- a/math/t/mpx-mul4 +++ b/math/t/mpx-mul4 @@ -29,6 +29,13 @@ mul4 { 0002b2f3db03f8310002b880e3fffed70001d457394991000001d812a4ace8a80000ee0b505470500000efed0e0e2428; ## cc } +mul4zc { + e3e2e1e0e7e6e5e4ebeae9e8efeeedec # x + f3f2f1f0f7f6f5f4fbfaf9f8fffefdfc # y + 6117a200e13e737feee2b25cca449ed7 # zz + 0002b2f3db03f8300002b880e3fffed70001d457394991000001d812a4ace8a80000ee0b505470500000efed0e0e2428; # cc +} + mla4 { b3b2b1b0b7b6b5b4bbbab9b8bfbebdbc # a 0000a5a4a3a2a1a000009594939291900000abaaa9a8a7a600009b9a999897960000afaeadacabaa00009f9e9d9c9b9a # c @@ -38,6 +45,14 @@ mla4 { 0002b2f3db03f8320002b880e3fffed70001d457394991000001d812a4ace8a80000ee0b505470500000efed0e0e2428; ## cc } +mla4zc { + b3b2b1b0b7b6b5b4bbbab9b8bfbebdbc # a + e3e2e1e0e7e6e5e4ebeae9e8efeeedec # x + f3f2f1f0f7f6f5f4fbfaf9f8fffefdfc # y + 14ca53b098f52934aa9d6c158a035c94 # zz + 0002b2f3db03f8310002b880e3fffed70001d457394991000001d812a4ace8a80000ee0b505470500000efed0e0e2428; # cc +} + mmul4 { c3c2c1c0c7c6c5c4cbcac9c8cfcecdcc # u acadaeafa8a9aaaba4a5a6a7a0a1a2a3 # n -- 2.11.0