| Index: crosstest/mem_intrin.cpp
|
| diff --git a/crosstest/mem_intrin.cpp b/crosstest/mem_intrin.cpp
|
| index 612edce481722e3cba8804d1e3a7b1ddec13bc43..239a05774c246037c7548806b7a055e79cd7e6cf 100644
|
| --- a/crosstest/mem_intrin.cpp
|
| +++ b/crosstest/mem_intrin.cpp
|
| @@ -39,30 +39,6 @@ fletcher_checksum(uint8_t *buf, size_t length) {
|
| return (sum_of_sums << 8) | sum;
|
| }
|
|
|
| -#define NWORDS 32
|
| -#define BYTE_LENGTH (NWORDS * sizeof(elem_t))
|
| -
|
| -int memcpy_test_fixed_len(uint8_t init) {
|
| - elem_t buf[NWORDS];
|
| - elem_t buf2[NWORDS];
|
| - reset_buf((uint8_t *)buf, init, BYTE_LENGTH);
|
| - memcpy((void *)buf2, (void *)buf, BYTE_LENGTH);
|
| - return fletcher_checksum((uint8_t *)buf2, BYTE_LENGTH);
|
| -}
|
| -
|
| -int memmove_test_fixed_len(uint8_t init) {
|
| - elem_t buf[NWORDS];
|
| - reset_buf((uint8_t *)buf, init, BYTE_LENGTH);
|
| - memmove((void *)(buf + 4), (void *)buf, BYTE_LENGTH - (4 * sizeof(elem_t)));
|
| - return fletcher_checksum((uint8_t *)buf + 4, BYTE_LENGTH - 4);
|
| -}
|
| -
|
| -int memset_test_fixed_len(uint8_t init) {
|
| - elem_t buf[NWORDS];
|
| - memset((void *)buf, init, BYTE_LENGTH);
|
| - return fletcher_checksum((uint8_t *)buf, BYTE_LENGTH);
|
| -}
|
| -
|
| int memcpy_test(uint8_t *buf, uint8_t *buf2, uint8_t init, size_t length) {
|
| reset_buf(buf, init, length);
|
| memcpy((void *)buf2, (void *)buf, length);
|
| @@ -93,3 +69,290 @@ int memset_test(uint8_t *buf, uint8_t *buf2, uint8_t init, size_t length) {
|
| memset((void *)buf2, init + 4, length);
|
| return fletcher_checksum(buf, length) + fletcher_checksum(buf2, length);
|
| }
|
| +
|
| +#define test_fixed_len(NBYTES) \
|
| + int memcpy_test_fixed_len_##NBYTES(uint8_t init) { \
|
| + uint8_t buf[NBYTES]; \
|
| + uint8_t buf2[NBYTES]; \
|
| + reset_buf(buf, init, NBYTES); \
|
| + memcpy((void *)buf2, (void *)buf, NBYTES); \
|
| + return fletcher_checksum(buf2, NBYTES); \
|
| + } \
|
| + \
|
| + int memmove_test_fixed_len_##NBYTES(uint8_t init) { \
|
| + uint8_t buf[NBYTES + 16]; \
|
| + uint8_t buf2[NBYTES + 16]; \
|
| + reset_buf(buf, init, NBYTES + 16); \
|
| + reset_buf(buf2, init, NBYTES + 16); \
|
| + /* Move up */ \
|
| + memmove((void *)(buf + 16), (void *)buf, NBYTES); \
|
| + /* Move down */ \
|
| + memmove((void *)buf2, (void *)(buf2 + 16), NBYTES); \
|
| + return fletcher_checksum(buf, NBYTES + 16) + \
|
| + fletcher_checksum(buf2, NBYTES + 16); \
|
| + } \
|
| + \
|
| + int memset_test_fixed_len_##NBYTES(uint8_t init) { \
|
| + uint8_t buf[NBYTES]; \
|
| + memset((void *)buf, init, NBYTES); \
|
| + return fletcher_checksum(buf, NBYTES); \
|
| + }
|
| +
|
| +test_fixed_len(1);
|
| +test_fixed_len(2);
|
| +test_fixed_len(3);
|
| +test_fixed_len(4);
|
| +test_fixed_len(5);
|
| +test_fixed_len(6);
|
| +test_fixed_len(7);
|
| +test_fixed_len(8);
|
| +test_fixed_len(9);
|
| +test_fixed_len(10);
|
| +test_fixed_len(11);
|
| +test_fixed_len(12);
|
| +test_fixed_len(13);
|
| +test_fixed_len(14);
|
| +test_fixed_len(15);
|
| +test_fixed_len(16);
|
| +test_fixed_len(17);
|
| +test_fixed_len(18);
|
| +test_fixed_len(19);
|
| +test_fixed_len(20);
|
| +test_fixed_len(21);
|
| +test_fixed_len(22);
|
| +test_fixed_len(23);
|
| +test_fixed_len(24);
|
| +test_fixed_len(25);
|
| +test_fixed_len(26);
|
| +test_fixed_len(27);
|
| +test_fixed_len(28);
|
| +test_fixed_len(29);
|
| +test_fixed_len(30);
|
| +test_fixed_len(31);
|
| +test_fixed_len(32);
|
| +test_fixed_len(33);
|
| +test_fixed_len(34);
|
| +test_fixed_len(35);
|
| +test_fixed_len(36);
|
| +test_fixed_len(37);
|
| +test_fixed_len(38);
|
| +test_fixed_len(39);
|
| +test_fixed_len(40);
|
| +test_fixed_len(41);
|
| +test_fixed_len(42);
|
| +test_fixed_len(43);
|
| +test_fixed_len(44);
|
| +test_fixed_len(45);
|
| +test_fixed_len(46);
|
| +test_fixed_len(47);
|
| +test_fixed_len(48);
|
| +test_fixed_len(49);
|
| +test_fixed_len(50);
|
| +test_fixed_len(51);
|
| +test_fixed_len(52);
|
| +test_fixed_len(53);
|
| +test_fixed_len(54);
|
| +test_fixed_len(55);
|
| +test_fixed_len(56);
|
| +test_fixed_len(57);
|
| +test_fixed_len(58);
|
| +test_fixed_len(59);
|
| +test_fixed_len(60);
|
| +test_fixed_len(61);
|
| +test_fixed_len(62);
|
| +test_fixed_len(63);
|
| +test_fixed_len(64);
|
| +test_fixed_len(65);
|
| +test_fixed_len(66);
|
| +test_fixed_len(67);
|
| +test_fixed_len(68);
|
| +test_fixed_len(69);
|
| +test_fixed_len(70);
|
| +test_fixed_len(71);
|
| +test_fixed_len(72);
|
| +test_fixed_len(73);
|
| +test_fixed_len(74);
|
| +test_fixed_len(75);
|
| +test_fixed_len(76);
|
| +test_fixed_len(77);
|
| +test_fixed_len(78);
|
| +test_fixed_len(79);
|
| +test_fixed_len(80);
|
| +test_fixed_len(81);
|
| +test_fixed_len(82);
|
| +test_fixed_len(83);
|
| +test_fixed_len(84);
|
| +test_fixed_len(85);
|
| +test_fixed_len(86);
|
| +test_fixed_len(87);
|
| +test_fixed_len(88);
|
| +test_fixed_len(89);
|
| +test_fixed_len(90);
|
| +test_fixed_len(91);
|
| +test_fixed_len(92);
|
| +test_fixed_len(93);
|
| +test_fixed_len(94);
|
| +test_fixed_len(95);
|
| +test_fixed_len(96);
|
| +test_fixed_len(97);
|
| +test_fixed_len(98);
|
| +test_fixed_len(99);
|
| +test_fixed_len(100);
|
| +test_fixed_len(101);
|
| +test_fixed_len(102);
|
| +test_fixed_len(103);
|
| +test_fixed_len(104);
|
| +test_fixed_len(105);
|
| +test_fixed_len(106);
|
| +test_fixed_len(107);
|
| +test_fixed_len(108);
|
| +test_fixed_len(109);
|
| +test_fixed_len(110);
|
| +test_fixed_len(111);
|
| +test_fixed_len(112);
|
| +test_fixed_len(113);
|
| +test_fixed_len(114);
|
| +test_fixed_len(115);
|
| +test_fixed_len(116);
|
| +test_fixed_len(117);
|
| +test_fixed_len(118);
|
| +test_fixed_len(119);
|
| +test_fixed_len(120);
|
| +test_fixed_len(121);
|
| +test_fixed_len(122);
|
| +test_fixed_len(123);
|
| +test_fixed_len(124);
|
| +test_fixed_len(125);
|
| +test_fixed_len(126);
|
| +test_fixed_len(127);
|
| +test_fixed_len(128);
|
| +test_fixed_len(129);
|
| +test_fixed_len(130);
|
| +test_fixed_len(131);
|
| +test_fixed_len(132);
|
| +test_fixed_len(133);
|
| +test_fixed_len(134);
|
| +test_fixed_len(135);
|
| +test_fixed_len(136);
|
| +test_fixed_len(137);
|
| +test_fixed_len(138);
|
| +test_fixed_len(139);
|
| +test_fixed_len(140);
|
| +test_fixed_len(141);
|
| +test_fixed_len(142);
|
| +test_fixed_len(143);
|
| +test_fixed_len(144);
|
| +test_fixed_len(145);
|
| +test_fixed_len(146);
|
| +test_fixed_len(147);
|
| +test_fixed_len(148);
|
| +test_fixed_len(149);
|
| +test_fixed_len(150);
|
| +test_fixed_len(151);
|
| +test_fixed_len(152);
|
| +test_fixed_len(153);
|
| +test_fixed_len(154);
|
| +test_fixed_len(155);
|
| +test_fixed_len(156);
|
| +test_fixed_len(157);
|
| +test_fixed_len(158);
|
| +test_fixed_len(159);
|
| +test_fixed_len(160);
|
| +test_fixed_len(161);
|
| +test_fixed_len(162);
|
| +test_fixed_len(163);
|
| +test_fixed_len(164);
|
| +test_fixed_len(165);
|
| +test_fixed_len(166);
|
| +test_fixed_len(167);
|
| +test_fixed_len(168);
|
| +test_fixed_len(169);
|
| +test_fixed_len(170);
|
| +test_fixed_len(171);
|
| +test_fixed_len(172);
|
| +test_fixed_len(173);
|
| +test_fixed_len(174);
|
| +test_fixed_len(175);
|
| +test_fixed_len(176);
|
| +test_fixed_len(177);
|
| +test_fixed_len(178);
|
| +test_fixed_len(179);
|
| +test_fixed_len(180);
|
| +test_fixed_len(181);
|
| +test_fixed_len(182);
|
| +test_fixed_len(183);
|
| +test_fixed_len(184);
|
| +test_fixed_len(185);
|
| +test_fixed_len(186);
|
| +test_fixed_len(187);
|
| +test_fixed_len(188);
|
| +test_fixed_len(189);
|
| +test_fixed_len(190);
|
| +test_fixed_len(191);
|
| +test_fixed_len(192);
|
| +test_fixed_len(193);
|
| +test_fixed_len(194);
|
| +test_fixed_len(195);
|
| +test_fixed_len(196);
|
| +test_fixed_len(197);
|
| +test_fixed_len(198);
|
| +test_fixed_len(199);
|
| +test_fixed_len(200);
|
| +test_fixed_len(201);
|
| +test_fixed_len(202);
|
| +test_fixed_len(203);
|
| +test_fixed_len(204);
|
| +test_fixed_len(205);
|
| +test_fixed_len(206);
|
| +test_fixed_len(207);
|
| +test_fixed_len(208);
|
| +test_fixed_len(209);
|
| +test_fixed_len(210);
|
| +test_fixed_len(211);
|
| +test_fixed_len(212);
|
| +test_fixed_len(213);
|
| +test_fixed_len(214);
|
| +test_fixed_len(215);
|
| +test_fixed_len(216);
|
| +test_fixed_len(217);
|
| +test_fixed_len(218);
|
| +test_fixed_len(219);
|
| +test_fixed_len(220);
|
| +test_fixed_len(221);
|
| +test_fixed_len(222);
|
| +test_fixed_len(223);
|
| +test_fixed_len(224);
|
| +test_fixed_len(225);
|
| +test_fixed_len(226);
|
| +test_fixed_len(227);
|
| +test_fixed_len(228);
|
| +test_fixed_len(229);
|
| +test_fixed_len(230);
|
| +test_fixed_len(231);
|
| +test_fixed_len(232);
|
| +test_fixed_len(233);
|
| +test_fixed_len(234);
|
| +test_fixed_len(235);
|
| +test_fixed_len(236);
|
| +test_fixed_len(237);
|
| +test_fixed_len(238);
|
| +test_fixed_len(239);
|
| +test_fixed_len(240);
|
| +test_fixed_len(241);
|
| +test_fixed_len(242);
|
| +test_fixed_len(243);
|
| +test_fixed_len(244);
|
| +test_fixed_len(245);
|
| +test_fixed_len(246);
|
| +test_fixed_len(247);
|
| +test_fixed_len(248);
|
| +test_fixed_len(249);
|
| +test_fixed_len(250);
|
| +test_fixed_len(251);
|
| +test_fixed_len(252);
|
| +test_fixed_len(253);
|
| +test_fixed_len(254);
|
| +test_fixed_len(255);
|
| +test_fixed_len(256);
|
| +
|
| +#undef test_fixed_len
|
|
|