| 1142 | // Helper: time 4-wide scalar s16x16 with a binary op |
| 1143 | template <typename Op> |
| 1144 | inline int64_t benchS16x16_4(int iters, Op op) { |
| 1145 | fl::s16x16 a0(1.5f), a1(2.3f), a2(0.7f), a3(3.1f); |
| 1146 | fl::s16x16 b0(0.5f), b1(1.2f), b2(2.0f), b3(0.9f); |
| 1147 | fl::s16x16 bump = fl::s16x16::from_raw(1); |
| 1148 | uint32_t t0 = micros(); |
| 1149 | for (int i = 0; i < iters; i++) { |
| 1150 | a0 = op(a0, b0); a1 = op(a1, b1); |
| 1151 | a2 = op(a2, b2); a3 = op(a3, b3); |
| 1152 | b0 = a0 + bump; b1 = a1 + bump; |
| 1153 | b2 = a2 + bump; b3 = a3 + bump; |
| 1154 | } |
| 1155 | uint32_t t1 = micros(); |
| 1156 | g_bench_sink = static_cast<uint32_t>(a0.raw()); |
| 1157 | return static_cast<int64_t>(t1 - t0); |
| 1158 | } |
| 1159 | |
| 1160 | // Helper: time s16x16x4 SIMD with a binary op |
| 1161 | template <typename Op> |
no test coverage detected