minimap2 0.2.25.1 → 0.2.26.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -0
  3. data/ext/Rakefile +2 -2
  4. data/ext/minimap2/NEWS.md +9 -0
  5. data/ext/minimap2/README.md +2 -2
  6. data/ext/minimap2/cookbook.md +2 -2
  7. data/ext/minimap2/minimap.h +1 -1
  8. data/ext/minimap2/minimap2.1 +1 -1
  9. data/ext/minimap2/misc/paftools.js +1 -1
  10. data/ext/minimap2/python/mappy.pyx +1 -1
  11. data/ext/minimap2/setup.py +22 -32
  12. data/lib/minimap2/version.rb +1 -1
  13. metadata +1 -97
  14. data/ext/minimap2/lib/simde/CONTRIBUTING.md +0 -114
  15. data/ext/minimap2/lib/simde/COPYING +0 -20
  16. data/ext/minimap2/lib/simde/README.md +0 -333
  17. data/ext/minimap2/lib/simde/amalgamate.py +0 -58
  18. data/ext/minimap2/lib/simde/meson.build +0 -33
  19. data/ext/minimap2/lib/simde/netlify.toml +0 -20
  20. data/ext/minimap2/lib/simde/simde/arm/neon/float32x2.h +0 -140
  21. data/ext/minimap2/lib/simde/simde/arm/neon/float32x4.h +0 -137
  22. data/ext/minimap2/lib/simde/simde/arm/neon/float64x1.h +0 -142
  23. data/ext/minimap2/lib/simde/simde/arm/neon/float64x2.h +0 -145
  24. data/ext/minimap2/lib/simde/simde/arm/neon/int16x4.h +0 -140
  25. data/ext/minimap2/lib/simde/simde/arm/neon/int16x8.h +0 -145
  26. data/ext/minimap2/lib/simde/simde/arm/neon/int32x2.h +0 -140
  27. data/ext/minimap2/lib/simde/simde/arm/neon/int32x4.h +0 -143
  28. data/ext/minimap2/lib/simde/simde/arm/neon/int64x1.h +0 -137
  29. data/ext/minimap2/lib/simde/simde/arm/neon/int64x2.h +0 -141
  30. data/ext/minimap2/lib/simde/simde/arm/neon/int8x16.h +0 -147
  31. data/ext/minimap2/lib/simde/simde/arm/neon/int8x8.h +0 -141
  32. data/ext/minimap2/lib/simde/simde/arm/neon/uint16x4.h +0 -134
  33. data/ext/minimap2/lib/simde/simde/arm/neon/uint16x8.h +0 -138
  34. data/ext/minimap2/lib/simde/simde/arm/neon/uint32x2.h +0 -134
  35. data/ext/minimap2/lib/simde/simde/arm/neon/uint32x4.h +0 -137
  36. data/ext/minimap2/lib/simde/simde/arm/neon/uint64x1.h +0 -131
  37. data/ext/minimap2/lib/simde/simde/arm/neon/uint64x2.h +0 -135
  38. data/ext/minimap2/lib/simde/simde/arm/neon/uint8x16.h +0 -141
  39. data/ext/minimap2/lib/simde/simde/arm/neon/uint8x8.h +0 -135
  40. data/ext/minimap2/lib/simde/simde/arm/neon.h +0 -97
  41. data/ext/minimap2/lib/simde/simde/check.h +0 -267
  42. data/ext/minimap2/lib/simde/simde/debug-trap.h +0 -83
  43. data/ext/minimap2/lib/simde/simde/hedley.h +0 -1899
  44. data/ext/minimap2/lib/simde/simde/simde-arch.h +0 -445
  45. data/ext/minimap2/lib/simde/simde/simde-common.h +0 -697
  46. data/ext/minimap2/lib/simde/simde/x86/avx.h +0 -5385
  47. data/ext/minimap2/lib/simde/simde/x86/avx2.h +0 -2402
  48. data/ext/minimap2/lib/simde/simde/x86/avx512bw.h +0 -391
  49. data/ext/minimap2/lib/simde/simde/x86/avx512f.h +0 -3389
  50. data/ext/minimap2/lib/simde/simde/x86/avx512vl.h +0 -112
  51. data/ext/minimap2/lib/simde/simde/x86/fma.h +0 -659
  52. data/ext/minimap2/lib/simde/simde/x86/mmx.h +0 -2210
  53. data/ext/minimap2/lib/simde/simde/x86/sse.h +0 -3696
  54. data/ext/minimap2/lib/simde/simde/x86/sse2.h +0 -5991
  55. data/ext/minimap2/lib/simde/simde/x86/sse3.h +0 -343
  56. data/ext/minimap2/lib/simde/simde/x86/sse4.1.h +0 -1783
  57. data/ext/minimap2/lib/simde/simde/x86/sse4.2.h +0 -105
  58. data/ext/minimap2/lib/simde/simde/x86/ssse3.h +0 -1053
  59. data/ext/minimap2/lib/simde/simde/x86/svml.h +0 -543
  60. data/ext/minimap2/lib/simde/test/CMakeLists.txt +0 -166
  61. data/ext/minimap2/lib/simde/test/arm/meson.build +0 -4
  62. data/ext/minimap2/lib/simde/test/arm/neon/meson.build +0 -23
  63. data/ext/minimap2/lib/simde/test/arm/neon/skel.c +0 -871
  64. data/ext/minimap2/lib/simde/test/arm/neon/test-neon-internal.h +0 -134
  65. data/ext/minimap2/lib/simde/test/arm/neon/test-neon.c +0 -39
  66. data/ext/minimap2/lib/simde/test/arm/neon/test-neon.h +0 -10
  67. data/ext/minimap2/lib/simde/test/arm/neon/vadd.c +0 -1260
  68. data/ext/minimap2/lib/simde/test/arm/neon/vdup_n.c +0 -873
  69. data/ext/minimap2/lib/simde/test/arm/neon/vmul.c +0 -1084
  70. data/ext/minimap2/lib/simde/test/arm/neon/vsub.c +0 -1260
  71. data/ext/minimap2/lib/simde/test/arm/test-arm-internal.h +0 -18
  72. data/ext/minimap2/lib/simde/test/arm/test-arm.c +0 -20
  73. data/ext/minimap2/lib/simde/test/arm/test-arm.h +0 -8
  74. data/ext/minimap2/lib/simde/test/cmake/AddCompilerFlags.cmake +0 -171
  75. data/ext/minimap2/lib/simde/test/cmake/ExtraWarningFlags.cmake +0 -68
  76. data/ext/minimap2/lib/simde/test/meson.build +0 -64
  77. data/ext/minimap2/lib/simde/test/munit/COPYING +0 -21
  78. data/ext/minimap2/lib/simde/test/munit/Makefile +0 -55
  79. data/ext/minimap2/lib/simde/test/munit/README.md +0 -54
  80. data/ext/minimap2/lib/simde/test/munit/example.c +0 -351
  81. data/ext/minimap2/lib/simde/test/munit/meson.build +0 -37
  82. data/ext/minimap2/lib/simde/test/munit/munit.c +0 -2055
  83. data/ext/minimap2/lib/simde/test/munit/munit.h +0 -535
  84. data/ext/minimap2/lib/simde/test/run-tests.c +0 -20
  85. data/ext/minimap2/lib/simde/test/run-tests.h +0 -260
  86. data/ext/minimap2/lib/simde/test/x86/avx.c +0 -13752
  87. data/ext/minimap2/lib/simde/test/x86/avx2.c +0 -9977
  88. data/ext/minimap2/lib/simde/test/x86/avx512bw.c +0 -2664
  89. data/ext/minimap2/lib/simde/test/x86/avx512f.c +0 -10416
  90. data/ext/minimap2/lib/simde/test/x86/avx512vl.c +0 -210
  91. data/ext/minimap2/lib/simde/test/x86/fma.c +0 -2557
  92. data/ext/minimap2/lib/simde/test/x86/meson.build +0 -33
  93. data/ext/minimap2/lib/simde/test/x86/mmx.c +0 -2878
  94. data/ext/minimap2/lib/simde/test/x86/skel.c +0 -2984
  95. data/ext/minimap2/lib/simde/test/x86/sse.c +0 -5121
  96. data/ext/minimap2/lib/simde/test/x86/sse2.c +0 -9860
  97. data/ext/minimap2/lib/simde/test/x86/sse3.c +0 -486
  98. data/ext/minimap2/lib/simde/test/x86/sse4.1.c +0 -3446
  99. data/ext/minimap2/lib/simde/test/x86/sse4.2.c +0 -101
  100. data/ext/minimap2/lib/simde/test/x86/ssse3.c +0 -2084
  101. data/ext/minimap2/lib/simde/test/x86/svml.c +0 -1545
  102. data/ext/minimap2/lib/simde/test/x86/test-avx.h +0 -16
  103. data/ext/minimap2/lib/simde/test/x86/test-avx512.h +0 -25
  104. data/ext/minimap2/lib/simde/test/x86/test-mmx.h +0 -13
  105. data/ext/minimap2/lib/simde/test/x86/test-sse.h +0 -13
  106. data/ext/minimap2/lib/simde/test/x86/test-sse2.h +0 -13
  107. data/ext/minimap2/lib/simde/test/x86/test-x86-internal.h +0 -196
  108. data/ext/minimap2/lib/simde/test/x86/test-x86.c +0 -48
  109. data/ext/minimap2/lib/simde/test/x86/test-x86.h +0 -8
@@ -1,3446 +0,0 @@
1
- /* Copyright (c) 2017 Evan Nemerson <evan@nemerson.com>
2
- *
3
- * Permission is hereby granted, free of charge, to any person
4
- * obtaining a copy of this software and associated documentation
5
- * files (the "Software"), to deal in the Software without
6
- * restriction, including without limitation the rights to use, copy,
7
- * modify, merge, publish, distribute, sublicense, and/or sell copies
8
- * of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be
12
- * included in all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
18
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- * SOFTWARE.
22
- */
23
-
24
- #define SIMDE_TESTS_CURRENT_ISAX sse4_1
25
- #include <simde/x86/sse4.1.h>
26
- #include <test/x86/test-sse2.h>
27
-
28
- #if defined(SIMDE_SSE4_1_NATIVE) || defined(SIMDE_NO_NATIVE) || defined(SIMDE_ALWAYS_BUILD_NATIVE_TESTS)
29
-
30
- static MunitResult
31
- test_simde_mm_blendv_epi8(const MunitParameter params[], void* data) {
32
- (void) params;
33
- (void) data;
34
-
35
- const struct {
36
- simde__m128i a;
37
- simde__m128i b;
38
- simde__m128i mask;
39
- simde__m128i r;
40
- } test_vec[8] = {
41
- { simde_mm_set_epi8(INT8_C( -85), INT8_C( -39), INT8_C(-107), INT8_C( -76),
42
- INT8_C( -25), INT8_C( -32), INT8_C( -50), INT8_C(-115),
43
- INT8_C( -54), INT8_C( -26), INT8_C( 56), INT8_C( 16),
44
- INT8_C( -17), INT8_C( 98), INT8_C( -10), INT8_C( -86)),
45
- simde_mm_set_epi8(INT8_C( 111), INT8_C( -17), INT8_C( 70), INT8_C( -98),
46
- INT8_C( 38), INT8_C( 75), INT8_C( 17), INT8_C( -50),
47
- INT8_C( -64), INT8_C( 25), INT8_C( -4), INT8_C( 42),
48
- INT8_C( 13), INT8_C( 109), INT8_C( 122), INT8_C(-104)),
49
- simde_mm_set_epi8(INT8_C( -13), INT8_C( 21), INT8_C( 111), INT8_C( -8),
50
- INT8_C( 32), INT8_C( -14), INT8_C( 25), INT8_C( 45),
51
- INT8_C( 34), INT8_C( -43), INT8_C( -81), INT8_C( 26),
52
- INT8_C(-105), INT8_C( 63), INT8_C( -61), INT8_C( -38)),
53
- simde_mm_set_epi8(INT8_C( 111), INT8_C( -39), INT8_C(-107), INT8_C( -98),
54
- INT8_C( -25), INT8_C( 75), INT8_C( -50), INT8_C(-115),
55
- INT8_C( -54), INT8_C( 25), INT8_C( -4), INT8_C( 16),
56
- INT8_C( 13), INT8_C( 98), INT8_C( 122), INT8_C(-104)) },
57
- { simde_mm_set_epi8(INT8_C( -79), INT8_C( 12), INT8_C( 105), INT8_C( -95),
58
- INT8_C( -27), INT8_C( 97), INT8_C( 123), INT8_C( -2),
59
- INT8_C( -75), INT8_C( -82), INT8_C( -63), INT8_C( 121),
60
- INT8_C( 39), INT8_C( -40), INT8_C(-103), INT8_C( -72)),
61
- simde_mm_set_epi8(INT8_C( -77), INT8_C( -58), INT8_C( -15), INT8_C( -99),
62
- INT8_C(-120), INT8_C( 124), INT8_C( 40), INT8_C( 82),
63
- INT8_C( 121), INT8_C( 50), INT8_C(-103), INT8_C( -45),
64
- INT8_C(-125), INT8_C( -55), INT8_C( -57), INT8_C( -95)),
65
- simde_mm_set_epi8(INT8_C( -97), INT8_C( -10), INT8_C( 107), INT8_C( 95),
66
- INT8_C( 99), INT8_C(-103), INT8_C( 112), INT8_C( -80),
67
- INT8_C( -21), INT8_C( 52), INT8_C(-128), INT8_C( 9),
68
- INT8_C( 47), INT8_C( -45), INT8_C( -98), INT8_C( 67)),
69
- simde_mm_set_epi8(INT8_C( -77), INT8_C( -58), INT8_C( 105), INT8_C( -95),
70
- INT8_C( -27), INT8_C( 124), INT8_C( 123), INT8_C( 82),
71
- INT8_C( 121), INT8_C( -82), INT8_C(-103), INT8_C( 121),
72
- INT8_C( 39), INT8_C( -55), INT8_C( -57), INT8_C( -72)) },
73
- { simde_mm_set_epi8(INT8_C( 65), INT8_C( 33), INT8_C( -24), INT8_C( -68),
74
- INT8_C( -81), INT8_C( 103), INT8_C( -77), INT8_C( -49),
75
- INT8_C( 99), INT8_C( 55), INT8_C( 98), INT8_C( 36),
76
- INT8_C( 31), INT8_C( 86), INT8_C( -79), INT8_C( 106)),
77
- simde_mm_set_epi8(INT8_C( 101), INT8_C( 91), INT8_C( -24), INT8_C( 33),
78
- INT8_C( -68), INT8_C(-109), INT8_C( -92), INT8_C( -49),
79
- INT8_C( -88), INT8_C( 86), INT8_C( 106), INT8_C( 125),
80
- INT8_C( 81), INT8_C( -60), INT8_C( -32), INT8_C( 38)),
81
- simde_mm_set_epi8(INT8_C( 3), INT8_C( 58), INT8_C( 40), INT8_C( 64),
82
- INT8_C( 7), INT8_C(-123), INT8_C( 47), INT8_C( 24),
83
- INT8_C( -14), INT8_C( 119), INT8_C( 8), INT8_C( 126),
84
- INT8_C( 123), INT8_C( 25), INT8_C( 42), INT8_C(-118)),
85
- simde_mm_set_epi8(INT8_C( 65), INT8_C( 33), INT8_C( -24), INT8_C( -68),
86
- INT8_C( -81), INT8_C(-109), INT8_C( -77), INT8_C( -49),
87
- INT8_C( -88), INT8_C( 55), INT8_C( 98), INT8_C( 36),
88
- INT8_C( 31), INT8_C( 86), INT8_C( -79), INT8_C( 38)) },
89
- { simde_mm_set_epi8(INT8_C( 34), INT8_C(-102), INT8_C( 26), INT8_C( 6),
90
- INT8_C( -98), INT8_C(-126), INT8_C( 34), INT8_C( 109),
91
- INT8_C( -65), INT8_C( -47), INT8_C( 54), INT8_C(-102),
92
- INT8_C( 52), INT8_C( 72), INT8_C( 95), INT8_C(-117)),
93
- simde_mm_set_epi8(INT8_C( -47), INT8_C( 2), INT8_C( 12), INT8_C( -2),
94
- INT8_C( 113), INT8_C( 15), INT8_C( -36), INT8_C( 63),
95
- INT8_C( 39), INT8_C( 47), INT8_C( -65), INT8_C( 45),
96
- INT8_C( -99), INT8_C( 91), INT8_C(-116), INT8_C( 94)),
97
- simde_mm_set_epi8(INT8_C( -98), INT8_C( 39), INT8_C( 27), INT8_C(-110),
98
- INT8_C( -56), INT8_C( 121), INT8_C( 15), INT8_C( 100),
99
- INT8_C( 94), INT8_C( 8), INT8_C(-121), INT8_C( 116),
100
- INT8_C( 47), INT8_C(-128), INT8_C( 82), INT8_C( 52)),
101
- simde_mm_set_epi8(INT8_C( -47), INT8_C(-102), INT8_C( 26), INT8_C( -2),
102
- INT8_C( 113), INT8_C(-126), INT8_C( 34), INT8_C( 109),
103
- INT8_C( -65), INT8_C( -47), INT8_C( -65), INT8_C(-102),
104
- INT8_C( 52), INT8_C( 91), INT8_C( 95), INT8_C(-117)) },
105
- { simde_mm_set_epi8(INT8_C( 114), INT8_C(-111), INT8_C( -9), INT8_C( -74),
106
- INT8_C( 56), INT8_C( -88), INT8_C( 102), INT8_C( 9),
107
- INT8_C( 123), INT8_C(-124), INT8_C( 2), INT8_C( -90),
108
- INT8_C( -87), INT8_C(-122), INT8_C( -39), INT8_C(-114)),
109
- simde_mm_set_epi8(INT8_C( -81), INT8_C( -26), INT8_C( 59), INT8_C( 3),
110
- INT8_C( 113), INT8_C( -96), INT8_C(-108), INT8_C( 77),
111
- INT8_C( -17), INT8_C( 59), INT8_C( -35), INT8_C( 43),
112
- INT8_C( 117), INT8_C( 11), INT8_C(-103), INT8_C( -21)),
113
- simde_mm_set_epi8(INT8_C(-116), INT8_C( 124), INT8_C( -23), INT8_C( -24),
114
- INT8_C(-105), INT8_C( -39), INT8_C( 45), INT8_C( -32),
115
- INT8_C( 5), INT8_C( -60), INT8_C( -98), INT8_C( 111),
116
- INT8_C(-112), INT8_C( -60), INT8_C( 8), INT8_C( 13)),
117
- simde_mm_set_epi8(INT8_C( -81), INT8_C(-111), INT8_C( 59), INT8_C( 3),
118
- INT8_C( 113), INT8_C( -96), INT8_C( 102), INT8_C( 77),
119
- INT8_C( 123), INT8_C( 59), INT8_C( -35), INT8_C( -90),
120
- INT8_C( 117), INT8_C( 11), INT8_C( -39), INT8_C(-114)) },
121
- { simde_mm_set_epi8(INT8_C( 53), INT8_C( -97), INT8_C( 79), INT8_C( -93),
122
- INT8_C( 55), INT8_C(-115), INT8_C( -80), INT8_C( -27),
123
- INT8_C( 104), INT8_C( 109), INT8_C( -16), INT8_C( -75),
124
- INT8_C( 125), INT8_C( 6), INT8_C( 38), INT8_C( -55)),
125
- simde_mm_set_epi8(INT8_C( 48), INT8_C( 25), INT8_C( 24), INT8_C( -17),
126
- INT8_C(-102), INT8_C( -66), INT8_C( -6), INT8_C( 22),
127
- INT8_C(-100), INT8_C( -56), INT8_C( 25), INT8_C( -26),
128
- INT8_C( -37), INT8_C( 49), INT8_C( 8), INT8_C( -6)),
129
- simde_mm_set_epi8(INT8_C(-114), INT8_C( 27), INT8_C( -68), INT8_C( 3),
130
- INT8_C( 88), INT8_C( 71), INT8_C( 77), INT8_C( 108),
131
- INT8_C(-112), INT8_C( 117), INT8_C(-100), INT8_C( -26),
132
- INT8_C( 86), INT8_C( -48), INT8_C( -34), INT8_C( -71)),
133
- simde_mm_set_epi8(INT8_C( 48), INT8_C( -97), INT8_C( 24), INT8_C( -93),
134
- INT8_C( 55), INT8_C(-115), INT8_C( -80), INT8_C( -27),
135
- INT8_C(-100), INT8_C( 109), INT8_C( 25), INT8_C( -26),
136
- INT8_C( 125), INT8_C( 49), INT8_C( 8), INT8_C( -6)) },
137
- { simde_mm_set_epi8(INT8_C(-121), INT8_C( 29), INT8_C( -87), INT8_C( 80),
138
- INT8_C( 19), INT8_C( 64), INT8_C( 104), INT8_C( 67),
139
- INT8_C( -22), INT8_C( -16), INT8_C( -57), INT8_C( -78),
140
- INT8_C( -96), INT8_C(-113), INT8_C( 114), INT8_C( 15)),
141
- simde_mm_set_epi8(INT8_C( 99), INT8_C( -98), INT8_C( 122), INT8_C( 119),
142
- INT8_C( 80), INT8_C( -87), INT8_C( -77), INT8_C( -36),
143
- INT8_C( 10), INT8_C( 99), INT8_C( 114), INT8_C( -46),
144
- INT8_C( -79), INT8_C( -58), INT8_C( -87), INT8_C( 106)),
145
- simde_mm_set_epi8(INT8_C( -96), INT8_C( 67), INT8_C( -85), INT8_C( 80),
146
- INT8_C( 107), INT8_C( 9), INT8_C( 20), INT8_C( 91),
147
- INT8_C( -58), INT8_C( -6), INT8_C( 120), INT8_C( -24),
148
- INT8_C( 26), INT8_C( -94), INT8_C( -17), INT8_C( 25)),
149
- simde_mm_set_epi8(INT8_C( 99), INT8_C( 29), INT8_C( 122), INT8_C( 80),
150
- INT8_C( 19), INT8_C( 64), INT8_C( 104), INT8_C( 67),
151
- INT8_C( 10), INT8_C( 99), INT8_C( -57), INT8_C( -46),
152
- INT8_C( -96), INT8_C( -58), INT8_C( -87), INT8_C( 15)) },
153
- { simde_mm_set_epi8(INT8_C( -13), INT8_C( 28), INT8_C( -62), INT8_C( 108),
154
- INT8_C( -15), INT8_C( 17), INT8_C( -48), INT8_C( 13),
155
- INT8_C( 32), INT8_C( -56), INT8_C( 83), INT8_C( -65),
156
- INT8_C( 73), INT8_C(-114), INT8_C( 47), INT8_C( 99)),
157
- simde_mm_set_epi8(INT8_C( 84), INT8_C( -32), INT8_C( -4), INT8_C( 8),
158
- INT8_C( 66), INT8_C( -71), INT8_C( -69), INT8_C( -41),
159
- INT8_C( -21), INT8_C( -40), INT8_C( 64), INT8_C( -47),
160
- INT8_C( 16), INT8_C( -61), INT8_C( 3), INT8_C( -15)),
161
- simde_mm_set_epi8(INT8_C( 27), INT8_C( 104), INT8_C( -26), INT8_C( -51),
162
- INT8_C( 114), INT8_C( -9), INT8_C( -56), INT8_C( 125),
163
- INT8_C( 41), INT8_C( -51), INT8_C( 26), INT8_C( 121),
164
- INT8_C( -16), INT8_C( -59), INT8_C( 93), INT8_C( -56)),
165
- simde_mm_set_epi8(INT8_C( -13), INT8_C( 28), INT8_C( -4), INT8_C( 8),
166
- INT8_C( -15), INT8_C( -71), INT8_C( -69), INT8_C( 13),
167
- INT8_C( 32), INT8_C( -40), INT8_C( 83), INT8_C( -65),
168
- INT8_C( 16), INT8_C( -61), INT8_C( 47), INT8_C( -15)) }
169
- };
170
-
171
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
172
- simde__m128i r = simde_mm_blendv_epi8(test_vec[i].a, test_vec[i].b, test_vec[i].mask);
173
- simde_assert_m128i_i8(r, ==, test_vec[i].r);
174
- }
175
-
176
- return MUNIT_OK;
177
- }
178
-
179
- static MunitResult
180
- test_simde_x_mm_blendv_epi16(const MunitParameter params[], void* data) {
181
- (void) params;
182
- (void) data;
183
-
184
- const struct {
185
- simde__m128i a;
186
- simde__m128i b;
187
- simde__m128i mask;
188
- simde__m128i r;
189
- } test_vec[8] = {
190
- { simde_mm_set_epi16(INT16_C( -5889), INT16_C( -9240), INT16_C( 13406), INT16_C( 23197),
191
- INT16_C( 25390), INT16_C( 20613), INT16_C( -3211), INT16_C( -5281)),
192
- simde_mm_set_epi16(INT16_C( -5787), INT16_C( 260), INT16_C(-28529), INT16_C( -341),
193
- INT16_C( 26074), INT16_C(-30339), INT16_C( -9562), INT16_C( -4010)),
194
- simde_mm_set_epi16(INT16_C( 11580), INT16_C(-26297), INT16_C( 8234), INT16_C( -6769),
195
- INT16_C( -3010), INT16_C( 26987), INT16_C( 26235), INT16_C(-23439)),
196
- simde_mm_set_epi16(INT16_C( -5889), INT16_C( 260), INT16_C( 13406), INT16_C( -341),
197
- INT16_C( 26074), INT16_C( 20613), INT16_C( -3211), INT16_C( -4010)) },
198
- { simde_mm_set_epi16(INT16_C(-10477), INT16_C( 1551), INT16_C(-16362), INT16_C(-15016),
199
- INT16_C( -3374), INT16_C(-19084), INT16_C( -221), INT16_C(-19089)),
200
- simde_mm_set_epi16(INT16_C( 8603), INT16_C( 8519), INT16_C( 4642), INT16_C( 1129),
201
- INT16_C( 6053), INT16_C( 28257), INT16_C( 10987), INT16_C(-17611)),
202
- simde_mm_set_epi16(INT16_C(-14703), INT16_C( 23402), INT16_C( -5363), INT16_C( 25451),
203
- INT16_C( 4787), INT16_C( 6143), INT16_C( -8049), INT16_C(-25291)),
204
- simde_mm_set_epi16(INT16_C( 8603), INT16_C( 1551), INT16_C( 4642), INT16_C(-15016),
205
- INT16_C( -3374), INT16_C(-19084), INT16_C( 10987), INT16_C(-17611)) },
206
- { simde_mm_set_epi16(INT16_C(-10958), INT16_C( 239), INT16_C(-29416), INT16_C( 25642),
207
- INT16_C(-31255), INT16_C( 18557), INT16_C( 17603), INT16_C( 9411)),
208
- simde_mm_set_epi16(INT16_C(-22204), INT16_C(-12104), INT16_C( 21385), INT16_C( 163),
209
- INT16_C(-13806), INT16_C( -4673), INT16_C(-31502), INT16_C( 30113)),
210
- simde_mm_set_epi16(INT16_C( 26590), INT16_C(-27173), INT16_C( 3052), INT16_C( 29423),
211
- INT16_C( 14159), INT16_C( 16581), INT16_C( 15114), INT16_C( 31350)),
212
- simde_mm_set_epi16(INT16_C(-10958), INT16_C(-12104), INT16_C(-29416), INT16_C( 25642),
213
- INT16_C(-31255), INT16_C( 18557), INT16_C( 17603), INT16_C( 9411)) },
214
- { simde_mm_set_epi16(INT16_C( -8795), INT16_C(-24496), INT16_C(-21018), INT16_C(-23768),
215
- INT16_C( 25939), INT16_C( -2265), INT16_C( 13801), INT16_C( 28390)),
216
- simde_mm_set_epi16(INT16_C(-31776), INT16_C( 7886), INT16_C( 19773), INT16_C( 11337),
217
- INT16_C( -9683), INT16_C(-15212), INT16_C(-11745), INT16_C(-21367)),
218
- simde_mm_set_epi16(INT16_C(-30437), INT16_C( -4024), INT16_C(-15989), INT16_C( -4852),
219
- INT16_C( 20067), INT16_C( 28092), INT16_C(-20772), INT16_C( 17444)),
220
- simde_mm_set_epi16(INT16_C(-31776), INT16_C( 7886), INT16_C( 19773), INT16_C( 11337),
221
- INT16_C( 25939), INT16_C( -2265), INT16_C(-11745), INT16_C( 28390)) },
222
- { simde_mm_set_epi16(INT16_C( 11712), INT16_C( 21433), INT16_C( -1195), INT16_C( 25259),
223
- INT16_C( 18957), INT16_C( 5262), INT16_C( -9688), INT16_C(-14506)),
224
- simde_mm_set_epi16(INT16_C( 24574), INT16_C( 2777), INT16_C(-18691), INT16_C( 4928),
225
- INT16_C( 32122), INT16_C(-10541), INT16_C( 2746), INT16_C( 8282)),
226
- simde_mm_set_epi16(INT16_C( 5301), INT16_C( 12242), INT16_C( 18664), INT16_C( 26110),
227
- INT16_C(-14367), INT16_C( -9137), INT16_C( -7209), INT16_C( 24768)),
228
- simde_mm_set_epi16(INT16_C( 11712), INT16_C( 21433), INT16_C( -1195), INT16_C( 25259),
229
- INT16_C( 32122), INT16_C(-10541), INT16_C( 2746), INT16_C(-14506)) },
230
- { simde_mm_set_epi16(INT16_C(-20542), INT16_C( 3332), INT16_C( 24354), INT16_C(-23695),
231
- INT16_C(-10493), INT16_C( 32452), INT16_C(-26923), INT16_C( 16579)),
232
- simde_mm_set_epi16(INT16_C( 29156), INT16_C( 8347), INT16_C(-32604), INT16_C(-24707),
233
- INT16_C(-20393), INT16_C(-18566), INT16_C( 17032), INT16_C(-18520)),
234
- simde_mm_set_epi16(INT16_C(-23886), INT16_C( 30820), INT16_C( 12721), INT16_C(-28893),
235
- INT16_C( -7688), INT16_C( 11154), INT16_C(-11967), INT16_C( 31969)),
236
- simde_mm_set_epi16(INT16_C( 29156), INT16_C( 3332), INT16_C( 24354), INT16_C(-24707),
237
- INT16_C(-20393), INT16_C( 32452), INT16_C( 17032), INT16_C( 16579)) },
238
- { simde_mm_set_epi16(INT16_C( 22583), INT16_C( 4415), INT16_C(-24878), INT16_C(-15401),
239
- INT16_C(-29840), INT16_C(-16999), INT16_C(-23406), INT16_C(-32259)),
240
- simde_mm_set_epi16(INT16_C( 31553), INT16_C( 23166), INT16_C(-15560), INT16_C( 31886),
241
- INT16_C( 7368), INT16_C(-15822), INT16_C(-17797), INT16_C( 1487)),
242
- simde_mm_set_epi16(INT16_C(-12147), INT16_C( 2989), INT16_C(-24661), INT16_C(-22664),
243
- INT16_C(-16476), INT16_C( 408), INT16_C(-13750), INT16_C(-15888)),
244
- simde_mm_set_epi16(INT16_C( 31553), INT16_C( 4415), INT16_C(-15560), INT16_C( 31886),
245
- INT16_C( 7368), INT16_C(-16999), INT16_C(-17797), INT16_C( 1487)) },
246
- { simde_mm_set_epi16(INT16_C( 32299), INT16_C( 7492), INT16_C( 26066), INT16_C( 30675),
247
- INT16_C( 26958), INT16_C( 8712), INT16_C(-17582), INT16_C(-18062)),
248
- simde_mm_set_epi16(INT16_C( 25592), INT16_C( 2248), INT16_C(-21774), INT16_C( 7511),
249
- INT16_C( 6101), INT16_C( 18791), INT16_C(-31731), INT16_C( 22067)),
250
- simde_mm_set_epi16(INT16_C(-26320), INT16_C( 16537), INT16_C(-11326), INT16_C( 8393),
251
- INT16_C(-25832), INT16_C( 24810), INT16_C(-17206), INT16_C(-26982)),
252
- simde_mm_set_epi16(INT16_C( 25592), INT16_C( 7492), INT16_C(-21774), INT16_C( 30675),
253
- INT16_C( 6101), INT16_C( 8712), INT16_C(-31731), INT16_C( 22067)) }
254
- };
255
-
256
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
257
- simde__m128i r = simde_x_mm_blendv_epi16(test_vec[i].a, test_vec[i].b, test_vec[i].mask);
258
- simde_assert_m128i_i16(r, ==, test_vec[i].r);
259
- }
260
-
261
- return MUNIT_OK;
262
- }
263
-
264
- static MunitResult
265
- test_simde_x_mm_blendv_epi32(const MunitParameter params[], void* data) {
266
- (void) params;
267
- (void) data;
268
-
269
- const struct {
270
- simde__m128i a;
271
- simde__m128i b;
272
- simde__m128i mask;
273
- simde__m128i r;
274
- } test_vec[8] = {
275
- { simde_mm_set_epi32(INT32_C( -385885208), INT32_C( 878598813), INT32_C( 1663979653), INT32_C( -210375841)),
276
- simde_mm_set_epi32(INT32_C( -379256572), INT32_C(-1869611349), INT32_C( 1708820861), INT32_C( -626593706)),
277
- simde_mm_set_epi32(INT32_C( 758946119), INT32_C( 539682191), INT32_C( -197236373), INT32_C( 1719379057)),
278
- simde_mm_set_epi32(INT32_C( -385885208), INT32_C( 878598813), INT32_C( 1708820861), INT32_C( -210375841)) },
279
- { simde_mm_set_epi32(INT32_C( -686619121), INT32_C(-1072249512), INT32_C( -221072012), INT32_C( -14437009)),
280
- simde_mm_set_epi32(INT32_C( 563814727), INT32_C( 304219241), INT32_C( 396717665), INT32_C( 720091957)),
281
- simde_mm_set_epi32(INT32_C( -963552406), INT32_C( -351444117), INT32_C( 313726975), INT32_C( -527459019)),
282
- simde_mm_set_epi32(INT32_C( 563814727), INT32_C( 304219241), INT32_C( -221072012), INT32_C( 720091957)) },
283
- { simde_mm_set_epi32(INT32_C( -718143249), INT32_C(-1927781334), INT32_C(-2048309123), INT32_C( 1153639619)),
284
- simde_mm_set_epi32(INT32_C(-1455107912), INT32_C( 1401487523), INT32_C( -904729153), INT32_C(-2064484959)),
285
- simde_mm_set_epi32(INT32_C( 1742640603), INT32_C( 200045295), INT32_C( 927940805), INT32_C( 990542454)),
286
- simde_mm_set_epi32(INT32_C( -718143249), INT32_C(-1927781334), INT32_C(-2048309123), INT32_C( 1153639619)) },
287
- { simde_mm_set_epi32(INT32_C( -576348080), INT32_C(-1377393880), INT32_C( 1700001575), INT32_C( 904490726)),
288
- simde_mm_set_epi32(INT32_C(-2082464050), INT32_C( 1295854665), INT32_C( -634534764), INT32_C( -769676151)),
289
- simde_mm_set_epi32(INT32_C(-1994657720), INT32_C(-1047794420), INT32_C( 1315139004), INT32_C(-1361296348)),
290
- simde_mm_set_epi32(INT32_C(-2082464050), INT32_C( 1295854665), INT32_C( 1700001575), INT32_C( -769676151)) },
291
- { simde_mm_set_epi32(INT32_C( 767579065), INT32_C( -78290261), INT32_C( 1242371214), INT32_C( -634861738)),
292
- simde_mm_set_epi32(INT32_C( 1610484441), INT32_C(-1224928448), INT32_C( 2105202387), INT32_C( 179970138)),
293
- simde_mm_set_epi32(INT32_C( 347418578), INT32_C( 1223190014), INT32_C( -941499313), INT32_C( -472424256)),
294
- simde_mm_set_epi32(INT32_C( 767579065), INT32_C( -78290261), INT32_C( 2105202387), INT32_C( 179970138)) },
295
- { simde_mm_set_epi32(INT32_C(-1346237180), INT32_C( 1596105585), INT32_C( -687636796), INT32_C(-1764409149)),
296
- simde_mm_set_epi32(INT32_C( 1910775963), INT32_C(-2136694915), INT32_C(-1336428678), INT32_C( 1116256168)),
297
- simde_mm_set_epi32(INT32_C(-1565362076), INT32_C( 833720099), INT32_C( -503829614), INT32_C( -784237343)),
298
- simde_mm_set_epi32(INT32_C( 1910775963), INT32_C( 1596105585), INT32_C(-1336428678), INT32_C( 1116256168)) },
299
- { simde_mm_set_epi32(INT32_C( 1480003903), INT32_C(-1630354473), INT32_C(-1955545703), INT32_C(-1533902339)),
300
- simde_mm_set_epi32(INT32_C( 2067880574), INT32_C(-1019708274), INT32_C( 482918962), INT32_C(-1166342705)),
301
- simde_mm_set_epi32(INT32_C( -796062803), INT32_C(-1616140424), INT32_C(-1079770728), INT32_C( -901070352)),
302
- simde_mm_set_epi32(INT32_C( 2067880574), INT32_C(-1019708274), INT32_C( 482918962), INT32_C(-1166342705)) },
303
- { simde_mm_set_epi32(INT32_C( 2116754756), INT32_C( 1708292051), INT32_C( 1766728200), INT32_C(-1152206478)),
304
- simde_mm_set_epi32(INT32_C( 1677199560), INT32_C(-1426973353), INT32_C( 399853927), INT32_C(-2079500749)),
305
- simde_mm_set_epi32(INT32_C(-1724890983), INT32_C( -742252343), INT32_C(-1692901142), INT32_C(-1127573862)),
306
- simde_mm_set_epi32(INT32_C( 1677199560), INT32_C(-1426973353), INT32_C( 399853927), INT32_C(-2079500749)) }
307
- };
308
-
309
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
310
- simde__m128i r = simde_x_mm_blendv_epi32(test_vec[i].a, test_vec[i].b, test_vec[i].mask);
311
- simde_assert_m128i_i32(r, ==, test_vec[i].r);
312
- }
313
-
314
- return MUNIT_OK;
315
- }
316
-
317
- static MunitResult
318
- test_simde_x_mm_blendv_epi64(const MunitParameter params[], void* data) {
319
- (void) params;
320
- (void) data;
321
-
322
- const struct {
323
- simde__m128i a;
324
- simde__m128i b;
325
- simde__m128i mask;
326
- simde__m128i r;
327
- } test_vec[8] = {
328
- { simde_mm_set_epi64x(INT64_C(-1657364347491558755), INT64_C( 7146738194929019743)),
329
- simde_mm_set_epi64x(INT64_C(-1628894571107713365), INT64_C( 7339329716385935446)),
330
- simde_mm_set_epi64x(INT64_C( 3259648761070806415), INT64_C( -847123769897278351)),
331
- simde_mm_set_epi64x(INT64_C(-1657364347491558755), INT64_C( 7339329716385935446)) },
332
- { simde_mm_set_epi64x(INT64_C(-2949006666280549032), INT64_C( -949497057320389265)),
333
- simde_mm_set_epi64x(INT64_C( 2421565813772387433), INT64_C( 1703889397640575797)),
334
- simde_mm_set_epi64x(INT64_C(-4138426067808590997), INT64_C( 1347447101265517877)),
335
- simde_mm_set_epi64x(INT64_C( 2421565813772387433), INT64_C( -949497057320389265)) },
336
- { simde_mm_set_epi64x(INT64_C(-3084401765930998742), INT64_C(-8797420694229801789)),
337
- simde_mm_set_epi64x(INT64_C(-6249640892789358429), INT64_C(-3885782121642297951)),
338
- simde_mm_set_epi64x(INT64_C( 7484584398766764783), INT64_C( 3985475411089455734)),
339
- simde_mm_set_epi64x(INT64_C(-3084401765930998742), INT64_C(-8797420694229801789)) },
340
- { simde_mm_set_epi64x(INT64_C(-2475396151794818264), INT64_C( 7301451168677981926)),
341
- simde_mm_set_epi64x(INT64_C(-8944114988549854135), INT64_C(-2725306056029786999)),
342
- simde_mm_set_epi64x(INT64_C(-8566989670866752244), INT64_C( 5648479014807684132)),
343
- simde_mm_set_epi64x(INT64_C(-8944114988549854135), INT64_C( 7301451168677981926)) },
344
- { simde_mm_set_epi64x(INT64_C( 3296726985485935275), INT64_C( 5335943737281922902)),
345
- simde_mm_set_epi64x(INT64_C( 6916978007881880384), INT64_C( 9041775403806105690)),
346
- simde_mm_set_epi64x(INT64_C( 1492151431756015102), INT64_C(-4043708754718924608)),
347
- simde_mm_set_epi64x(INT64_C( 3296726985485935275), INT64_C( 9041775403806105690)) },
348
- { simde_mm_set_epi64x(INT64_C(-5782044659163159695), INT64_C(-2953377547815665469)),
349
- simde_mm_set_epi64x(INT64_C( 8206720273226178429), INT64_C(-5739917464330258520)),
350
- simde_mm_set_epi64x(INT64_C(-6723178921984946397), INT64_C(-2163931711375573791)),
351
- simde_mm_set_epi64x(INT64_C( 8206720273226178429), INT64_C(-5739917464330258520)) },
352
- { simde_mm_set_epi64x(INT64_C( 6356568364001969111), INT64_C(-8399004837457264131)),
353
- simde_mm_set_epi64x(INT64_C( 8881479440638966926), INT64_C( 2074121151536891343)),
354
- simde_mm_set_epi64x(INT64_C(-3419063701768263816), INT64_C(-4637579960544214544)),
355
- simde_mm_set_epi64x(INT64_C( 8881479440638966926), INT64_C( 2074121151536891343)) },
356
- { simde_mm_set_epi64x(INT64_C( 9091392452380751827), INT64_C( 7588039843063708018)),
357
- simde_mm_set_epi64x(INT64_C( 7203517261933583703), INT64_C( 1717359541857637939)),
358
- simde_mm_set_epi64x(INT64_C(-7408350357597577015), INT64_C(-7270955037083658598)),
359
- simde_mm_set_epi64x(INT64_C( 7203517261933583703), INT64_C( 1717359541857637939)) }
360
- };
361
-
362
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
363
- simde__m128i r = simde_x_mm_blendv_epi64(test_vec[i].a, test_vec[i].b, test_vec[i].mask);
364
- simde_assert_m128i_i64(r, ==, test_vec[i].r);
365
- }
366
-
367
- return MUNIT_OK;
368
- }
369
-
370
- static MunitResult
371
- test_simde_mm_blend_epi16(const MunitParameter params[], void* data) {
372
- (void) params;
373
- (void) data;
374
-
375
- const struct {
376
- simde__m128i a;
377
- simde__m128i b;
378
- simde__m128i r;
379
- } test_vec[8] = {
380
- { simde_mm_set_epi16(INT16_C( 13825), INT16_C(-17802), INT16_C( -1598), INT16_C( 25326),
381
- INT16_C( 14943), INT16_C( -8227), INT16_C( 21745), INT16_C( 9989)),
382
- simde_mm_set_epi16(INT16_C(-11058), INT16_C( 4192), INT16_C(-28252), INT16_C( 10795),
383
- INT16_C( 19700), INT16_C( 29704), INT16_C( -7052), INT16_C( 16432)),
384
- simde_mm_set_epi16(INT16_C( 13825), INT16_C(-17802), INT16_C( -1598), INT16_C( 25326),
385
- INT16_C( 14943), INT16_C( -8227), INT16_C( -7052), INT16_C( 16432)) },
386
- { simde_mm_set_epi16(INT16_C(-17914), INT16_C(-32103), INT16_C( 17164), INT16_C( -187),
387
- INT16_C( 21942), INT16_C(-25306), INT16_C( -7849), INT16_C(-11297)),
388
- simde_mm_set_epi16(INT16_C( -9027), INT16_C(-14363), INT16_C( 16126), INT16_C( 30921),
389
- INT16_C( 3730), INT16_C(-20492), INT16_C( -5510), INT16_C( 32723)),
390
- simde_mm_set_epi16(INT16_C(-17914), INT16_C(-32103), INT16_C( 17164), INT16_C( -187),
391
- INT16_C( 21942), INT16_C(-25306), INT16_C( -5510), INT16_C( 32723)) },
392
- { simde_mm_set_epi16(INT16_C(-25152), INT16_C( 30665), INT16_C( 26270), INT16_C( 23820),
393
- INT16_C(-24322), INT16_C( 706), INT16_C(-26336), INT16_C(-13296)),
394
- simde_mm_set_epi16(INT16_C(-24671), INT16_C(-19680), INT16_C( 10653), INT16_C( -9500),
395
- INT16_C(-16899), INT16_C( 495), INT16_C( 26780), INT16_C(-11315)),
396
- simde_mm_set_epi16(INT16_C(-25152), INT16_C( 30665), INT16_C( 26270), INT16_C( 23820),
397
- INT16_C(-24322), INT16_C( 706), INT16_C( 26780), INT16_C(-11315)) },
398
- { simde_mm_set_epi16(INT16_C( 20562), INT16_C(-19834), INT16_C( 5180), INT16_C( -5117),
399
- INT16_C( 16168), INT16_C( 23520), INT16_C(-16838), INT16_C( 28892)),
400
- simde_mm_set_epi16(INT16_C( 2860), INT16_C( -6670), INT16_C(-25365), INT16_C( -4954),
401
- INT16_C( 30912), INT16_C( 6045), INT16_C( 2749), INT16_C( 4401)),
402
- simde_mm_set_epi16(INT16_C( 20562), INT16_C(-19834), INT16_C( 5180), INT16_C( -5117),
403
- INT16_C( 16168), INT16_C( 23520), INT16_C( 2749), INT16_C( 4401)) },
404
- { simde_mm_set_epi16(INT16_C( 25997), INT16_C( -1860), INT16_C( -9126), INT16_C( 12214),
405
- INT16_C( 7159), INT16_C( -2303), INT16_C( 7182), INT16_C(-20779)),
406
- simde_mm_set_epi16(INT16_C( -7432), INT16_C( 954), INT16_C(-26453), INT16_C( -2062),
407
- INT16_C( 14984), INT16_C( -7563), INT16_C( 13369), INT16_C( -4134)),
408
- simde_mm_set_epi16(INT16_C( 25997), INT16_C( -1860), INT16_C( -9126), INT16_C( 12214),
409
- INT16_C( 7159), INT16_C( -2303), INT16_C( 13369), INT16_C( -4134)) },
410
- { simde_mm_set_epi16(INT16_C( -6104), INT16_C(-18564), INT16_C( 5298), INT16_C( -6001),
411
- INT16_C( -6122), INT16_C( 14804), INT16_C(-32440), INT16_C(-10960)),
412
- simde_mm_set_epi16(INT16_C( 8197), INT16_C( 14220), INT16_C(-10924), INT16_C( 17196),
413
- INT16_C( 21768), INT16_C( 7639), INT16_C( -4935), INT16_C( -993)),
414
- simde_mm_set_epi16(INT16_C( -6104), INT16_C(-18564), INT16_C( 5298), INT16_C( -6001),
415
- INT16_C( -6122), INT16_C( 14804), INT16_C( -4935), INT16_C( -993)) },
416
- { simde_mm_set_epi16(INT16_C( 6003), INT16_C( -5880), INT16_C( 31967), INT16_C(-28984),
417
- INT16_C( -9503), INT16_C( 30320), INT16_C(-19146), INT16_C( 32146)),
418
- simde_mm_set_epi16(INT16_C( 4317), INT16_C( 22644), INT16_C(-25807), INT16_C(-30524),
419
- INT16_C( 223), INT16_C( -7098), INT16_C( 9867), INT16_C( -9190)),
420
- simde_mm_set_epi16(INT16_C( 6003), INT16_C( -5880), INT16_C( 31967), INT16_C(-28984),
421
- INT16_C( -9503), INT16_C( 30320), INT16_C( 9867), INT16_C( -9190)) },
422
- { simde_mm_set_epi16(INT16_C( 12033), INT16_C( 14639), INT16_C( 28420), INT16_C( 14334),
423
- INT16_C( -3029), INT16_C(-20328), INT16_C( 8988), INT16_C( 23547)),
424
- simde_mm_set_epi16(INT16_C( 9966), INT16_C(-21867), INT16_C( 738), INT16_C(-29688),
425
- INT16_C( 9349), INT16_C( 2360), INT16_C(-12771), INT16_C(-15402)),
426
- simde_mm_set_epi16(INT16_C( 12033), INT16_C( 14639), INT16_C( 28420), INT16_C( 14334),
427
- INT16_C( -3029), INT16_C(-20328), INT16_C(-12771), INT16_C(-15402)) }
428
- };
429
-
430
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
431
- simde__m128i r = simde_mm_blend_epi16(test_vec[i].a, test_vec[i].b, 3);
432
- simde_assert_m128i_i16(r, ==, test_vec[i].r);
433
- }
434
-
435
- return MUNIT_OK;
436
- }
437
-
438
- static MunitResult
439
- test_simde_mm_blend_pd(const MunitParameter params[], void* data) {
440
- (void) params;
441
- (void) data;
442
-
443
- const struct {
444
- simde__m128d a;
445
- simde__m128d b;
446
- simde__m128d r;
447
- } test_vec[8] = {
448
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 307.09), SIMDE_FLOAT64_C( -991.93)),
449
- simde_mm_set_pd(SIMDE_FLOAT64_C( -252.92), SIMDE_FLOAT64_C( -56.61)),
450
- simde_mm_set_pd(SIMDE_FLOAT64_C( 307.09), SIMDE_FLOAT64_C( -56.61)) },
451
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 263.25), SIMDE_FLOAT64_C( 576.67)),
452
- simde_mm_set_pd(SIMDE_FLOAT64_C( -398.47), SIMDE_FLOAT64_C( -845.00)),
453
- simde_mm_set_pd(SIMDE_FLOAT64_C( 263.25), SIMDE_FLOAT64_C( -845.00)) },
454
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -156.21), SIMDE_FLOAT64_C( 805.98)),
455
- simde_mm_set_pd(SIMDE_FLOAT64_C( -712.32), SIMDE_FLOAT64_C( -557.85)),
456
- simde_mm_set_pd(SIMDE_FLOAT64_C( -156.21), SIMDE_FLOAT64_C( -557.85)) },
457
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 191.78), SIMDE_FLOAT64_C( -309.61)),
458
- simde_mm_set_pd(SIMDE_FLOAT64_C( -997.82), SIMDE_FLOAT64_C( -493.58)),
459
- simde_mm_set_pd(SIMDE_FLOAT64_C( 191.78), SIMDE_FLOAT64_C( -493.58)) },
460
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -933.58), SIMDE_FLOAT64_C( -486.36)),
461
- simde_mm_set_pd(SIMDE_FLOAT64_C( 880.67), SIMDE_FLOAT64_C( 791.10)),
462
- simde_mm_set_pd(SIMDE_FLOAT64_C( -933.58), SIMDE_FLOAT64_C( 791.10)) },
463
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 45.45), SIMDE_FLOAT64_C( -436.38)),
464
- simde_mm_set_pd(SIMDE_FLOAT64_C( 211.82), SIMDE_FLOAT64_C( 653.98)),
465
- simde_mm_set_pd(SIMDE_FLOAT64_C( 45.45), SIMDE_FLOAT64_C( 653.98)) },
466
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 915.51), SIMDE_FLOAT64_C( -445.43)),
467
- simde_mm_set_pd(SIMDE_FLOAT64_C( -69.14), SIMDE_FLOAT64_C( -345.82)),
468
- simde_mm_set_pd(SIMDE_FLOAT64_C( 915.51), SIMDE_FLOAT64_C( -345.82)) },
469
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -603.21), SIMDE_FLOAT64_C( -182.69)),
470
- simde_mm_set_pd(SIMDE_FLOAT64_C( -463.45), SIMDE_FLOAT64_C( 929.21)),
471
- simde_mm_set_pd(SIMDE_FLOAT64_C( -603.21), SIMDE_FLOAT64_C( 929.21)) }
472
- };
473
-
474
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
475
- simde__m128d r = simde_mm_blend_pd(test_vec[i].a, test_vec[i].b, 1);
476
- simde_assert_m128d_close(r, test_vec[i].r, 1);
477
- }
478
-
479
- return MUNIT_OK;
480
- }
481
-
482
- static MunitResult
483
- test_simde_mm_blend_ps(const MunitParameter params[], void* data) {
484
- (void) params;
485
- (void) data;
486
-
487
- const struct {
488
- simde__m128 a;
489
- simde__m128 b;
490
- simde__m128 r;
491
- } test_vec[8] = {
492
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 263.25), SIMDE_FLOAT32_C( 576.67), SIMDE_FLOAT32_C( 307.09), SIMDE_FLOAT32_C( -991.93)),
493
- simde_mm_set_ps(SIMDE_FLOAT32_C( -398.47), SIMDE_FLOAT32_C( -845.00), SIMDE_FLOAT32_C( -252.92), SIMDE_FLOAT32_C( -56.61)),
494
- simde_mm_set_ps(SIMDE_FLOAT32_C( 263.25), SIMDE_FLOAT32_C( 576.67), SIMDE_FLOAT32_C( -252.92), SIMDE_FLOAT32_C( -991.93)) },
495
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 191.78), SIMDE_FLOAT32_C( -309.61), SIMDE_FLOAT32_C( -156.21), SIMDE_FLOAT32_C( 805.98)),
496
- simde_mm_set_ps(SIMDE_FLOAT32_C( -997.82), SIMDE_FLOAT32_C( -493.58), SIMDE_FLOAT32_C( -712.32), SIMDE_FLOAT32_C( -557.85)),
497
- simde_mm_set_ps(SIMDE_FLOAT32_C( 191.78), SIMDE_FLOAT32_C( -309.61), SIMDE_FLOAT32_C( -712.32), SIMDE_FLOAT32_C( 805.98)) },
498
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 45.45), SIMDE_FLOAT32_C( -436.38), SIMDE_FLOAT32_C( -933.58), SIMDE_FLOAT32_C( -486.36)),
499
- simde_mm_set_ps(SIMDE_FLOAT32_C( 211.82), SIMDE_FLOAT32_C( 653.98), SIMDE_FLOAT32_C( 880.67), SIMDE_FLOAT32_C( 791.10)),
500
- simde_mm_set_ps(SIMDE_FLOAT32_C( 45.45), SIMDE_FLOAT32_C( -436.38), SIMDE_FLOAT32_C( 880.67), SIMDE_FLOAT32_C( -486.36)) },
501
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -603.21), SIMDE_FLOAT32_C( -182.69), SIMDE_FLOAT32_C( 915.51), SIMDE_FLOAT32_C( -445.43)),
502
- simde_mm_set_ps(SIMDE_FLOAT32_C( -463.45), SIMDE_FLOAT32_C( 929.21), SIMDE_FLOAT32_C( -69.14), SIMDE_FLOAT32_C( -345.82)),
503
- simde_mm_set_ps(SIMDE_FLOAT32_C( -603.21), SIMDE_FLOAT32_C( -182.69), SIMDE_FLOAT32_C( -69.14), SIMDE_FLOAT32_C( -445.43)) },
504
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 898.89), SIMDE_FLOAT32_C( -75.69), SIMDE_FLOAT32_C( 396.94), SIMDE_FLOAT32_C( -959.19)),
505
- simde_mm_set_ps(SIMDE_FLOAT32_C( -419.62), SIMDE_FLOAT32_C( -299.33), SIMDE_FLOAT32_C( -147.28), SIMDE_FLOAT32_C( -458.75)),
506
- simde_mm_set_ps(SIMDE_FLOAT32_C( 898.89), SIMDE_FLOAT32_C( -75.69), SIMDE_FLOAT32_C( -147.28), SIMDE_FLOAT32_C( -959.19)) },
507
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 480.97), SIMDE_FLOAT32_C( 316.97), SIMDE_FLOAT32_C( -700.74), SIMDE_FLOAT32_C( -81.35)),
508
- simde_mm_set_ps(SIMDE_FLOAT32_C( -930.08), SIMDE_FLOAT32_C( 58.79), SIMDE_FLOAT32_C( -729.84), SIMDE_FLOAT32_C( 572.31)),
509
- simde_mm_set_ps(SIMDE_FLOAT32_C( 480.97), SIMDE_FLOAT32_C( 316.97), SIMDE_FLOAT32_C( -729.84), SIMDE_FLOAT32_C( -81.35)) },
510
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -51.53), SIMDE_FLOAT32_C( 742.30), SIMDE_FLOAT32_C( 440.93), SIMDE_FLOAT32_C( -885.24)),
511
- simde_mm_set_ps(SIMDE_FLOAT32_C( 883.38), SIMDE_FLOAT32_C( -314.94), SIMDE_FLOAT32_C( -805.26), SIMDE_FLOAT32_C( 843.17)),
512
- simde_mm_set_ps(SIMDE_FLOAT32_C( -51.53), SIMDE_FLOAT32_C( 742.30), SIMDE_FLOAT32_C( -805.26), SIMDE_FLOAT32_C( -885.24)) },
513
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 812.23), SIMDE_FLOAT32_C( -335.37), SIMDE_FLOAT32_C( 369.92), SIMDE_FLOAT32_C( -137.19)),
514
- simde_mm_set_ps(SIMDE_FLOAT32_C( 119.89), SIMDE_FLOAT32_C( 901.62), SIMDE_FLOAT32_C( -234.15), SIMDE_FLOAT32_C( 494.86)),
515
- simde_mm_set_ps(SIMDE_FLOAT32_C( 812.23), SIMDE_FLOAT32_C( -335.37), SIMDE_FLOAT32_C( -234.15), SIMDE_FLOAT32_C( -137.19)) }
516
- };
517
-
518
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
519
- simde__m128 r = simde_mm_blend_ps(test_vec[i].a, test_vec[i].b, 2);
520
- simde_assert_m128_close(r, test_vec[i].r, 1);
521
- }
522
-
523
- return MUNIT_OK;
524
- }
525
-
526
- static MunitResult
527
- test_simde_mm_blendv_pd(const MunitParameter params[], void* data) {
528
- (void) params;
529
- (void) data;
530
-
531
- const struct {
532
- simde__m128d a;
533
- simde__m128d b;
534
- simde__m128i mask;
535
- simde__m128d r;
536
- } test_vec[8] = {
537
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 290.02), SIMDE_FLOAT64_C( -775.12)),
538
- simde_mm_set_pd(SIMDE_FLOAT64_C( 567.65), SIMDE_FLOAT64_C( 339.87)),
539
- simde_x_mm_set_epu64x(UINT64_C( 0), UINT64_C( 1)),
540
- simde_mm_set_pd(SIMDE_FLOAT64_C( 290.02), SIMDE_FLOAT64_C( -775.12)) },
541
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 702.24), SIMDE_FLOAT64_C( -371.99)),
542
- simde_mm_set_pd(SIMDE_FLOAT64_C( 899.02), SIMDE_FLOAT64_C( -664.73)),
543
- simde_x_mm_set_epu64x(UINT64_C( 1), UINT64_C( 1)),
544
- simde_mm_set_pd(SIMDE_FLOAT64_C( 702.24), SIMDE_FLOAT64_C( -371.99)) },
545
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 403.27), SIMDE_FLOAT64_C( -740.87)),
546
- simde_mm_set_pd(SIMDE_FLOAT64_C( 975.40), SIMDE_FLOAT64_C( -480.24)),
547
- simde_x_mm_set_epu64x(UINT64_C( 0), UINT64_C( 0)),
548
- simde_mm_set_pd(SIMDE_FLOAT64_C( 403.27), SIMDE_FLOAT64_C( -740.87)) },
549
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -417.67), SIMDE_FLOAT64_C( 711.92)),
550
- simde_mm_set_pd(SIMDE_FLOAT64_C( -897.21), SIMDE_FLOAT64_C( -402.59)),
551
- simde_x_mm_set_epu64x(UINT64_C( 1), UINT64_C( 0)),
552
- simde_mm_set_pd(SIMDE_FLOAT64_C( -417.67), SIMDE_FLOAT64_C( 711.92)) },
553
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 578.89), SIMDE_FLOAT64_C( -895.99)),
554
- simde_mm_set_pd(SIMDE_FLOAT64_C( -800.50), SIMDE_FLOAT64_C( -144.28)),
555
- simde_x_mm_set_epu64x(UINT64_C( 1), UINT64_C( 0)),
556
- simde_mm_set_pd(SIMDE_FLOAT64_C( 578.89), SIMDE_FLOAT64_C( -895.99)) },
557
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 546.78), SIMDE_FLOAT64_C( 883.57)),
558
- simde_mm_set_pd(SIMDE_FLOAT64_C( 415.01), SIMDE_FLOAT64_C( 773.21)),
559
- simde_x_mm_set_epu64x(UINT64_C( 1), UINT64_C( 0)),
560
- simde_mm_set_pd(SIMDE_FLOAT64_C( 546.78), SIMDE_FLOAT64_C( 883.57)) },
561
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 26.01), SIMDE_FLOAT64_C( -59.50)),
562
- simde_mm_set_pd(SIMDE_FLOAT64_C( -530.26), SIMDE_FLOAT64_C( 580.89)),
563
- simde_x_mm_set_epu64x(UINT64_C( 0), UINT64_C( 1)),
564
- simde_mm_set_pd(SIMDE_FLOAT64_C( 26.01), SIMDE_FLOAT64_C( -59.50)) },
565
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -344.22), SIMDE_FLOAT64_C( 626.91)),
566
- simde_mm_set_pd(SIMDE_FLOAT64_C( 752.48), SIMDE_FLOAT64_C( 453.28)),
567
- simde_x_mm_set_epu64x(UINT64_C( 0), UINT64_C( 1)),
568
- simde_mm_set_pd(SIMDE_FLOAT64_C( -344.22), SIMDE_FLOAT64_C( 626.91)) }
569
- };
570
-
571
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
572
- simde__m128d r = simde_mm_blendv_pd(test_vec[i].a, test_vec[i].b, simde_mm_castsi128_pd(test_vec[i].mask));
573
- simde_assert_m128d_close(r, test_vec[i].r, 1);
574
- }
575
-
576
- return MUNIT_OK;
577
- }
578
-
579
- static MunitResult
580
- test_simde_mm_blendv_ps(const MunitParameter params[], void* data) {
581
- (void) params;
582
- (void) data;
583
-
584
- const struct {
585
- simde__m128 a;
586
- simde__m128 b;
587
- simde__m128i mask;
588
- simde__m128 r;
589
- } test_vec[8] = {
590
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -155.18), SIMDE_FLOAT32_C( -698.08), SIMDE_FLOAT32_C( -535.18), SIMDE_FLOAT32_C( -144.32)),
591
- simde_mm_set_ps(SIMDE_FLOAT32_C( -362.54), SIMDE_FLOAT32_C( -779.39), SIMDE_FLOAT32_C( 825.01), SIMDE_FLOAT32_C( -777.93)),
592
- simde_x_mm_set_epu32(UINT32_C( 1), UINT32_C( 0), UINT32_C( 1), UINT32_C( 0)),
593
- simde_mm_set_ps(SIMDE_FLOAT32_C( -155.18), SIMDE_FLOAT32_C( -698.08), SIMDE_FLOAT32_C( -535.18), SIMDE_FLOAT32_C( -144.32)) },
594
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -284.42), SIMDE_FLOAT32_C( 692.24), SIMDE_FLOAT32_C( 101.85), SIMDE_FLOAT32_C( -819.28)),
595
- simde_mm_set_ps(SIMDE_FLOAT32_C( 327.10), SIMDE_FLOAT32_C( 184.40), SIMDE_FLOAT32_C( 440.54), SIMDE_FLOAT32_C( 732.07)),
596
- simde_x_mm_set_epu32(UINT32_C( 0), UINT32_C( 0), UINT32_C( 0), UINT32_C( 1)),
597
- simde_mm_set_ps(SIMDE_FLOAT32_C( -284.42), SIMDE_FLOAT32_C( 692.24), SIMDE_FLOAT32_C( 101.85), SIMDE_FLOAT32_C( -819.28)) },
598
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 264.15), SIMDE_FLOAT32_C( -480.80), SIMDE_FLOAT32_C( -304.32), SIMDE_FLOAT32_C( 862.50)),
599
- simde_mm_set_ps(SIMDE_FLOAT32_C( 230.55), SIMDE_FLOAT32_C( -649.28), SIMDE_FLOAT32_C( 827.43), SIMDE_FLOAT32_C( -462.60)),
600
- simde_x_mm_set_epu32(UINT32_C( 0), UINT32_C( 0), UINT32_C( 0), UINT32_C( 0)),
601
- simde_mm_set_ps(SIMDE_FLOAT32_C( 264.15), SIMDE_FLOAT32_C( -480.80), SIMDE_FLOAT32_C( -304.32), SIMDE_FLOAT32_C( 862.50)) },
602
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 235.66), SIMDE_FLOAT32_C( 478.16), SIMDE_FLOAT32_C( 480.58), SIMDE_FLOAT32_C( -53.52)),
603
- simde_mm_set_ps(SIMDE_FLOAT32_C( 982.67), SIMDE_FLOAT32_C( -772.62), SIMDE_FLOAT32_C( -150.10), SIMDE_FLOAT32_C( -737.86)),
604
- simde_x_mm_set_epu32(UINT32_C( 1), UINT32_C( 1), UINT32_C( 0), UINT32_C( 0)),
605
- simde_mm_set_ps(SIMDE_FLOAT32_C( 235.66), SIMDE_FLOAT32_C( 478.16), SIMDE_FLOAT32_C( 480.58), SIMDE_FLOAT32_C( -53.52)) },
606
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 121.52), SIMDE_FLOAT32_C( 798.57), SIMDE_FLOAT32_C( 563.90), SIMDE_FLOAT32_C( 845.42)),
607
- simde_mm_set_ps(SIMDE_FLOAT32_C( 593.41), SIMDE_FLOAT32_C( 201.43), SIMDE_FLOAT32_C( -263.22), SIMDE_FLOAT32_C( 41.51)),
608
- simde_x_mm_set_epu32(UINT32_C( 1), UINT32_C( 1), UINT32_C( 1), UINT32_C( 0)),
609
- simde_mm_set_ps(SIMDE_FLOAT32_C( 121.52), SIMDE_FLOAT32_C( 798.57), SIMDE_FLOAT32_C( 563.90), SIMDE_FLOAT32_C( 845.42)) },
610
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -938.86), SIMDE_FLOAT32_C( -190.10), SIMDE_FLOAT32_C( -729.05), SIMDE_FLOAT32_C( 956.23)),
611
- simde_mm_set_ps(SIMDE_FLOAT32_C( 574.98), SIMDE_FLOAT32_C( -82.92), SIMDE_FLOAT32_C( 247.07), SIMDE_FLOAT32_C( -802.43)),
612
- simde_x_mm_set_epu32(UINT32_C( 0), UINT32_C( 1), UINT32_C( 0), UINT32_C( 0)),
613
- simde_mm_set_ps(SIMDE_FLOAT32_C( -938.86), SIMDE_FLOAT32_C( -190.10), SIMDE_FLOAT32_C( -729.05), SIMDE_FLOAT32_C( 956.23)) },
614
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -592.31), SIMDE_FLOAT32_C( -123.91), SIMDE_FLOAT32_C( 105.67), SIMDE_FLOAT32_C( 596.25)),
615
- simde_mm_set_ps(SIMDE_FLOAT32_C( -99.40), SIMDE_FLOAT32_C( 86.32), SIMDE_FLOAT32_C( -827.82), SIMDE_FLOAT32_C( 443.02)),
616
- simde_x_mm_set_epu32(UINT32_C( 1), UINT32_C( 1), UINT32_C( 1), UINT32_C( 0)),
617
- simde_mm_set_ps(SIMDE_FLOAT32_C( -592.31), SIMDE_FLOAT32_C( -123.91), SIMDE_FLOAT32_C( 105.67), SIMDE_FLOAT32_C( 596.25)) },
618
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 59.00), SIMDE_FLOAT32_C( -93.37), SIMDE_FLOAT32_C( -934.05), SIMDE_FLOAT32_C( 930.21)),
619
- simde_mm_set_ps(SIMDE_FLOAT32_C( -592.32), SIMDE_FLOAT32_C( 420.31), SIMDE_FLOAT32_C( -235.36), SIMDE_FLOAT32_C( -335.98)),
620
- simde_x_mm_set_epu32(UINT32_C( 1), UINT32_C( 1), UINT32_C( 1), UINT32_C( 1)),
621
- simde_mm_set_ps(SIMDE_FLOAT32_C( 59.00), SIMDE_FLOAT32_C( -93.37), SIMDE_FLOAT32_C( -934.05), SIMDE_FLOAT32_C( 930.21)) }
622
- };
623
-
624
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
625
- simde__m128 r = simde_mm_blendv_ps(test_vec[i].a, test_vec[i].b, simde_mm_castsi128_ps(test_vec[i].mask));
626
- simde_assert_m128_close(r, test_vec[i].r, 1);
627
- }
628
-
629
- return MUNIT_OK;
630
- }
631
-
632
- static MunitResult
633
- test_simde_mm_ceil_pd(const MunitParameter params[], void* data) {
634
- (void) params;
635
- (void) data;
636
-
637
- const struct {
638
- simde__m128d a;
639
- simde__m128d r;
640
- } test_vec[8] = {
641
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 241.39), SIMDE_FLOAT64_C( 553.26)),
642
- simde_mm_set_pd(SIMDE_FLOAT64_C( 242.00), SIMDE_FLOAT64_C( 554.00)) },
643
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 307.83), SIMDE_FLOAT64_C( 377.37)),
644
- simde_mm_set_pd(SIMDE_FLOAT64_C( 308.00), SIMDE_FLOAT64_C( 378.00)) },
645
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 558.16), SIMDE_FLOAT64_C( -404.55)),
646
- simde_mm_set_pd(SIMDE_FLOAT64_C( 559.00), SIMDE_FLOAT64_C( -404.00)) },
647
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 219.15), SIMDE_FLOAT64_C( 818.17)),
648
- simde_mm_set_pd(SIMDE_FLOAT64_C( 220.00), SIMDE_FLOAT64_C( 819.00)) },
649
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 25.83), SIMDE_FLOAT64_C( -230.94)),
650
- simde_mm_set_pd(SIMDE_FLOAT64_C( 26.00), SIMDE_FLOAT64_C( -230.00)) },
651
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 173.52), SIMDE_FLOAT64_C( 64.50)),
652
- simde_mm_set_pd(SIMDE_FLOAT64_C( 174.00), SIMDE_FLOAT64_C( 65.00)) },
653
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -453.11), SIMDE_FLOAT64_C( -845.77)),
654
- simde_mm_set_pd(SIMDE_FLOAT64_C( -453.00), SIMDE_FLOAT64_C( -845.00)) },
655
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -50.98), SIMDE_FLOAT64_C( -179.55)),
656
- simde_mm_set_pd(SIMDE_FLOAT64_C( -50.00), SIMDE_FLOAT64_C( -179.00)) }
657
- };
658
-
659
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
660
- simde__m128d r = simde_mm_ceil_pd(test_vec[i].a);
661
- simde_assert_m128d_close(r, test_vec[i].r, 1);
662
- }
663
-
664
- return MUNIT_OK;
665
- }
666
-
667
- static MunitResult
668
- test_simde_mm_ceil_ps(const MunitParameter params[], void* data) {
669
- (void) params;
670
- (void) data;
671
-
672
- const struct {
673
- simde__m128 a;
674
- simde__m128 r;
675
- } test_vec[8] = {
676
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -624.94), SIMDE_FLOAT32_C( -243.25), SIMDE_FLOAT32_C( -61.63), SIMDE_FLOAT32_C( -948.73)),
677
- simde_mm_set_ps(SIMDE_FLOAT32_C( -624.00), SIMDE_FLOAT32_C( -243.00), SIMDE_FLOAT32_C( -61.00), SIMDE_FLOAT32_C( -948.00)) },
678
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -906.63), SIMDE_FLOAT32_C( -236.42), SIMDE_FLOAT32_C( 571.51), SIMDE_FLOAT32_C( 624.62)),
679
- simde_mm_set_ps(SIMDE_FLOAT32_C( -906.00), SIMDE_FLOAT32_C( -236.00), SIMDE_FLOAT32_C( 572.00), SIMDE_FLOAT32_C( 625.00)) },
680
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 503.85), SIMDE_FLOAT32_C( -317.51), SIMDE_FLOAT32_C( -529.30), SIMDE_FLOAT32_C( -871.89)),
681
- simde_mm_set_ps(SIMDE_FLOAT32_C( 504.00), SIMDE_FLOAT32_C( -317.00), SIMDE_FLOAT32_C( -529.00), SIMDE_FLOAT32_C( -871.00)) },
682
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 571.49), SIMDE_FLOAT32_C( -129.77), SIMDE_FLOAT32_C( -739.71), SIMDE_FLOAT32_C( 413.18)),
683
- simde_mm_set_ps(SIMDE_FLOAT32_C( 572.00), SIMDE_FLOAT32_C( -129.00), SIMDE_FLOAT32_C( -739.00), SIMDE_FLOAT32_C( 414.00)) },
684
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 438.35), SIMDE_FLOAT32_C( 517.03), SIMDE_FLOAT32_C( 278.46), SIMDE_FLOAT32_C( -656.36)),
685
- simde_mm_set_ps(SIMDE_FLOAT32_C( 439.00), SIMDE_FLOAT32_C( 518.00), SIMDE_FLOAT32_C( 279.00), SIMDE_FLOAT32_C( -656.00)) },
686
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -159.40), SIMDE_FLOAT32_C( -802.82), SIMDE_FLOAT32_C( 663.71), SIMDE_FLOAT32_C( 186.86)),
687
- simde_mm_set_ps(SIMDE_FLOAT32_C( -159.00), SIMDE_FLOAT32_C( -802.00), SIMDE_FLOAT32_C( 664.00), SIMDE_FLOAT32_C( 187.00)) },
688
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -163.74), SIMDE_FLOAT32_C( 485.54), SIMDE_FLOAT32_C( 138.17), SIMDE_FLOAT32_C( 794.67)),
689
- simde_mm_set_ps(SIMDE_FLOAT32_C( -163.00), SIMDE_FLOAT32_C( 486.00), SIMDE_FLOAT32_C( 139.00), SIMDE_FLOAT32_C( 795.00)) },
690
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -469.36), SIMDE_FLOAT32_C( -418.24), SIMDE_FLOAT32_C( -419.25), SIMDE_FLOAT32_C( 390.46)),
691
- simde_mm_set_ps(SIMDE_FLOAT32_C( -469.00), SIMDE_FLOAT32_C( -418.00), SIMDE_FLOAT32_C( -419.00), SIMDE_FLOAT32_C( 391.00)) }
692
- };
693
-
694
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
695
- simde__m128 r = simde_mm_ceil_ps(test_vec[i].a);
696
- simde_assert_m128_close(r, test_vec[i].r, 1);
697
- }
698
-
699
- return MUNIT_OK;
700
- }
701
-
702
- static MunitResult
703
- test_simde_mm_ceil_sd(const MunitParameter params[], void* data) {
704
- (void) params;
705
- (void) data;
706
-
707
- const struct {
708
- simde__m128d a;
709
- simde__m128d b;
710
- simde__m128d r;
711
- } test_vec[8] = {
712
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -610.18), SIMDE_FLOAT64_C( 172.21)),
713
- simde_mm_set_pd(SIMDE_FLOAT64_C( 234.40), SIMDE_FLOAT64_C( -339.84)),
714
- simde_mm_set_pd(SIMDE_FLOAT64_C( -610.18), SIMDE_FLOAT64_C( -339.00)) },
715
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -467.52), SIMDE_FLOAT64_C( 904.78)),
716
- simde_mm_set_pd(SIMDE_FLOAT64_C( -527.39), SIMDE_FLOAT64_C( -115.63)),
717
- simde_mm_set_pd(SIMDE_FLOAT64_C( -467.52), SIMDE_FLOAT64_C( -115.00)) },
718
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 191.24), SIMDE_FLOAT64_C( 823.78)),
719
- simde_mm_set_pd(SIMDE_FLOAT64_C( 835.27), SIMDE_FLOAT64_C( 744.81)),
720
- simde_mm_set_pd(SIMDE_FLOAT64_C( 191.24), SIMDE_FLOAT64_C( 745.00)) },
721
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -49.25), SIMDE_FLOAT64_C( -695.95)),
722
- simde_mm_set_pd(SIMDE_FLOAT64_C( 800.62), SIMDE_FLOAT64_C( 853.84)),
723
- simde_mm_set_pd(SIMDE_FLOAT64_C( -49.25), SIMDE_FLOAT64_C( 854.00)) },
724
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 668.83), SIMDE_FLOAT64_C( -182.73)),
725
- simde_mm_set_pd(SIMDE_FLOAT64_C( -875.46), SIMDE_FLOAT64_C( 752.10)),
726
- simde_mm_set_pd(SIMDE_FLOAT64_C( 668.83), SIMDE_FLOAT64_C( 753.00)) },
727
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 242.57), SIMDE_FLOAT64_C( -906.00)),
728
- simde_mm_set_pd(SIMDE_FLOAT64_C( -816.22), SIMDE_FLOAT64_C( 339.03)),
729
- simde_mm_set_pd(SIMDE_FLOAT64_C( 242.57), SIMDE_FLOAT64_C( 340.00)) },
730
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -745.15), SIMDE_FLOAT64_C( -744.04)),
731
- simde_mm_set_pd(SIMDE_FLOAT64_C( -802.81), SIMDE_FLOAT64_C( 890.79)),
732
- simde_mm_set_pd(SIMDE_FLOAT64_C( -745.15), SIMDE_FLOAT64_C( 891.00)) },
733
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 238.48), SIMDE_FLOAT64_C( -167.28)),
734
- simde_mm_set_pd(SIMDE_FLOAT64_C( -484.51), SIMDE_FLOAT64_C( 175.95)),
735
- simde_mm_set_pd(SIMDE_FLOAT64_C( 238.48), SIMDE_FLOAT64_C( 176.00)) }
736
- };
737
-
738
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
739
- simde__m128d r = simde_mm_ceil_sd(test_vec[i].a, test_vec[i].b);
740
- simde_assert_m128d_close(r, test_vec[i].r, 1);
741
- }
742
-
743
- return MUNIT_OK;
744
- }
745
-
746
- static MunitResult
747
- test_simde_mm_ceil_ss(const MunitParameter params[], void* data) {
748
- (void) params;
749
- (void) data;
750
-
751
- const struct {
752
- simde__m128 a;
753
- simde__m128 b;
754
- simde__m128 r;
755
- } test_vec[8] = {
756
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -124.45), SIMDE_FLOAT32_C( 911.12), SIMDE_FLOAT32_C( 900.52), SIMDE_FLOAT32_C( -468.92)),
757
- simde_mm_set_ps(SIMDE_FLOAT32_C( -31.56), SIMDE_FLOAT32_C( -29.76), SIMDE_FLOAT32_C( -939.35), SIMDE_FLOAT32_C( 459.71)),
758
- simde_mm_set_ps(SIMDE_FLOAT32_C( -124.45), SIMDE_FLOAT32_C( 911.12), SIMDE_FLOAT32_C( 900.52), SIMDE_FLOAT32_C( 460.00)) },
759
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 514.22), SIMDE_FLOAT32_C( -972.44), SIMDE_FLOAT32_C( -908.76), SIMDE_FLOAT32_C( -817.52)),
760
- simde_mm_set_ps(SIMDE_FLOAT32_C( -711.78), SIMDE_FLOAT32_C( 489.62), SIMDE_FLOAT32_C( -109.52), SIMDE_FLOAT32_C( -2.01)),
761
- simde_mm_set_ps(SIMDE_FLOAT32_C( 514.22), SIMDE_FLOAT32_C( -972.44), SIMDE_FLOAT32_C( -908.76), SIMDE_FLOAT32_C( -2.00)) },
762
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -269.88), SIMDE_FLOAT32_C( -875.85), SIMDE_FLOAT32_C( -139.27), SIMDE_FLOAT32_C( -841.56)),
763
- simde_mm_set_ps(SIMDE_FLOAT32_C( 501.05), SIMDE_FLOAT32_C( 280.43), SIMDE_FLOAT32_C( -173.91), SIMDE_FLOAT32_C( 644.42)),
764
- simde_mm_set_ps(SIMDE_FLOAT32_C( -269.88), SIMDE_FLOAT32_C( -875.85), SIMDE_FLOAT32_C( -139.27), SIMDE_FLOAT32_C( 645.00)) },
765
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -643.26), SIMDE_FLOAT32_C( 616.48), SIMDE_FLOAT32_C( 835.28), SIMDE_FLOAT32_C( 527.52)),
766
- simde_mm_set_ps(SIMDE_FLOAT32_C( 636.48), SIMDE_FLOAT32_C( -46.56), SIMDE_FLOAT32_C( -891.84), SIMDE_FLOAT32_C( 948.43)),
767
- simde_mm_set_ps(SIMDE_FLOAT32_C( -643.26), SIMDE_FLOAT32_C( 616.48), SIMDE_FLOAT32_C( 835.28), SIMDE_FLOAT32_C( 949.00)) },
768
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 3.13), SIMDE_FLOAT32_C( -654.36), SIMDE_FLOAT32_C( -994.98), SIMDE_FLOAT32_C( -148.95)),
769
- simde_mm_set_ps(SIMDE_FLOAT32_C( 806.15), SIMDE_FLOAT32_C( 529.29), SIMDE_FLOAT32_C( -804.42), SIMDE_FLOAT32_C( 408.19)),
770
- simde_mm_set_ps(SIMDE_FLOAT32_C( 3.13), SIMDE_FLOAT32_C( -654.36), SIMDE_FLOAT32_C( -994.98), SIMDE_FLOAT32_C( 409.00)) },
771
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -138.18), SIMDE_FLOAT32_C( -446.48), SIMDE_FLOAT32_C( -413.95), SIMDE_FLOAT32_C( -252.30)),
772
- simde_mm_set_ps(SIMDE_FLOAT32_C( 957.68), SIMDE_FLOAT32_C( 373.35), SIMDE_FLOAT32_C( 271.98), SIMDE_FLOAT32_C( -653.93)),
773
- simde_mm_set_ps(SIMDE_FLOAT32_C( -138.18), SIMDE_FLOAT32_C( -446.48), SIMDE_FLOAT32_C( -413.95), SIMDE_FLOAT32_C( -653.00)) },
774
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 124.40), SIMDE_FLOAT32_C( -866.66), SIMDE_FLOAT32_C( 288.57), SIMDE_FLOAT32_C( -708.46)),
775
- simde_mm_set_ps(SIMDE_FLOAT32_C( 685.14), SIMDE_FLOAT32_C( 776.00), SIMDE_FLOAT32_C( 453.56), SIMDE_FLOAT32_C( -112.81)),
776
- simde_mm_set_ps(SIMDE_FLOAT32_C( 124.40), SIMDE_FLOAT32_C( -866.66), SIMDE_FLOAT32_C( 288.57), SIMDE_FLOAT32_C( -112.00)) },
777
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -232.75), SIMDE_FLOAT32_C( -137.55), SIMDE_FLOAT32_C( 50.26), SIMDE_FLOAT32_C( -189.71)),
778
- simde_mm_set_ps(SIMDE_FLOAT32_C( -288.67), SIMDE_FLOAT32_C( -112.95), SIMDE_FLOAT32_C( 792.47), SIMDE_FLOAT32_C( -200.27)),
779
- simde_mm_set_ps(SIMDE_FLOAT32_C( -232.75), SIMDE_FLOAT32_C( -137.55), SIMDE_FLOAT32_C( 50.26), SIMDE_FLOAT32_C( -200.00)) }
780
- };
781
-
782
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
783
- simde__m128 r = simde_mm_ceil_ss(test_vec[i].a, test_vec[i].b);
784
- simde_assert_m128_close(r, test_vec[i].r, 1);
785
- }
786
-
787
- return MUNIT_OK;
788
- }
789
-
790
- static MunitResult
791
- test_simde_mm_cmpeq_epi64(const MunitParameter params[], void* data) {
792
- (void) params;
793
- (void) data;
794
-
795
- const struct {
796
- simde__m128i a;
797
- simde__m128i b;
798
- simde__m128i r;
799
- } test_vec[8] = {
800
- { simde_x_mm_set_epu64x(UINT64_C(13269709557652540150), UINT64_C( 5229646237911669536)),
801
- simde_x_mm_set_epu64x(UINT64_C(13269709557652540150), UINT64_C( 5229646237911669536)),
802
- simde_x_mm_set_epu64x(UINT64_C(18446744073709551615), UINT64_C(18446744073709551615)) },
803
- { simde_x_mm_set_epu64x(UINT64_C(14039735832537203737), UINT64_C(18065414586371585158)),
804
- simde_x_mm_set_epu64x(UINT64_C( 7896134184979754273), UINT64_C(18065414586371585158)),
805
- simde_x_mm_set_epu64x(UINT64_C( 0), UINT64_C(18446744073709551615)) },
806
- { simde_x_mm_set_epu64x(UINT64_C( 8088434365645432882), UINT64_C( 2110149590601129498)),
807
- simde_x_mm_set_epu64x(UINT64_C(12894308138858138936), UINT64_C( 7645444803376971084)),
808
- simde_x_mm_set_epu64x(UINT64_C( 0), UINT64_C( 0)) },
809
- { simde_x_mm_set_epu64x(UINT64_C( 6900998750312547586), UINT64_C(11115665826166806875)),
810
- simde_x_mm_set_epu64x(UINT64_C( 253910074237567150), UINT64_C(11115665826166806875)),
811
- simde_x_mm_set_epu64x(UINT64_C( 0), UINT64_C(18446744073709551615)) },
812
- { simde_x_mm_set_epu64x(UINT64_C(15513947591537518317), UINT64_C( 6346622963553980783)),
813
- simde_x_mm_set_epu64x(UINT64_C( 1894817647097843127), UINT64_C( 9019647896255166506)),
814
- simde_x_mm_set_epu64x(UINT64_C( 0), UINT64_C( 0)) },
815
- { simde_x_mm_set_epu64x(UINT64_C( 189073800069710221), UINT64_C( 5830713182261233236)),
816
- simde_x_mm_set_epu64x(UINT64_C( 189073800069710221), UINT64_C( 8422068610497871432)),
817
- simde_x_mm_set_epu64x(UINT64_C(18446744073709551615), UINT64_C( 0)) },
818
- { simde_x_mm_set_epu64x(UINT64_C(17115829668729212386), UINT64_C(11158226665026575121)),
819
- simde_x_mm_set_epu64x(UINT64_C(17115829668729212386), UINT64_C(11158226665026575121)),
820
- simde_x_mm_set_epu64x(UINT64_C(18446744073709551615), UINT64_C(18446744073709551615)) },
821
- { simde_x_mm_set_epu64x(UINT64_C( 9543887299291080046), UINT64_C(14913997234931691871)),
822
- simde_x_mm_set_epu64x(UINT64_C( 9543887299291080046), UINT64_C(12485648986158046833)),
823
- simde_x_mm_set_epu64x(UINT64_C(18446744073709551615), UINT64_C( 0)) }
824
- };
825
-
826
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
827
- simde__m128i r = simde_mm_cmpeq_epi64(test_vec[i].a, test_vec[i].b);
828
- simde_assert_m128i_i64(r, ==, test_vec[i].r);
829
- }
830
-
831
- return MUNIT_OK;
832
- }
833
-
834
- static MunitResult
835
- test_simde_mm_cvtepi16_epi32(const MunitParameter params[], void* data) {
836
- (void) params;
837
- (void) data;
838
-
839
- const struct {
840
- simde__m128i a;
841
- simde__m128i r;
842
- } test_vec[8] = {
843
- { simde_mm_set_epi16(-15854, 0, -12807, 5951, 29318, -11078, -2252, 10096),
844
- simde_mm_set_epi32( 29318, -11078, -2252, 10096) },
845
- { simde_mm_set_epi16( 24388, 32521, -30980, -12289, 27092, 24521, 12106, -27709),
846
- simde_mm_set_epi32( 27092, 24521, 12106, -27709) },
847
- { simde_mm_set_epi16(-11871, 15750, -7986, 4594, 22346, 1400, -21386, 7662),
848
- simde_mm_set_epi32( 22346, 1400, -21386, 7662) },
849
- { simde_mm_set_epi16(-15687, -15477, -26077, -28781, -29737, -30311, 16950, 14614),
850
- simde_mm_set_epi32(-29737, -30311, 16950, 14614) },
851
- { simde_mm_set_epi16(-30646, 13049, -24166, 637, 7297, -627, 6143, -26200),
852
- simde_mm_set_epi32( 7297, -627, 6143, -26200) },
853
- { simde_mm_set_epi16( 30171, 1922, -122, -17991, 30806, 12552, -28515, -9185),
854
- simde_mm_set_epi32( 30806, 12552, -28515, -9185) },
855
- { simde_mm_set_epi16( 29385, 21267, -10152, 25553, 20674, 6661, -29222, -19848),
856
- simde_mm_set_epi32( 20674, 6661, -29222, -19848) },
857
- { simde_mm_set_epi16( 24527, 18305, 30094, -5437, -26652, 20361, 10408, -4948),
858
- simde_mm_set_epi32(-26652, 20361, 10408, -4948) }
859
- };
860
-
861
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
862
- simde__m128i r = simde_mm_cvtepi16_epi32(test_vec[i].a);
863
- simde_assert_m128i_i32(r, ==, test_vec[i].r);
864
- }
865
-
866
- return MUNIT_OK;
867
- }
868
-
869
- static MunitResult
870
- test_simde_mm_cvtepi16_epi64(const MunitParameter params[], void* data) {
871
- (void) params;
872
- (void) data;
873
-
874
- const struct {
875
- simde__m128i a;
876
- simde__m128i r;
877
- } test_vec[8] = {
878
- { simde_mm_set_epi16(INT16_C(-25288), INT16_C( 737), INT16_C(-31366), INT16_C(-21360),
879
- INT16_C( 1927), INT16_C( 32195), INT16_C( -4472), INT16_C( -2085)),
880
- simde_mm_set_epi64x(INT64_C( -4472), INT64_C( -2085)) },
881
- { simde_mm_set_epi16(INT16_C(-30817), INT16_C( 5734), INT16_C( -6209), INT16_C(-18846),
882
- INT16_C( 14970), INT16_C( 30345), INT16_C( -8853), INT16_C(-31121)),
883
- simde_mm_set_epi64x(INT64_C( -8853), INT64_C( -31121)) },
884
- { simde_mm_set_epi16(INT16_C( -970), INT16_C(-11861), INT16_C(-11667), INT16_C( 14936),
885
- INT16_C( 21732), INT16_C(-17006), INT16_C( -2668), INT16_C( 30170)),
886
- simde_mm_set_epi64x(INT64_C( -2668), INT64_C( 30170)) },
887
- { simde_mm_set_epi16(INT16_C( 2721), INT16_C(-13375), INT16_C( -1976), INT16_C( 30833),
888
- INT16_C(-18247), INT16_C( 16242), INT16_C( 4569), INT16_C( 10132)),
889
- simde_mm_set_epi64x(INT64_C( 4569), INT64_C( 10132)) },
890
- { simde_mm_set_epi16(INT16_C(-22879), INT16_C(-24842), INT16_C(-29886), INT16_C(-13312),
891
- INT16_C( 24862), INT16_C(-30679), INT16_C( 6258), INT16_C(-19461)),
892
- simde_mm_set_epi64x(INT64_C( 6258), INT64_C( -19461)) },
893
- { simde_mm_set_epi16(INT16_C( 15048), INT16_C( 5334), INT16_C( 21517), INT16_C( 10106),
894
- INT16_C(-25890), INT16_C( -8759), INT16_C( 21361), INT16_C( 17584)),
895
- simde_mm_set_epi64x(INT64_C( 21361), INT64_C( 17584)) },
896
- { simde_mm_set_epi16(INT16_C( 18353), INT16_C( 9848), INT16_C( 20583), INT16_C(-28706),
897
- INT16_C( 28353), INT16_C( 979), INT16_C(-15312), INT16_C( -4296)),
898
- simde_mm_set_epi64x(INT64_C( -15312), INT64_C( -4296)) },
899
- { simde_mm_set_epi16(INT16_C( 21066), INT16_C( 26185), INT16_C( 29520), INT16_C( -9848),
900
- INT16_C(-20587), INT16_C( -254), INT16_C(-19969), INT16_C( -2307)),
901
- simde_mm_set_epi64x(INT64_C( -19969), INT64_C( -2307)) }
902
- };
903
-
904
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
905
- simde__m128i r = simde_mm_cvtepi16_epi64(test_vec[i].a);
906
- simde_assert_m128i_i64(r, ==, test_vec[i].r);
907
- }
908
-
909
- return MUNIT_OK;
910
- }
911
-
912
- static MunitResult
913
- test_simde_mm_cvtepi32_epi64(const MunitParameter params[], void* data) {
914
- (void) params;
915
- (void) data;
916
-
917
- const struct {
918
- simde__m128i a;
919
- simde__m128i r;
920
- } test_vec[8] = {
921
- { simde_mm_set_epi32(INT32_C(-1750586859), INT32_C( 1743108010), INT32_C( -56370522), INT32_C( 214732685)),
922
- simde_mm_set_epi64x(INT64_C( -56370522), INT64_C( 214732685)) },
923
- { simde_mm_set_epi32(INT32_C( 1019578476), INT32_C( 2006962808), INT32_C( 1356966666), INT32_C( 443191452)),
924
- simde_mm_set_epi64x(INT64_C( 1356966666), INT64_C( 443191452)) },
925
- { simde_mm_set_epi32(INT32_C( 811952499), INT32_C( 1388789927), INT32_C( 1562076587), INT32_C( 1374574189)),
926
- simde_mm_set_epi64x(INT64_C( 1562076587), INT64_C( 1374574189)) },
927
- { simde_mm_set_epi32(INT32_C(-1130424581), INT32_C( -754503048), INT32_C( -175987570), INT32_C( 252857640)),
928
- simde_mm_set_epi64x(INT64_C( -175987570), INT64_C( 252857640)) },
929
- { simde_mm_set_epi32(INT32_C( -662885345), INT32_C( -469769762), INT32_C( 1876427062), INT32_C(-1227144336)),
930
- simde_mm_set_epi64x(INT64_C( 1876427062), INT64_C( -1227144336)) },
931
- { simde_mm_set_epi32(INT32_C(-1459145913), INT32_C( -624950308), INT32_C(-1740403350), INT32_C(-2023012954)),
932
- simde_mm_set_epi64x(INT64_C( -1740403350), INT64_C( -2023012954)) },
933
- { simde_mm_set_epi32(INT32_C( 807996884), INT32_C( -721517626), INT32_C(-1345085365), INT32_C( 3500292)),
934
- simde_mm_set_epi64x(INT64_C( -1345085365), INT64_C( 3500292)) },
935
- { simde_mm_set_epi32(INT32_C( 1631614297), INT32_C(-2082769218), INT32_C( 285385405), INT32_C(-1874296921)),
936
- simde_mm_set_epi64x(INT64_C( 285385405), INT64_C( -1874296921)) }
937
- };
938
-
939
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
940
- simde__m128i r = simde_mm_cvtepi32_epi64(test_vec[i].a);
941
- simde_assert_m128i_i64(r, ==, test_vec[i].r);
942
- }
943
-
944
- return MUNIT_OK;
945
- }
946
-
947
- static MunitResult
948
- test_simde_mm_cvtepi8_epi16(const MunitParameter params[], void* data) {
949
- (void) params;
950
- (void) data;
951
-
952
- const struct {
953
- simde__m128i a;
954
- simde__m128i r;
955
- } test_vec[8] = {
956
- { simde_mm_set_epi8(INT8_C( -34), INT8_C( 20), INT8_C( 53), INT8_C( 81),
957
- INT8_C( 37), INT8_C( -97), INT8_C( -59), INT8_C( 127),
958
- INT8_C( -43), INT8_C( -82), INT8_C( 84), INT8_C(-127),
959
- INT8_C( 11), INT8_C( 120), INT8_C( -98), INT8_C( -80)),
960
- simde_mm_set_epi16(INT16_C( -43), INT16_C( -82), INT16_C( 84), INT16_C( -127),
961
- INT16_C( 11), INT16_C( 120), INT16_C( -98), INT16_C( -80)) },
962
- { simde_mm_set_epi8(INT8_C( 66), INT8_C( 57), INT8_C( 40), INT8_C(-113),
963
- INT8_C( 71), INT8_C( -5), INT8_C( 70), INT8_C( 22),
964
- INT8_C( -70), INT8_C( 14), INT8_C( -76), INT8_C(-101),
965
- INT8_C( 13), INT8_C( 64), INT8_C( -86), INT8_C( 34)),
966
- simde_mm_set_epi16(INT16_C( -70), INT16_C( 14), INT16_C( -76), INT16_C( -101),
967
- INT16_C( 13), INT16_C( 64), INT16_C( -86), INT16_C( 34)) },
968
- { simde_mm_set_epi8(INT8_C( 87), INT8_C( 115), INT8_C( 108), INT8_C( -88),
969
- INT8_C( 113), INT8_C( 91), INT8_C( -95), INT8_C( -69),
970
- INT8_C( 32), INT8_C( 98), INT8_C( -16), INT8_C( -55),
971
- INT8_C( 11), INT8_C( -23), INT8_C( 72), INT8_C( 121)),
972
- simde_mm_set_epi16(INT16_C( 32), INT16_C( 98), INT16_C( -16), INT16_C( -55),
973
- INT16_C( 11), INT16_C( -23), INT16_C( 72), INT16_C( 121)) },
974
- { simde_mm_set_epi8(INT8_C( 88), INT8_C( 68), INT8_C( -76), INT8_C( 35),
975
- INT8_C(-119), INT8_C( -67), INT8_C( 52), INT8_C( 58),
976
- INT8_C( 7), INT8_C( 70), INT8_C( -26), INT8_C( 55),
977
- INT8_C( 126), INT8_C( 69), INT8_C( 105), INT8_C( 40)),
978
- simde_mm_set_epi16(INT16_C( 7), INT16_C( 70), INT16_C( -26), INT16_C( 55),
979
- INT16_C( 126), INT16_C( 69), INT16_C( 105), INT16_C( 40)) },
980
- { simde_mm_set_epi8(INT8_C( 110), INT8_C( -4), INT8_C( 41), INT8_C( -98),
981
- INT8_C( -91), INT8_C( 117), INT8_C( -33), INT8_C(-110),
982
- INT8_C( 126), INT8_C( -63), INT8_C( -65), INT8_C( -86),
983
- INT8_C(-108), INT8_C( -64), INT8_C( -4), INT8_C( 25)),
984
- simde_mm_set_epi16(INT16_C( 126), INT16_C( -63), INT16_C( -65), INT16_C( -86),
985
- INT16_C( -108), INT16_C( -64), INT16_C( -4), INT16_C( 25)) },
986
- { simde_mm_set_epi8(INT8_C( 105), INT8_C( -31), INT8_C( -57), INT8_C( -74),
987
- INT8_C( 119), INT8_C( 56), INT8_C( -36), INT8_C(-128),
988
- INT8_C( 102), INT8_C( 57), INT8_C( -27), INT8_C( 19),
989
- INT8_C( -50), INT8_C( -15), INT8_C( 36), INT8_C(-124)),
990
- simde_mm_set_epi16(INT16_C( 102), INT16_C( 57), INT16_C( -27), INT16_C( 19),
991
- INT16_C( -50), INT16_C( -15), INT16_C( 36), INT16_C( -124)) },
992
- { simde_mm_set_epi8(INT8_C( 44), INT8_C( -84), INT8_C( -61), INT8_C( 59),
993
- INT8_C( 18), INT8_C(-118), INT8_C( 6), INT8_C( 56),
994
- INT8_C( -11), INT8_C( 78), INT8_C( -64), INT8_C( -28),
995
- INT8_C( -85), INT8_C( -77), INT8_C( -25), INT8_C(-100)),
996
- simde_mm_set_epi16(INT16_C( -11), INT16_C( 78), INT16_C( -64), INT16_C( -28),
997
- INT16_C( -85), INT16_C( -77), INT16_C( -25), INT16_C( -100)) },
998
- { simde_mm_set_epi8(INT8_C( -13), INT8_C( -24), INT8_C( 94), INT8_C( 58),
999
- INT8_C( 1), INT8_C( -14), INT8_C( -90), INT8_C(-123),
1000
- INT8_C(-101), INT8_C( 71), INT8_C( -51), INT8_C( 87),
1001
- INT8_C( -34), INT8_C( 77), INT8_C( 124), INT8_C( -63)),
1002
- simde_mm_set_epi16(INT16_C( -101), INT16_C( 71), INT16_C( -51), INT16_C( 87),
1003
- INT16_C( -34), INT16_C( 77), INT16_C( 124), INT16_C( -63)) }
1004
- };
1005
-
1006
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1007
- simde__m128i r = simde_mm_cvtepi8_epi16(test_vec[i].a);
1008
- simde_assert_m128i_i16(r, ==, test_vec[i].r);
1009
- }
1010
-
1011
- return MUNIT_OK;
1012
- }
1013
-
1014
- static MunitResult
1015
- test_simde_mm_cvtepi8_epi32(const MunitParameter params[], void* data) {
1016
- (void) params;
1017
- (void) data;
1018
-
1019
- const struct {
1020
- simde__m128i a;
1021
- simde__m128i r;
1022
- } test_vec[8] = {
1023
- { simde_mm_set_epi8(INT8_C( -34), INT8_C( 20), INT8_C( 53), INT8_C( 81),
1024
- INT8_C( 37), INT8_C( -97), INT8_C( -59), INT8_C( 127),
1025
- INT8_C( -43), INT8_C( -82), INT8_C( 84), INT8_C(-127),
1026
- INT8_C( 11), INT8_C( 120), INT8_C( -98), INT8_C( -80)),
1027
- simde_mm_set_epi32(INT32_C( 11), INT32_C( 120), INT32_C( -98), INT32_C( -80)) },
1028
- { simde_mm_set_epi8(INT8_C( 66), INT8_C( 57), INT8_C( 40), INT8_C(-113),
1029
- INT8_C( 71), INT8_C( -5), INT8_C( 70), INT8_C( 22),
1030
- INT8_C( -70), INT8_C( 14), INT8_C( -76), INT8_C(-101),
1031
- INT8_C( 13), INT8_C( 64), INT8_C( -86), INT8_C( 34)),
1032
- simde_mm_set_epi32(INT32_C( 13), INT32_C( 64), INT32_C( -86), INT32_C( 34)) },
1033
- { simde_mm_set_epi8(INT8_C( 87), INT8_C( 115), INT8_C( 108), INT8_C( -88),
1034
- INT8_C( 113), INT8_C( 91), INT8_C( -95), INT8_C( -69),
1035
- INT8_C( 32), INT8_C( 98), INT8_C( -16), INT8_C( -55),
1036
- INT8_C( 11), INT8_C( -23), INT8_C( 72), INT8_C( 121)),
1037
- simde_mm_set_epi32(INT32_C( 11), INT32_C( -23), INT32_C( 72), INT32_C( 121)) },
1038
- { simde_mm_set_epi8(INT8_C( 88), INT8_C( 68), INT8_C( -76), INT8_C( 35),
1039
- INT8_C(-119), INT8_C( -67), INT8_C( 52), INT8_C( 58),
1040
- INT8_C( 7), INT8_C( 70), INT8_C( -26), INT8_C( 55),
1041
- INT8_C( 126), INT8_C( 69), INT8_C( 105), INT8_C( 40)),
1042
- simde_mm_set_epi32(INT32_C( 126), INT32_C( 69), INT32_C( 105), INT32_C( 40)) },
1043
- { simde_mm_set_epi8(INT8_C( 110), INT8_C( -4), INT8_C( 41), INT8_C( -98),
1044
- INT8_C( -91), INT8_C( 117), INT8_C( -33), INT8_C(-110),
1045
- INT8_C( 126), INT8_C( -63), INT8_C( -65), INT8_C( -86),
1046
- INT8_C(-108), INT8_C( -64), INT8_C( -4), INT8_C( 25)),
1047
- simde_mm_set_epi32(INT32_C( -108), INT32_C( -64), INT32_C( -4), INT32_C( 25)) },
1048
- { simde_mm_set_epi8(INT8_C( 105), INT8_C( -31), INT8_C( -57), INT8_C( -74),
1049
- INT8_C( 119), INT8_C( 56), INT8_C( -36), INT8_C(-128),
1050
- INT8_C( 102), INT8_C( 57), INT8_C( -27), INT8_C( 19),
1051
- INT8_C( -50), INT8_C( -15), INT8_C( 36), INT8_C(-124)),
1052
- simde_mm_set_epi32(INT32_C( -50), INT32_C( -15), INT32_C( 36), INT32_C( -124)) },
1053
- { simde_mm_set_epi8(INT8_C( 44), INT8_C( -84), INT8_C( -61), INT8_C( 59),
1054
- INT8_C( 18), INT8_C(-118), INT8_C( 6), INT8_C( 56),
1055
- INT8_C( -11), INT8_C( 78), INT8_C( -64), INT8_C( -28),
1056
- INT8_C( -85), INT8_C( -77), INT8_C( -25), INT8_C(-100)),
1057
- simde_mm_set_epi32(INT32_C( -85), INT32_C( -77), INT32_C( -25), INT32_C( -100)) },
1058
- { simde_mm_set_epi8(INT8_C( -13), INT8_C( -24), INT8_C( 94), INT8_C( 58),
1059
- INT8_C( 1), INT8_C( -14), INT8_C( -90), INT8_C(-123),
1060
- INT8_C(-101), INT8_C( 71), INT8_C( -51), INT8_C( 87),
1061
- INT8_C( -34), INT8_C( 77), INT8_C( 124), INT8_C( -63)),
1062
- simde_mm_set_epi32(INT32_C( -34), INT32_C( 77), INT32_C( 124), INT32_C( -63)) }
1063
- };
1064
-
1065
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1066
- simde__m128i r = simde_mm_cvtepi8_epi32(test_vec[i].a);
1067
- simde_assert_m128i_i32(r, ==, test_vec[i].r);
1068
- }
1069
-
1070
- return MUNIT_OK;
1071
- }
1072
-
1073
- static MunitResult
1074
- test_simde_mm_cvtepi8_epi64(const MunitParameter params[], void* data) {
1075
- (void) params;
1076
- (void) data;
1077
-
1078
- const struct {
1079
- simde__m128i a;
1080
- simde__m128i r;
1081
- } test_vec[8] = {
1082
- { simde_mm_set_epi8(INT8_C( -34), INT8_C( 20), INT8_C( 53), INT8_C( 81),
1083
- INT8_C( 37), INT8_C( -97), INT8_C( -59), INT8_C( 127),
1084
- INT8_C( -43), INT8_C( -82), INT8_C( 84), INT8_C(-127),
1085
- INT8_C( 11), INT8_C( 120), INT8_C( -98), INT8_C( -80)),
1086
- simde_mm_set_epi64x(INT64_C( -98), INT64_C( -80)) },
1087
- { simde_mm_set_epi8(INT8_C( 66), INT8_C( 57), INT8_C( 40), INT8_C(-113),
1088
- INT8_C( 71), INT8_C( -5), INT8_C( 70), INT8_C( 22),
1089
- INT8_C( -70), INT8_C( 14), INT8_C( -76), INT8_C(-101),
1090
- INT8_C( 13), INT8_C( 64), INT8_C( -86), INT8_C( 34)),
1091
- simde_mm_set_epi64x(INT64_C( -86), INT64_C( 34)) },
1092
- { simde_mm_set_epi8(INT8_C( 87), INT8_C( 115), INT8_C( 108), INT8_C( -88),
1093
- INT8_C( 113), INT8_C( 91), INT8_C( -95), INT8_C( -69),
1094
- INT8_C( 32), INT8_C( 98), INT8_C( -16), INT8_C( -55),
1095
- INT8_C( 11), INT8_C( -23), INT8_C( 72), INT8_C( 121)),
1096
- simde_mm_set_epi64x(INT64_C( 72), INT64_C( 121)) },
1097
- { simde_mm_set_epi8(INT8_C( 88), INT8_C( 68), INT8_C( -76), INT8_C( 35),
1098
- INT8_C(-119), INT8_C( -67), INT8_C( 52), INT8_C( 58),
1099
- INT8_C( 7), INT8_C( 70), INT8_C( -26), INT8_C( 55),
1100
- INT8_C( 126), INT8_C( 69), INT8_C( 105), INT8_C( 40)),
1101
- simde_mm_set_epi64x(INT64_C( 105), INT64_C( 40)) },
1102
- { simde_mm_set_epi8(INT8_C( 110), INT8_C( -4), INT8_C( 41), INT8_C( -98),
1103
- INT8_C( -91), INT8_C( 117), INT8_C( -33), INT8_C(-110),
1104
- INT8_C( 126), INT8_C( -63), INT8_C( -65), INT8_C( -86),
1105
- INT8_C(-108), INT8_C( -64), INT8_C( -4), INT8_C( 25)),
1106
- simde_mm_set_epi64x(INT64_C( -4), INT64_C( 25)) },
1107
- { simde_mm_set_epi8(INT8_C( 105), INT8_C( -31), INT8_C( -57), INT8_C( -74),
1108
- INT8_C( 119), INT8_C( 56), INT8_C( -36), INT8_C(-128),
1109
- INT8_C( 102), INT8_C( 57), INT8_C( -27), INT8_C( 19),
1110
- INT8_C( -50), INT8_C( -15), INT8_C( 36), INT8_C(-124)),
1111
- simde_mm_set_epi64x(INT64_C( 36), INT64_C( -124)) },
1112
- { simde_mm_set_epi8(INT8_C( 44), INT8_C( -84), INT8_C( -61), INT8_C( 59),
1113
- INT8_C( 18), INT8_C(-118), INT8_C( 6), INT8_C( 56),
1114
- INT8_C( -11), INT8_C( 78), INT8_C( -64), INT8_C( -28),
1115
- INT8_C( -85), INT8_C( -77), INT8_C( -25), INT8_C(-100)),
1116
- simde_mm_set_epi64x(INT64_C( -25), INT64_C( -100)) },
1117
- { simde_mm_set_epi8(INT8_C( -13), INT8_C( -24), INT8_C( 94), INT8_C( 58),
1118
- INT8_C( 1), INT8_C( -14), INT8_C( -90), INT8_C(-123),
1119
- INT8_C(-101), INT8_C( 71), INT8_C( -51), INT8_C( 87),
1120
- INT8_C( -34), INT8_C( 77), INT8_C( 124), INT8_C( -63)),
1121
- simde_mm_set_epi64x(INT64_C( 124), INT64_C( -63)) }
1122
- };
1123
-
1124
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1125
- simde__m128i r = simde_mm_cvtepi8_epi64(test_vec[i].a);
1126
- simde_assert_m128i_i64(r, ==, test_vec[i].r);
1127
- }
1128
-
1129
- return MUNIT_OK;
1130
- }
1131
-
1132
- static MunitResult
1133
- test_simde_mm_cvtepu8_epi16(const MunitParameter params[], void* data) {
1134
- (void) params;
1135
- (void) data;
1136
-
1137
- const struct {
1138
- simde__m128i a;
1139
- simde__m128i r;
1140
- } test_vec[8] = {
1141
- { simde_x_mm_set_epu8(UINT8_C(133), UINT8_C( 55), UINT8_C(102), UINT8_C(130),
1142
- UINT8_C(197), UINT8_C( 52), UINT8_C(225), UINT8_C( 87),
1143
- UINT8_C(218), UINT8_C( 15), UINT8_C(214), UINT8_C(152),
1144
- UINT8_C(108), UINT8_C( 18), UINT8_C(104), UINT8_C( 3)),
1145
- simde_mm_set_epi16(INT16_C( 218), INT16_C( 15), INT16_C( 214), INT16_C( 152),
1146
- INT16_C( 108), INT16_C( 18), INT16_C( 104), INT16_C( 3)) },
1147
- { simde_x_mm_set_epu8(UINT8_C( 51), UINT8_C(122), UINT8_C(167), UINT8_C(232),
1148
- UINT8_C( 3), UINT8_C(167), UINT8_C( 89), UINT8_C(206),
1149
- UINT8_C( 96), UINT8_C(235), UINT8_C(128), UINT8_C(134),
1150
- UINT8_C(187), UINT8_C(190), UINT8_C(232), UINT8_C(112)),
1151
- simde_mm_set_epi16(INT16_C( 96), INT16_C( 235), INT16_C( 128), INT16_C( 134),
1152
- INT16_C( 187), INT16_C( 190), INT16_C( 232), INT16_C( 112)) },
1153
- { simde_x_mm_set_epu8(UINT8_C( 15), UINT8_C( 99), UINT8_C(228), UINT8_C( 12),
1154
- UINT8_C(155), UINT8_C(138), UINT8_C( 87), UINT8_C( 96),
1155
- UINT8_C( 98), UINT8_C( 66), UINT8_C( 96), UINT8_C( 53),
1156
- UINT8_C( 65), UINT8_C(187), UINT8_C(183), UINT8_C(114)),
1157
- simde_mm_set_epi16(INT16_C( 98), INT16_C( 66), INT16_C( 96), INT16_C( 53),
1158
- INT16_C( 65), INT16_C( 187), INT16_C( 183), INT16_C( 114)) },
1159
- { simde_x_mm_set_epu8(UINT8_C( 58), UINT8_C( 51), UINT8_C(210), UINT8_C( 42),
1160
- UINT8_C(132), UINT8_C(100), UINT8_C( 83), UINT8_C( 44),
1161
- UINT8_C(115), UINT8_C(204), UINT8_C(195), UINT8_C( 11),
1162
- UINT8_C( 48), UINT8_C( 39), UINT8_C( 37), UINT8_C(183)),
1163
- simde_mm_set_epi16(INT16_C( 115), INT16_C( 204), INT16_C( 195), INT16_C( 11),
1164
- INT16_C( 48), INT16_C( 39), INT16_C( 37), INT16_C( 183)) },
1165
- { simde_x_mm_set_epu8(UINT8_C( 56), UINT8_C(101), UINT8_C(162), UINT8_C(107),
1166
- UINT8_C( 59), UINT8_C( 91), UINT8_C( 63), UINT8_C(129),
1167
- UINT8_C(189), UINT8_C( 4), UINT8_C( 9), UINT8_C(155),
1168
- UINT8_C(150), UINT8_C( 39), UINT8_C(140), UINT8_C( 87)),
1169
- simde_mm_set_epi16(INT16_C( 189), INT16_C( 4), INT16_C( 9), INT16_C( 155),
1170
- INT16_C( 150), INT16_C( 39), INT16_C( 140), INT16_C( 87)) },
1171
- { simde_x_mm_set_epu8(UINT8_C(203), UINT8_C(158), UINT8_C(175), UINT8_C( 0),
1172
- UINT8_C( 27), UINT8_C( 64), UINT8_C(129), UINT8_C( 41),
1173
- UINT8_C(208), UINT8_C(180), UINT8_C(174), UINT8_C( 83),
1174
- UINT8_C(142), UINT8_C(198), UINT8_C( 36), UINT8_C(158)),
1175
- simde_mm_set_epi16(INT16_C( 208), INT16_C( 180), INT16_C( 174), INT16_C( 83),
1176
- INT16_C( 142), INT16_C( 198), INT16_C( 36), INT16_C( 158)) },
1177
- { simde_x_mm_set_epu8(UINT8_C( 48), UINT8_C(139), UINT8_C( 69), UINT8_C( 42),
1178
- UINT8_C(239), UINT8_C(255), UINT8_C( 84), UINT8_C(226),
1179
- UINT8_C(180), UINT8_C(204), UINT8_C( 81), UINT8_C(133),
1180
- UINT8_C(230), UINT8_C( 25), UINT8_C(218), UINT8_C(139)),
1181
- simde_mm_set_epi16(INT16_C( 180), INT16_C( 204), INT16_C( 81), INT16_C( 133),
1182
- INT16_C( 230), INT16_C( 25), INT16_C( 218), INT16_C( 139)) },
1183
- { simde_x_mm_set_epu8(UINT8_C(213), UINT8_C( 5), UINT8_C( 37), UINT8_C(243),
1184
- UINT8_C(196), UINT8_C(241), UINT8_C( 11), UINT8_C( 32),
1185
- UINT8_C(137), UINT8_C( 5), UINT8_C(216), UINT8_C(243),
1186
- UINT8_C( 25), UINT8_C( 23), UINT8_C(212), UINT8_C( 57)),
1187
- simde_mm_set_epi16(INT16_C( 137), INT16_C( 5), INT16_C( 216), INT16_C( 243),
1188
- INT16_C( 25), INT16_C( 23), INT16_C( 212), INT16_C( 57)) }
1189
- };
1190
-
1191
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1192
- simde__m128i r = simde_mm_cvtepu8_epi16(test_vec[i].a);
1193
- simde_assert_m128i_i16(r, ==, test_vec[i].r);
1194
- }
1195
-
1196
- return MUNIT_OK;
1197
- }
1198
-
1199
- static MunitResult
1200
- test_simde_mm_cvtepu8_epi32(const MunitParameter params[], void* data) {
1201
- (void) params;
1202
- (void) data;
1203
-
1204
- const struct {
1205
- simde__m128i a;
1206
- simde__m128i r;
1207
- } test_vec[8] = {
1208
- { simde_x_mm_set_epu8(216, 58, 77, 216, 179, 254, 83, 42,
1209
- 179, 211, 84, 116, 211, 142, 19, 247),
1210
- simde_mm_set_epi32(211, 142, 19, 247) },
1211
- { simde_x_mm_set_epu8(161, 70, 71, 24, 62, 44, 28, 40,
1212
- 34, 181, 114, 59, 33, 122, 68, 198),
1213
- simde_mm_set_epi32( 33, 122, 68, 198) },
1214
- { simde_x_mm_set_epu8(145, 160, 60, 140, 53, 127, 68, 235,
1215
- 225, 143, 244, 79, 20, 67, 173, 209),
1216
- simde_mm_set_epi32( 20, 67, 173, 209) },
1217
- { simde_x_mm_set_epu8(117, 146, 120, 54, 143, 242, 141, 149,
1218
- 73, 58, 87, 32, 199, 183, 202, 12),
1219
- simde_mm_set_epi32(199, 183, 202, 12) },
1220
- { simde_x_mm_set_epu8( 40, 57, 16, 79, 103, 249, 143, 197,
1221
- 214, 78, 201, 95, 85, 53, 247, 134),
1222
- simde_mm_set_epi32( 85, 53, 247, 134) },
1223
- { simde_x_mm_set_epu8( 72, 163, 211, 103, 152, 114, 2, 140,
1224
- 52, 64, 1, 9, 184, 145, 190, 245),
1225
- simde_mm_set_epi32(184, 145, 190, 245) },
1226
- { simde_x_mm_set_epu8( 7, 28, 147, 3, 70, 73, 159, 19,
1227
- 118, 122, 100, 52, 236, 17, 135, 121),
1228
- simde_mm_set_epi32(236, 17, 135, 121) },
1229
- { simde_x_mm_set_epu8(100, 233, 199, 97, 158, 240, 121, 115,
1230
- 142, 146, 159, 107, 202, 224, 156, 149),
1231
- simde_mm_set_epi32(202, 224, 156, 149) }
1232
- };
1233
-
1234
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1235
- simde__m128i r = simde_mm_cvtepu8_epi32(test_vec[i].a);
1236
- simde_assert_m128i_i32(r, ==, test_vec[i].r);
1237
- }
1238
-
1239
- return MUNIT_OK;
1240
- }
1241
-
1242
- static MunitResult
1243
- test_simde_mm_cvtepu8_epi64(const MunitParameter params[], void* data) {
1244
- (void) params;
1245
- (void) data;
1246
-
1247
- const struct {
1248
- simde__m128i a;
1249
- simde__m128i r;
1250
- } test_vec[8] = {
1251
- { simde_x_mm_set_epu8(UINT8_C(165), UINT8_C(138), UINT8_C( 9), UINT8_C(193),
1252
- UINT8_C(199), UINT8_C(213), UINT8_C(108), UINT8_C(127),
1253
- UINT8_C( 76), UINT8_C( 44), UINT8_C( 97), UINT8_C( 43),
1254
- UINT8_C( 10), UINT8_C( 41), UINT8_C(226), UINT8_C(134)),
1255
- simde_mm_set_epi64x(INT64_C( 226), INT64_C( 134)) },
1256
- { simde_x_mm_set_epu8(UINT8_C(206), UINT8_C(216), UINT8_C(228), UINT8_C( 95),
1257
- UINT8_C( 16), UINT8_C(235), UINT8_C(117), UINT8_C(249),
1258
- UINT8_C(118), UINT8_C(169), UINT8_C( 43), UINT8_C(125),
1259
- UINT8_C(139), UINT8_C( 7), UINT8_C( 78), UINT8_C( 91)),
1260
- simde_mm_set_epi64x(INT64_C( 78), INT64_C( 91)) },
1261
- { simde_x_mm_set_epu8(UINT8_C(217), UINT8_C( 54), UINT8_C( 70), UINT8_C( 24),
1262
- UINT8_C( 18), UINT8_C(185), UINT8_C( 8), UINT8_C( 83),
1263
- UINT8_C(138), UINT8_C(127), UINT8_C(171), UINT8_C(232),
1264
- UINT8_C( 25), UINT8_C( 28), UINT8_C(187), UINT8_C(172)),
1265
- simde_mm_set_epi64x(INT64_C( 187), INT64_C( 172)) },
1266
- { simde_x_mm_set_epu8(UINT8_C(139), UINT8_C(164), UINT8_C(130), UINT8_C(202),
1267
- UINT8_C(244), UINT8_C(121), UINT8_C( 41), UINT8_C(156),
1268
- UINT8_C(187), UINT8_C( 51), UINT8_C( 98), UINT8_C( 32),
1269
- UINT8_C(179), UINT8_C(192), UINT8_C(214), UINT8_C(180)),
1270
- simde_mm_set_epi64x(INT64_C( 214), INT64_C( 180)) },
1271
- { simde_x_mm_set_epu8(UINT8_C(216), UINT8_C( 40), UINT8_C(253), UINT8_C(179),
1272
- UINT8_C(134), UINT8_C(199), UINT8_C( 8), UINT8_C( 38),
1273
- UINT8_C(169), UINT8_C(253), UINT8_C(114), UINT8_C( 51),
1274
- UINT8_C(228), UINT8_C(119), UINT8_C(103), UINT8_C(155)),
1275
- simde_mm_set_epi64x(INT64_C( 103), INT64_C( 155)) },
1276
- { simde_x_mm_set_epu8(UINT8_C(197), UINT8_C(169), UINT8_C( 70), UINT8_C(235),
1277
- UINT8_C(100), UINT8_C(250), UINT8_C( 64), UINT8_C(127),
1278
- UINT8_C(118), UINT8_C(162), UINT8_C( 19), UINT8_C(173),
1279
- UINT8_C(116), UINT8_C(180), UINT8_C( 7), UINT8_C(216)),
1280
- simde_mm_set_epi64x(INT64_C( 7), INT64_C( 216)) },
1281
- { simde_x_mm_set_epu8(UINT8_C( 50), UINT8_C( 69), UINT8_C( 69), UINT8_C(227),
1282
- UINT8_C( 69), UINT8_C( 0), UINT8_C( 34), UINT8_C(232),
1283
- UINT8_C( 24), UINT8_C( 46), UINT8_C(141), UINT8_C(128),
1284
- UINT8_C(115), UINT8_C(157), UINT8_C(112), UINT8_C( 71)),
1285
- simde_mm_set_epi64x(INT64_C( 112), INT64_C( 71)) },
1286
- { simde_x_mm_set_epu8(UINT8_C(120), UINT8_C( 3), UINT8_C(197), UINT8_C(139),
1287
- UINT8_C( 31), UINT8_C(200), UINT8_C(250), UINT8_C(106),
1288
- UINT8_C(219), UINT8_C( 4), UINT8_C(206), UINT8_C( 64),
1289
- UINT8_C(217), UINT8_C(231), UINT8_C(229), UINT8_C( 14)),
1290
- simde_mm_set_epi64x(INT64_C( 229), INT64_C( 14)) }
1291
- };
1292
-
1293
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1294
- simde__m128i r = simde_mm_cvtepu8_epi64(test_vec[i].a);
1295
- simde_assert_m128i_i64(r, ==, test_vec[i].r);
1296
- }
1297
-
1298
- return MUNIT_OK;
1299
- }
1300
-
1301
- static MunitResult
1302
- test_simde_mm_cvtepu16_epi32(const MunitParameter params[], void* data) {
1303
- (void) params;
1304
- (void) data;
1305
-
1306
- const struct {
1307
- simde__m128i a;
1308
- simde__m128i r;
1309
- } test_vec[8] = {
1310
- { simde_x_mm_set_epu16(UINT16_C(45997), UINT16_C(54881), UINT16_C( 8073), UINT16_C(50053),
1311
- UINT16_C(33513), UINT16_C(60494), UINT16_C(44453), UINT16_C(35449)),
1312
- simde_mm_set_epi32(INT32_C( 33513), INT32_C( 60494), INT32_C( 44453), INT32_C( 35449)) },
1313
- { simde_x_mm_set_epu16(UINT16_C(29322), UINT16_C(60312), UINT16_C(23894), UINT16_C( 5611),
1314
- UINT16_C(43169), UINT16_C(36178), UINT16_C(30857), UINT16_C(27437)),
1315
- simde_mm_set_epi32(INT32_C( 43169), INT32_C( 36178), INT32_C( 30857), INT32_C( 27437)) },
1316
- { simde_x_mm_set_epu16(UINT16_C(36165), UINT16_C(32250), UINT16_C(32420), UINT16_C(54083),
1317
- UINT16_C(37595), UINT16_C( 6323), UINT16_C(24868), UINT16_C(13806)),
1318
- simde_mm_set_epi32(INT32_C( 37595), INT32_C( 6323), INT32_C( 24868), INT32_C( 13806)) },
1319
- { simde_x_mm_set_epu16(UINT16_C(47473), UINT16_C(25142), UINT16_C(53974), UINT16_C(29717),
1320
- UINT16_C(38600), UINT16_C(37432), UINT16_C(33857), UINT16_C( 7799)),
1321
- simde_mm_set_epi32(INT32_C( 38600), INT32_C( 37432), INT32_C( 33857), INT32_C( 7799)) },
1322
- { simde_x_mm_set_epu16(UINT16_C( 9476), UINT16_C(49162), UINT16_C(59100), UINT16_C(46196),
1323
- UINT16_C(39403), UINT16_C(33179), UINT16_C(42032), UINT16_C(16407)),
1324
- simde_mm_set_epi32(INT32_C( 39403), INT32_C( 33179), INT32_C( 42032), INT32_C( 16407)) },
1325
- { simde_x_mm_set_epu16(UINT16_C(13947), UINT16_C(14884), UINT16_C(63463), UINT16_C(60885),
1326
- UINT16_C(44795), UINT16_C(57577), UINT16_C( 9399), UINT16_C(54740)),
1327
- simde_mm_set_epi32(INT32_C( 44795), INT32_C( 57577), INT32_C( 9399), INT32_C( 54740)) },
1328
- { simde_x_mm_set_epu16(UINT16_C(16348), UINT16_C(41263), UINT16_C(29933), UINT16_C( 7966),
1329
- UINT16_C(11747), UINT16_C(45808), UINT16_C(10076), UINT16_C(52634)),
1330
- simde_mm_set_epi32(INT32_C( 11747), INT32_C( 45808), INT32_C( 10076), INT32_C( 52634)) },
1331
- { simde_x_mm_set_epu16(UINT16_C(44921), UINT16_C(31426), UINT16_C(50653), UINT16_C(39011),
1332
- UINT16_C(15796), UINT16_C(28031), UINT16_C(50348), UINT16_C(35430)),
1333
- simde_mm_set_epi32(INT32_C( 15796), INT32_C( 28031), INT32_C( 50348), INT32_C( 35430)) }
1334
- };
1335
-
1336
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1337
- simde__m128i r = simde_mm_cvtepu16_epi32(test_vec[i].a);
1338
- simde_assert_m128i_i32(r, ==, test_vec[i].r);
1339
- }
1340
-
1341
- return MUNIT_OK;
1342
- }
1343
-
1344
- static MunitResult
1345
- test_simde_mm_cvtepu16_epi64(const MunitParameter params[], void* data) {
1346
- (void) params;
1347
- (void) data;
1348
-
1349
- const struct {
1350
- simde__m128i a;
1351
- simde__m128i r;
1352
- } test_vec[8] = {
1353
- { simde_x_mm_set_epu16(UINT16_C(36944), UINT16_C(47640), UINT16_C( 2187), UINT16_C(10560),
1354
- UINT16_C( 1923), UINT16_C(52017), UINT16_C(41190), UINT16_C(51381)),
1355
- simde_mm_set_epi64x(INT64_C( 41190), INT64_C( 51381)) },
1356
- { simde_x_mm_set_epu16(UINT16_C(59110), UINT16_C( 781), UINT16_C( 2267), UINT16_C(32518),
1357
- UINT16_C(16361), UINT16_C(14242), UINT16_C(28197), UINT16_C(27455)),
1358
- simde_mm_set_epi64x(INT64_C( 28197), INT64_C( 27455)) },
1359
- { simde_x_mm_set_epu16(UINT16_C(45312), UINT16_C( 9417), UINT16_C(53316), UINT16_C(54914),
1360
- UINT16_C( 6651), UINT16_C(32993), UINT16_C(51134), UINT16_C(31066)),
1361
- simde_mm_set_epi64x(INT64_C( 51134), INT64_C( 31066)) },
1362
- { simde_x_mm_set_epu16(UINT16_C( 6198), UINT16_C(41996), UINT16_C(34257), UINT16_C( 1856),
1363
- UINT16_C(54306), UINT16_C(57993), UINT16_C(28922), UINT16_C(25456)),
1364
- simde_mm_set_epi64x(INT64_C( 28922), INT64_C( 25456)) },
1365
- { simde_x_mm_set_epu16(UINT16_C(52812), UINT16_C(10727), UINT16_C(10105), UINT16_C(31173),
1366
- UINT16_C( 2196), UINT16_C(38149), UINT16_C(12797), UINT16_C(56721)),
1367
- simde_mm_set_epi64x(INT64_C( 12797), INT64_C( 56721)) },
1368
- { simde_x_mm_set_epu16(UINT16_C(43893), UINT16_C(22212), UINT16_C(55173), UINT16_C(39507),
1369
- UINT16_C(17371), UINT16_C( 1379), UINT16_C(37505), UINT16_C(51758)),
1370
- simde_mm_set_epi64x(INT64_C( 37505), INT64_C( 51758)) },
1371
- { simde_x_mm_set_epu16(UINT16_C(10102), UINT16_C(59029), UINT16_C(11878), UINT16_C(57288),
1372
- UINT16_C(63955), UINT16_C(62443), UINT16_C( 1106), UINT16_C(32843)),
1373
- simde_mm_set_epi64x(INT64_C( 1106), INT64_C( 32843)) },
1374
- { simde_x_mm_set_epu16(UINT16_C( 7384), UINT16_C(18925), UINT16_C(61664), UINT16_C(62156),
1375
- UINT16_C(64229), UINT16_C(12260), UINT16_C(17269), UINT16_C( 165)),
1376
- simde_mm_set_epi64x(INT64_C( 17269), INT64_C( 165)) }
1377
- };
1378
-
1379
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1380
- simde__m128i r = simde_mm_cvtepu16_epi64(test_vec[i].a);
1381
- simde_assert_m128i_i64(r, ==, test_vec[i].r);
1382
- }
1383
-
1384
- return MUNIT_OK;
1385
- }
1386
-
1387
- static MunitResult
1388
- test_simde_mm_cvtepu32_epi64(const MunitParameter params[], void* data) {
1389
- (void) params;
1390
- (void) data;
1391
-
1392
- const struct {
1393
- simde__m128i a;
1394
- simde__m128i r;
1395
- } test_vec[8] = {
1396
- { simde_x_mm_set_epu32(UINT32_C(1089356158), UINT32_C( 716812601), UINT32_C(2600352285), UINT32_C( 851998215)),
1397
- simde_mm_set_epi64x(INT64_C( 2600352285), INT64_C( 851998215)) },
1398
- { simde_x_mm_set_epu32(UINT32_C(2083471993), UINT32_C(3995663695), UINT32_C( 718227173), UINT32_C(3645469582)),
1399
- simde_mm_set_epi64x(INT64_C( 718227173), INT64_C( 3645469582)) },
1400
- { simde_x_mm_set_epu32(UINT32_C(3121544286), UINT32_C( 583537062), UINT32_C( 362422775), UINT32_C(3876080612)),
1401
- simde_mm_set_epi64x(INT64_C( 362422775), INT64_C( 3876080612)) },
1402
- { simde_x_mm_set_epu32(UINT32_C( 336299187), UINT32_C(1772325077), UINT32_C(4159021368), UINT32_C(3897849224)),
1403
- simde_mm_set_epi64x(INT64_C( 4159021368), INT64_C( 3897849224)) },
1404
- { simde_x_mm_set_epu32(UINT32_C(2614142766), UINT32_C(3735995755), UINT32_C(2880699788), UINT32_C( 410975381)),
1405
- simde_mm_set_epi64x(INT64_C( 2880699788), INT64_C( 410975381)) },
1406
- { simde_x_mm_set_epu32(UINT32_C(2584819359), UINT32_C(2278276482), UINT32_C(3087779260), UINT32_C(2573826343)),
1407
- simde_mm_set_epi64x(INT64_C( 3087779260), INT64_C( 2573826343)) },
1408
- { simde_x_mm_set_epu32(UINT32_C( 809379705), UINT32_C( 343015345), UINT32_C( 434582428), UINT32_C( 776037113)),
1409
- simde_mm_set_epi64x(INT64_C( 434582428), INT64_C( 776037113)) },
1410
- { simde_x_mm_set_epu32(UINT32_C(2474833343), UINT32_C(1439643533), UINT32_C(3207542234), UINT32_C(2907982947)),
1411
- simde_mm_set_epi64x(INT64_C( 3207542234), INT64_C( 2907982947)) }
1412
- };
1413
-
1414
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1415
- simde__m128i r = simde_mm_cvtepu32_epi64(test_vec[i].a);
1416
- simde_assert_m128i_i64(r, ==, test_vec[i].r);
1417
- }
1418
-
1419
- return MUNIT_OK;
1420
- }
1421
-
1422
- static MunitResult
1423
- test_simde_mm_dp_pd(const MunitParameter params[], void* data) {
1424
- (void) params;
1425
- (void) data;
1426
-
1427
- const struct {
1428
- simde__m128d a;
1429
- simde__m128d b;
1430
- simde__m128d r;
1431
- } test_vec[8] = {
1432
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -564.11), SIMDE_FLOAT64_C( 340.88)),
1433
- simde_mm_set_pd(SIMDE_FLOAT64_C( -778.50), SIMDE_FLOAT64_C( -785.47)),
1434
- simde_mm_set_pd(SIMDE_FLOAT64_C( 0.00), SIMDE_FLOAT64_C(-267751.01)) },
1435
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -557.21), SIMDE_FLOAT64_C( -291.36)),
1436
- simde_mm_set_pd(SIMDE_FLOAT64_C( -799.93), SIMDE_FLOAT64_C( -716.65)),
1437
- simde_mm_set_pd(SIMDE_FLOAT64_C( 0.00), SIMDE_FLOAT64_C(208803.14)) },
1438
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -377.58), SIMDE_FLOAT64_C( 860.62)),
1439
- simde_mm_set_pd(SIMDE_FLOAT64_C( -199.70), SIMDE_FLOAT64_C( -642.81)),
1440
- simde_mm_set_pd(SIMDE_FLOAT64_C( 0.00), SIMDE_FLOAT64_C(-553215.14)) },
1441
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -782.59), SIMDE_FLOAT64_C( 223.96)),
1442
- simde_mm_set_pd(SIMDE_FLOAT64_C( -805.25), SIMDE_FLOAT64_C( 736.23)),
1443
- simde_mm_set_pd(SIMDE_FLOAT64_C( 0.00), SIMDE_FLOAT64_C(164886.07)) },
1444
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 472.55), SIMDE_FLOAT64_C( -591.15)),
1445
- simde_mm_set_pd(SIMDE_FLOAT64_C( 932.48), SIMDE_FLOAT64_C( 630.07)),
1446
- simde_mm_set_pd(SIMDE_FLOAT64_C( 0.00), SIMDE_FLOAT64_C(-372465.88)) },
1447
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 484.26), SIMDE_FLOAT64_C( -41.63)),
1448
- simde_mm_set_pd(SIMDE_FLOAT64_C( 593.03), SIMDE_FLOAT64_C( 955.21)),
1449
- simde_mm_set_pd(SIMDE_FLOAT64_C( 0.00), SIMDE_FLOAT64_C(-39765.39)) },
1450
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 820.67), SIMDE_FLOAT64_C( 120.74)),
1451
- simde_mm_set_pd(SIMDE_FLOAT64_C( 576.08), SIMDE_FLOAT64_C( 524.49)),
1452
- simde_mm_set_pd(SIMDE_FLOAT64_C( 0.00), SIMDE_FLOAT64_C(63326.92)) },
1453
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 696.23), SIMDE_FLOAT64_C( -565.44)),
1454
- simde_mm_set_pd(SIMDE_FLOAT64_C( 313.65), SIMDE_FLOAT64_C( 242.19)),
1455
- simde_mm_set_pd(SIMDE_FLOAT64_C( 0.00), SIMDE_FLOAT64_C(-136943.91)) }
1456
- };
1457
-
1458
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1459
- simde__m128d r = simde_mm_dp_pd(test_vec[i].a, test_vec[i].b, 85);
1460
- simde_assert_m128d_close(r, test_vec[i].r, 1);
1461
- }
1462
-
1463
- return MUNIT_OK;
1464
- }
1465
-
1466
- static MunitResult
1467
- test_simde_mm_dp_ps(const MunitParameter params[], void* data) {
1468
- (void) params;
1469
- (void) data;
1470
-
1471
- const struct {
1472
- simde__m128 a;
1473
- simde__m128 b;
1474
- simde__m128 r;
1475
- } test_vec[8] = {
1476
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 553.37), SIMDE_FLOAT32_C( 120.49), SIMDE_FLOAT32_C( -272.20), SIMDE_FLOAT32_C( -36.55)),
1477
- simde_mm_set_ps(SIMDE_FLOAT32_C( 115.84), SIMDE_FLOAT32_C( 676.89), SIMDE_FLOAT32_C( -919.81), SIMDE_FLOAT32_C( -927.02)),
1478
- simde_mm_set_ps(SIMDE_FLOAT32_C(250372.30), SIMDE_FLOAT32_C( 0.00), SIMDE_FLOAT32_C(250372.30), SIMDE_FLOAT32_C( 0.00)) },
1479
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 329.44), SIMDE_FLOAT32_C( -11.73), SIMDE_FLOAT32_C( -693.65), SIMDE_FLOAT32_C( -971.02)),
1480
- simde_mm_set_ps(SIMDE_FLOAT32_C( -316.00), SIMDE_FLOAT32_C( -919.35), SIMDE_FLOAT32_C( 956.50), SIMDE_FLOAT32_C( -382.80)),
1481
- simde_mm_set_ps(SIMDE_FLOAT32_C(-663476.25), SIMDE_FLOAT32_C( 0.00), SIMDE_FLOAT32_C(-663476.25), SIMDE_FLOAT32_C( 0.00)) },
1482
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 48.87), SIMDE_FLOAT32_C( -212.15), SIMDE_FLOAT32_C( 812.72), SIMDE_FLOAT32_C( 350.56)),
1483
- simde_mm_set_ps(SIMDE_FLOAT32_C( 612.16), SIMDE_FLOAT32_C( -336.28), SIMDE_FLOAT32_C( -314.44), SIMDE_FLOAT32_C( 725.39)),
1484
- simde_mm_set_ps(SIMDE_FLOAT32_C(-255551.67), SIMDE_FLOAT32_C( 0.00), SIMDE_FLOAT32_C(-255551.67), SIMDE_FLOAT32_C( 0.00)) },
1485
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -17.80), SIMDE_FLOAT32_C( 55.32), SIMDE_FLOAT32_C( 517.59), SIMDE_FLOAT32_C( 356.24)),
1486
- simde_mm_set_ps(SIMDE_FLOAT32_C( 440.41), SIMDE_FLOAT32_C( -728.96), SIMDE_FLOAT32_C( 250.15), SIMDE_FLOAT32_C( -658.46)),
1487
- simde_mm_set_ps(SIMDE_FLOAT32_C(129475.14), SIMDE_FLOAT32_C( 0.00), SIMDE_FLOAT32_C(129475.14), SIMDE_FLOAT32_C( 0.00)) },
1488
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 724.19), SIMDE_FLOAT32_C( 892.03), SIMDE_FLOAT32_C( 632.84), SIMDE_FLOAT32_C( 912.13)),
1489
- simde_mm_set_ps(SIMDE_FLOAT32_C( 816.72), SIMDE_FLOAT32_C( 934.76), SIMDE_FLOAT32_C( -86.66), SIMDE_FLOAT32_C( 780.21)),
1490
- simde_mm_set_ps(SIMDE_FLOAT32_C(-54841.92), SIMDE_FLOAT32_C( 0.00), SIMDE_FLOAT32_C(-54841.92), SIMDE_FLOAT32_C( 0.00)) },
1491
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 767.35), SIMDE_FLOAT32_C( 593.67), SIMDE_FLOAT32_C( 295.16), SIMDE_FLOAT32_C( -928.99)),
1492
- simde_mm_set_ps(SIMDE_FLOAT32_C( 446.17), SIMDE_FLOAT32_C( -781.62), SIMDE_FLOAT32_C( 967.10), SIMDE_FLOAT32_C( -630.50)),
1493
- simde_mm_set_ps(SIMDE_FLOAT32_C(285449.22), SIMDE_FLOAT32_C( 0.00), SIMDE_FLOAT32_C(285449.22), SIMDE_FLOAT32_C( 0.00)) },
1494
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 954.16), SIMDE_FLOAT32_C( -247.39), SIMDE_FLOAT32_C( 69.65), SIMDE_FLOAT32_C( -817.12)),
1495
- simde_mm_set_ps(SIMDE_FLOAT32_C( 330.91), SIMDE_FLOAT32_C( 409.60), SIMDE_FLOAT32_C( 841.84), SIMDE_FLOAT32_C( -474.27)),
1496
- simde_mm_set_ps(SIMDE_FLOAT32_C(58634.16), SIMDE_FLOAT32_C( 0.00), SIMDE_FLOAT32_C(58634.16), SIMDE_FLOAT32_C( 0.00)) },
1497
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -783.51), SIMDE_FLOAT32_C( -866.65), SIMDE_FLOAT32_C( -877.85), SIMDE_FLOAT32_C( -911.84)),
1498
- simde_mm_set_ps(SIMDE_FLOAT32_C( 4.33), SIMDE_FLOAT32_C( 855.54), SIMDE_FLOAT32_C( -839.28), SIMDE_FLOAT32_C( 261.89)),
1499
- simde_mm_set_ps(SIMDE_FLOAT32_C(736761.94), SIMDE_FLOAT32_C( 0.00), SIMDE_FLOAT32_C(736761.94), SIMDE_FLOAT32_C( 0.00)) }
1500
- };
1501
-
1502
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1503
- simde__m128 r = simde_mm_dp_ps(test_vec[i].a, test_vec[i].b, 42);
1504
- simde_assert_m128_close(r, test_vec[i].r, 1);
1505
- }
1506
-
1507
- return MUNIT_OK;
1508
- }
1509
-
1510
- static MunitResult
1511
- test_simde_mm_extract_epi8(const MunitParameter params[], void* data) {
1512
- (void) params;
1513
- (void) data;
1514
-
1515
- const struct {
1516
- simde__m128i a;
1517
- int8_t r;
1518
- } test_vec[8] = {
1519
- { simde_mm_set_epi8(INT8_C(-105), INT8_C(-107), INT8_C( -84), INT8_C( -57),
1520
- INT8_C( 13), INT8_C(-101), INT8_C( -59), INT8_C( -93),
1521
- INT8_C( 53), INT8_C( 83), INT8_C( -28), INT8_C( 126),
1522
- INT8_C(-111), INT8_C( -97), INT8_C( 25), INT8_C( -72)),
1523
- INT8_C(-97) },
1524
- { simde_mm_set_epi8(INT8_C( -76), INT8_C( -25), INT8_C( 36), INT8_C( -92),
1525
- INT8_C( -6), INT8_C( 77), INT8_C( -49), INT8_C(-126),
1526
- INT8_C( -50), INT8_C( 79), INT8_C( -93), INT8_C( -95),
1527
- INT8_C( -54), INT8_C(-116), INT8_C( -84), INT8_C( 66)),
1528
- INT8_C(-116) },
1529
- { simde_mm_set_epi8(INT8_C( 83), INT8_C( 123), INT8_C( 120), INT8_C( -66),
1530
- INT8_C( -3), INT8_C( 66), INT8_C( 110), INT8_C( 76),
1531
- INT8_C( 0), INT8_C( 83), INT8_C( 20), INT8_C( -12),
1532
- INT8_C( 83), INT8_C( 4), INT8_C( -39), INT8_C( 118)),
1533
- INT8_C(4) },
1534
- { simde_mm_set_epi8(INT8_C( 32), INT8_C( 30), INT8_C( 127), INT8_C( -79),
1535
- INT8_C( -10), INT8_C( 64), INT8_C( -45), INT8_C( 101),
1536
- INT8_C( 44), INT8_C( -25), INT8_C(-110), INT8_C( 105),
1537
- INT8_C( 83), INT8_C( 27), INT8_C( 15), INT8_C( 3)),
1538
- INT8_C(27) },
1539
- { simde_mm_set_epi8(INT8_C( 79), INT8_C( 95), INT8_C(-109), INT8_C( 26),
1540
- INT8_C( -81), INT8_C( -5), INT8_C( -84), INT8_C( 115),
1541
- INT8_C( -48), INT8_C( 104), INT8_C( 67), INT8_C( 26),
1542
- INT8_C( -41), INT8_C( -30), INT8_C( 94), INT8_C( -19)),
1543
- INT8_C(-30) },
1544
- { simde_mm_set_epi8(INT8_C( -81), INT8_C( -80), INT8_C(-109), INT8_C( -14),
1545
- INT8_C( 65), INT8_C( 10), INT8_C( 95), INT8_C( 83),
1546
- INT8_C( 123), INT8_C( 45), INT8_C( 39), INT8_C( 106),
1547
- INT8_C( -16), INT8_C(-123), INT8_C( -27), INT8_C( 56)),
1548
- INT8_C(-123) },
1549
- { simde_mm_set_epi8(INT8_C( 86), INT8_C( 79), INT8_C( 41), INT8_C( -51),
1550
- INT8_C( 97), INT8_C( 42), INT8_C( 117), INT8_C(-119),
1551
- INT8_C( -18), INT8_C(-127), INT8_C( 28), INT8_C( -21),
1552
- INT8_C(-101), INT8_C( -61), INT8_C( -63), INT8_C( 13)),
1553
- INT8_C(-61) },
1554
- { simde_mm_set_epi8(INT8_C( -22), INT8_C( -42), INT8_C( 109), INT8_C( -75),
1555
- INT8_C( -84), INT8_C( 60), INT8_C( -44), INT8_C( 8),
1556
- INT8_C( 118), INT8_C( 102), INT8_C( -6), INT8_C( 0),
1557
- INT8_C( -28), INT8_C( -81), INT8_C( 2), INT8_C( 94)),
1558
- INT8_C(-81) }
1559
- };
1560
-
1561
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1562
- int8_t r = simde_mm_extract_epi8(test_vec[i].a, 2);
1563
- munit_assert_int8(r, ==, test_vec[i].r);
1564
- }
1565
-
1566
- return MUNIT_OK;
1567
- }
1568
-
1569
- static MunitResult
1570
- test_simde_mm_extract_epi32(const MunitParameter params[], void* data) {
1571
- (void) params;
1572
- (void) data;
1573
-
1574
- const struct {
1575
- simde__m128i a;
1576
- int32_t r;
1577
- } test_vec[8] = {
1578
- { simde_mm_set_epi32(INT32_C( -989914365), INT32_C( -320568713), INT32_C( 764201252), INT32_C( -823076780)),
1579
- -320568713 },
1580
- { simde_mm_set_epi32(INT32_C( 1872661147), INT32_C( 1704933787), INT32_C( -552294669), INT32_C(-1494809408)),
1581
- 1704933787 },
1582
- { simde_mm_set_epi32(INT32_C( 1741332044), INT32_C( 170998046), INT32_C( 1368723621), INT32_C(-2071088920)),
1583
- 170998046 },
1584
- { simde_mm_set_epi32(INT32_C(-1942216470), INT32_C(-1426359243), INT32_C( 862877610), INT32_C( 898094861)),
1585
- -1426359243 },
1586
- { simde_mm_set_epi32(INT32_C( 998704029), INT32_C( 2083244310), INT32_C( 1997200410), INT32_C( -459833332)),
1587
- 2083244310 },
1588
- { simde_mm_set_epi32(INT32_C( 1256369906), INT32_C( 953394288), INT32_C( 1499034833), INT32_C( 990189413)),
1589
- 953394288 },
1590
- { simde_mm_set_epi32(INT32_C( 1704589159), INT32_C( -719174981), INT32_C( -821402820), INT32_C( -969954348)),
1591
- -719174981 },
1592
- { simde_mm_set_epi32(INT32_C( 29062750), INT32_C( 1388055657), INT32_C( 1520861645), INT32_C(-1651761160)),
1593
- 1388055657 }
1594
- };
1595
-
1596
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1597
- int32_t r = simde_mm_extract_epi32(test_vec[i].a, 2);
1598
- munit_assert_int32(r, ==, test_vec[i].r);
1599
- }
1600
-
1601
- return MUNIT_OK;
1602
- }
1603
-
1604
- static MunitResult
1605
- test_simde_mm_extract_epi64(const MunitParameter params[], void* data) {
1606
- (void) params;
1607
- (void) data;
1608
-
1609
- const struct {
1610
- simde__m128i a;
1611
- int64_t r;
1612
- } test_vec[8] = {
1613
- { simde_mm_set_epi64x(INT64_C( 3272238239526171606), INT64_C( 1654850679014379440)),
1614
- INT64_C( 3272238239526171606) },
1615
- { simde_mm_set_epi64x(INT64_C( -6129313439874067621), INT64_C( 8613384435853876616)),
1616
- INT64_C( -6129313439874067621) },
1617
- { simde_mm_set_epi64x(INT64_C( -6049641799095753965), INT64_C( -2810493496227171537)),
1618
- INT64_C( -6049641799095753965) },
1619
- { simde_mm_set_epi64x(INT64_C( 1486209521702266950), INT64_C( -7779883419844099734)),
1620
- INT64_C( 1486209521702266950) },
1621
- { simde_mm_set_epi64x(INT64_C( -4910022048576872084), INT64_C( -5820696718361059251)),
1622
- INT64_C( -4910022048576872084) },
1623
- { simde_mm_set_epi64x(INT64_C( -1923881977407946859), INT64_C( -5589720307210562868)),
1624
- INT64_C( -1923881977407946859) },
1625
- { simde_mm_set_epi64x(INT64_C( -3527421069943215520), INT64_C( 4545940692351426251)),
1626
- INT64_C( -3527421069943215520) },
1627
- { simde_mm_set_epi64x(INT64_C( 6123229719758625458), INT64_C( 1813312819011147191)),
1628
- INT64_C( 6123229719758625458) }
1629
- };
1630
-
1631
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1632
- int64_t r = simde_mm_extract_epi64(test_vec[i].a, 1);
1633
- munit_assert_int64(r, ==, test_vec[i].r);
1634
- }
1635
-
1636
- return MUNIT_OK;
1637
- }
1638
-
1639
- static MunitResult
1640
- test_simde_mm_floor_pd(const MunitParameter params[], void* data) {
1641
- (void) params;
1642
- (void) data;
1643
-
1644
- const struct {
1645
- simde__m128d a;
1646
- simde__m128d r;
1647
- } test_vec[8] = {
1648
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -638.24), SIMDE_FLOAT64_C( 771.01)),
1649
- simde_mm_set_pd(SIMDE_FLOAT64_C( -639.00), SIMDE_FLOAT64_C( 771.00)) },
1650
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -79.94), SIMDE_FLOAT64_C( 536.55)),
1651
- simde_mm_set_pd(SIMDE_FLOAT64_C( -80.00), SIMDE_FLOAT64_C( 536.00)) },
1652
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 145.74), SIMDE_FLOAT64_C( 124.77)),
1653
- simde_mm_set_pd(SIMDE_FLOAT64_C( 145.00), SIMDE_FLOAT64_C( 124.00)) },
1654
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 309.89), SIMDE_FLOAT64_C( -929.92)),
1655
- simde_mm_set_pd(SIMDE_FLOAT64_C( 309.00), SIMDE_FLOAT64_C( -930.00)) },
1656
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 138.72), SIMDE_FLOAT64_C( 502.95)),
1657
- simde_mm_set_pd(SIMDE_FLOAT64_C( 138.00), SIMDE_FLOAT64_C( 502.00)) },
1658
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 512.22), SIMDE_FLOAT64_C( 187.34)),
1659
- simde_mm_set_pd(SIMDE_FLOAT64_C( 512.00), SIMDE_FLOAT64_C( 187.00)) },
1660
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 560.17), SIMDE_FLOAT64_C( 420.10)),
1661
- simde_mm_set_pd(SIMDE_FLOAT64_C( 560.00), SIMDE_FLOAT64_C( 420.00)) },
1662
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 367.30), SIMDE_FLOAT64_C( 619.17)),
1663
- simde_mm_set_pd(SIMDE_FLOAT64_C( 367.00), SIMDE_FLOAT64_C( 619.00)) }
1664
- };
1665
-
1666
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1667
- simde__m128d r = simde_mm_floor_pd(test_vec[i].a);
1668
- simde_assert_m128d_close(r, test_vec[i].r, 1);
1669
- }
1670
-
1671
- return MUNIT_OK;
1672
- }
1673
-
1674
- static MunitResult
1675
- test_simde_mm_floor_ps(const MunitParameter params[], void* data) {
1676
- (void) params;
1677
- (void) data;
1678
-
1679
- const struct {
1680
- simde__m128 a;
1681
- simde__m128 r;
1682
- } test_vec[8] = {
1683
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 50.80), SIMDE_FLOAT32_C( 459.30), SIMDE_FLOAT32_C( -834.21), SIMDE_FLOAT32_C( 808.45)),
1684
- simde_mm_set_ps(SIMDE_FLOAT32_C( 50.00), SIMDE_FLOAT32_C( 459.00), SIMDE_FLOAT32_C( -835.00), SIMDE_FLOAT32_C( 808.00)) },
1685
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -648.20), SIMDE_FLOAT32_C( 768.10), SIMDE_FLOAT32_C( -885.11), SIMDE_FLOAT32_C( -162.62)),
1686
- simde_mm_set_ps(SIMDE_FLOAT32_C( -649.00), SIMDE_FLOAT32_C( 768.00), SIMDE_FLOAT32_C( -886.00), SIMDE_FLOAT32_C( -163.00)) },
1687
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -136.33), SIMDE_FLOAT32_C( 361.95), SIMDE_FLOAT32_C( -729.16), SIMDE_FLOAT32_C( -786.42)),
1688
- simde_mm_set_ps(SIMDE_FLOAT32_C( -137.00), SIMDE_FLOAT32_C( 361.00), SIMDE_FLOAT32_C( -730.00), SIMDE_FLOAT32_C( -787.00)) },
1689
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -579.89), SIMDE_FLOAT32_C( 55.32), SIMDE_FLOAT32_C( -998.01), SIMDE_FLOAT32_C( 191.65)),
1690
- simde_mm_set_ps(SIMDE_FLOAT32_C( -580.00), SIMDE_FLOAT32_C( 55.00), SIMDE_FLOAT32_C( -999.00), SIMDE_FLOAT32_C( 191.00)) },
1691
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 781.10), SIMDE_FLOAT32_C( 884.98), SIMDE_FLOAT32_C( 903.22), SIMDE_FLOAT32_C( 964.51)),
1692
- simde_mm_set_ps(SIMDE_FLOAT32_C( 781.00), SIMDE_FLOAT32_C( 884.00), SIMDE_FLOAT32_C( 903.00), SIMDE_FLOAT32_C( 964.00)) },
1693
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 255.11), SIMDE_FLOAT32_C( 929.26), SIMDE_FLOAT32_C( 869.55), SIMDE_FLOAT32_C( -749.47)),
1694
- simde_mm_set_ps(SIMDE_FLOAT32_C( 255.00), SIMDE_FLOAT32_C( 929.00), SIMDE_FLOAT32_C( 869.00), SIMDE_FLOAT32_C( -750.00)) },
1695
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -859.43), SIMDE_FLOAT32_C( 380.85), SIMDE_FLOAT32_C( -956.74), SIMDE_FLOAT32_C( -486.36)),
1696
- simde_mm_set_ps(SIMDE_FLOAT32_C( -860.00), SIMDE_FLOAT32_C( 380.00), SIMDE_FLOAT32_C( -957.00), SIMDE_FLOAT32_C( -487.00)) },
1697
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 154.98), SIMDE_FLOAT32_C( 341.89), SIMDE_FLOAT32_C( -431.03), SIMDE_FLOAT32_C( -687.74)),
1698
- simde_mm_set_ps(SIMDE_FLOAT32_C( 154.00), SIMDE_FLOAT32_C( 341.00), SIMDE_FLOAT32_C( -432.00), SIMDE_FLOAT32_C( -688.00)) }
1699
- };
1700
-
1701
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1702
- simde__m128 r = simde_mm_floor_ps(test_vec[i].a);
1703
- simde_assert_m128_close(r, test_vec[i].r, 1);
1704
- }
1705
-
1706
- return MUNIT_OK;
1707
- }
1708
-
1709
- static MunitResult
1710
- test_simde_mm_floor_sd(const MunitParameter params[], void* data) {
1711
- (void) params;
1712
- (void) data;
1713
-
1714
- const struct {
1715
- simde__m128d a;
1716
- simde__m128d b;
1717
- simde__m128d r;
1718
- } test_vec[8] = {
1719
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -651.87), SIMDE_FLOAT64_C( 624.42)),
1720
- simde_mm_set_pd(SIMDE_FLOAT64_C( 634.56), SIMDE_FLOAT64_C( -443.27)),
1721
- simde_mm_set_pd(SIMDE_FLOAT64_C( -651.87), SIMDE_FLOAT64_C( -444.00)) },
1722
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -650.57), SIMDE_FLOAT64_C( -388.70)),
1723
- simde_mm_set_pd(SIMDE_FLOAT64_C( 862.67), SIMDE_FLOAT64_C( -847.32)),
1724
- simde_mm_set_pd(SIMDE_FLOAT64_C( -650.57), SIMDE_FLOAT64_C( -848.00)) },
1725
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -429.60), SIMDE_FLOAT64_C( -927.81)),
1726
- simde_mm_set_pd(SIMDE_FLOAT64_C( 516.52), SIMDE_FLOAT64_C( -109.38)),
1727
- simde_mm_set_pd(SIMDE_FLOAT64_C( -429.60), SIMDE_FLOAT64_C( -110.00)) },
1728
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 119.92), SIMDE_FLOAT64_C( 571.26)),
1729
- simde_mm_set_pd(SIMDE_FLOAT64_C( 15.01), SIMDE_FLOAT64_C( 819.76)),
1730
- simde_mm_set_pd(SIMDE_FLOAT64_C( 119.92), SIMDE_FLOAT64_C( 819.00)) },
1731
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -625.27), SIMDE_FLOAT64_C( 998.84)),
1732
- simde_mm_set_pd(SIMDE_FLOAT64_C( -570.19), SIMDE_FLOAT64_C( -85.39)),
1733
- simde_mm_set_pd(SIMDE_FLOAT64_C( -625.27), SIMDE_FLOAT64_C( -86.00)) },
1734
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 105.61), SIMDE_FLOAT64_C( -345.20)),
1735
- simde_mm_set_pd(SIMDE_FLOAT64_C( -705.02), SIMDE_FLOAT64_C( -93.90)),
1736
- simde_mm_set_pd(SIMDE_FLOAT64_C( 105.61), SIMDE_FLOAT64_C( -94.00)) },
1737
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -824.97), SIMDE_FLOAT64_C( -396.57)),
1738
- simde_mm_set_pd(SIMDE_FLOAT64_C( -840.00), SIMDE_FLOAT64_C( 609.38)),
1739
- simde_mm_set_pd(SIMDE_FLOAT64_C( -824.97), SIMDE_FLOAT64_C( 609.00)) },
1740
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 488.09), SIMDE_FLOAT64_C( -64.70)),
1741
- simde_mm_set_pd(SIMDE_FLOAT64_C( 92.99), SIMDE_FLOAT64_C( 531.79)),
1742
- simde_mm_set_pd(SIMDE_FLOAT64_C( 488.09), SIMDE_FLOAT64_C( 531.00)) }
1743
- };
1744
-
1745
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1746
- simde__m128d r = simde_mm_floor_sd(test_vec[i].a, test_vec[i].b);
1747
- simde_assert_m128d_close(r, test_vec[i].r, 1);
1748
- }
1749
-
1750
- return MUNIT_OK;
1751
- }
1752
-
1753
- static MunitResult
1754
- test_simde_mm_floor_ss(const MunitParameter params[], void* data) {
1755
- (void) params;
1756
- (void) data;
1757
-
1758
- const struct {
1759
- simde__m128 a;
1760
- simde__m128 b;
1761
- simde__m128 r;
1762
- } test_vec[8] = {
1763
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 932.95), SIMDE_FLOAT32_C( 946.85), SIMDE_FLOAT32_C( -866.96), SIMDE_FLOAT32_C( 383.68)),
1764
- simde_mm_set_ps(SIMDE_FLOAT32_C( 82.96), SIMDE_FLOAT32_C( 541.21), SIMDE_FLOAT32_C( 296.52), SIMDE_FLOAT32_C( 677.59)),
1765
- simde_mm_set_ps(SIMDE_FLOAT32_C( 932.95), SIMDE_FLOAT32_C( 946.85), SIMDE_FLOAT32_C( -866.96), SIMDE_FLOAT32_C( 677.00)) },
1766
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -824.32), SIMDE_FLOAT32_C( -924.44), SIMDE_FLOAT32_C( -44.45), SIMDE_FLOAT32_C( 340.62)),
1767
- simde_mm_set_ps(SIMDE_FLOAT32_C( 771.85), SIMDE_FLOAT32_C( -635.91), SIMDE_FLOAT32_C( 706.67), SIMDE_FLOAT32_C( 477.32)),
1768
- simde_mm_set_ps(SIMDE_FLOAT32_C( -824.32), SIMDE_FLOAT32_C( -924.44), SIMDE_FLOAT32_C( -44.45), SIMDE_FLOAT32_C( 477.00)) },
1769
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 991.94), SIMDE_FLOAT32_C( 918.28), SIMDE_FLOAT32_C( -617.36), SIMDE_FLOAT32_C( 932.02)),
1770
- simde_mm_set_ps(SIMDE_FLOAT32_C( -21.99), SIMDE_FLOAT32_C( 274.28), SIMDE_FLOAT32_C( 819.55), SIMDE_FLOAT32_C( -957.22)),
1771
- simde_mm_set_ps(SIMDE_FLOAT32_C( 991.94), SIMDE_FLOAT32_C( 918.28), SIMDE_FLOAT32_C( -617.36), SIMDE_FLOAT32_C( -958.00)) },
1772
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 178.34), SIMDE_FLOAT32_C( -961.13), SIMDE_FLOAT32_C( 949.60), SIMDE_FLOAT32_C( -711.62)),
1773
- simde_mm_set_ps(SIMDE_FLOAT32_C( -951.61), SIMDE_FLOAT32_C( 53.93), SIMDE_FLOAT32_C( 376.79), SIMDE_FLOAT32_C( -892.19)),
1774
- simde_mm_set_ps(SIMDE_FLOAT32_C( 178.34), SIMDE_FLOAT32_C( -961.13), SIMDE_FLOAT32_C( 949.60), SIMDE_FLOAT32_C( -893.00)) },
1775
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -858.80), SIMDE_FLOAT32_C( 721.75), SIMDE_FLOAT32_C( 422.70), SIMDE_FLOAT32_C( -573.55)),
1776
- simde_mm_set_ps(SIMDE_FLOAT32_C( 473.81), SIMDE_FLOAT32_C( -473.48), SIMDE_FLOAT32_C( 815.69), SIMDE_FLOAT32_C( 520.75)),
1777
- simde_mm_set_ps(SIMDE_FLOAT32_C( -858.80), SIMDE_FLOAT32_C( 721.75), SIMDE_FLOAT32_C( 422.70), SIMDE_FLOAT32_C( 520.00)) },
1778
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -849.38), SIMDE_FLOAT32_C( 6.45), SIMDE_FLOAT32_C( -927.45), SIMDE_FLOAT32_C( -143.78)),
1779
- simde_mm_set_ps(SIMDE_FLOAT32_C( 593.59), SIMDE_FLOAT32_C( 314.52), SIMDE_FLOAT32_C( 115.80), SIMDE_FLOAT32_C( 369.25)),
1780
- simde_mm_set_ps(SIMDE_FLOAT32_C( -849.38), SIMDE_FLOAT32_C( 6.45), SIMDE_FLOAT32_C( -927.45), SIMDE_FLOAT32_C( 369.00)) },
1781
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -22.36), SIMDE_FLOAT32_C( 891.64), SIMDE_FLOAT32_C( 742.10), SIMDE_FLOAT32_C( 13.68)),
1782
- simde_mm_set_ps(SIMDE_FLOAT32_C( 900.76), SIMDE_FLOAT32_C( -733.09), SIMDE_FLOAT32_C( -137.10), SIMDE_FLOAT32_C( -90.09)),
1783
- simde_mm_set_ps(SIMDE_FLOAT32_C( -22.36), SIMDE_FLOAT32_C( 891.64), SIMDE_FLOAT32_C( 742.10), SIMDE_FLOAT32_C( -91.00)) },
1784
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -977.22), SIMDE_FLOAT32_C( -98.98), SIMDE_FLOAT32_C( -253.27), SIMDE_FLOAT32_C( 664.01)),
1785
- simde_mm_set_ps(SIMDE_FLOAT32_C( 252.97), SIMDE_FLOAT32_C( 266.57), SIMDE_FLOAT32_C( -16.11), SIMDE_FLOAT32_C( -404.33)),
1786
- simde_mm_set_ps(SIMDE_FLOAT32_C( -977.22), SIMDE_FLOAT32_C( -98.98), SIMDE_FLOAT32_C( -253.27), SIMDE_FLOAT32_C( -405.00)) }
1787
- };
1788
-
1789
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1790
- simde__m128 r = simde_mm_floor_ss(test_vec[i].a, test_vec[i].b);
1791
- simde_assert_m128_close(r, test_vec[i].r, 1);
1792
- }
1793
-
1794
- return MUNIT_OK;
1795
- }
1796
-
1797
- static MunitResult
1798
- test_simde_mm_insert_epi8(const MunitParameter params[], void* data) {
1799
- (void) params;
1800
- (void) data;
1801
-
1802
- const struct {
1803
- simde__m128i a;
1804
- int b;
1805
- simde__m128i r;
1806
- } test_vec[8] = {
1807
- { simde_mm_set_epi8(INT8_C( 10), INT8_C( -18), INT8_C(-117), INT8_C( 95),
1808
- INT8_C(-108), INT8_C( 57), INT8_C( 54), INT8_C( -50),
1809
- INT8_C( 60), INT8_C( -68), INT8_C( 115), INT8_C( 14),
1810
- INT8_C( -71), INT8_C( -40), INT8_C( 34), INT8_C( 112)),
1811
- 6,
1812
- simde_mm_set_epi8(INT8_C( 10), INT8_C( -18), INT8_C(-117), INT8_C( 6),
1813
- INT8_C(-108), INT8_C( 57), INT8_C( 54), INT8_C( -50),
1814
- INT8_C( 60), INT8_C( -68), INT8_C( 115), INT8_C( 14),
1815
- INT8_C( -71), INT8_C( -40), INT8_C( 34), INT8_C( 112)) },
1816
- { simde_mm_set_epi8(INT8_C(-117), INT8_C( 67), INT8_C(-105), INT8_C( 26),
1817
- INT8_C( 118), INT8_C( 67), INT8_C( 72), INT8_C( 120),
1818
- INT8_C( -74), INT8_C( -8), INT8_C(-126), INT8_C( -39),
1819
- INT8_C( 53), INT8_C( 74), INT8_C( 64), INT8_C( -74)),
1820
- 13,
1821
- simde_mm_set_epi8(INT8_C(-117), INT8_C( 67), INT8_C(-105), INT8_C( 13),
1822
- INT8_C( 118), INT8_C( 67), INT8_C( 72), INT8_C( 120),
1823
- INT8_C( -74), INT8_C( -8), INT8_C(-126), INT8_C( -39),
1824
- INT8_C( 53), INT8_C( 74), INT8_C( 64), INT8_C( -74)) },
1825
- { simde_mm_set_epi8(INT8_C( 10), INT8_C(-114), INT8_C( 116), INT8_C(-108),
1826
- INT8_C( 36), INT8_C( -74), INT8_C( 76), INT8_C( -2),
1827
- INT8_C( 118), INT8_C( -60), INT8_C( 3), INT8_C( 48),
1828
- INT8_C( 76), INT8_C( -18), INT8_C( -69), INT8_C(-110)),
1829
- 13,
1830
- simde_mm_set_epi8(INT8_C( 10), INT8_C(-114), INT8_C( 116), INT8_C( 13),
1831
- INT8_C( 36), INT8_C( -74), INT8_C( 76), INT8_C( -2),
1832
- INT8_C( 118), INT8_C( -60), INT8_C( 3), INT8_C( 48),
1833
- INT8_C( 76), INT8_C( -18), INT8_C( -69), INT8_C(-110)) },
1834
- { simde_mm_set_epi8(INT8_C( -48), INT8_C( -33), INT8_C( -9), INT8_C( -27),
1835
- INT8_C( -99), INT8_C( 29), INT8_C( 111), INT8_C( 85),
1836
- INT8_C( 104), INT8_C( -59), INT8_C( -17), INT8_C( 23),
1837
- INT8_C( 113), INT8_C( 8), INT8_C( 94), INT8_C( -32)),
1838
- 0,
1839
- simde_mm_set_epi8(INT8_C( -48), INT8_C( -33), INT8_C( -9), INT8_C( 0),
1840
- INT8_C( -99), INT8_C( 29), INT8_C( 111), INT8_C( 85),
1841
- INT8_C( 104), INT8_C( -59), INT8_C( -17), INT8_C( 23),
1842
- INT8_C( 113), INT8_C( 8), INT8_C( 94), INT8_C( -32)) },
1843
- { simde_mm_set_epi8(INT8_C( -15), INT8_C(-126), INT8_C( 63), INT8_C( 14),
1844
- INT8_C( 2), INT8_C( 88), INT8_C( -73), INT8_C( 22),
1845
- INT8_C( -36), INT8_C( 60), INT8_C( -75), INT8_C( -26),
1846
- INT8_C( -12), INT8_C(-126), INT8_C( 44), INT8_C( -36)),
1847
- 8,
1848
- simde_mm_set_epi8(INT8_C( -15), INT8_C(-126), INT8_C( 63), INT8_C( 8),
1849
- INT8_C( 2), INT8_C( 88), INT8_C( -73), INT8_C( 22),
1850
- INT8_C( -36), INT8_C( 60), INT8_C( -75), INT8_C( -26),
1851
- INT8_C( -12), INT8_C(-126), INT8_C( 44), INT8_C( -36)) },
1852
- { simde_mm_set_epi8(INT8_C( 41), INT8_C(-102), INT8_C( 115), INT8_C( 65),
1853
- INT8_C( 22), INT8_C( -32), INT8_C( -29), INT8_C( 85),
1854
- INT8_C( -61), INT8_C( 79), INT8_C(-107), INT8_C( -9),
1855
- INT8_C( 89), INT8_C( -3), INT8_C(-124), INT8_C( 71)),
1856
- 4,
1857
- simde_mm_set_epi8(INT8_C( 41), INT8_C(-102), INT8_C( 115), INT8_C( 4),
1858
- INT8_C( 22), INT8_C( -32), INT8_C( -29), INT8_C( 85),
1859
- INT8_C( -61), INT8_C( 79), INT8_C(-107), INT8_C( -9),
1860
- INT8_C( 89), INT8_C( -3), INT8_C(-124), INT8_C( 71)) },
1861
- { simde_mm_set_epi8(INT8_C( 109), INT8_C( -46), INT8_C( -71), INT8_C( 107),
1862
- INT8_C( 105), INT8_C( 123), INT8_C( -72), INT8_C( 72),
1863
- INT8_C( -43), INT8_C( 111), INT8_C( 75), INT8_C( 60),
1864
- INT8_C( 47), INT8_C( 78), INT8_C( -45), INT8_C(-101)),
1865
- 7,
1866
- simde_mm_set_epi8(INT8_C( 109), INT8_C( -46), INT8_C( -71), INT8_C( 7),
1867
- INT8_C( 105), INT8_C( 123), INT8_C( -72), INT8_C( 72),
1868
- INT8_C( -43), INT8_C( 111), INT8_C( 75), INT8_C( 60),
1869
- INT8_C( 47), INT8_C( 78), INT8_C( -45), INT8_C(-101)) },
1870
- { simde_mm_set_epi8(INT8_C( -15), INT8_C( -23), INT8_C( 43), INT8_C( 15),
1871
- INT8_C(-126), INT8_C( 102), INT8_C( 109), INT8_C( 84),
1872
- INT8_C( -63), INT8_C( 80), INT8_C(-127), INT8_C( -46),
1873
- INT8_C(-119), INT8_C( 111), INT8_C( -57), INT8_C( 55)),
1874
- 15,
1875
- simde_mm_set_epi8(INT8_C( -15), INT8_C( -23), INT8_C( 43), INT8_C( 15),
1876
- INT8_C(-126), INT8_C( 102), INT8_C( 109), INT8_C( 84),
1877
- INT8_C( -63), INT8_C( 80), INT8_C(-127), INT8_C( -46),
1878
- INT8_C(-119), INT8_C( 111), INT8_C( -57), INT8_C( 55)) }
1879
- };
1880
-
1881
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1882
- simde__m128i r = simde_mm_insert_epi8(test_vec[i].a, test_vec[i].b, 12);
1883
- simde_assert_m128i_i8(r, ==, test_vec[i].r);
1884
- }
1885
-
1886
- return MUNIT_OK;
1887
- }
1888
-
1889
- static MunitResult
1890
- test_simde_mm_insert_epi32(const MunitParameter params[], void* data) {
1891
- (void) params;
1892
- (void) data;
1893
-
1894
- const struct {
1895
- simde__m128i a;
1896
- int32_t b;
1897
- simde__m128i r;
1898
- } test_vec[8] = {
1899
- { simde_mm_set_epi32(INT32_C( 1714139829), INT32_C( 980372706), INT32_C(-2140490700), INT32_C( 1671335242)),
1900
- INT32_C( -570572581),
1901
- simde_mm_set_epi32(INT32_C( -570572581), INT32_C( 980372706), INT32_C(-2140490700), INT32_C( 1671335242)) },
1902
- { simde_mm_set_epi32(INT32_C( -385110226), INT32_C( 1048550831), INT32_C( -768686987), INT32_C( -197993270)),
1903
- INT32_C( 292040766),
1904
- simde_mm_set_epi32(INT32_C( 292040766), INT32_C( 1048550831), INT32_C( -768686987), INT32_C( -197993270)) },
1905
- { simde_mm_set_epi32(INT32_C( 1804855856), INT32_C( -940421248), INT32_C(-2104492113), INT32_C( 529461525)),
1906
- INT32_C( 514665012),
1907
- simde_mm_set_epi32(INT32_C( 514665012), INT32_C( -940421248), INT32_C(-2104492113), INT32_C( 529461525)) },
1908
- { simde_mm_set_epi32(INT32_C( -85551175), INT32_C( 885869319), INT32_C( 2003605165), INT32_C( -219227805)),
1909
- INT32_C( 1214139778),
1910
- simde_mm_set_epi32(INT32_C( 1214139778), INT32_C( 885869319), INT32_C( 2003605165), INT32_C( -219227805)) },
1911
- { simde_mm_set_epi32(INT32_C( -682699624), INT32_C( -729535744), INT32_C( -714850455), INT32_C( 418841580)),
1912
- INT32_C( -606767281),
1913
- simde_mm_set_epi32(INT32_C( -606767281), INT32_C( -729535744), INT32_C( -714850455), INT32_C( 418841580)) },
1914
- { simde_mm_set_epi32(INT32_C( 1844877442), INT32_C(-1305620543), INT32_C( -803345723), INT32_C(-1617611400)),
1915
- INT32_C( 166894477),
1916
- simde_mm_set_epi32(INT32_C( 166894477), INT32_C(-1305620543), INT32_C( -803345723), INT32_C(-1617611400)) },
1917
- { simde_mm_set_epi32(INT32_C( 1121577587), INT32_C( 1868325196), INT32_C( 567002451), INT32_C(-2029289287)),
1918
- INT32_C( 566028624),
1919
- simde_mm_set_epi32(INT32_C( 566028624), INT32_C( 1868325196), INT32_C( 567002451), INT32_C(-2029289287)) },
1920
- { simde_mm_set_epi32(INT32_C( 1745932520), INT32_C( 83968460), INT32_C(-1677360074), INT32_C( -664327669)),
1921
- INT32_C(-2041481189),
1922
- simde_mm_set_epi32(INT32_C(-2041481189), INT32_C( 83968460), INT32_C(-1677360074), INT32_C( -664327669)) }
1923
- };
1924
-
1925
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1926
- simde__m128i r = simde_mm_insert_epi32(test_vec[i].a, test_vec[i].b, 3);
1927
- simde_assert_m128i_i32(r, ==, test_vec[i].r);
1928
- }
1929
-
1930
- return MUNIT_OK;
1931
- }
1932
-
1933
- static MunitResult
1934
- test_simde_mm_insert_epi64(const MunitParameter params[], void* data) {
1935
- (void) params;
1936
- (void) data;
1937
-
1938
- const struct {
1939
- simde__m128i a;
1940
- int64_t b;
1941
- simde__m128i r;
1942
- } test_vec[8] = {
1943
- { simde_mm_set_epi64x(INT64_C( 7362174507306405090), INT64_C(-9193337552220811958)),
1944
- INT64_C( -850374615753703205),
1945
- simde_mm_set_epi64x(INT64_C( -850374615753703205), INT64_C(-9193337552220811958)) },
1946
- { simde_mm_set_epi64x(INT64_C( 1254305542978645806), INT64_C( 4503491530864903285)),
1947
- INT64_C(-9038724799495474923),
1948
- simde_mm_set_epi64x(INT64_C(-9038724799495474923), INT64_C( 4503491530864903285)) },
1949
- { simde_mm_set_epi64x(INT64_C( -941576252334200268), INT64_C( 7751796878868631424)),
1950
- INT64_C( 3804779755638396589),
1951
- simde_mm_set_epi64x(INT64_C( 3804779755638396589), INT64_C( 7751796878868631424)) },
1952
- { simde_mm_set_epi64x(INT64_C(-3070259325336878100), INT64_C( 5214690643492116409)),
1953
- INT64_C(-2932172554506065152),
1954
- simde_mm_set_epi64x(INT64_C(-2932172554506065152), INT64_C( 5214690643492116409)) },
1955
- { simde_mm_set_epi64x(INT64_C(-5607597529679140155), INT64_C(-6947588056948574385)),
1956
- INT64_C( 716806322442901634),
1957
- simde_mm_set_epi64x(INT64_C( 716806322442901634), INT64_C(-6947588056948574385)) },
1958
- { simde_mm_set_epi64x(INT64_C( 4817139057959919948), INT64_C( 2435256986062520505)),
1959
- INT64_C(-2853265611616884400),
1960
- simde_mm_set_epi64x(INT64_C(-2853265611616884400), INT64_C( 2435256986062520505)) },
1961
- { simde_mm_set_epi64x(INT64_C(-8768094940408262424), INT64_C( 360641792213091382)),
1962
- INT64_C(-4200371864439390341),
1963
- simde_mm_set_epi64x(INT64_C(-4200371864439390341), INT64_C( 360641792213091382)) },
1964
- { simde_mm_set_epi64x(INT64_C(-6597763380374804743), INT64_C( 8897544020142746680)),
1965
- INT64_C( 6543676199726157119),
1966
- simde_mm_set_epi64x(INT64_C( 6543676199726157119), INT64_C( 8897544020142746680)) }
1967
- };
1968
-
1969
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
1970
- simde__m128i r = simde_mm_insert_epi64(test_vec[i].a, test_vec[i].b, 1);
1971
- simde_assert_m128i_i64(r, ==, test_vec[i].r);
1972
- }
1973
-
1974
- return MUNIT_OK;
1975
- }
1976
-
1977
- static MunitResult
1978
- test_simde_mm_insert_ps(const MunitParameter params[], void* data) {
1979
- (void) params;
1980
- (void) data;
1981
-
1982
- const struct {
1983
- simde__m128 a;
1984
- simde__m128 b;
1985
- simde__m128 r;
1986
- } test_vec[8] = {
1987
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -841.30), SIMDE_FLOAT32_C( 235.25), SIMDE_FLOAT32_C( -673.83), SIMDE_FLOAT32_C( -700.28)),
1988
- simde_mm_set_ps(SIMDE_FLOAT32_C( 92.06), SIMDE_FLOAT32_C( 735.95), SIMDE_FLOAT32_C( 171.76), SIMDE_FLOAT32_C( 644.60)),
1989
- simde_mm_set_ps(SIMDE_FLOAT32_C( -841.30), SIMDE_FLOAT32_C( 235.25), SIMDE_FLOAT32_C( 0.00), SIMDE_FLOAT32_C( 0.00)) },
1990
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 658.47), SIMDE_FLOAT32_C( -385.89), SIMDE_FLOAT32_C( 916.54), SIMDE_FLOAT32_C( -937.06)),
1991
- simde_mm_set_ps(SIMDE_FLOAT32_C( -209.24), SIMDE_FLOAT32_C( -655.00), SIMDE_FLOAT32_C( -722.53), SIMDE_FLOAT32_C( -502.41)),
1992
- simde_mm_set_ps(SIMDE_FLOAT32_C( 658.47), SIMDE_FLOAT32_C( -385.89), SIMDE_FLOAT32_C( 0.00), SIMDE_FLOAT32_C( 0.00)) },
1993
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 364.58), SIMDE_FLOAT32_C( -402.45), SIMDE_FLOAT32_C( -252.76), SIMDE_FLOAT32_C( 525.23)),
1994
- simde_mm_set_ps(SIMDE_FLOAT32_C( -670.47), SIMDE_FLOAT32_C( 704.70), SIMDE_FLOAT32_C( -13.52), SIMDE_FLOAT32_C( -328.78)),
1995
- simde_mm_set_ps(SIMDE_FLOAT32_C( 364.58), SIMDE_FLOAT32_C( -402.45), SIMDE_FLOAT32_C( 0.00), SIMDE_FLOAT32_C( 0.00)) },
1996
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 313.55), SIMDE_FLOAT32_C( 334.89), SIMDE_FLOAT32_C( -877.87), SIMDE_FLOAT32_C( -974.35)),
1997
- simde_mm_set_ps(SIMDE_FLOAT32_C( 708.89), SIMDE_FLOAT32_C( 60.29), SIMDE_FLOAT32_C( 416.58), SIMDE_FLOAT32_C( -180.37)),
1998
- simde_mm_set_ps(SIMDE_FLOAT32_C( 313.55), SIMDE_FLOAT32_C( 334.89), SIMDE_FLOAT32_C( 0.00), SIMDE_FLOAT32_C( 0.00)) },
1999
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 857.51), SIMDE_FLOAT32_C( 674.21), SIMDE_FLOAT32_C( 882.64), SIMDE_FLOAT32_C( 238.47)),
2000
- simde_mm_set_ps(SIMDE_FLOAT32_C( 556.45), SIMDE_FLOAT32_C( -280.75), SIMDE_FLOAT32_C( -829.81), SIMDE_FLOAT32_C( 113.59)),
2001
- simde_mm_set_ps(SIMDE_FLOAT32_C( 857.51), SIMDE_FLOAT32_C( 674.21), SIMDE_FLOAT32_C( 0.00), SIMDE_FLOAT32_C( 0.00)) },
2002
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 520.41), SIMDE_FLOAT32_C( -251.34), SIMDE_FLOAT32_C( 896.76), SIMDE_FLOAT32_C( -419.46)),
2003
- simde_mm_set_ps(SIMDE_FLOAT32_C( 87.20), SIMDE_FLOAT32_C( 358.54), SIMDE_FLOAT32_C( 859.02), SIMDE_FLOAT32_C( -278.34)),
2004
- simde_mm_set_ps(SIMDE_FLOAT32_C( 520.41), SIMDE_FLOAT32_C( -251.34), SIMDE_FLOAT32_C( 0.00), SIMDE_FLOAT32_C( 0.00)) },
2005
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 533.51), SIMDE_FLOAT32_C( 968.42), SIMDE_FLOAT32_C( -332.89), SIMDE_FLOAT32_C( 137.03)),
2006
- simde_mm_set_ps(SIMDE_FLOAT32_C( -277.45), SIMDE_FLOAT32_C( 701.40), SIMDE_FLOAT32_C( -500.07), SIMDE_FLOAT32_C( -788.33)),
2007
- simde_mm_set_ps(SIMDE_FLOAT32_C( 533.51), SIMDE_FLOAT32_C( 968.42), SIMDE_FLOAT32_C( 0.00), SIMDE_FLOAT32_C( 0.00)) },
2008
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -468.51), SIMDE_FLOAT32_C( -644.45), SIMDE_FLOAT32_C( -325.06), SIMDE_FLOAT32_C( 994.31)),
2009
- simde_mm_set_ps(SIMDE_FLOAT32_C( 290.72), SIMDE_FLOAT32_C( 585.35), SIMDE_FLOAT32_C( 669.48), SIMDE_FLOAT32_C( 65.07)),
2010
- simde_mm_set_ps(SIMDE_FLOAT32_C( -468.51), SIMDE_FLOAT32_C( -644.45), SIMDE_FLOAT32_C( 0.00), SIMDE_FLOAT32_C( 0.00)) }
2011
- };
2012
-
2013
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
2014
- simde__m128 r = simde_mm_insert_ps(test_vec[i].a, test_vec[i].b, 3);
2015
- simde_assert_m128_close(r, test_vec[i].r, 1);
2016
- }
2017
-
2018
- return MUNIT_OK;
2019
- }
2020
-
2021
- static MunitResult
2022
- test_simde_mm_max_epi8(const MunitParameter params[], void* data) {
2023
- (void) params;
2024
- (void) data;
2025
-
2026
- const struct {
2027
- simde__m128i a;
2028
- simde__m128i b;
2029
- simde__m128i r;
2030
- } test_vec[8] = {
2031
- { simde_mm_set_epi8(INT8_C( -83), INT8_C( 29), INT8_C( 3), INT8_C( 84), INT8_C( 22), INT8_C( -7), INT8_C( 112), INT8_C(-107),
2032
- INT8_C( -53), INT8_C(-125), INT8_C( -41), INT8_C( -27), INT8_C(-118), INT8_C( 43), INT8_C( 44), INT8_C( 16)),
2033
- simde_mm_set_epi8(INT8_C( -80), INT8_C( -52), INT8_C( 93), INT8_C( 71), INT8_C( 45), INT8_C( -99), INT8_C( -14), INT8_C( -97),
2034
- INT8_C( 11), INT8_C( 62), INT8_C( 111), INT8_C( 17), INT8_C(-108), INT8_C( -6), INT8_C( 95), INT8_C( 1)),
2035
- simde_mm_set_epi8(INT8_C( -80), INT8_C( 29), INT8_C( 93), INT8_C( 84), INT8_C( 45), INT8_C( -7), INT8_C( 112), INT8_C( -97),
2036
- INT8_C( 11), INT8_C( 62), INT8_C( 111), INT8_C( 17), INT8_C(-108), INT8_C( 43), INT8_C( 95), INT8_C( 16)) },
2037
- { simde_mm_set_epi8(INT8_C( 61), INT8_C(-100), INT8_C( 79), INT8_C( 19), INT8_C( -86), INT8_C( 116), INT8_C( -34), INT8_C( 96),
2038
- INT8_C( 70), INT8_C( -48), INT8_C( -13), INT8_C( 103), INT8_C(-107), INT8_C( 79), INT8_C( 24), INT8_C( -71)),
2039
- simde_mm_set_epi8(INT8_C( 39), INT8_C( -53), INT8_C(-117), INT8_C( 65), INT8_C( -55), INT8_C( 21), INT8_C( 49), INT8_C( -22),
2040
- INT8_C( 118), INT8_C( -71), INT8_C(-113), INT8_C( 2), INT8_C( -83), INT8_C( -74), INT8_C( -11), INT8_C( 85)),
2041
- simde_mm_set_epi8(INT8_C( 61), INT8_C( -53), INT8_C( 79), INT8_C( 65), INT8_C( -55), INT8_C( 116), INT8_C( 49), INT8_C( 96),
2042
- INT8_C( 118), INT8_C( -48), INT8_C( -13), INT8_C( 103), INT8_C( -83), INT8_C( 79), INT8_C( 24), INT8_C( 85)) },
2043
- { simde_mm_set_epi8(INT8_C( -13), INT8_C(-124), INT8_C(-110), INT8_C( 22), INT8_C(-109), INT8_C( 127), INT8_C( -45), INT8_C( -62),
2044
- INT8_C( 0), INT8_C( 51), INT8_C( -98), INT8_C( -11), INT8_C( -54), INT8_C( -75), INT8_C(-101), INT8_C(-109)),
2045
- simde_mm_set_epi8(INT8_C( -28), INT8_C(-120), INT8_C( 90), INT8_C( -89), INT8_C( -72), INT8_C( 93), INT8_C( -68), INT8_C(-105),
2046
- INT8_C( 39), INT8_C( 46), INT8_C( 2), INT8_C( 5), INT8_C( 16), INT8_C( 34), INT8_C( -99), INT8_C( 64)),
2047
- simde_mm_set_epi8(INT8_C( -13), INT8_C(-120), INT8_C( 90), INT8_C( 22), INT8_C( -72), INT8_C( 127), INT8_C( -45), INT8_C( -62),
2048
- INT8_C( 39), INT8_C( 51), INT8_C( 2), INT8_C( 5), INT8_C( 16), INT8_C( 34), INT8_C( -99), INT8_C( 64)) },
2049
- { simde_mm_set_epi8(INT8_C( -43), INT8_C(-102), INT8_C( 111), INT8_C( 97), INT8_C( -69), INT8_C( 104), INT8_C( -24), INT8_C( -6),
2050
- INT8_C( 29), INT8_C( 43), INT8_C( 65), INT8_C( 47), INT8_C( -60), INT8_C( 52), INT8_C( 2), INT8_C( -40)),
2051
- simde_mm_set_epi8(INT8_C( -7), INT8_C( 85), INT8_C( -63), INT8_C( 48), INT8_C(-117), INT8_C( 19), INT8_C( 99), INT8_C( 67),
2052
- INT8_C( -50), INT8_C(-116), INT8_C( 5), INT8_C( 2), INT8_C( -96), INT8_C( 125), INT8_C( -95), INT8_C( 0)),
2053
- simde_mm_set_epi8(INT8_C( -7), INT8_C( 85), INT8_C( 111), INT8_C( 97), INT8_C( -69), INT8_C( 104), INT8_C( 99), INT8_C( 67),
2054
- INT8_C( 29), INT8_C( 43), INT8_C( 65), INT8_C( 47), INT8_C( -60), INT8_C( 125), INT8_C( 2), INT8_C( 0)) },
2055
- { simde_mm_set_epi8(INT8_C( 98), INT8_C( -7), INT8_C( -56), INT8_C( 9), INT8_C( 74), INT8_C( 50), INT8_C( -95), INT8_C( 127),
2056
- INT8_C( 114), INT8_C( 118), INT8_C( -76), INT8_C( 110), INT8_C( -48), INT8_C( -50), INT8_C( 57), INT8_C( -47)),
2057
- simde_mm_set_epi8(INT8_C( 47), INT8_C( -82), INT8_C( 66), INT8_C( -76), INT8_C( 6), INT8_C( 117), INT8_C( 80), INT8_C( -13),
2058
- INT8_C( 80), INT8_C(-109), INT8_C( 126), INT8_C( 70), INT8_C( 60), INT8_C( 40), INT8_C( -54), INT8_C( 3)),
2059
- simde_mm_set_epi8(INT8_C( 98), INT8_C( -7), INT8_C( 66), INT8_C( 9), INT8_C( 74), INT8_C( 117), INT8_C( 80), INT8_C( 127),
2060
- INT8_C( 114), INT8_C( 118), INT8_C( 126), INT8_C( 110), INT8_C( 60), INT8_C( 40), INT8_C( 57), INT8_C( 3)) },
2061
- { simde_mm_set_epi8(INT8_C( -80), INT8_C( -39), INT8_C( 113), INT8_C( -58), INT8_C( 58), INT8_C( -88), INT8_C( 22), INT8_C( -99),
2062
- INT8_C( 112), INT8_C( -21), INT8_C( 44), INT8_C( -31), INT8_C( -2), INT8_C( 109), INT8_C( 19), INT8_C( -74)),
2063
- simde_mm_set_epi8(INT8_C( 71), INT8_C( -38), INT8_C( 47), INT8_C( -92), INT8_C( 8), INT8_C( 48), INT8_C( 105), INT8_C( -82),
2064
- INT8_C( 35), INT8_C( 54), INT8_C( 25), INT8_C( 36), INT8_C( 111), INT8_C( -7), INT8_C( -12), INT8_C( -75)),
2065
- simde_mm_set_epi8(INT8_C( 71), INT8_C( -38), INT8_C( 113), INT8_C( -58), INT8_C( 58), INT8_C( 48), INT8_C( 105), INT8_C( -82),
2066
- INT8_C( 112), INT8_C( 54), INT8_C( 44), INT8_C( 36), INT8_C( 111), INT8_C( 109), INT8_C( 19), INT8_C( -74)) },
2067
- { simde_mm_set_epi8(INT8_C( 18), INT8_C( -41), INT8_C( -74), INT8_C( 60), INT8_C( -63), INT8_C( -55), INT8_C( -71), INT8_C( 118),
2068
- INT8_C( 46), INT8_C( -19), INT8_C( 19), INT8_C( -7), INT8_C( -55), INT8_C( -75), INT8_C( 125), INT8_C( -82)),
2069
- simde_mm_set_epi8(INT8_C(-125), INT8_C(-106), INT8_C(-127), INT8_C( -23), INT8_C( -63), INT8_C( 0), INT8_C( 56), INT8_C( -23),
2070
- INT8_C( -34), INT8_C( -32), INT8_C( 33), INT8_C( 127), INT8_C( 39), INT8_C( -68), INT8_C(-103), INT8_C( 126)),
2071
- simde_mm_set_epi8(INT8_C( 18), INT8_C( -41), INT8_C( -74), INT8_C( 60), INT8_C( -63), INT8_C( 0), INT8_C( 56), INT8_C( 118),
2072
- INT8_C( 46), INT8_C( -19), INT8_C( 33), INT8_C( 127), INT8_C( 39), INT8_C( -68), INT8_C( 125), INT8_C( 126)) },
2073
- { simde_mm_set_epi8(INT8_C( -90), INT8_C( -81), INT8_C( 72), INT8_C( -34), INT8_C( -85), INT8_C( 108), INT8_C( 42), INT8_C( 34),
2074
- INT8_C( -79), INT8_C( -48), INT8_C( 3), INT8_C( 113), INT8_C( -62), INT8_C( 25), INT8_C( -74), INT8_C( 13)),
2075
- simde_mm_set_epi8(INT8_C( -44), INT8_C( -22), INT8_C( 26), INT8_C( -52), INT8_C( 29), INT8_C( 96), INT8_C( -97), INT8_C( 88),
2076
- INT8_C( -11), INT8_C(-125), INT8_C( -60), INT8_C( 88), INT8_C( -55), INT8_C( 40), INT8_C( 76), INT8_C( -80)),
2077
- simde_mm_set_epi8(INT8_C( -44), INT8_C( -22), INT8_C( 72), INT8_C( -34), INT8_C( 29), INT8_C( 108), INT8_C( 42), INT8_C( 88),
2078
- INT8_C( -11), INT8_C( -48), INT8_C( 3), INT8_C( 113), INT8_C( -55), INT8_C( 40), INT8_C( 76), INT8_C( 13)) }
2079
- };
2080
-
2081
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
2082
- simde__m128i r = simde_mm_max_epi8(test_vec[i].a, test_vec[i].b);
2083
- simde_assert_m128i_i8(r, ==, test_vec[i].r);
2084
- }
2085
-
2086
- return MUNIT_OK;
2087
- }
2088
-
2089
- static MunitResult
2090
- test_simde_mm_max_epi32(const MunitParameter params[], void* data) {
2091
- (void) params;
2092
- (void) data;
2093
-
2094
- const struct {
2095
- simde__m128i a;
2096
- simde__m128i b;
2097
- simde__m128i r;
2098
- } test_vec[8] = {
2099
- { simde_mm_set_epi32(INT32_C( 477039853), INT32_C( 1555162887), INT32_C( 960008067), INT32_C(-2078514865)),
2100
- simde_mm_set_epi32(INT32_C( -346254872), INT32_C( 70690131), INT32_C( -249580279), INT32_C( -297974983)),
2101
- simde_mm_set_epi32(INT32_C( 477039853), INT32_C( 1555162887), INT32_C( 960008067), INT32_C( -297974983)) },
2102
- { simde_mm_set_epi32(INT32_C( 1946076095), INT32_C( 1626099315), INT32_C( 367020053), INT32_C( -768900730)),
2103
- simde_mm_set_epi32(INT32_C( -534331032), INT32_C(-1542646073), INT32_C( 900332023), INT32_C( 1625404528)),
2104
- simde_mm_set_epi32(INT32_C( 1946076095), INT32_C( 1626099315), INT32_C( 900332023), INT32_C( 1625404528)) },
2105
- { simde_mm_set_epi32(INT32_C( 1785938855), INT32_C( 217054136), INT32_C( 6277613), INT32_C( 1323071612)),
2106
- simde_mm_set_epi32(INT32_C(-1842447194), INT32_C( 1202045241), INT32_C( 391997517), INT32_C( 904511960)),
2107
- simde_mm_set_epi32(INT32_C( 1785938855), INT32_C( 1202045241), INT32_C( 391997517), INT32_C( 1323071612)) },
2108
- { simde_mm_set_epi32(INT32_C( -303416903), INT32_C( 131247622), INT32_C(-2038528381), INT32_C(-1774779832)),
2109
- simde_mm_set_epi32(INT32_C( 307942484), INT32_C(-1408988466), INT32_C(-1799017519), INT32_C( 1885804693)),
2110
- simde_mm_set_epi32(INT32_C( 307942484), INT32_C( 131247622), INT32_C(-1799017519), INT32_C( 1885804693)) },
2111
- { simde_mm_set_epi32(INT32_C( -424176665), INT32_C( 531131808), INT32_C( -752351935), INT32_C( 650848232)),
2112
- simde_mm_set_epi32(INT32_C(-1513144536), INT32_C( -875213417), INT32_C(-1592044131), INT32_C(-1714853090)),
2113
- simde_mm_set_epi32(INT32_C( -424176665), INT32_C( 531131808), INT32_C( -752351935), INT32_C( 650848232)) },
2114
- { simde_mm_set_epi32(INT32_C( 1901471013), INT32_C(-1928782687), INT32_C(-1204237637), INT32_C(-1735607658)),
2115
- simde_mm_set_epi32(INT32_C( 1526238167), INT32_C( 1155872155), INT32_C( -981128645), INT32_C(-1655952235)),
2116
- simde_mm_set_epi32(INT32_C( 1901471013), INT32_C( 1155872155), INT32_C( -981128645), INT32_C(-1655952235)) },
2117
- { simde_mm_set_epi32(INT32_C( 2067002242), INT32_C( -967820279), INT32_C(-1842332164), INT32_C( 1466140749)),
2118
- simde_mm_set_epi32(INT32_C( -25857443), INT32_C(-1417095277), INT32_C( -31302876), INT32_C(-1114441571)),
2119
- simde_mm_set_epi32(INT32_C( 2067002242), INT32_C( -967820279), INT32_C( -31302876), INT32_C( 1466140749)) },
2120
- { simde_mm_set_epi32(INT32_C( -515864750), INT32_C( 1885657427), INT32_C(-1627411585), INT32_C( -455970760)),
2121
- simde_mm_set_epi32(INT32_C( -505553594), INT32_C(-1363391302), INT32_C( 1929235496), INT32_C(-1212934452)),
2122
- simde_mm_set_epi32(INT32_C( -505553594), INT32_C( 1885657427), INT32_C( 1929235496), INT32_C( -455970760)) }
2123
- };
2124
-
2125
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
2126
- simde__m128i r = simde_mm_max_epi32(test_vec[i].a, test_vec[i].b);
2127
- simde_assert_m128i_i32(r, ==, test_vec[i].r);
2128
- }
2129
-
2130
- return MUNIT_OK;
2131
- }
2132
-
2133
- static MunitResult
2134
- test_simde_mm_max_epu16(const MunitParameter params[], void* data) {
2135
- (void) params;
2136
- (void) data;
2137
-
2138
- const struct {
2139
- simde__m128i a;
2140
- simde__m128i b;
2141
- simde__m128i r;
2142
- } test_vec[8] = {
2143
- { simde_x_mm_set_epu16(UINT16_C(31378), UINT16_C(24380), UINT16_C(40255), UINT16_C(13201),
2144
- UINT16_C(58870), UINT16_C(49460), UINT16_C(64732), UINT16_C(36111)),
2145
- simde_x_mm_set_epu16(UINT16_C(64055), UINT16_C(45511), UINT16_C(61004), UINT16_C(49058),
2146
- UINT16_C(25195), UINT16_C(65082), UINT16_C( 861), UINT16_C( 2148)),
2147
- simde_x_mm_set_epu16(UINT16_C(64055), UINT16_C(45511), UINT16_C(61004), UINT16_C(49058),
2148
- UINT16_C(58870), UINT16_C(65082), UINT16_C(64732), UINT16_C(36111)) },
2149
- { simde_x_mm_set_epu16(UINT16_C(17034), UINT16_C(61660), UINT16_C(37691), UINT16_C(48256),
2150
- UINT16_C(52466), UINT16_C(59150), UINT16_C(48524), UINT16_C(48932)),
2151
- simde_x_mm_set_epu16(UINT16_C( 9311), UINT16_C(52954), UINT16_C(59922), UINT16_C(37439),
2152
- UINT16_C(48521), UINT16_C(44576), UINT16_C(58557), UINT16_C( 4347)),
2153
- simde_x_mm_set_epu16(UINT16_C(17034), UINT16_C(61660), UINT16_C(59922), UINT16_C(48256),
2154
- UINT16_C(52466), UINT16_C(59150), UINT16_C(58557), UINT16_C(48932)) },
2155
- { simde_x_mm_set_epu16(UINT16_C( 3717), UINT16_C(65479), UINT16_C(47591), UINT16_C(37591),
2156
- UINT16_C(56498), UINT16_C(64377), UINT16_C( 4742), UINT16_C(26061)),
2157
- simde_x_mm_set_epu16(UINT16_C(53135), UINT16_C(25263), UINT16_C(35893), UINT16_C(43723),
2158
- UINT16_C(55550), UINT16_C(13729), UINT16_C(44168), UINT16_C(18708)),
2159
- simde_x_mm_set_epu16(UINT16_C(53135), UINT16_C(65479), UINT16_C(47591), UINT16_C(43723),
2160
- UINT16_C(56498), UINT16_C(64377), UINT16_C(44168), UINT16_C(26061)) },
2161
- { simde_x_mm_set_epu16(UINT16_C(32738), UINT16_C(32324), UINT16_C(12257), UINT16_C( 4392),
2162
- UINT16_C(48941), UINT16_C(15991), UINT16_C(56181), UINT16_C(64839)),
2163
- simde_x_mm_set_epu16(UINT16_C(54182), UINT16_C(32645), UINT16_C(19389), UINT16_C(64736),
2164
- UINT16_C(55568), UINT16_C(54741), UINT16_C(47863), UINT16_C(26870)),
2165
- simde_x_mm_set_epu16(UINT16_C(54182), UINT16_C(32645), UINT16_C(19389), UINT16_C(64736),
2166
- UINT16_C(55568), UINT16_C(54741), UINT16_C(56181), UINT16_C(64839)) },
2167
- { simde_x_mm_set_epu16(UINT16_C(25092), UINT16_C( 2337), UINT16_C(41136), UINT16_C(62054),
2168
- UINT16_C(31692), UINT16_C(47896), UINT16_C(26455), UINT16_C(41876)),
2169
- simde_x_mm_set_epu16(UINT16_C(57533), UINT16_C( 4966), UINT16_C(21312), UINT16_C(22488),
2170
- UINT16_C(59621), UINT16_C( 4501), UINT16_C(18372), UINT16_C(62293)),
2171
- simde_x_mm_set_epu16(UINT16_C(57533), UINT16_C( 4966), UINT16_C(41136), UINT16_C(62054),
2172
- UINT16_C(59621), UINT16_C(47896), UINT16_C(26455), UINT16_C(62293)) },
2173
- { simde_x_mm_set_epu16(UINT16_C(48994), UINT16_C(54179), UINT16_C(26228), UINT16_C(61187),
2174
- UINT16_C(44854), UINT16_C(57084), UINT16_C(16902), UINT16_C( 1404)),
2175
- simde_x_mm_set_epu16(UINT16_C( 4826), UINT16_C(23694), UINT16_C(32546), UINT16_C(41184),
2176
- UINT16_C( 725), UINT16_C(27358), UINT16_C(30444), UINT16_C(27027)),
2177
- simde_x_mm_set_epu16(UINT16_C(48994), UINT16_C(54179), UINT16_C(32546), UINT16_C(61187),
2178
- UINT16_C(44854), UINT16_C(57084), UINT16_C(30444), UINT16_C(27027)) },
2179
- { simde_x_mm_set_epu16(UINT16_C(60922), UINT16_C(51825), UINT16_C( 9165), UINT16_C(16534),
2180
- UINT16_C( 2526), UINT16_C(29939), UINT16_C(61826), UINT16_C(45025)),
2181
- simde_x_mm_set_epu16(UINT16_C(10446), UINT16_C(28319), UINT16_C(61630), UINT16_C(32182),
2182
- UINT16_C(17860), UINT16_C(15017), UINT16_C(59067), UINT16_C(19548)),
2183
- simde_x_mm_set_epu16(UINT16_C(60922), UINT16_C(51825), UINT16_C(61630), UINT16_C(32182),
2184
- UINT16_C(17860), UINT16_C(29939), UINT16_C(61826), UINT16_C(45025)) },
2185
- { simde_x_mm_set_epu16(UINT16_C(34011), UINT16_C(36834), UINT16_C(12993), UINT16_C(21384),
2186
- UINT16_C(62643), UINT16_C(55943), UINT16_C(12296), UINT16_C(62062)),
2187
- simde_x_mm_set_epu16(UINT16_C(22645), UINT16_C(31782), UINT16_C(42377), UINT16_C(17805),
2188
- UINT16_C(55262), UINT16_C(50550), UINT16_C(53828), UINT16_C(32401)),
2189
- simde_x_mm_set_epu16(UINT16_C(34011), UINT16_C(36834), UINT16_C(42377), UINT16_C(21384),
2190
- UINT16_C(62643), UINT16_C(55943), UINT16_C(53828), UINT16_C(62062)) }
2191
- };
2192
-
2193
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
2194
- simde__m128i r = simde_mm_max_epu16(test_vec[i].a, test_vec[i].b);
2195
- simde_assert_m128i_u16(r, ==, test_vec[i].r);
2196
- }
2197
-
2198
- return MUNIT_OK;
2199
- }
2200
-
2201
- static MunitResult
2202
- test_simde_mm_max_epu32(const MunitParameter params[], void* data) {
2203
- (void) params;
2204
- (void) data;
2205
-
2206
- const struct {
2207
- simde__m128i a;
2208
- simde__m128i b;
2209
- simde__m128i r;
2210
- } test_vec[8] = {
2211
- { simde_x_mm_set_epu32(UINT32_C(2532888443), UINT32_C( 529927089), UINT32_C(4207752004), UINT32_C(3510207683)),
2212
- simde_x_mm_set_epu32(UINT32_C( 574626150), UINT32_C(1395025810), UINT32_C(1034901368), UINT32_C(3021400990)),
2213
- simde_x_mm_set_epu32(UINT32_C(2532888443), UINT32_C(1395025810), UINT32_C(4207752004), UINT32_C(3510207683)) },
2214
- { simde_x_mm_set_epu32(UINT32_C(2363706693), UINT32_C(3928702803), UINT32_C( 881772043), UINT32_C( 57971440)),
2215
- simde_x_mm_set_epu32(UINT32_C(4216913656), UINT32_C(3303535239), UINT32_C( 568980555), UINT32_C( 308523788)),
2216
- simde_x_mm_set_epu32(UINT32_C(4216913656), UINT32_C(3928702803), UINT32_C( 881772043), UINT32_C( 308523788)) },
2217
- { simde_x_mm_set_epu32(UINT32_C( 548389896), UINT32_C(2976724828), UINT32_C(3723033325), UINT32_C(1050716143)),
2218
- simde_x_mm_set_epu32(UINT32_C(3591135284), UINT32_C( 856620101), UINT32_C( 833768684), UINT32_C( 203883279)),
2219
- simde_x_mm_set_epu32(UINT32_C(3591135284), UINT32_C(2976724828), UINT32_C(3723033325), UINT32_C(1050716143)) },
2220
- { simde_x_mm_set_epu32(UINT32_C(3717602953), UINT32_C(2736045656), UINT32_C(2539339865), UINT32_C(2199825857)),
2221
- simde_x_mm_set_epu32(UINT32_C(3331243307), UINT32_C(1452685186), UINT32_C(2337560284), UINT32_C(3592613020)),
2222
- simde_x_mm_set_epu32(UINT32_C(3717602953), UINT32_C(2736045656), UINT32_C(2539339865), UINT32_C(3592613020)) },
2223
- { simde_x_mm_set_epu32(UINT32_C(2462641628), UINT32_C(4101106468), UINT32_C(2939293383), UINT32_C( 448332726)),
2224
- simde_x_mm_set_epu32(UINT32_C(4091790581), UINT32_C( 227177150), UINT32_C(4294101921), UINT32_C(1459100736)),
2225
- simde_x_mm_set_epu32(UINT32_C(4091790581), UINT32_C(4101106468), UINT32_C(4294101921), UINT32_C(1459100736)) },
2226
- { simde_x_mm_set_epu32(UINT32_C(1973671448), UINT32_C(1498045863), UINT32_C(1898038098), UINT32_C(1965060938)),
2227
- simde_x_mm_set_epu32(UINT32_C( 29809850), UINT32_C( 861011023), UINT32_C( 63413124), UINT32_C(2176922492)),
2228
- simde_x_mm_set_epu32(UINT32_C(1973671448), UINT32_C(1498045863), UINT32_C(1898038098), UINT32_C(2176922492)) },
2229
- { simde_x_mm_set_epu32(UINT32_C( 526896309), UINT32_C( 817143907), UINT32_C(1563490657), UINT32_C(3681037749)),
2230
- simde_x_mm_set_epu32(UINT32_C(3002623714), UINT32_C(3298584662), UINT32_C(1905485247), UINT32_C( 108377847)),
2231
- simde_x_mm_set_epu32(UINT32_C(3002623714), UINT32_C(3298584662), UINT32_C(1905485247), UINT32_C(3681037749)) },
2232
- { simde_x_mm_set_epu32(UINT32_C( 749402761), UINT32_C(3319236993), UINT32_C(3240012333), UINT32_C(1509228324)),
2233
- simde_x_mm_set_epu32(UINT32_C(3285355124), UINT32_C(3206151128), UINT32_C(2987263147), UINT32_C(3706118926)),
2234
- simde_x_mm_set_epu32(UINT32_C(3285355124), UINT32_C(3319236993), UINT32_C(3240012333), UINT32_C(3706118926)) }
2235
- };
2236
-
2237
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
2238
- simde__m128i r = simde_mm_max_epu32(test_vec[i].a, test_vec[i].b);
2239
- simde_assert_m128i_u32(r, ==, test_vec[i].r);
2240
- }
2241
-
2242
- return MUNIT_OK;
2243
- }
2244
-
2245
- static MunitResult
2246
- test_simde_mm_min_epi8(const MunitParameter params[], void* data) {
2247
- (void) params;
2248
- (void) data;
2249
-
2250
- const struct {
2251
- simde__m128i a;
2252
- simde__m128i b;
2253
- simde__m128i r;
2254
- } test_vec[8] = {
2255
- { simde_mm_set_epi8(INT8_C( -85), INT8_C( 106), INT8_C( -97), INT8_C( -26),
2256
- INT8_C( -5), INT8_C( 83), INT8_C(-106), INT8_C(-116),
2257
- INT8_C(-113), INT8_C( -34), INT8_C( -81), INT8_C( 109),
2258
- INT8_C( -25), INT8_C( -16), INT8_C( 28), INT8_C( -76)),
2259
- simde_mm_set_epi8(INT8_C( -69), INT8_C( -4), INT8_C( 73), INT8_C( -90),
2260
- INT8_C( 93), INT8_C(-116), INT8_C( 19), INT8_C( 124),
2261
- INT8_C( -67), INT8_C( 48), INT8_C( 38), INT8_C( 11),
2262
- INT8_C( 21), INT8_C( 91), INT8_C( 118), INT8_C( 103)),
2263
- simde_mm_set_epi8(INT8_C( -85), INT8_C( -4), INT8_C( -97), INT8_C( -90),
2264
- INT8_C( -5), INT8_C(-116), INT8_C(-106), INT8_C(-116),
2265
- INT8_C(-113), INT8_C( -34), INT8_C( -81), INT8_C( 11),
2266
- INT8_C( -25), INT8_C( -16), INT8_C( 28), INT8_C( -76)) },
2267
- { simde_mm_set_epi8(INT8_C( -69), INT8_C( -84), INT8_C( 37), INT8_C( -17),
2268
- INT8_C( 36), INT8_C( -34), INT8_C(-104), INT8_C( 112),
2269
- INT8_C( 13), INT8_C( 47), INT8_C( -94), INT8_C( -38),
2270
- INT8_C( 111), INT8_C( -44), INT8_C( -90), INT8_C( -86)),
2271
- simde_mm_set_epi8(INT8_C(-125), INT8_C( 55), INT8_C( 5), INT8_C( 113),
2272
- INT8_C( 100), INT8_C( -35), INT8_C( -4), INT8_C( 29),
2273
- INT8_C( 60), INT8_C( 120), INT8_C( -36), INT8_C( 72),
2274
- INT8_C( 92), INT8_C( 31), INT8_C( 11), INT8_C(-106)),
2275
- simde_mm_set_epi8(INT8_C(-125), INT8_C( -84), INT8_C( 5), INT8_C( -17),
2276
- INT8_C( 36), INT8_C( -35), INT8_C(-104), INT8_C( 29),
2277
- INT8_C( 13), INT8_C( 47), INT8_C( -94), INT8_C( -38),
2278
- INT8_C( 92), INT8_C( -44), INT8_C( -90), INT8_C(-106)) },
2279
- { simde_mm_set_epi8(INT8_C( 49), INT8_C(-113), INT8_C( -25), INT8_C( -86),
2280
- INT8_C( 106), INT8_C( 71), INT8_C( 43), INT8_C( 81),
2281
- INT8_C( -66), INT8_C( 111), INT8_C( 40), INT8_C( 35),
2282
- INT8_C( 15), INT8_C( 51), INT8_C( 21), INT8_C( 60)),
2283
- simde_mm_set_epi8(INT8_C( 37), INT8_C( -84), INT8_C( 110), INT8_C( -46),
2284
- INT8_C( -27), INT8_C( -56), INT8_C( 104), INT8_C( 2),
2285
- INT8_C(-105), INT8_C( 65), INT8_C( 54), INT8_C( 75),
2286
- INT8_C( 113), INT8_C( 29), INT8_C( -47), INT8_C( 84)),
2287
- simde_mm_set_epi8(INT8_C( 37), INT8_C(-113), INT8_C( -25), INT8_C( -86),
2288
- INT8_C( -27), INT8_C( -56), INT8_C( 43), INT8_C( 2),
2289
- INT8_C(-105), INT8_C( 65), INT8_C( 40), INT8_C( 35),
2290
- INT8_C( 15), INT8_C( 29), INT8_C( -47), INT8_C( 60)) },
2291
- { simde_mm_set_epi8(INT8_C( -9), INT8_C( -51), INT8_C( -8), INT8_C( -23),
2292
- INT8_C( 42), INT8_C( 26), INT8_C( -68), INT8_C( -93),
2293
- INT8_C( -78), INT8_C( -45), INT8_C( -36), INT8_C( -34),
2294
- INT8_C( -79), INT8_C( -94), INT8_C( 80), INT8_C( 99)),
2295
- simde_mm_set_epi8(INT8_C( 27), INT8_C( 45), INT8_C( 48), INT8_C( -73),
2296
- INT8_C( -21), INT8_C( 86), INT8_C( 54), INT8_C( -39),
2297
- INT8_C( -2), INT8_C( 108), INT8_C( -19), INT8_C( -81),
2298
- INT8_C( -52), INT8_C( 118), INT8_C( 61), INT8_C( -36)),
2299
- simde_mm_set_epi8(INT8_C( -9), INT8_C( -51), INT8_C( -8), INT8_C( -73),
2300
- INT8_C( -21), INT8_C( 26), INT8_C( -68), INT8_C( -93),
2301
- INT8_C( -78), INT8_C( -45), INT8_C( -36), INT8_C( -81),
2302
- INT8_C( -79), INT8_C( -94), INT8_C( 61), INT8_C( -36)) },
2303
- { simde_mm_set_epi8(INT8_C( 75), INT8_C( 2), INT8_C( -37), INT8_C( -22),
2304
- INT8_C( 110), INT8_C(-125), INT8_C( 33), INT8_C( -94),
2305
- INT8_C( -5), INT8_C( -67), INT8_C( -78), INT8_C( -46),
2306
- INT8_C( 43), INT8_C( -89), INT8_C( 74), INT8_C( 18)),
2307
- simde_mm_set_epi8(INT8_C( 84), INT8_C( -44), INT8_C(-115), INT8_C( 29),
2308
- INT8_C(-121), INT8_C( 22), INT8_C( 43), INT8_C(-123),
2309
- INT8_C( -63), INT8_C( -73), INT8_C( 36), INT8_C( -60),
2310
- INT8_C( -96), INT8_C( -58), INT8_C( -42), INT8_C( 78)),
2311
- simde_mm_set_epi8(INT8_C( 75), INT8_C( -44), INT8_C(-115), INT8_C( -22),
2312
- INT8_C(-121), INT8_C(-125), INT8_C( 33), INT8_C(-123),
2313
- INT8_C( -63), INT8_C( -73), INT8_C( -78), INT8_C( -60),
2314
- INT8_C( -96), INT8_C( -89), INT8_C( -42), INT8_C( 18)) },
2315
- { simde_mm_set_epi8(INT8_C( -82), INT8_C( -34), INT8_C( 74), INT8_C( 86),
2316
- INT8_C( -7), INT8_C( 93), INT8_C( -99), INT8_C( -7),
2317
- INT8_C( 127), INT8_C( 26), INT8_C( -51), INT8_C( 41),
2318
- INT8_C( 71), INT8_C( 67), INT8_C(-102), INT8_C(-119)),
2319
- simde_mm_set_epi8(INT8_C( -8), INT8_C( 88), INT8_C( 46), INT8_C( 105),
2320
- INT8_C( -43), INT8_C(-109), INT8_C( 38), INT8_C( -35),
2321
- INT8_C( -17), INT8_C( -4), INT8_C(-122), INT8_C(-112),
2322
- INT8_C( -62), INT8_C( 100), INT8_C( 89), INT8_C( -83)),
2323
- simde_mm_set_epi8(INT8_C( -82), INT8_C( -34), INT8_C( 46), INT8_C( 86),
2324
- INT8_C( -43), INT8_C(-109), INT8_C( -99), INT8_C( -35),
2325
- INT8_C( -17), INT8_C( -4), INT8_C(-122), INT8_C(-112),
2326
- INT8_C( -62), INT8_C( 67), INT8_C(-102), INT8_C(-119)) },
2327
- { simde_mm_set_epi8(INT8_C( 21), INT8_C( -83), INT8_C( -9), INT8_C( -66),
2328
- INT8_C( -50), INT8_C( -47), INT8_C( -30), INT8_C( 4),
2329
- INT8_C( -60), INT8_C( 23), INT8_C( 126), INT8_C( 69),
2330
- INT8_C( 56), INT8_C( 4), INT8_C( 32), INT8_C( 31)),
2331
- simde_mm_set_epi8(INT8_C( 76), INT8_C( -95), INT8_C( 81), INT8_C( 9),
2332
- INT8_C(-106), INT8_C( -75), INT8_C( 46), INT8_C( 117),
2333
- INT8_C(-119), INT8_C( -56), INT8_C(-115), INT8_C( -97),
2334
- INT8_C( -52), INT8_C( -81), INT8_C(-123), INT8_C( 54)),
2335
- simde_mm_set_epi8(INT8_C( 21), INT8_C( -95), INT8_C( -9), INT8_C( -66),
2336
- INT8_C(-106), INT8_C( -75), INT8_C( -30), INT8_C( 4),
2337
- INT8_C(-119), INT8_C( -56), INT8_C(-115), INT8_C( -97),
2338
- INT8_C( -52), INT8_C( -81), INT8_C(-123), INT8_C( 31)) },
2339
- { simde_mm_set_epi8(INT8_C( -56), INT8_C(-107), INT8_C( 36), INT8_C( -66),
2340
- INT8_C( -22), INT8_C(-112), INT8_C( 57), INT8_C( 12),
2341
- INT8_C( -40), INT8_C(-109), INT8_C( -85), INT8_C( 86),
2342
- INT8_C( -31), INT8_C( -66), INT8_C( 99), INT8_C( -10)),
2343
- simde_mm_set_epi8(INT8_C( 57), INT8_C(-109), INT8_C( 45), INT8_C( 32),
2344
- INT8_C( 94), INT8_C( -27), INT8_C( 11), INT8_C( 67),
2345
- INT8_C(-114), INT8_C( -40), INT8_C(-125), INT8_C(-106),
2346
- INT8_C( 72), INT8_C( -34), INT8_C(-102), INT8_C( 18)),
2347
- simde_mm_set_epi8(INT8_C( -56), INT8_C(-109), INT8_C( 36), INT8_C( -66),
2348
- INT8_C( -22), INT8_C(-112), INT8_C( 11), INT8_C( 12),
2349
- INT8_C(-114), INT8_C(-109), INT8_C(-125), INT8_C(-106),
2350
- INT8_C( -31), INT8_C( -66), INT8_C(-102), INT8_C( -10)) }
2351
- };
2352
-
2353
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
2354
- simde__m128i r = simde_mm_min_epi8(test_vec[i].a, test_vec[i].b);
2355
- simde_assert_m128i_i8(r, ==, test_vec[i].r);
2356
- }
2357
-
2358
- return MUNIT_OK;
2359
- }
2360
-
2361
- static MunitResult
2362
- test_simde_mm_min_epi32(const MunitParameter params[], void* data) {
2363
- (void) params;
2364
- (void) data;
2365
-
2366
- const struct {
2367
- simde__m128i a;
2368
- simde__m128i b;
2369
- simde__m128i r;
2370
- } test_vec[8] = {
2371
- { simde_mm_set_epi32(INT32_C(-1390607532), INT32_C( 385446037), INT32_C( -880551963), INT32_C(-1976882160)),
2372
- simde_mm_set_epi32(INT32_C(-1328784057), INT32_C( 765325983), INT32_C( 188641041), INT32_C(-1795531007)),
2373
- simde_mm_set_epi32(INT32_C(-1390607532), INT32_C( 385446037), INT32_C( -880551963), INT32_C(-1976882160)) },
2374
- { simde_mm_set_epi32(INT32_C( 1033654035), INT32_C(-1435181472), INT32_C( 1188098919), INT32_C(-1789978439)),
2375
- simde_mm_set_epi32(INT32_C( 667650881), INT32_C( -921357846), INT32_C( 1991872258), INT32_C(-1380518571)),
2376
- simde_mm_set_epi32(INT32_C( 667650881), INT32_C(-1435181472), INT32_C( 1188098919), INT32_C(-1789978439)) },
2377
- { simde_mm_set_epi32(INT32_C( -209415658), INT32_C(-1820339262), INT32_C( 3383029), INT32_C( -894067821)),
2378
- simde_mm_set_epi32(INT32_C( -460825945), INT32_C(-1201816425), INT32_C( 657326597), INT32_C( 270703936)),
2379
- simde_mm_set_epi32(INT32_C( -460825945), INT32_C(-1820339262), INT32_C( 3383029), INT32_C( -894067821)) },
2380
- { simde_mm_set_epi32(INT32_C( -711299231), INT32_C(-1150752518), INT32_C( 489373999), INT32_C(-1003224360)),
2381
- simde_mm_set_epi32(INT32_C( -111820496), INT32_C(-1961663677), INT32_C( -829684478), INT32_C(-1602379520)),
2382
- simde_mm_set_epi32(INT32_C( -711299231), INT32_C(-1961663677), INT32_C( -829684478), INT32_C(-1602379520)) },
2383
- { simde_mm_set_epi32(INT32_C( 1660536841), INT32_C( 1244832127), INT32_C( 1920382062), INT32_C( -791791151)),
2384
- simde_mm_set_epi32(INT32_C( 799949492), INT32_C( 108351731), INT32_C( 1351843398), INT32_C( 1009306115)),
2385
- simde_mm_set_epi32(INT32_C( 799949492), INT32_C( 108351731), INT32_C( 1351843398), INT32_C( -791791151)) },
2386
- { simde_mm_set_epi32(INT32_C(-1327926842), INT32_C( 984094365), INT32_C( 1894460641), INT32_C( -26405962)),
2387
- simde_mm_set_epi32(INT32_C( 1205481380), INT32_C( 137390510), INT32_C( 590747940), INT32_C( 1878652085)),
2388
- simde_mm_set_epi32(INT32_C(-1327926842), INT32_C( 137390510), INT32_C( 590747940), INT32_C( -26405962)) },
2389
- { simde_mm_set_epi32(INT32_C( 316126780), INT32_C(-1043744394), INT32_C( 787289081), INT32_C( -910852690)),
2390
- simde_mm_set_epi32(INT32_C(-2087288343), INT32_C(-1056950039), INT32_C( -555736705), INT32_C( 666671486)),
2391
- simde_mm_set_epi32(INT32_C(-2087288343), INT32_C(-1056950039), INT32_C( -555736705), INT32_C( -910852690)) },
2392
- { simde_mm_set_epi32(INT32_C(-1498461986), INT32_C(-1418974686), INT32_C(-1311767695), INT32_C(-1038502387)),
2393
- simde_mm_set_epi32(INT32_C( -722855220), INT32_C( 492871512), INT32_C( -175913896), INT32_C( -920105808)),
2394
- simde_mm_set_epi32(INT32_C(-1498461986), INT32_C(-1418974686), INT32_C(-1311767695), INT32_C(-1038502387)) }
2395
- };
2396
-
2397
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
2398
- simde__m128i r = simde_mm_min_epi32(test_vec[i].a, test_vec[i].b);
2399
- simde_assert_m128i_i32(r, ==, test_vec[i].r);
2400
- }
2401
-
2402
- return MUNIT_OK;
2403
- }
2404
-
2405
- static MunitResult
2406
- test_simde_mm_min_epu16(const MunitParameter params[], void* data) {
2407
- (void) params;
2408
- (void) data;
2409
-
2410
- const struct {
2411
- simde__m128i a;
2412
- simde__m128i b;
2413
- simde__m128i r;
2414
- } test_vec[8] = {
2415
- { simde_x_mm_set_epu16(UINT16_C(51368), UINT16_C(47248), UINT16_C( 2518), UINT16_C(59587),
2416
- UINT16_C(64433), UINT16_C(45544), UINT16_C( 8944), UINT16_C(56380)),
2417
- simde_x_mm_set_epu16(UINT16_C(35287), UINT16_C( 4953), UINT16_C(55160), UINT16_C(11599),
2418
- UINT16_C( 1282), UINT16_C(22629), UINT16_C( 1908), UINT16_C(57232)),
2419
- simde_x_mm_set_epu16(UINT16_C(35287), UINT16_C( 4953), UINT16_C( 2518), UINT16_C(11599),
2420
- UINT16_C( 1282), UINT16_C(22629), UINT16_C( 1908), UINT16_C(56380)) },
2421
- { simde_x_mm_set_epu16(UINT16_C(51082), UINT16_C(41324), UINT16_C(63856), UINT16_C(49625),
2422
- UINT16_C(47646), UINT16_C(40071), UINT16_C(43894), UINT16_C( 6845)),
2423
- simde_x_mm_set_epu16(UINT16_C(29622), UINT16_C(57397), UINT16_C(58908), UINT16_C(15516),
2424
- UINT16_C(57300), UINT16_C(16770), UINT16_C( 6179), UINT16_C(31976)),
2425
- simde_x_mm_set_epu16(UINT16_C(29622), UINT16_C(41324), UINT16_C(58908), UINT16_C(15516),
2426
- UINT16_C(47646), UINT16_C(16770), UINT16_C( 6179), UINT16_C( 6845)) },
2427
- { simde_x_mm_set_epu16(UINT16_C( 7791), UINT16_C( 9357), UINT16_C(51414), UINT16_C(32085),
2428
- UINT16_C( 5803), UINT16_C(15112), UINT16_C( 4983), UINT16_C(62284)),
2429
- simde_x_mm_set_epu16(UINT16_C(19191), UINT16_C(53664), UINT16_C(31350), UINT16_C(59818),
2430
- UINT16_C(36846), UINT16_C(44912), UINT16_C(44597), UINT16_C(18257)),
2431
- simde_x_mm_set_epu16(UINT16_C( 7791), UINT16_C( 9357), UINT16_C(31350), UINT16_C(32085),
2432
- UINT16_C( 5803), UINT16_C(15112), UINT16_C( 4983), UINT16_C(18257)) },
2433
- { simde_x_mm_set_epu16(UINT16_C(23178), UINT16_C(52616), UINT16_C(54786), UINT16_C(18857),
2434
- UINT16_C(64323), UINT16_C(44008), UINT16_C(12675), UINT16_C(13653)),
2435
- simde_x_mm_set_epu16(UINT16_C(16010), UINT16_C(49432), UINT16_C(46679), UINT16_C(33525),
2436
- UINT16_C(47161), UINT16_C(64878), UINT16_C(40685), UINT16_C(46136)),
2437
- simde_x_mm_set_epu16(UINT16_C(16010), UINT16_C(49432), UINT16_C(46679), UINT16_C(18857),
2438
- UINT16_C(47161), UINT16_C(44008), UINT16_C(12675), UINT16_C(13653)) },
2439
- { simde_x_mm_set_epu16(UINT16_C(33571), UINT16_C(12594), UINT16_C( 3662), UINT16_C(56380),
2440
- UINT16_C(54926), UINT16_C(32164), UINT16_C( 3421), UINT16_C(38714)),
2441
- simde_x_mm_set_epu16(UINT16_C(65175), UINT16_C(47536), UINT16_C(21879), UINT16_C(12881),
2442
- UINT16_C(50915), UINT16_C(31304), UINT16_C(10941), UINT16_C(57984)),
2443
- simde_x_mm_set_epu16(UINT16_C(33571), UINT16_C(12594), UINT16_C( 3662), UINT16_C(12881),
2444
- UINT16_C(50915), UINT16_C(31304), UINT16_C( 3421), UINT16_C(38714)) },
2445
- { simde_x_mm_set_epu16(UINT16_C(17540), UINT16_C(62844), UINT16_C(46558), UINT16_C(45098),
2446
- UINT16_C(32389), UINT16_C(20250), UINT16_C(19285), UINT16_C(40862)),
2447
- simde_x_mm_set_epu16(UINT16_C(17361), UINT16_C( 8131), UINT16_C(50246), UINT16_C(30481),
2448
- UINT16_C(30265), UINT16_C(57439), UINT16_C(42358), UINT16_C(24996)),
2449
- simde_x_mm_set_epu16(UINT16_C(17361), UINT16_C( 8131), UINT16_C(46558), UINT16_C(30481),
2450
- UINT16_C(30265), UINT16_C(20250), UINT16_C(19285), UINT16_C(24996)) },
2451
- { simde_x_mm_set_epu16(UINT16_C(11573), UINT16_C(56754), UINT16_C(38860), UINT16_C(26669),
2452
- UINT16_C(21209), UINT16_C( 2072), UINT16_C(19855), UINT16_C(11067)),
2453
- simde_x_mm_set_epu16(UINT16_C( 4235), UINT16_C(30280), UINT16_C(23335), UINT16_C(17584),
2454
- UINT16_C( 3445), UINT16_C( 1117), UINT16_C(46968), UINT16_C(58704)),
2455
- simde_x_mm_set_epu16(UINT16_C( 4235), UINT16_C(30280), UINT16_C(23335), UINT16_C(17584),
2456
- UINT16_C( 3445), UINT16_C( 1117), UINT16_C(19855), UINT16_C(11067)) },
2457
- { simde_x_mm_set_epu16(UINT16_C( 1826), UINT16_C(34774), UINT16_C(17130), UINT16_C(44175),
2458
- UINT16_C(60865), UINT16_C(54658), UINT16_C(62552), UINT16_C(62233)),
2459
- simde_x_mm_set_epu16(UINT16_C(15183), UINT16_C(55598), UINT16_C( 5779), UINT16_C(28145),
2460
- UINT16_C(24471), UINT16_C(50174), UINT16_C(53029), UINT16_C(43004)),
2461
- simde_x_mm_set_epu16(UINT16_C( 1826), UINT16_C(34774), UINT16_C( 5779), UINT16_C(28145),
2462
- UINT16_C(24471), UINT16_C(50174), UINT16_C(53029), UINT16_C(43004)) }
2463
- };
2464
-
2465
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
2466
- simde__m128i r = simde_mm_min_epu16(test_vec[i].a, test_vec[i].b);
2467
- simde_assert_m128i_u16(r, ==, test_vec[i].r);
2468
- }
2469
-
2470
- return MUNIT_OK;
2471
- }
2472
-
2473
- static MunitResult
2474
- test_simde_mm_min_epu32(const MunitParameter params[], void* data) {
2475
- (void) params;
2476
- (void) data;
2477
-
2478
- const struct {
2479
- simde__m128i a;
2480
- simde__m128i b;
2481
- simde__m128i r;
2482
- } test_vec[8] = {
2483
- { simde_x_mm_set_epu32(UINT32_C( 788201309), UINT32_C(2071601612), UINT32_C(3123609508), UINT32_C(1344608341)),
2484
- simde_x_mm_set_epu32(UINT32_C(3982697916), UINT32_C( 968486606), UINT32_C(1116860132), UINT32_C(2825138301)),
2485
- simde_x_mm_set_epu32(UINT32_C( 788201309), UINT32_C( 968486606), UINT32_C(1116860132), UINT32_C(1344608341)) },
2486
- { simde_x_mm_set_epu32(UINT32_C( 384132137), UINT32_C(1977877021), UINT32_C(4289747748), UINT32_C(2515962526)),
2487
- simde_x_mm_set_epu32(UINT32_C(3869012810), UINT32_C( 645527240), UINT32_C(4230349530), UINT32_C(1145244296)),
2488
- simde_x_mm_set_epu32(UINT32_C( 384132137), UINT32_C( 645527240), UINT32_C(4230349530), UINT32_C(1145244296)) },
2489
- { simde_x_mm_set_epu32(UINT32_C(3974730728), UINT32_C(3242218332), UINT32_C(1720053534), UINT32_C(3159005428)),
2490
- simde_x_mm_set_epu32(UINT32_C(3856942180), UINT32_C(4205396871), UINT32_C(2272972736), UINT32_C(4113553543)),
2491
- simde_x_mm_set_epu32(UINT32_C(3856942180), UINT32_C(3242218332), UINT32_C(1720053534), UINT32_C(3159005428)) },
2492
- { simde_x_mm_set_epu32(UINT32_C(3254877076), UINT32_C(2399148141), UINT32_C(2938842657), UINT32_C(1961058722)),
2493
- simde_x_mm_set_epu32(UINT32_C(1528033433), UINT32_C( 461232656), UINT32_C(1948639979), UINT32_C(1593317844)),
2494
- simde_x_mm_set_epu32(UINT32_C(1528033433), UINT32_C( 461232656), UINT32_C(1948639979), UINT32_C(1593317844)) },
2495
- { simde_x_mm_set_epu32(UINT32_C(1721814381), UINT32_C(3279771329), UINT32_C(1032528892), UINT32_C(1770589845)),
2496
- simde_x_mm_set_epu32(UINT32_C( 338961476), UINT32_C(1015681646), UINT32_C(2529171351), UINT32_C(1474803551)),
2497
- simde_x_mm_set_epu32(UINT32_C( 338961476), UINT32_C(1015681646), UINT32_C(1032528892), UINT32_C(1474803551)) },
2498
- { simde_x_mm_set_epu32(UINT32_C(2865994869), UINT32_C(3359283004), UINT32_C(2376950903), UINT32_C(2025629636)),
2499
- simde_x_mm_set_epu32(UINT32_C(1089016862), UINT32_C(3251738064), UINT32_C(2393163457), UINT32_C( 147184464)),
2500
- simde_x_mm_set_epu32(UINT32_C(1089016862), UINT32_C(3251738064), UINT32_C(2376950903), UINT32_C( 147184464)) },
2501
- { simde_x_mm_set_epu32(UINT32_C(1041113949), UINT32_C(2410530901), UINT32_C( 131686205), UINT32_C(3148398563)),
2502
- simde_x_mm_set_epu32(UINT32_C(1539533337), UINT32_C(3899801708), UINT32_C(3357338729), UINT32_C( 465532279)),
2503
- simde_x_mm_set_epu32(UINT32_C(1041113949), UINT32_C(2410530901), UINT32_C( 131686205), UINT32_C( 465532279)) },
2504
- { simde_x_mm_set_epu32(UINT32_C(2571079475), UINT32_C(4121171595), UINT32_C(3849859490), UINT32_C(2510281154)),
2505
- simde_x_mm_set_epu32(UINT32_C(2596335814), UINT32_C(2240823510), UINT32_C(2609625051), UINT32_C(1259317116)),
2506
- simde_x_mm_set_epu32(UINT32_C(2571079475), UINT32_C(2240823510), UINT32_C(2609625051), UINT32_C(1259317116)) }
2507
- };
2508
-
2509
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
2510
- simde__m128i r = simde_mm_min_epu32(test_vec[i].a, test_vec[i].b);
2511
- simde_assert_m128i_u32(r, ==, test_vec[i].r);
2512
- }
2513
-
2514
- return MUNIT_OK;
2515
- }
2516
-
2517
- static MunitResult
2518
- test_simde_mm_minpos_epu16(const MunitParameter params[], void* data) {
2519
- (void) params;
2520
- (void) data;
2521
-
2522
- const struct {
2523
- simde__m128i a;
2524
- simde__m128i r;
2525
- } test_vec[8] = {
2526
- { simde_x_mm_set_epu16(UINT16_C(40818), UINT16_C(13812), UINT16_C(10872), UINT16_C(54124),
2527
- UINT16_C(15100), UINT16_C(22810), UINT16_C(31798), UINT16_C(58017)),
2528
- simde_x_mm_set_epu16(UINT16_C( 0), UINT16_C( 0), UINT16_C( 0), UINT16_C( 0),
2529
- UINT16_C( 0), UINT16_C( 0), UINT16_C( 5), UINT16_C(10872)) },
2530
- { simde_x_mm_set_epu16(UINT16_C(37656), UINT16_C(38804), UINT16_C(35573), UINT16_C(33536),
2531
- UINT16_C(16030), UINT16_C(50431), UINT16_C(35836), UINT16_C(37491)),
2532
- simde_x_mm_set_epu16(UINT16_C( 0), UINT16_C( 0), UINT16_C( 0), UINT16_C( 0),
2533
- UINT16_C( 0), UINT16_C( 0), UINT16_C( 3), UINT16_C(16030)) },
2534
- { simde_x_mm_set_epu16(UINT16_C(56214), UINT16_C(56676), UINT16_C(56044), UINT16_C(59619),
2535
- UINT16_C(21150), UINT16_C(47982), UINT16_C( 92), UINT16_C(46668)),
2536
- simde_x_mm_set_epu16(UINT16_C( 0), UINT16_C( 0), UINT16_C( 0), UINT16_C( 0),
2537
- UINT16_C( 0), UINT16_C( 0), UINT16_C( 1), UINT16_C( 92)) },
2538
- { simde_x_mm_set_epu16(UINT16_C(30841), UINT16_C(41481), UINT16_C(22332), UINT16_C(20377),
2539
- UINT16_C( 8461), UINT16_C(16174), UINT16_C(46168), UINT16_C(38746)),
2540
- simde_x_mm_set_epu16(UINT16_C( 0), UINT16_C( 0), UINT16_C( 0), UINT16_C( 0),
2541
- UINT16_C( 0), UINT16_C( 0), UINT16_C( 3), UINT16_C( 8461)) },
2542
- { simde_x_mm_set_epu16(UINT16_C(38550), UINT16_C(63031), UINT16_C(12859), UINT16_C(36699),
2543
- UINT16_C(19386), UINT16_C(49588), UINT16_C(27067), UINT16_C(12812)),
2544
- simde_x_mm_set_epu16(UINT16_C( 0), UINT16_C( 0), UINT16_C( 0), UINT16_C( 0),
2545
- UINT16_C( 0), UINT16_C( 0), UINT16_C( 0), UINT16_C(12812)) },
2546
- { simde_x_mm_set_epu16(UINT16_C(20747), UINT16_C(29576), UINT16_C( 5460), UINT16_C(38860),
2547
- UINT16_C(52108), UINT16_C( 149), UINT16_C(63981), UINT16_C(19000)),
2548
- simde_x_mm_set_epu16(UINT16_C( 0), UINT16_C( 0), UINT16_C( 0), UINT16_C( 0),
2549
- UINT16_C( 0), UINT16_C( 0), UINT16_C( 2), UINT16_C( 149)) },
2550
- { simde_x_mm_set_epu16(UINT16_C(31686), UINT16_C( 5758), UINT16_C(64324), UINT16_C(55924),
2551
- UINT16_C(43567), UINT16_C(17467), UINT16_C(18633), UINT16_C(20456)),
2552
- simde_x_mm_set_epu16(UINT16_C( 0), UINT16_C( 0), UINT16_C( 0), UINT16_C( 0),
2553
- UINT16_C( 0), UINT16_C( 0), UINT16_C( 6), UINT16_C( 5758)) },
2554
- { simde_x_mm_set_epu16(UINT16_C(13431), UINT16_C(48627), UINT16_C(23340), UINT16_C(23935),
2555
- UINT16_C(12927), UINT16_C(48412), UINT16_C(33835), UINT16_C(15901)),
2556
- simde_x_mm_set_epu16(UINT16_C( 0), UINT16_C( 0), UINT16_C( 0), UINT16_C( 0),
2557
- UINT16_C( 0), UINT16_C( 0), UINT16_C( 3), UINT16_C(12927)) }
2558
- };
2559
-
2560
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
2561
- simde__m128i r = simde_mm_minpos_epu16(test_vec[i].a);
2562
- simde_assert_m128i_u16(r, ==, test_vec[i].r);
2563
- }
2564
-
2565
- return MUNIT_OK;
2566
- }
2567
-
2568
- static MunitResult
2569
- test_simde_mm_mpsadbw_epu8(const MunitParameter params[], void* data) {
2570
- (void) params;
2571
- (void) data;
2572
-
2573
- const struct {
2574
- simde__m128i a;
2575
- simde__m128i b;
2576
- simde__m128i r;
2577
- } test_vec[8] = {
2578
- { simde_x_mm_set_epu8(UINT8_C(226), UINT8_C(204), UINT8_C(132), UINT8_C(191),
2579
- UINT8_C(109), UINT8_C( 5), UINT8_C( 22), UINT8_C(209),
2580
- UINT8_C(243), UINT8_C(105), UINT8_C(186), UINT8_C(151),
2581
- UINT8_C( 27), UINT8_C( 30), UINT8_C(223), UINT8_C( 88)),
2582
- simde_x_mm_set_epu8(UINT8_C(139), UINT8_C(113), UINT8_C( 31), UINT8_C( 64),
2583
- UINT8_C(155), UINT8_C( 28), UINT8_C(223), UINT8_C(195),
2584
- UINT8_C(151), UINT8_C( 30), UINT8_C( 86), UINT8_C( 95),
2585
- UINT8_C(158), UINT8_C( 54), UINT8_C( 10), UINT8_C( 66)),
2586
- simde_x_mm_set_epu16(UINT16_C( 289), UINT16_C( 222), UINT16_C( 124), UINT16_C( 292),
2587
- UINT16_C( 582), UINT16_C( 466), UINT16_C( 396), UINT16_C( 354)) },
2588
- { simde_x_mm_set_epu8(UINT8_C(171), UINT8_C( 80), UINT8_C(108), UINT8_C(236),
2589
- UINT8_C(239), UINT8_C(191), UINT8_C(219), UINT8_C(208),
2590
- UINT8_C(165), UINT8_C( 30), UINT8_C(251), UINT8_C(196),
2591
- UINT8_C( 25), UINT8_C(255), UINT8_C( 78), UINT8_C( 81)),
2592
- simde_x_mm_set_epu8(UINT8_C( 98), UINT8_C( 67), UINT8_C(141), UINT8_C(239),
2593
- UINT8_C( 33), UINT8_C(138), UINT8_C(161), UINT8_C(132),
2594
- UINT8_C( 23), UINT8_C( 84), UINT8_C(170), UINT8_C(230),
2595
- UINT8_C(214), UINT8_C(115), UINT8_C( 58), UINT8_C(130)),
2596
- simde_x_mm_set_epu16(UINT16_C( 154), UINT16_C( 325), UINT16_C( 380), UINT16_C( 374),
2597
- UINT16_C( 386), UINT16_C( 495), UINT16_C( 331), UINT16_C( 257)) },
2598
- { simde_x_mm_set_epu8(UINT8_C( 36), UINT8_C( 1), UINT8_C( 5), UINT8_C( 22),
2599
- UINT8_C( 73), UINT8_C(242), UINT8_C( 47), UINT8_C( 2),
2600
- UINT8_C(204), UINT8_C(245), UINT8_C( 42), UINT8_C( 38),
2601
- UINT8_C( 36), UINT8_C(136), UINT8_C( 36), UINT8_C(163)),
2602
- simde_x_mm_set_epu8(UINT8_C(168), UINT8_C(213), UINT8_C( 2), UINT8_C( 30),
2603
- UINT8_C( 25), UINT8_C(127), UINT8_C( 31), UINT8_C(133),
2604
- UINT8_C(118), UINT8_C(121), UINT8_C(113), UINT8_C(231),
2605
- UINT8_C( 34), UINT8_C( 80), UINT8_C(116), UINT8_C( 25)),
2606
- simde_x_mm_set_epu16(UINT16_C( 438), UINT16_C( 637), UINT16_C( 543), UINT16_C( 197),
2607
- UINT16_C( 414), UINT16_C( 749), UINT16_C( 430), UINT16_C( 116)) },
2608
- { simde_x_mm_set_epu8(UINT8_C( 29), UINT8_C( 29), UINT8_C(199), UINT8_C(141),
2609
- UINT8_C(153), UINT8_C(161), UINT8_C(202), UINT8_C( 57),
2610
- UINT8_C( 56), UINT8_C( 10), UINT8_C(125), UINT8_C( 91),
2611
- UINT8_C(212), UINT8_C(168), UINT8_C( 43), UINT8_C(108)),
2612
- simde_x_mm_set_epu8(UINT8_C( 54), UINT8_C( 56), UINT8_C(193), UINT8_C(184),
2613
- UINT8_C( 44), UINT8_C( 35), UINT8_C(133), UINT8_C( 78),
2614
- UINT8_C( 34), UINT8_C(199), UINT8_C(192), UINT8_C(116),
2615
- UINT8_C( 79), UINT8_C(137), UINT8_C(150), UINT8_C( 19)),
2616
- simde_x_mm_set_epu16(UINT16_C( 251), UINT16_C( 293), UINT16_C( 234), UINT16_C( 340),
2617
- UINT16_C( 517), UINT16_C( 460), UINT16_C( 245), UINT16_C( 209)) },
2618
- { simde_x_mm_set_epu8(UINT8_C(211), UINT8_C(227), UINT8_C(150), UINT8_C( 37),
2619
- UINT8_C(162), UINT8_C(249), UINT8_C(215), UINT8_C(195),
2620
- UINT8_C( 63), UINT8_C(183), UINT8_C(196), UINT8_C( 97),
2621
- UINT8_C( 60), UINT8_C(192), UINT8_C(194), UINT8_C(164)),
2622
- simde_x_mm_set_epu8(UINT8_C(120), UINT8_C( 70), UINT8_C(238), UINT8_C(106),
2623
- UINT8_C( 29), UINT8_C( 66), UINT8_C( 80), UINT8_C(174),
2624
- UINT8_C( 76), UINT8_C(151), UINT8_C( 56), UINT8_C( 77),
2625
- UINT8_C( 36), UINT8_C(138), UINT8_C(170), UINT8_C(105)),
2626
- simde_x_mm_set_epu16(UINT16_C( 444), UINT16_C( 282), UINT16_C( 295), UINT16_C( 333),
2627
- UINT16_C( 360), UINT16_C( 472), UINT16_C( 227), UINT16_C( 221)) },
2628
- { simde_x_mm_set_epu8(UINT8_C(167), UINT8_C(231), UINT8_C(129), UINT8_C(236),
2629
- UINT8_C(158), UINT8_C( 34), UINT8_C(219), UINT8_C( 52),
2630
- UINT8_C(201), UINT8_C( 55), UINT8_C( 88), UINT8_C( 76),
2631
- UINT8_C( 91), UINT8_C(192), UINT8_C( 80), UINT8_C(141)),
2632
- simde_x_mm_set_epu8(UINT8_C(215), UINT8_C( 0), UINT8_C( 39), UINT8_C(166),
2633
- UINT8_C( 94), UINT8_C(231), UINT8_C(224), UINT8_C(140),
2634
- UINT8_C(153), UINT8_C( 38), UINT8_C(229), UINT8_C(239),
2635
- UINT8_C(167), UINT8_C( 85), UINT8_C(242), UINT8_C(231)),
2636
- simde_x_mm_set_epu16(UINT16_C( 350), UINT16_C( 573), UINT16_C( 237), UINT16_C( 385),
2637
- UINT16_C( 448), UINT16_C( 329), UINT16_C( 458), UINT16_C( 208)) },
2638
- { simde_x_mm_set_epu8(UINT8_C(125), UINT8_C( 70), UINT8_C(248), UINT8_C(193),
2639
- UINT8_C(244), UINT8_C( 76), UINT8_C(163), UINT8_C(150),
2640
- UINT8_C(169), UINT8_C( 24), UINT8_C(114), UINT8_C( 21),
2641
- UINT8_C(171), UINT8_C( 13), UINT8_C(157), UINT8_C(178)),
2642
- simde_x_mm_set_epu8(UINT8_C(198), UINT8_C(153), UINT8_C(205), UINT8_C(219),
2643
- UINT8_C(198), UINT8_C( 83), UINT8_C( 62), UINT8_C( 96),
2644
- UINT8_C(119), UINT8_C(213), UINT8_C( 90), UINT8_C(147),
2645
- UINT8_C(232), UINT8_C( 64), UINT8_C(164), UINT8_C(129)),
2646
- simde_x_mm_set_epu16(UINT16_C( 260), UINT16_C( 272), UINT16_C( 281), UINT16_C( 234),
2647
- UINT16_C( 237), UINT16_C( 269), UINT16_C( 350), UINT16_C( 447)) },
2648
- { simde_x_mm_set_epu8(UINT8_C( 35), UINT8_C(118), UINT8_C(198), UINT8_C( 85),
2649
- UINT8_C( 8), UINT8_C(150), UINT8_C(121), UINT8_C(243),
2650
- UINT8_C( 16), UINT8_C(221), UINT8_C(227), UINT8_C( 37),
2651
- UINT8_C( 87), UINT8_C( 66), UINT8_C(216), UINT8_C(177)),
2652
- simde_x_mm_set_epu8(UINT8_C(148), UINT8_C(250), UINT8_C( 9), UINT8_C(204),
2653
- UINT8_C(136), UINT8_C(106), UINT8_C( 76), UINT8_C(162),
2654
- UINT8_C(111), UINT8_C( 61), UINT8_C( 51), UINT8_C(174),
2655
- UINT8_C(202), UINT8_C(248), UINT8_C( 64), UINT8_C(174)),
2656
- simde_x_mm_set_epu16(UINT16_C( 354), UINT16_C( 270), UINT16_C( 529), UINT16_C( 391),
2657
- UINT16_C( 553), UINT16_C( 58), UINT16_C( 564), UINT16_C( 546)) }
2658
- };
2659
-
2660
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
2661
- simde__m128i r = simde_mm_mpsadbw_epu8(test_vec[i].a, test_vec[i].b, 7);
2662
- simde_assert_m128i_u16(r, ==, test_vec[i].r);
2663
- }
2664
-
2665
- return MUNIT_OK;
2666
- }
2667
-
2668
- static MunitResult
2669
- test_simde_mm_mul_epi32(const MunitParameter params[], void* data) {
2670
- (void) params;
2671
- (void) data;
2672
-
2673
- const struct {
2674
- simde__m128i a;
2675
- simde__m128i b;
2676
- simde__m128i r;
2677
- } test_vec[8] = {
2678
- { simde_mm_set_epi32(INT32_C(-1795240134), INT32_C( -225235276), INT32_C( 260214100), INT32_C(-1437997118)),
2679
- simde_mm_set_epi32(INT32_C(-1930516827), INT32_C(-2112091397), INT32_C(-2111031164), INT32_C( 1337416900)),
2680
- simde_mm_set_epi64x(INT64_C( 475717488740520572), INT64_C(-1923201647764494200)) },
2681
- { simde_mm_set_epi32(INT32_C(-2008734650), INT32_C( 1987866784), INT32_C( 1460586541), INT32_C( -308079008)),
2682
- simde_mm_set_epi32(INT32_C( 1619497162), INT32_C( 1948444521), INT32_C(-1962326453), INT32_C( 355525826)),
2683
- simde_mm_set_epi64x(INT64_C( 3873248143762690464), INT64_C( -109530043792460608)) },
2684
- { simde_mm_set_epi32(INT32_C( -967525151), INT32_C( 610102911), INT32_C( -82193087), INT32_C( 610685272)),
2685
- simde_mm_set_epi32(INT32_C( -464555473), INT32_C( 1911406284), INT32_C( 1504403418), INT32_C( 1044708348)),
2686
- simde_mm_set_epi64x(INT64_C( 1166154537972092724), INT64_C( 637988001659050656)) },
2687
- { simde_mm_set_epi32(INT32_C( 734959886), INT32_C( 727387476), INT32_C(-1178464916), INT32_C( 759159032)),
2688
- simde_mm_set_epi32(INT32_C( 227151790), INT32_C( 2027589232), INT32_C( -510665157), INT32_C( 664410245)),
2689
- simde_mm_set_epi64x(INT64_C( 1474843013829258432), INT64_C( 504393038445082840)) },
2690
- { simde_mm_set_epi32(INT32_C( -981875510), INT32_C(-1517853387), INT32_C( 645890048), INT32_C( 1483649404)),
2691
- simde_mm_set_epi32(INT32_C(-1176179108), INT32_C( -884770028), INT32_C( 1667209942), INT32_C( -150484050)),
2692
- simde_mm_set_epi64x(INT64_C( 1342951183715884836), INT64_C( -223265571094006200)) },
2693
- { simde_mm_set_epi32(INT32_C( -229613172), INT32_C( -220620915), INT32_C( 1178015644), INT32_C(-1087297921)),
2694
- simde_mm_set_epi32(INT32_C(-1751226172), INT32_C(-1807182523), INT32_C( 804591673), INT32_C( -413406506)),
2695
- simde_mm_set_epi64x(INT64_C( 398702261796268545), INT64_C( 449496034501674026)) },
2696
- { simde_mm_set_epi32(INT32_C(-1537480837), INT32_C( -185479936), INT32_C( 386155243), INT32_C( 479622311)),
2697
- simde_mm_set_epi32(INT32_C( -579116298), INT32_C( -674452315), INT32_C( -142346909), INT32_C(-1350064613)),
2698
- simde_mm_set_epi64x(INT64_C( 125097372221251840), INT64_C( -647521109686380643)) },
2699
- { simde_mm_set_epi32(INT32_C( 2146108348), INT32_C( 341648975), INT32_C( 901701854), INT32_C( -45673158)),
2700
- simde_mm_set_epi32(INT32_C( 723948067), INT32_C( 1076365190), INT32_C( -693273363), INT32_C( 420311114)),
2701
- simde_mm_set_epi64x(INT64_C( 367739063889180250), INT64_C( -19196935918878012)) }
2702
- };
2703
-
2704
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
2705
- simde__m128i r = simde_mm_mul_epi32(test_vec[i].a, test_vec[i].b);
2706
- simde_assert_m128i_i32(r, ==, test_vec[i].r);
2707
- }
2708
-
2709
- return MUNIT_OK;
2710
- }
2711
-
2712
- static MunitResult
2713
- test_simde_mm_mullo_epi32(const MunitParameter params[], void* data) {
2714
- (void) params;
2715
- (void) data;
2716
-
2717
- const struct {
2718
- simde__m128i a;
2719
- simde__m128i b;
2720
- simde__m128i r;
2721
- } test_vec[8] = {
2722
- { simde_mm_set_epi32(INT32_C( 1431531471), INT32_C(-1934656662), INT32_C( -638668877), INT32_C( 1966621031)),
2723
- simde_mm_set_epi32(INT32_C( -646581607), INT32_C( 1232530244), INT32_C( 841047033), INT32_C(-1472432488)),
2724
- simde_mm_set_epi32(INT32_C( 1865056439), INT32_C(-1849485784), INT32_C( 1840285211), INT32_C( 1940934440)) },
2725
- { simde_mm_set_epi32(INT32_C( 2119691862), INT32_C( 1656188631), INT32_C( 949015012), INT32_C( -645064268)),
2726
- simde_mm_set_epi32(INT32_C( 1854664684), INT32_C( 1364588379), INT32_C( -185048322), INT32_C( 1546431794)),
2727
- simde_mm_set_epi32(INT32_C( -314310328), INT32_C( -410462355), INT32_C( 887719992), INT32_C( -220354264)) },
2728
- { simde_mm_set_epi32(INT32_C( 390191893), INT32_C( 1246080619), INT32_C( 2032818940), INT32_C(-1664549536)),
2729
- simde_mm_set_epi32(INT32_C( 1802476280), INT32_C(-1492538899), INT32_C( -866846002), INT32_C(-1929477089)),
2730
- simde_mm_set_epi32(INT32_C( -357441960), INT32_C(-1318446065), INT32_C(-2019602744), INT32_C(-2076430688)) },
2731
- { simde_mm_set_epi32(INT32_C( -629988407), INT32_C(-1719063308), INT32_C( -231912988), INT32_C( 1462330866)),
2732
- simde_mm_set_epi32(INT32_C(-1320599620), INT32_C( -769970788), INT32_C( -625134420), INT32_C( 293199422)),
2733
- simde_mm_set_epi32(INT32_C( -273826148), INT32_C(-1841674064), INT32_C(-1631324880), INT32_C( 1137740956)) },
2734
- { simde_mm_set_epi32(INT32_C(-1221152076), INT32_C(-1223458578), INT32_C(-1263311025), INT32_C( 2089857790)),
2735
- simde_mm_set_epi32(INT32_C(-2068401725), INT32_C( 1531524331), INT32_C( 1064638153), INT32_C( -843878287)),
2736
- simde_mm_set_epi32(INT32_C( 1009816348), INT32_C( 1660269178), INT32_C( -203954425), INT32_C( -674749922)) },
2737
- { simde_mm_set_epi32(INT32_C(-1283522478), INT32_C( 524522527), INT32_C( 1152886109), INT32_C( -438302719)),
2738
- simde_mm_set_epi32(INT32_C(-2012975476), INT32_C( -67951228), INT32_C( 258710699), INT32_C( -25585755)),
2739
- simde_mm_set_epi32(INT32_C( 1289709784), INT32_C( -508699908), INT32_C( 1615798559), INT32_C( 345423781)) },
2740
- { simde_mm_set_epi32(INT32_C( 199098300), INT32_C(-1941350427), INT32_C(-1170519288), INT32_C( 2117275260)),
2741
- simde_mm_set_epi32(INT32_C( 1736533752), INT32_C( 668304389), INT32_C(-1871663356), INT32_C( -231105582)),
2742
- simde_mm_set_epi32(INT32_C( 1957733920), INT32_C(-1823880327), INT32_C( -994597856), INT32_C( -515705416)) },
2743
- { simde_mm_set_epi32(INT32_C( 796248112), INT32_C( -74441002), INT32_C( 756194998), INT32_C( 128690934)),
2744
- simde_mm_set_epi32(INT32_C( -934813484), INT32_C( 1495167051), INT32_C( 549239917), INT32_C( 1315900336)),
2745
- simde_mm_set_epi32(INT32_C( 1644414912), INT32_C(-1010128718), INT32_C( 723729278), INT32_C(-1157096672)) }
2746
- };
2747
-
2748
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
2749
- simde__m128i r = simde_mm_mullo_epi32(test_vec[i].a, test_vec[i].b);
2750
- simde_assert_m128i_i32(r, ==, test_vec[i].r);
2751
- }
2752
-
2753
- return MUNIT_OK;
2754
- }
2755
-
2756
- static MunitResult
2757
- test_simde_mm_packus_epi32(const MunitParameter params[], void* data) {
2758
- (void) params;
2759
- (void) data;
2760
-
2761
- const struct {
2762
- simde__m128i a;
2763
- simde__m128i b;
2764
- simde__m128i r;
2765
- } test_vec[8] = {
2766
- { simde_mm_set_epi32(INT32_C(-1174506975), INT32_C(-1622542395), INT32_C( -228565455), INT32_C( 1722092951)),
2767
- simde_mm_set_epi32(INT32_C( -188735178), INT32_C( -859437923), INT32_C( 40707), INT32_C(-2078308106)),
2768
- simde_x_mm_set_epu16(UINT16_C( 0), UINT16_C( 0), UINT16_C(40707), UINT16_C( 0),
2769
- UINT16_C( 0), UINT16_C( 0), UINT16_C( 0), UINT16_C(65535)) },
2770
- { simde_mm_set_epi32(INT32_C( 279157042), INT32_C( -664033471), INT32_C( 1210432777), INT32_C(-1162534366)),
2771
- simde_mm_set_epi32(INT32_C( 330673804), INT32_C(-1666667776), INT32_C(-1924642427), INT32_C(-1118465206)),
2772
- simde_x_mm_set_epu16(UINT16_C(65535), UINT16_C( 0), UINT16_C( 0), UINT16_C( 0),
2773
- UINT16_C(65535), UINT16_C( 0), UINT16_C(65535), UINT16_C( 0)) },
2774
- { simde_mm_set_epi32(INT32_C(-1675273454), INT32_C( 252374167), INT32_C(-1898193118), INT32_C(-2121147721)),
2775
- simde_mm_set_epi32(INT32_C(-1175340609), INT32_C( 1859609595), INT32_C( 305301369), INT32_C( 1936442403)),
2776
- simde_x_mm_set_epu16(UINT16_C( 0), UINT16_C(65535), UINT16_C(65535), UINT16_C(65535),
2777
- UINT16_C( 0), UINT16_C(65535), UINT16_C( 0), UINT16_C( 0)) },
2778
- { simde_mm_set_epi32(INT32_C( -372493069), INT32_C(-1071911212), INT32_C( 122218483), INT32_C( 1644546153)),
2779
- simde_mm_set_epi32(INT32_C( -603471664), INT32_C( -435236634), INT32_C(-1237577227), INT32_C( 40156)),
2780
- simde_x_mm_set_epu16(UINT16_C( 0), UINT16_C( 0), UINT16_C( 0), UINT16_C(40156),
2781
- UINT16_C( 0), UINT16_C( 0), UINT16_C(65535), UINT16_C(65535)) },
2782
- { simde_mm_set_epi32(INT32_C( -132052641), INT32_C( 1567528732), INT32_C( -1505776), INT32_C( 422872655)),
2783
- simde_mm_set_epi32(INT32_C( 1525337323), INT32_C(-1409556892), INT32_C( -388396270), INT32_C(-2086963765)),
2784
- simde_x_mm_set_epu16(UINT16_C(65535), UINT16_C( 0), UINT16_C( 0), UINT16_C( 0),
2785
- UINT16_C( 0), UINT16_C(65535), UINT16_C( 0), UINT16_C(65535)) },
2786
- { simde_mm_set_epi32(INT32_C(-1206563380), INT32_C( 1557268555), INT32_C( -872999034), INT32_C( 234221095)),
2787
- simde_mm_set_epi32(INT32_C( 723455818), INT32_C( 773436940), INT32_C( 326719262), INT32_C( -826281673)),
2788
- simde_x_mm_set_epu16(UINT16_C(65535), UINT16_C(65535), UINT16_C(65535), UINT16_C( 0),
2789
- UINT16_C( 0), UINT16_C(65535), UINT16_C( 0), UINT16_C(65535)) },
2790
- { simde_mm_set_epi32(INT32_C( -738729427), INT32_C( 1061139854), INT32_C(-2031157453), INT32_C( 2064098327)),
2791
- simde_mm_set_epi32(INT32_C(-1034678142), INT32_C( 97345786), INT32_C( 1187222665), INT32_C( 61643)),
2792
- simde_x_mm_set_epu16(UINT16_C( 0), UINT16_C(65535), UINT16_C(65535), UINT16_C(61643),
2793
- UINT16_C( 0), UINT16_C(65535), UINT16_C( 0), UINT16_C(65535)) },
2794
- { simde_mm_set_epi32(INT32_C(-2037944282), INT32_C( -355400074), INT32_C( -341422900), INT32_C(-1605623445)),
2795
- simde_mm_set_epi32(INT32_C( 629990551), INT32_C( 397893118), INT32_C(-1310491239), INT32_C(-2050362652)),
2796
- simde_x_mm_set_epu16(UINT16_C(65535), UINT16_C(65535), UINT16_C( 0), UINT16_C( 0),
2797
- UINT16_C( 0), UINT16_C( 0), UINT16_C( 0), UINT16_C( 0)) }
2798
- };
2799
-
2800
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
2801
- simde__m128i r = simde_mm_packus_epi32(test_vec[i].a, test_vec[i].b);
2802
- simde_assert_m128i_i32(r, ==, test_vec[i].r);
2803
- }
2804
-
2805
- return MUNIT_OK;
2806
- }
2807
-
2808
- static MunitResult
2809
- test_simde_mm_round_pd(const MunitParameter params[], void* data) {
2810
- (void) params;
2811
- (void) data;
2812
-
2813
- const struct {
2814
- simde__m128d a;
2815
- int rounding;
2816
- simde__m128d r;
2817
- } test_vec[8] = {
2818
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 959.46), SIMDE_FLOAT64_C( -646.56)),
2819
- SIMDE_MM_FROUND_TO_NEAREST_INT,
2820
- simde_mm_set_pd(SIMDE_FLOAT64_C( 959.00), SIMDE_FLOAT64_C( -647.00)) },
2821
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -813.43), SIMDE_FLOAT64_C( 515.75)),
2822
- SIMDE_MM_FROUND_TO_NEAREST_INT,
2823
- simde_mm_set_pd(SIMDE_FLOAT64_C( -813.00), SIMDE_FLOAT64_C( 516.00)) },
2824
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -365.43), SIMDE_FLOAT64_C( 840.28)),
2825
- SIMDE_MM_FROUND_TO_NEG_INF,
2826
- simde_mm_set_pd(SIMDE_FLOAT64_C( -366.00), SIMDE_FLOAT64_C( 840.00)) },
2827
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -843.69), SIMDE_FLOAT64_C( -641.36)),
2828
- SIMDE_MM_FROUND_TO_NEG_INF,
2829
- simde_mm_set_pd(SIMDE_FLOAT64_C( -844.00), SIMDE_FLOAT64_C( -642.00)) },
2830
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -542.64), SIMDE_FLOAT64_C( -757.34)),
2831
- SIMDE_MM_FROUND_TO_POS_INF,
2832
- simde_mm_set_pd(SIMDE_FLOAT64_C( -542.00), SIMDE_FLOAT64_C( -757.00)) },
2833
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -593.16), SIMDE_FLOAT64_C( 973.59)),
2834
- SIMDE_MM_FROUND_TO_POS_INF,
2835
- simde_mm_set_pd(SIMDE_FLOAT64_C( -593.00), SIMDE_FLOAT64_C( 974.00)) },
2836
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 54.67), SIMDE_FLOAT64_C( -54.55)),
2837
- SIMDE_MM_FROUND_TO_ZERO,
2838
- simde_mm_set_pd(SIMDE_FLOAT64_C( 54.00), SIMDE_FLOAT64_C( -54.00)) },
2839
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -31.89), SIMDE_FLOAT64_C( 136.86)),
2840
- SIMDE_MM_FROUND_TO_ZERO,
2841
- simde_mm_set_pd(SIMDE_FLOAT64_C( -31.00), SIMDE_FLOAT64_C( 136.00)) }
2842
- };
2843
-
2844
- for (size_t i = 0 ; i < 2 ; i++) {
2845
- simde__m128d r = simde_mm_round_pd(test_vec[i].a, SIMDE_MM_FROUND_TO_NEAREST_INT);
2846
- simde_assert_m128d_close(r, test_vec[i].r, 1);
2847
- }
2848
- for (size_t i = 2 ; i < 4 ; i++) {
2849
- simde__m128d r = simde_mm_round_pd(test_vec[i].a, SIMDE_MM_FROUND_TO_NEG_INF);
2850
- simde_assert_m128d_close(r, test_vec[i].r, 1);
2851
- }
2852
- for (size_t i = 4 ; i < 6 ; i++) {
2853
- simde__m128d r = simde_mm_round_pd(test_vec[i].a, SIMDE_MM_FROUND_TO_POS_INF);
2854
- simde_assert_m128d_close(r, test_vec[i].r, 1);
2855
- }
2856
- for (size_t i = 6 ; i < 8 ; i++) {
2857
- simde__m128d r = simde_mm_round_pd(test_vec[i].a, SIMDE_MM_FROUND_TO_ZERO);
2858
- simde_assert_m128d_close(r, test_vec[i].r, 1);
2859
- }
2860
-
2861
- return MUNIT_OK;
2862
- }
2863
-
2864
- static MunitResult
2865
- test_simde_mm_round_ps(const MunitParameter params[], void* data) {
2866
- (void) params;
2867
- (void) data;
2868
-
2869
- const struct {
2870
- simde__m128 a;
2871
- int rounding;
2872
- simde__m128 r;
2873
- } test_vec[8] = {
2874
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 201.21), SIMDE_FLOAT32_C( -972.67), SIMDE_FLOAT32_C( -880.37), SIMDE_FLOAT32_C( 126.05)),
2875
- SIMDE_MM_FROUND_TO_NEAREST_INT,
2876
- simde_mm_set_ps(SIMDE_FLOAT32_C( 201.00), SIMDE_FLOAT32_C( -973.00), SIMDE_FLOAT32_C( -880.00), SIMDE_FLOAT32_C( 126.00)) },
2877
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -339.94), SIMDE_FLOAT32_C( 81.10), SIMDE_FLOAT32_C( 664.61), SIMDE_FLOAT32_C( 207.74)),
2878
- SIMDE_MM_FROUND_TO_NEAREST_INT,
2879
- simde_mm_set_ps(SIMDE_FLOAT32_C( -340.00), SIMDE_FLOAT32_C( 81.00), SIMDE_FLOAT32_C( 665.00), SIMDE_FLOAT32_C( 208.00)) },
2880
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -476.74), SIMDE_FLOAT32_C( 320.44), SIMDE_FLOAT32_C( -89.85), SIMDE_FLOAT32_C( -531.60)),
2881
- SIMDE_MM_FROUND_TO_NEG_INF,
2882
- simde_mm_set_ps(SIMDE_FLOAT32_C( -477.00), SIMDE_FLOAT32_C( 320.00), SIMDE_FLOAT32_C( -90.00), SIMDE_FLOAT32_C( -532.00)) },
2883
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -802.32), SIMDE_FLOAT32_C( -381.83), SIMDE_FLOAT32_C( -743.96), SIMDE_FLOAT32_C( -180.00)),
2884
- SIMDE_MM_FROUND_TO_NEG_INF,
2885
- simde_mm_set_ps(SIMDE_FLOAT32_C( -803.00), SIMDE_FLOAT32_C( -382.00), SIMDE_FLOAT32_C( -744.00), SIMDE_FLOAT32_C( -180.00)) },
2886
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 231.59), SIMDE_FLOAT32_C( 681.41), SIMDE_FLOAT32_C( 561.95), SIMDE_FLOAT32_C( -598.34)),
2887
- SIMDE_MM_FROUND_TO_POS_INF,
2888
- simde_mm_set_ps(SIMDE_FLOAT32_C( 232.00), SIMDE_FLOAT32_C( 682.00), SIMDE_FLOAT32_C( 562.00), SIMDE_FLOAT32_C( -598.00)) },
2889
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -440.45), SIMDE_FLOAT32_C( 343.18), SIMDE_FLOAT32_C( 88.66), SIMDE_FLOAT32_C( -98.54)),
2890
- SIMDE_MM_FROUND_TO_POS_INF,
2891
- simde_mm_set_ps(SIMDE_FLOAT32_C( -440.00), SIMDE_FLOAT32_C( 344.00), SIMDE_FLOAT32_C( 89.00), SIMDE_FLOAT32_C( -98.00)) },
2892
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -128.87), SIMDE_FLOAT32_C( -558.72), SIMDE_FLOAT32_C( 864.66), SIMDE_FLOAT32_C( -576.19)),
2893
- SIMDE_MM_FROUND_TO_ZERO,
2894
- simde_mm_set_ps(SIMDE_FLOAT32_C( -128.00), SIMDE_FLOAT32_C( -558.00), SIMDE_FLOAT32_C( 864.00), SIMDE_FLOAT32_C( -576.00)) },
2895
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 669.69), SIMDE_FLOAT32_C( 902.50), SIMDE_FLOAT32_C( -479.42), SIMDE_FLOAT32_C( 565.85)),
2896
- SIMDE_MM_FROUND_TO_ZERO,
2897
- simde_mm_set_ps(SIMDE_FLOAT32_C( 669.00), SIMDE_FLOAT32_C( 902.00), SIMDE_FLOAT32_C( -479.00), SIMDE_FLOAT32_C( 565.00)) }
2898
- };
2899
-
2900
- for (size_t i = 0 ; i < 2 ; i++) {
2901
- simde__m128 r = simde_mm_round_ps(test_vec[i].a, SIMDE_MM_FROUND_TO_NEAREST_INT);
2902
- simde_assert_m128_close(r, test_vec[i].r, 1);
2903
- }
2904
- for (size_t i = 2 ; i < 4 ; i++) {
2905
- simde__m128 r = simde_mm_round_ps(test_vec[i].a, SIMDE_MM_FROUND_TO_NEG_INF);
2906
- simde_assert_m128_close(r, test_vec[i].r, 1);
2907
- }
2908
- for (size_t i = 4 ; i < 6 ; i++) {
2909
- simde__m128 r = simde_mm_round_ps(test_vec[i].a, SIMDE_MM_FROUND_TO_POS_INF);
2910
- simde_assert_m128_close(r, test_vec[i].r, 1);
2911
- }
2912
- for (size_t i = 6 ; i < 8 ; i++) {
2913
- simde__m128 r = simde_mm_round_ps(test_vec[i].a, SIMDE_MM_FROUND_TO_ZERO);
2914
- simde_assert_m128_close(r, test_vec[i].r, 1);
2915
- }
2916
-
2917
- return MUNIT_OK;
2918
- }
2919
-
2920
- static MunitResult
2921
- test_simde_mm_round_sd(const MunitParameter params[], void* data) {
2922
- (void) params;
2923
- (void) data;
2924
-
2925
- const struct {
2926
- simde__m128d a;
2927
- simde__m128d b;
2928
- int rounding;
2929
- simde__m128d r;
2930
- } test_vec[8] = {
2931
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -57.59), SIMDE_FLOAT64_C( -91.48)),
2932
- simde_mm_set_pd(SIMDE_FLOAT64_C( -114.01), SIMDE_FLOAT64_C( 129.18)),
2933
- SIMDE_MM_FROUND_TO_NEAREST_INT,
2934
- simde_mm_set_pd(SIMDE_FLOAT64_C( -57.59), SIMDE_FLOAT64_C( 129.00)) },
2935
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 367.02), SIMDE_FLOAT64_C( -228.73)),
2936
- simde_mm_set_pd(SIMDE_FLOAT64_C( -106.57), SIMDE_FLOAT64_C( -248.85)),
2937
- SIMDE_MM_FROUND_TO_NEAREST_INT,
2938
- simde_mm_set_pd(SIMDE_FLOAT64_C( 367.02), SIMDE_FLOAT64_C( -249.00)) },
2939
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 218.19), SIMDE_FLOAT64_C( -121.02)),
2940
- simde_mm_set_pd(SIMDE_FLOAT64_C( -367.84), SIMDE_FLOAT64_C( -492.19)),
2941
- SIMDE_MM_FROUND_TO_NEG_INF,
2942
- simde_mm_set_pd(SIMDE_FLOAT64_C( 218.19), SIMDE_FLOAT64_C( -493.00)) },
2943
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 706.26), SIMDE_FLOAT64_C( 710.85)),
2944
- simde_mm_set_pd(SIMDE_FLOAT64_C( -391.17), SIMDE_FLOAT64_C( -834.44)),
2945
- SIMDE_MM_FROUND_TO_NEG_INF,
2946
- simde_mm_set_pd(SIMDE_FLOAT64_C( 706.26), SIMDE_FLOAT64_C( -835.00)) },
2947
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -784.90), SIMDE_FLOAT64_C( -810.73)),
2948
- simde_mm_set_pd(SIMDE_FLOAT64_C( -554.44), SIMDE_FLOAT64_C( -463.60)),
2949
- SIMDE_MM_FROUND_TO_POS_INF,
2950
- simde_mm_set_pd(SIMDE_FLOAT64_C( -784.90), SIMDE_FLOAT64_C( -463.00)) },
2951
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -997.83), SIMDE_FLOAT64_C( 6.91)),
2952
- simde_mm_set_pd(SIMDE_FLOAT64_C( -51.24), SIMDE_FLOAT64_C( -801.09)),
2953
- SIMDE_MM_FROUND_TO_POS_INF,
2954
- simde_mm_set_pd(SIMDE_FLOAT64_C( -997.83), SIMDE_FLOAT64_C( -801.00)) },
2955
- { simde_mm_set_pd(SIMDE_FLOAT64_C( -237.53), SIMDE_FLOAT64_C( 215.82)),
2956
- simde_mm_set_pd(SIMDE_FLOAT64_C( -338.32), SIMDE_FLOAT64_C( -289.00)),
2957
- SIMDE_MM_FROUND_TO_ZERO,
2958
- simde_mm_set_pd(SIMDE_FLOAT64_C( -237.53), SIMDE_FLOAT64_C( -289.00)) },
2959
- { simde_mm_set_pd(SIMDE_FLOAT64_C( 964.37), SIMDE_FLOAT64_C( -304.03)),
2960
- simde_mm_set_pd(SIMDE_FLOAT64_C( 237.14), SIMDE_FLOAT64_C( 621.16)),
2961
- SIMDE_MM_FROUND_TO_ZERO,
2962
- simde_mm_set_pd(SIMDE_FLOAT64_C( 964.37), SIMDE_FLOAT64_C( 621.00)) }
2963
- };
2964
-
2965
- for (size_t i = 0 ; i < 2 ; i++) {
2966
- simde__m128d r = simde_mm_round_sd(test_vec[i].a, test_vec[i].b, SIMDE_MM_FROUND_TO_NEAREST_INT);
2967
- simde_assert_m128d_close(r, test_vec[i].r, 1);
2968
- }
2969
- for (size_t i = 2 ; i < 4 ; i++) {
2970
- simde__m128d r = simde_mm_round_sd(test_vec[i].a, test_vec[i].b, SIMDE_MM_FROUND_TO_NEG_INF);
2971
- simde_assert_m128d_close(r, test_vec[i].r, 1);
2972
- }
2973
- for (size_t i = 4 ; i < 6 ; i++) {
2974
- simde__m128d r = simde_mm_round_sd(test_vec[i].a, test_vec[i].b, SIMDE_MM_FROUND_TO_POS_INF);
2975
- simde_assert_m128d_close(r, test_vec[i].r, 1);
2976
- }
2977
- for (size_t i = 6 ; i < 8 ; i++) {
2978
- simde__m128d r = simde_mm_round_sd(test_vec[i].a, test_vec[i].b, SIMDE_MM_FROUND_TO_ZERO);
2979
- simde_assert_m128d_close(r, test_vec[i].r, 1);
2980
- }
2981
-
2982
- return MUNIT_OK;
2983
- }
2984
-
2985
- static MunitResult
2986
- test_simde_mm_round_ss(const MunitParameter params[], void* data) {
2987
- (void) params;
2988
- (void) data;
2989
-
2990
- const struct {
2991
- simde__m128 a;
2992
- simde__m128 b;
2993
- int rounding;
2994
- simde__m128 r;
2995
- } test_vec[8] = {
2996
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -963.12), SIMDE_FLOAT32_C( -638.96), SIMDE_FLOAT32_C( -855.75), SIMDE_FLOAT32_C( 789.49)),
2997
- simde_mm_set_ps(SIMDE_FLOAT32_C( 969.82), SIMDE_FLOAT32_C( 14.36), SIMDE_FLOAT32_C( 60.33), SIMDE_FLOAT32_C( -666.61)),
2998
- SIMDE_MM_FROUND_TO_NEAREST_INT,
2999
- simde_mm_set_ps(SIMDE_FLOAT32_C( -963.12), SIMDE_FLOAT32_C( -638.96), SIMDE_FLOAT32_C( -855.75), SIMDE_FLOAT32_C( -667.00)) },
3000
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -53.45), SIMDE_FLOAT32_C( 397.58), SIMDE_FLOAT32_C( 386.64), SIMDE_FLOAT32_C( 779.00)),
3001
- simde_mm_set_ps(SIMDE_FLOAT32_C( 497.83), SIMDE_FLOAT32_C( -657.35), SIMDE_FLOAT32_C( -712.13), SIMDE_FLOAT32_C( 600.92)),
3002
- SIMDE_MM_FROUND_TO_NEAREST_INT,
3003
- simde_mm_set_ps(SIMDE_FLOAT32_C( -53.45), SIMDE_FLOAT32_C( 397.58), SIMDE_FLOAT32_C( 386.64), SIMDE_FLOAT32_C( 601.00)) },
3004
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -527.69), SIMDE_FLOAT32_C( -487.47), SIMDE_FLOAT32_C( -52.23), SIMDE_FLOAT32_C( 18.71)),
3005
- simde_mm_set_ps(SIMDE_FLOAT32_C( -912.96), SIMDE_FLOAT32_C( 897.40), SIMDE_FLOAT32_C( -873.59), SIMDE_FLOAT32_C( 52.18)),
3006
- SIMDE_MM_FROUND_TO_NEG_INF,
3007
- simde_mm_set_ps(SIMDE_FLOAT32_C( -527.69), SIMDE_FLOAT32_C( -487.47), SIMDE_FLOAT32_C( -52.23), SIMDE_FLOAT32_C( 52.00)) },
3008
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 857.48), SIMDE_FLOAT32_C( -849.82), SIMDE_FLOAT32_C( 971.09), SIMDE_FLOAT32_C( -929.13)),
3009
- simde_mm_set_ps(SIMDE_FLOAT32_C( 871.04), SIMDE_FLOAT32_C( 284.36), SIMDE_FLOAT32_C( 561.82), SIMDE_FLOAT32_C( -146.68)),
3010
- SIMDE_MM_FROUND_TO_NEG_INF,
3011
- simde_mm_set_ps(SIMDE_FLOAT32_C( 857.48), SIMDE_FLOAT32_C( -849.82), SIMDE_FLOAT32_C( 971.09), SIMDE_FLOAT32_C( -147.00)) },
3012
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -859.81), SIMDE_FLOAT32_C( -105.89), SIMDE_FLOAT32_C( -18.60), SIMDE_FLOAT32_C( -214.59)),
3013
- simde_mm_set_ps(SIMDE_FLOAT32_C( -360.47), SIMDE_FLOAT32_C( 472.18), SIMDE_FLOAT32_C( 960.99), SIMDE_FLOAT32_C( -396.53)),
3014
- SIMDE_MM_FROUND_TO_POS_INF,
3015
- simde_mm_set_ps(SIMDE_FLOAT32_C( -859.81), SIMDE_FLOAT32_C( -105.89), SIMDE_FLOAT32_C( -18.60), SIMDE_FLOAT32_C( -396.00)) },
3016
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -657.82), SIMDE_FLOAT32_C( -922.27), SIMDE_FLOAT32_C( -130.03), SIMDE_FLOAT32_C( 877.75)),
3017
- simde_mm_set_ps(SIMDE_FLOAT32_C( -413.60), SIMDE_FLOAT32_C( 824.69), SIMDE_FLOAT32_C( 124.72), SIMDE_FLOAT32_C( 312.34)),
3018
- SIMDE_MM_FROUND_TO_POS_INF,
3019
- simde_mm_set_ps(SIMDE_FLOAT32_C( -657.82), SIMDE_FLOAT32_C( -922.27), SIMDE_FLOAT32_C( -130.03), SIMDE_FLOAT32_C( 313.00)) },
3020
- { simde_mm_set_ps(SIMDE_FLOAT32_C( -636.42), SIMDE_FLOAT32_C( -978.69), SIMDE_FLOAT32_C( 787.73), SIMDE_FLOAT32_C( -705.33)),
3021
- simde_mm_set_ps(SIMDE_FLOAT32_C( -179.55), SIMDE_FLOAT32_C( 391.06), SIMDE_FLOAT32_C( -805.63), SIMDE_FLOAT32_C( 831.10)),
3022
- SIMDE_MM_FROUND_TO_ZERO,
3023
- simde_mm_set_ps(SIMDE_FLOAT32_C( -636.42), SIMDE_FLOAT32_C( -978.69), SIMDE_FLOAT32_C( 787.73), SIMDE_FLOAT32_C( 831.00)) },
3024
- { simde_mm_set_ps(SIMDE_FLOAT32_C( 529.08), SIMDE_FLOAT32_C( -665.00), SIMDE_FLOAT32_C( 786.13), SIMDE_FLOAT32_C( 843.11)),
3025
- simde_mm_set_ps(SIMDE_FLOAT32_C( -295.93), SIMDE_FLOAT32_C( -148.90), SIMDE_FLOAT32_C( 483.10), SIMDE_FLOAT32_C( -790.07)),
3026
- SIMDE_MM_FROUND_TO_ZERO,
3027
- simde_mm_set_ps(SIMDE_FLOAT32_C( 529.08), SIMDE_FLOAT32_C( -665.00), SIMDE_FLOAT32_C( 786.13), SIMDE_FLOAT32_C( -790.00)) }
3028
- };
3029
-
3030
- for (size_t i = 0 ; i < 2 ; i++) {
3031
- simde__m128 r = simde_mm_round_ss(test_vec[i].a, test_vec[i].b, SIMDE_MM_FROUND_TO_NEAREST_INT);
3032
- simde_assert_m128_close(r, test_vec[i].r, 1);
3033
- }
3034
- for (size_t i = 2 ; i < 4 ; i++) {
3035
- simde__m128 r = simde_mm_round_ss(test_vec[i].a, test_vec[i].b, SIMDE_MM_FROUND_TO_NEG_INF);
3036
- simde_assert_m128_close(r, test_vec[i].r, 1);
3037
- }
3038
- for (size_t i = 4 ; i < 6 ; i++) {
3039
- simde__m128 r = simde_mm_round_ss(test_vec[i].a, test_vec[i].b, SIMDE_MM_FROUND_TO_POS_INF);
3040
- simde_assert_m128_close(r, test_vec[i].r, 1);
3041
- }
3042
- for (size_t i = 6 ; i < 8 ; i++) {
3043
- simde__m128 r = simde_mm_round_ss(test_vec[i].a, test_vec[i].b, SIMDE_MM_FROUND_TO_ZERO);
3044
- simde_assert_m128_close(r, test_vec[i].r, 1);
3045
- }
3046
-
3047
- return MUNIT_OK;
3048
- }
3049
-
3050
- static MunitResult
3051
- test_simde_mm_stream_load_si128(const MunitParameter params[], void* data) {
3052
- (void) params;
3053
- (void) data;
3054
-
3055
- const struct {
3056
- simde__m128i a;
3057
- simde__m128i r;
3058
- } test_vec[8] = {
3059
- { simde_mm_set_epi32(INT32_C( -547904967), INT32_C(-1362990942), INT32_C( 2066137598), INT32_C(-1778922116)),
3060
- simde_mm_set_epi32(INT32_C( -547904967), INT32_C(-1362990942), INT32_C( 2066137598), INT32_C(-1778922116)) },
3061
- { simde_mm_set_epi32(INT32_C(-2087163583), INT32_C( 2115433203), INT32_C(-1978815624), INT32_C( 1025228414)),
3062
- simde_mm_set_epi32(INT32_C(-2087163583), INT32_C( 2115433203), INT32_C(-1978815624), INT32_C( 1025228414)) },
3063
- { simde_mm_set_epi32(INT32_C(-1244490055), INT32_C( 1943548537), INT32_C( 589236062), INT32_C( -751161899)),
3064
- simde_mm_set_epi32(INT32_C(-1244490055), INT32_C( 1943548537), INT32_C( 589236062), INT32_C( -751161899)) },
3065
- { simde_mm_set_epi32(INT32_C(-1274215918), INT32_C(-1858225286), INT32_C( -472727069), INT32_C( 528679049)),
3066
- simde_mm_set_epi32(INT32_C(-1274215918), INT32_C(-1858225286), INT32_C( -472727069), INT32_C( 528679049)) },
3067
- { simde_mm_set_epi32(INT32_C(-1568552575), INT32_C( 411221897), INT32_C(-1334506552), INT32_C( 1554165859)),
3068
- simde_mm_set_epi32(INT32_C(-1568552575), INT32_C( 411221897), INT32_C(-1334506552), INT32_C( 1554165859)) },
3069
- { simde_mm_set_epi32(INT32_C( 1044144940), INT32_C(-1916851863), INT32_C( -589120926), INT32_C( 651795910)),
3070
- simde_mm_set_epi32(INT32_C( 1044144940), INT32_C(-1916851863), INT32_C( -589120926), INT32_C( 651795910)) },
3071
- { simde_mm_set_epi32(INT32_C( -25575503), INT32_C(-1782121708), INT32_C( 751836326), INT32_C( 1005598033)),
3072
- simde_mm_set_epi32(INT32_C( -25575503), INT32_C(-1782121708), INT32_C( 751836326), INT32_C( 1005598033)) },
3073
- { simde_mm_set_epi32(INT32_C(-1873195901), INT32_C( -450900536), INT32_C( 904584108), INT32_C( 251416593)),
3074
- simde_mm_set_epi32(INT32_C(-1873195901), INT32_C( -450900536), INT32_C( 904584108), INT32_C( 251416593)) }
3075
- };
3076
-
3077
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
3078
- simde__m128i r = simde_mm_stream_load_si128(&(test_vec[i].a));
3079
- simde_assert_m128i_i32(r, ==, test_vec[i].r);
3080
- }
3081
-
3082
- return MUNIT_OK;
3083
- }
3084
-
3085
- static MunitResult
3086
- test_simde_mm_test_all_ones(const MunitParameter params[], void* data) {
3087
- (void) params;
3088
- (void) data;
3089
-
3090
- const struct {
3091
- simde__m128i a;
3092
- int r;
3093
- } test_vec[8] = {
3094
- { simde_x_mm_set_epu32(~UINT32_C( 0), UINT32_C(1993838502), UINT32_C(1216384299), UINT32_C(2484321284)),
3095
- 0 },
3096
- { simde_x_mm_set_epu32(UINT32_C( 708002161), ~UINT32_C( 0), UINT32_C(1641125312), UINT32_C(1784735378)),
3097
- 0 },
3098
- { simde_x_mm_set_epu32(UINT32_C(3153393974), UINT32_C(3299961049), ~UINT32_C( 0), UINT32_C( 256198680)),
3099
- 0 },
3100
- { simde_x_mm_set_epu32(UINT32_C(3219291087), UINT32_C(2995285646), UINT32_C(3353269087), ~UINT32_C( 0)),
3101
- 0 },
3102
- { simde_x_mm_set_epu32(~UINT32_C( 0), UINT32_C(1590943288), UINT32_C(4263015539), UINT32_C(1245312939)),
3103
- 0 },
3104
- { simde_x_mm_set_epu32(~UINT32_C( 0), ~UINT32_C( 0), UINT32_C( 453365074), UINT32_C( 94225678)),
3105
- 0 },
3106
- { simde_x_mm_set_epu32(~UINT32_C( 0), ~UINT32_C( 0), ~UINT32_C( 0), UINT32_C(3354153743)),
3107
- 0 },
3108
- { simde_x_mm_set_epu32(~UINT32_C( 0), ~UINT32_C( 0), ~UINT32_C( 0), ~UINT32_C( 0)),
3109
- 1 }
3110
- };
3111
-
3112
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
3113
- int r = simde_mm_test_all_ones(test_vec[i].a);
3114
- munit_assert_int(r, ==, test_vec[i].r);
3115
- }
3116
-
3117
- return MUNIT_OK;
3118
- }
3119
-
3120
- static MunitResult
3121
- test_simde_mm_test_all_zeros(const MunitParameter params[], void* data) {
3122
- (void) params;
3123
- (void) data;
3124
-
3125
- const struct {
3126
- simde__m128i a;
3127
- simde__m128i b;
3128
- int r;
3129
- } test_vec[8] = {
3130
- { simde_x_mm_set_epu32(UINT32_C(1201894317), UINT32_C(2319231887), UINT32_C(1402528928), UINT32_C(3687328034)),
3131
- simde_x_mm_set_epu32(UINT32_C(1967137742), UINT32_C(1472851836), UINT32_C(2181608867), UINT32_C(1889365185)),
3132
- 0 },
3133
- { simde_x_mm_set_epu32(UINT32_C(2135448036), UINT32_C(1619848109), UINT32_C(2289839916), UINT32_C(3523984647)),
3134
- simde_x_mm_set_epu32(UINT32_C(2046676780), UINT32_C(1214034345), UINT32_C( 106141409), UINT32_C(4219215983)),
3135
- 0 },
3136
- { simde_x_mm_set_epu32(UINT32_C( 657893603), UINT32_C(3270868697), UINT32_C(1314977284), UINT32_C(2544509951)),
3137
- simde_x_mm_set_epu32(UINT32_C(2424312328), UINT32_C( 687898658), UINT32_C(2425031026), UINT32_C( 672223232)),
3138
- 1 },
3139
- { simde_x_mm_set_epu32(UINT32_C(3537640743), UINT32_C( 372152333), UINT32_C(4133234814), UINT32_C( 396143667)),
3140
- simde_x_mm_set_epu32(UINT32_C( 671105736), UINT32_C(3909093360), UINT32_C( 8553473), UINT32_C( 541283144)),
3141
- 1 },
3142
- { simde_x_mm_set_epu32(UINT32_C(2182578541), UINT32_C(4064427053), UINT32_C(2602515508), UINT32_C(4049235221)),
3143
- simde_x_mm_set_epu32(UINT32_C( 203975314), UINT32_C( 227393856), UINT32_C( 536871690), UINT32_C( 75760138)),
3144
- 1 },
3145
- { simde_x_mm_set_epu32(UINT32_C( 152354605), UINT32_C(2176274914), UINT32_C(3011079004), UINT32_C(3847789567)),
3146
- simde_x_mm_set_epu32(UINT32_C(1562291537), UINT32_C( 354162251), UINT32_C(1134881489), UINT32_C(2956892685)),
3147
- 0 },
3148
- { simde_x_mm_set_epu32(UINT32_C(2096532328), UINT32_C(1165454747), UINT32_C(3275710596), UINT32_C(1593733565)),
3149
- simde_x_mm_set_epu32(UINT32_C(1988174269), UINT32_C(1339821769), UINT32_C(1810810088), UINT32_C( 840755548)),
3150
- 0 },
3151
- { simde_x_mm_set_epu32(UINT32_C(3588833624), UINT32_C( 610042197), UINT32_C(1310204993), UINT32_C(1509811379)),
3152
- simde_x_mm_set_epu32(UINT32_C( 571869223), UINT32_C(1235317762), UINT32_C( 29362474), UINT32_C( 570561100)),
3153
- 1 }
3154
- };
3155
-
3156
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
3157
- int r = simde_mm_test_all_zeros(test_vec[i].a, test_vec[i].b);
3158
- munit_assert_int(r, ==, test_vec[i].r);
3159
- }
3160
-
3161
- return MUNIT_OK;
3162
- }
3163
-
3164
- static MunitResult
3165
- test_simde_mm_test_mix_ones_zeros(const MunitParameter params[], void* data) {
3166
- (void) params;
3167
- (void) data;
3168
-
3169
- const struct {
3170
- simde__m128i a;
3171
- simde__m128i b;
3172
- int r;
3173
- } test_vec[8] = {
3174
- { simde_x_mm_set_epu32(UINT32_C( 817555810), UINT32_C(3902491734), UINT32_C(3977937498), UINT32_C(2772762421)),
3175
- simde_x_mm_set_epu32(UINT32_C(1924103348), UINT32_C(1357836992), UINT32_C(4064253767), UINT32_C(3196943489)),
3176
- 1 },
3177
- { simde_x_mm_set_epu32(UINT32_C(1969146297), UINT32_C(3716202658), UINT32_C( 759743671), UINT32_C(2926294225)),
3178
- simde_x_mm_set_epu32(UINT32_C(2325820998), UINT32_C( 578764637), UINT32_C(3535223624), UINT32_C(1368673070)),
3179
- 0 },
3180
- { simde_x_mm_set_epu32(UINT32_C(3794246328), UINT32_C(2295817460), UINT32_C(2963593754), UINT32_C(2249033119)),
3181
- simde_x_mm_set_epu32(UINT32_C(1810964868), UINT32_C(3773017844), UINT32_C(1790481610), UINT32_C(4104297207)),
3182
- 1 },
3183
- { simde_x_mm_set_epu32(UINT32_C(3721359930), UINT32_C(2092677361), UINT32_C(2672746089), UINT32_C(2784499405)),
3184
- simde_x_mm_set_epu32(UINT32_C( 573607365), UINT32_C(2202289934), UINT32_C(1622221206), UINT32_C(1510467890)),
3185
- 0 },
3186
- { simde_x_mm_set_epu32(UINT32_C(1688049548), UINT32_C( 227731129), UINT32_C(2187006143), UINT32_C(2191704962)),
3187
- simde_x_mm_set_epu32(UINT32_C(3739754335), UINT32_C(1136006144), UINT32_C(2036111421), UINT32_C(3950298731)),
3188
- 1 },
3189
- { simde_x_mm_set_epu32(UINT32_C(2420605154), UINT32_C(1034465439), UINT32_C( 270210360), UINT32_C(1245331438)),
3190
- simde_x_mm_set_epu32(UINT32_C(1874362141), UINT32_C(3260501856), UINT32_C(4024756935), UINT32_C(3049635857)),
3191
- 0 },
3192
- { simde_x_mm_set_epu32(UINT32_C(2202152506), UINT32_C( 285372976), UINT32_C(4113851867), UINT32_C(1775650196)),
3193
- simde_x_mm_set_epu32(UINT32_C(2951443467), UINT32_C(1206063205), UINT32_C(2278810499), UINT32_C(1561806132)),
3194
- 1 },
3195
- { simde_x_mm_set_epu32(UINT32_C(2386514979), UINT32_C(2103226597), UINT32_C( 427456035), UINT32_C(2075844151)),
3196
- simde_x_mm_set_epu32(UINT32_C(2028307641), UINT32_C(3795980391), UINT32_C(1321164258), UINT32_C(1543009672)),
3197
- 1 }
3198
- };
3199
-
3200
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
3201
- int r = simde_mm_test_mix_ones_zeros(test_vec[i].a, test_vec[i].b);
3202
- munit_assert_int(r, ==, test_vec[i].r);
3203
- }
3204
-
3205
- return MUNIT_OK;
3206
- }
3207
-
3208
- static MunitResult
3209
- test_simde_mm_testc_si128(const MunitParameter params[], void* data) {
3210
- (void) params;
3211
- (void) data;
3212
-
3213
- const struct {
3214
- simde__m128i a;
3215
- simde__m128i b;
3216
- int r;
3217
- } test_vec[8] = {
3218
- { simde_x_mm_set_epu32(UINT32_C(2830619595), UINT32_C(3721899845), UINT32_C(1506484780), UINT32_C(3754634237)),
3219
- simde_x_mm_set_epu32(UINT32_C( 135762121), UINT32_C(1485021188), UINT32_C( 66080), UINT32_C(1279789969)),
3220
- 1 },
3221
- { simde_x_mm_set_epu32(UINT32_C( 193385482), UINT32_C(2729396552), UINT32_C(3295558360), UINT32_C(1810466520)),
3222
- simde_x_mm_set_epu32(UINT32_C(2126857072), UINT32_C(2130569152), UINT32_C( 589776977), UINT32_C(3538187411)),
3223
- 0 },
3224
- { simde_x_mm_set_epu32(UINT32_C( 786883487), UINT32_C(1935834902), UINT32_C(1176572533), UINT32_C(2648243675)),
3225
- simde_x_mm_set_epu32(UINT32_C( 782262300), UINT32_C(1617050388), UINT32_C( 33620084), UINT32_C( 294672713)),
3226
- 1 },
3227
- { simde_x_mm_set_epu32(UINT32_C(1041307471), UINT32_C( 45744950), UINT32_C(1982345789), UINT32_C(3152632048)),
3228
- simde_x_mm_set_epu32(UINT32_C(1387031193), UINT32_C( 524221074), UINT32_C(2963552394), UINT32_C( 26167124)),
3229
- 0 },
3230
- { simde_x_mm_set_epu32(UINT32_C(4096311220), UINT32_C(1013684968), UINT32_C(3348640547), UINT32_C(2194828263)),
3231
- simde_x_mm_set_epu32(UINT32_C(3288368404), UINT32_C( 873007168), UINT32_C( 127402785), UINT32_C( 43000416)),
3232
- 1 },
3233
- { simde_x_mm_set_epu32(UINT32_C(3620270306), UINT32_C( 102683939), UINT32_C(1921801133), UINT32_C(4285709000)),
3234
- simde_x_mm_set_epu32(UINT32_C(2218828002), UINT32_C( 67671297), UINT32_C(1384665613), UINT32_C(2030217920)),
3235
- 1 },
3236
- { simde_x_mm_set_epu32(UINT32_C( 948424904), UINT32_C(1962159425), UINT32_C(1599818052), UINT32_C( 324039513)),
3237
- simde_x_mm_set_epu32(UINT32_C( 671486144), UINT32_C(1888759104), UINT32_C(1191182592), UINT32_C( 319836488)),
3238
- 1 },
3239
- { simde_x_mm_set_epu32(UINT32_C(2926329185), UINT32_C(3270382597), UINT32_C( 628918622), UINT32_C(3097066353)),
3240
- simde_x_mm_set_epu32(UINT32_C(2282240352), UINT32_C(3265794053), UINT32_C( 71305480), UINT32_C( 948529457)),
3241
- 1 }
3242
- };
3243
-
3244
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
3245
- int r = simde_mm_testc_si128(test_vec[i].a, test_vec[i].b);
3246
- munit_assert_int(r, ==, test_vec[i].r);
3247
- }
3248
-
3249
- return MUNIT_OK;
3250
- }
3251
-
3252
- static MunitResult
3253
- test_simde_mm_testnzc_si128(const MunitParameter params[], void* data) {
3254
- (void) params;
3255
- (void) data;
3256
-
3257
- const struct {
3258
- simde__m128i a;
3259
- simde__m128i b;
3260
- int r;
3261
- } test_vec[8] = {
3262
- { simde_x_mm_set_epu32(UINT32_C(1875425415), UINT32_C(3970564046), UINT32_C(3151364481), UINT32_C(3646821095)),
3263
- simde_x_mm_set_epu32(UINT32_C( 939391786), UINT32_C(1418582693), UINT32_C(3583579146), UINT32_C(2978542122)),
3264
- 1 },
3265
- { simde_x_mm_set_epu32(UINT32_C(1948733162), UINT32_C(3713693944), UINT32_C(2694213253), UINT32_C(1663204587)),
3266
- simde_x_mm_set_epu32(UINT32_C(1140998794), UINT32_C(1141393520), UINT32_C(2685534720), UINT32_C(1124213826)),
3267
- 0 },
3268
- { simde_x_mm_set_epu32(UINT32_C(1383702507), UINT32_C(4170492791), UINT32_C( 81283149), UINT32_C(2572004949)),
3269
- simde_x_mm_set_epu32(UINT32_C(1383112482), UINT32_C( 1049365), UINT32_C( 67110920), UINT32_C( 33301)),
3270
- 0 },
3271
- { simde_x_mm_set_epu32(UINT32_C( 122650173), UINT32_C(3420397620), UINT32_C(2510350310), UINT32_C(1202770589)),
3272
- simde_x_mm_set_epu32(UINT32_C(3675302012), UINT32_C( 291962269), UINT32_C(1109447557), UINT32_C( 739260950)),
3273
- 1 },
3274
- { simde_x_mm_set_epu32(UINT32_C(1579102285), UINT32_C( 270245457), UINT32_C(1078977019), UINT32_C(2085912657)),
3275
- simde_x_mm_set_epu32(UINT32_C(1242112064), UINT32_C( 1606145), UINT32_C( 688393), UINT32_C( 402685968)),
3276
- 0 },
3277
- { simde_x_mm_set_epu32(UINT32_C(3394408789), UINT32_C(2660724232), UINT32_C(2317277326), UINT32_C(3204989336)),
3278
- simde_x_mm_set_epu32(UINT32_C(1819319362), UINT32_C( 329857933), UINT32_C(3391127410), UINT32_C( 743662239)),
3279
- 1 },
3280
- { simde_x_mm_set_epu32(UINT32_C(4125624985), UINT32_C( 2864942), UINT32_C( 875515634), UINT32_C(2091317004)),
3281
- simde_x_mm_set_epu32(UINT32_C( 617089160), UINT32_C( 112418), UINT32_C( 606079728), UINT32_C(1881276672)),
3282
- 0 },
3283
- { simde_x_mm_set_epu32(UINT32_C(2421997128), UINT32_C(3685823722), UINT32_C(2588454762), UINT32_C(2067412407)),
3284
- simde_x_mm_set_epu32(UINT32_C(3926740437), UINT32_C( 589344338), UINT32_C(2958265721), UINT32_C(1121386306)),
3285
- 1 }
3286
- };
3287
-
3288
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
3289
- int r = simde_mm_testnzc_si128(test_vec[i].a, test_vec[i].b);
3290
- munit_assert_int(r, ==, test_vec[i].r);
3291
- }
3292
-
3293
- return MUNIT_OK;
3294
- }
3295
-
3296
- static MunitResult
3297
- test_simde_mm_testz_si128(const MunitParameter params[], void* data) {
3298
- (void) params;
3299
- (void) data;
3300
-
3301
- const struct {
3302
- simde__m128i a;
3303
- simde__m128i b;
3304
- int r;
3305
- } test_vec[8] = {
3306
- { simde_x_mm_set_epu32(UINT32_C(3990889899), UINT32_C(4230789057), UINT32_C(3808461042), UINT32_C(3371427410)),
3307
- simde_x_mm_set_epu32(UINT32_C( 331792), UINT32_C( 63127558), UINT32_C( 483990789), UINT32_C( 530828)),
3308
- 1 },
3309
- { simde_x_mm_set_epu32(UINT32_C(3603350831), UINT32_C(2431793515), UINT32_C(1875486201), UINT32_C(3530533257)),
3310
- simde_x_mm_set_epu32(UINT32_C( 19933776), UINT32_C(1174733824), UINT32_C(2147880964), UINT32_C( 8393234)),
3311
- 1 },
3312
- { simde_x_mm_set_epu32(UINT32_C(3124097223), UINT32_C(4066616999), UINT32_C(2076362673), UINT32_C( 124456258)),
3313
- simde_x_mm_set_epu32(UINT32_C(1170213928), UINT32_C( 84416520), UINT32_C(2150893634), UINT32_C(3499413545)),
3314
- 1 },
3315
- { simde_x_mm_set_epu32(UINT32_C(4156796004), UINT32_C(1994002854), UINT32_C(4034407880), UINT32_C( 600089084)),
3316
- simde_x_mm_set_epu32(UINT32_C(2971079954), UINT32_C(3997808651), UINT32_C( 222740062), UINT32_C(3989806580)),
3317
- 0 },
3318
- { simde_x_mm_set_epu32(UINT32_C(4130552440), UINT32_C( 812777701), UINT32_C(2016424386), UINT32_C( 886379222)),
3319
- simde_x_mm_set_epu32(UINT32_C( 70177905), UINT32_C(2046022589), UINT32_C( 670901459), UINT32_C(2978865170)),
3320
- 0 },
3321
- { simde_x_mm_set_epu32(UINT32_C( 192532312), UINT32_C(1467133872), UINT32_C(1075139299), UINT32_C( 191167596)),
3322
- simde_x_mm_set_epu32(UINT32_C(1026534956), UINT32_C(4130843248), UINT32_C(3619306010), UINT32_C(3598027302)),
3323
- 0 },
3324
- { simde_x_mm_set_epu32(UINT32_C(2410417876), UINT32_C( 74289906), UINT32_C(4031840239), UINT32_C(2837881625)),
3325
- simde_x_mm_set_epu32(UINT32_C( 542327083), UINT32_C( 680656909), UINT32_C( 184549392), UINT32_C(1421938882)),
3326
- 1 },
3327
- { simde_x_mm_set_epu32(UINT32_C(3782150825), UINT32_C(3325635017), UINT32_C(1617333560), UINT32_C(3634437083)),
3328
- simde_x_mm_set_epu32(UINT32_C( 167825730), UINT32_C( 294047748), UINT32_C( 126906945), UINT32_C( 17884164)),
3329
- 1 }
3330
- };
3331
-
3332
- for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])); i++) {
3333
- int r = simde_mm_testz_si128(test_vec[i].a, test_vec[i].b);
3334
- munit_assert_int(r, ==, test_vec[i].r);
3335
- }
3336
-
3337
- return MUNIT_OK;
3338
- }
3339
-
3340
- #endif /* defined(SIMDE_SSE4_1_NATIVE) || defined(SIMDE_NO_NATIVE) || defined(SIMDE_ALWAYS_BUILD_NATIVE_TESTS) */
3341
-
3342
- HEDLEY_DIAGNOSTIC_PUSH
3343
- HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL
3344
-
3345
- static MunitTest test_suite_tests[] = {
3346
- #if defined(SIMDE_SSE4_1_NATIVE) || defined(SIMDE_NO_NATIVE) || defined(SIMDE_ALWAYS_BUILD_NATIVE_TESTS)
3347
- SIMDE_TESTS_DEFINE_TEST(mm_blend_epi16),
3348
- SIMDE_TESTS_DEFINE_TEST(mm_blend_pd),
3349
- SIMDE_TESTS_DEFINE_TEST(mm_blend_ps),
3350
-
3351
- SIMDE_TESTS_DEFINE_TEST(mm_blendv_epi8),
3352
- SIMDE_TESTS_DEFINE_TEST(x_mm_blendv_epi16),
3353
- SIMDE_TESTS_DEFINE_TEST(x_mm_blendv_epi32),
3354
- SIMDE_TESTS_DEFINE_TEST(x_mm_blendv_epi64),
3355
- SIMDE_TESTS_DEFINE_TEST(mm_blendv_pd),
3356
- SIMDE_TESTS_DEFINE_TEST(mm_blendv_ps),
3357
-
3358
- SIMDE_TESTS_DEFINE_TEST(mm_ceil_pd),
3359
- SIMDE_TESTS_DEFINE_TEST(mm_ceil_ps),
3360
- SIMDE_TESTS_DEFINE_TEST(mm_ceil_sd),
3361
- SIMDE_TESTS_DEFINE_TEST(mm_ceil_ss),
3362
-
3363
- SIMDE_TESTS_DEFINE_TEST(mm_cmpeq_epi64),
3364
-
3365
- SIMDE_TESTS_DEFINE_TEST(mm_cvtepi8_epi16),
3366
- SIMDE_TESTS_DEFINE_TEST(mm_cvtepi8_epi32),
3367
- SIMDE_TESTS_DEFINE_TEST(mm_cvtepi8_epi64),
3368
- SIMDE_TESTS_DEFINE_TEST(mm_cvtepu8_epi16),
3369
- SIMDE_TESTS_DEFINE_TEST(mm_cvtepu8_epi32),
3370
- SIMDE_TESTS_DEFINE_TEST(mm_cvtepu8_epi64),
3371
- SIMDE_TESTS_DEFINE_TEST(mm_cvtepi16_epi32),
3372
- SIMDE_TESTS_DEFINE_TEST(mm_cvtepi16_epi64),
3373
- SIMDE_TESTS_DEFINE_TEST(mm_cvtepu16_epi32),
3374
- SIMDE_TESTS_DEFINE_TEST(mm_cvtepu16_epi64),
3375
- SIMDE_TESTS_DEFINE_TEST(mm_cvtepi32_epi64),
3376
- SIMDE_TESTS_DEFINE_TEST(mm_cvtepu32_epi64),
3377
-
3378
- SIMDE_TESTS_DEFINE_TEST(mm_dp_pd),
3379
- SIMDE_TESTS_DEFINE_TEST(mm_dp_ps),
3380
-
3381
- SIMDE_TESTS_DEFINE_TEST(mm_extract_epi8),
3382
- SIMDE_TESTS_DEFINE_TEST(mm_extract_epi32),
3383
- SIMDE_TESTS_DEFINE_TEST(mm_extract_epi64),
3384
-
3385
- SIMDE_TESTS_DEFINE_TEST(mm_floor_pd),
3386
- SIMDE_TESTS_DEFINE_TEST(mm_floor_ps),
3387
- SIMDE_TESTS_DEFINE_TEST(mm_floor_sd),
3388
- SIMDE_TESTS_DEFINE_TEST(mm_floor_ss),
3389
-
3390
- SIMDE_TESTS_DEFINE_TEST(mm_insert_epi8),
3391
- SIMDE_TESTS_DEFINE_TEST(mm_insert_epi32),
3392
- SIMDE_TESTS_DEFINE_TEST(mm_insert_epi64),
3393
- SIMDE_TESTS_DEFINE_TEST(mm_insert_ps),
3394
-
3395
- SIMDE_TESTS_DEFINE_TEST(mm_max_epi8),
3396
- SIMDE_TESTS_DEFINE_TEST(mm_max_epi32),
3397
- SIMDE_TESTS_DEFINE_TEST(mm_max_epu16),
3398
- SIMDE_TESTS_DEFINE_TEST(mm_max_epu32),
3399
-
3400
- SIMDE_TESTS_DEFINE_TEST(mm_min_epi8),
3401
- SIMDE_TESTS_DEFINE_TEST(mm_min_epi32),
3402
- SIMDE_TESTS_DEFINE_TEST(mm_min_epu16),
3403
- SIMDE_TESTS_DEFINE_TEST(mm_min_epu32),
3404
-
3405
- SIMDE_TESTS_DEFINE_TEST(mm_minpos_epu16),
3406
-
3407
- SIMDE_TESTS_DEFINE_TEST(mm_mpsadbw_epu8),
3408
-
3409
- SIMDE_TESTS_DEFINE_TEST(mm_mul_epi32),
3410
- SIMDE_TESTS_DEFINE_TEST(mm_mullo_epi32),
3411
-
3412
- SIMDE_TESTS_DEFINE_TEST(mm_packus_epi32),
3413
-
3414
- SIMDE_TESTS_DEFINE_TEST(mm_round_pd),
3415
- SIMDE_TESTS_DEFINE_TEST(mm_round_ps),
3416
- SIMDE_TESTS_DEFINE_TEST(mm_round_sd),
3417
- SIMDE_TESTS_DEFINE_TEST(mm_round_ss),
3418
-
3419
- SIMDE_TESTS_DEFINE_TEST(mm_stream_load_si128),
3420
-
3421
- SIMDE_TESTS_DEFINE_TEST(mm_test_all_ones),
3422
- SIMDE_TESTS_DEFINE_TEST(mm_test_all_zeros),
3423
- SIMDE_TESTS_DEFINE_TEST(mm_test_mix_ones_zeros),
3424
- SIMDE_TESTS_DEFINE_TEST(mm_testc_si128),
3425
- SIMDE_TESTS_DEFINE_TEST(mm_testnzc_si128),
3426
- SIMDE_TESTS_DEFINE_TEST(mm_testz_si128),
3427
- #endif /* defined(SIMDE_SSE4_1_NATIVE) || defined(SIMDE_NO_NATIVE) || defined(SIMDE_ALWAYS_BUILD_NATIVE_TESTS) */
3428
-
3429
- { NULL, NULL, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL }
3430
- };
3431
-
3432
- HEDLEY_C_DECL MunitSuite* SIMDE_TESTS_GENERATE_SYMBOL(suite)(void) {
3433
- static MunitSuite suite = { (char*) "/" HEDLEY_STRINGIFY(SIMDE_TESTS_CURRENT_ISAX), test_suite_tests, NULL, 1, MUNIT_SUITE_OPTION_NONE };
3434
-
3435
- return &suite;
3436
- }
3437
-
3438
- #if defined(SIMDE_TESTS_SINGLE_ISAX)
3439
- int main(int argc, char* argv[HEDLEY_ARRAY_PARAM(argc + 1)]) {
3440
- static MunitSuite suite = { "", test_suite_tests, NULL, 1, MUNIT_SUITE_OPTION_NONE };
3441
-
3442
- return munit_suite_main(&suite, NULL, argc, argv);
3443
- }
3444
- #endif /* defined(SIMDE_TESTS_SINGLE_ISAX) */
3445
-
3446
- HEDLEY_DIAGNOSTIC_POP