Modestas Valauskas
b74add4813
[vm/compiler] Specialize Int32x4 operators in AOT.
...
The five binary operators on Int32x4 (+, -, |, &, ^) were never added
to the recognized-method list as graph intrinsics, so calls to them
were left as runtime calls through external-name bodies. In JIT the
call specializer picked kInt32x4Cid from IC feedback and emitted a
native SimdOpInstr, but AOT has no IC feedback and therefore fell back
to boxed calls, making Int32x4List inner loops 10-70x slower than both
the JIT version and a hand-written scalar equivalent.
This CL wires the same specialization paths that already exist for
Float32x4.+,-,*,/:
- recognize the five operators as graph intrinsics and mark them
with `@pragma("vm:recognized", "graph-intrinsic")` plus an
exact-result-type pragma;
- add Build_Int32x4{Add,Sub,BitAnd,BitOr,BitXor} helpers that
delegate to the existing BuildSimdOp;
- extend SimdOpInstr::KindForOperator and CreateFromCall;
- extend CallSpecializer::InlineSimdOp and TryInlineRecognizedMethod
so the non-speculative null-check path used for Float32x4 operators
in AOT also applies here.
Measured on macOS arm64 (M-series), `dart compile exe`:
Issue 63217 orSimd : 12.58 -> 0.32 us/iter (39x)
Issue 63217 andNotSimd : 23.51 -> 0.34 us/iter (69x)
Issue 53662 mandelbrot : 4038.5 -> 55.5 ms (72x)
A new benchmark benchmarks/SimdInt32x4 exercises all five operators
with a scalar and a SIMD variant so the specialization stays covered
by the benchmark bots; it is registered in Omnibus and OmnibusDeferred.
Existing tests/lib/typed_data/simd_*_test.dart still pass in JIT and
AOT.
TEST=tests/lib/typed_data/int32x4_arithmetic_test; benchmarks/SimdInt32x4
Bug: https://github.com/dart-lang/sdk/issues/53662
Bug: https://github.com/dart-lang/sdk/issues/63217
Change-Id: I9b76ab4fff228ff1a5e3d3c86f4bfc059e66a49a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497000
Reviewed-by: Slava Egorov <vegorov@google.com >
Commit-Queue: Slava Egorov <vegorov@google.com >
Auto-Submit: Modestas Valauskas <valauskasmodestas@gmail.com >
Reviewed-by: Alexander Aprelev <aam@google.com >
2026-04-22 00:01:52 -07:00
..
2026-04-22 00:01:52 -07:00
2024-07-23 10:43:43 +00:00
2026-04-01 08:15:11 -07:00
2026-03-31 15:36:18 -07:00
2026-04-20 10:28:01 -07:00
2025-02-26 14:01:44 -08:00
2026-02-04 10:16:41 -08:00
2026-02-04 10:16:41 -08:00
2025-07-08 02:36:10 -07:00
2026-04-21 10:13:04 -07:00
2026-02-04 10:16:41 -08:00
2023-09-05 21:47:59 +00:00
2026-03-26 08:21:00 -07:00
2025-11-10 02:29:41 -08:00
2026-02-04 10:16:41 -08:00
2024-08-28 08:52:19 +00:00
2026-01-28 10:27:29 -08:00
2024-04-17 19:14:41 +00:00
2026-02-04 10:16:41 -08:00
2026-02-27 07:43:14 -08:00
2026-03-25 06:59:41 -07:00
2026-04-10 06:15:22 -07:00
2026-03-18 10:18:06 -07:00
2026-03-18 10:18:06 -07:00
2026-03-31 19:59:09 -07:00
2026-04-16 04:25:37 -07:00
2026-03-02 07:55:38 -08:00
2026-02-23 09:54:47 -08:00
2026-02-23 09:54:47 -08:00
2026-04-16 04:25:37 -07:00
2026-04-16 04:25:37 -07:00
2026-04-13 10:10:42 -07:00
2024-10-24 03:24:08 +00:00
2024-06-10 20:38:30 +00:00
2026-03-02 08:13:26 -08:00
2026-03-02 07:55:38 -08:00
2026-02-04 10:16:41 -08:00
2026-02-04 10:16:41 -08:00
2025-07-29 12:54:49 -07:00
2026-01-29 13:18:24 -08:00
2025-07-29 12:54:49 -07:00
2025-10-07 10:44:02 -07:00
2025-10-07 10:44:02 -07:00
2025-07-29 12:54:49 -07:00
2026-01-29 13:18:24 -08:00
2025-07-29 12:54:49 -07:00
2026-01-29 13:18:24 -08:00
2025-09-12 04:19:40 -07:00
2025-10-07 10:44:02 -07:00
2025-10-01 09:41:26 -07:00
2026-04-10 06:15:22 -07:00
2026-04-10 06:15:22 -07:00
2023-11-30 16:42:28 +00:00
2026-04-10 06:15:22 -07:00
2026-02-19 09:43:52 -08:00
2026-04-10 06:15:22 -07:00
2025-11-18 14:33:11 -08:00
2026-04-20 17:46:32 -07:00
2026-04-10 06:15:22 -07:00
2023-09-04 14:38:27 +00:00
2023-11-28 13:15:56 +00:00
2025-06-18 13:07:22 -07:00
2024-02-15 23:08:48 +00:00
2023-09-12 16:22:19 +00:00
2025-06-18 13:07:22 -07:00
2025-06-18 13:07:22 -07:00
2025-06-18 13:07:22 -07:00
2024-03-14 21:48:59 +00:00
2024-03-15 19:26:13 +00:00
2024-12-04 14:36:46 +00:00
2026-03-12 09:08:14 -07:00
2026-04-20 11:31:19 -07:00
2026-03-31 12:55:51 -07:00
2026-04-08 15:26:06 -07:00
2024-04-17 19:14:41 +00:00
2026-03-24 11:26:23 -07:00
2026-03-31 12:55:51 -07:00
2026-03-31 12:55:51 -07:00
2026-04-01 09:56:13 -07:00
2026-03-31 12:55:51 -07:00
2025-11-19 07:45:52 -08:00
2025-11-21 06:42:16 -08:00
2024-08-19 21:46:26 +00:00
2024-01-22 16:07:39 +00:00
2025-07-29 12:54:49 -07:00
2025-07-29 12:54:49 -07:00
2025-06-12 20:46:54 -07:00
2025-07-29 12:54:49 -07:00
2025-07-29 12:54:49 -07:00
2026-03-26 08:21:00 -07:00
2026-02-18 09:18:10 -08:00
2026-04-10 06:15:22 -07:00
2026-04-10 06:15:22 -07:00
2026-02-04 10:16:41 -08:00
2026-02-04 10:16:41 -08:00
2023-11-07 16:13:11 +00:00
2026-02-17 14:14:59 -08:00
2025-06-17 06:22:15 -07:00
2026-02-04 10:16:41 -08:00
2026-02-04 10:16:41 -08:00
2026-02-04 10:16:41 -08:00
2025-05-27 06:30:20 -07:00
2024-12-04 14:36:46 +00:00
2026-01-27 09:14:39 -08:00
2026-01-27 09:14:39 -08:00
2026-02-18 15:26:18 -08:00
2026-02-18 15:26:18 -08:00
2026-04-10 06:15:22 -07:00
2026-04-14 12:22:48 -07:00
2026-04-14 12:22:48 -07:00
2026-04-14 12:22:48 -07:00
2026-03-04 12:40:19 -08:00
2026-03-04 12:40:19 -08:00
2026-02-23 09:54:47 -08:00
2025-12-01 16:15:39 -08:00
2025-12-01 16:15:39 -08:00
2023-10-20 19:45:49 +00:00
2024-08-15 14:09:52 +00:00
2026-04-14 17:22:31 -07:00
2024-04-17 19:14:41 +00:00
2026-02-04 10:16:41 -08:00
2025-05-05 15:21:13 -07:00
2026-02-25 04:48:51 -08:00
2026-02-25 04:48:51 -08:00
2024-06-27 18:29:58 +00:00
2026-01-14 08:42:22 -08:00
2026-02-04 10:16:41 -08:00
2026-01-29 13:18:24 -08:00
2025-10-01 10:06:20 -07:00
2026-01-29 13:18:24 -08:00
2025-10-01 10:06:20 -07:00
2026-01-29 13:18:24 -08:00
2025-10-01 10:06:20 -07:00
2025-09-15 10:00:29 -07:00
2026-04-10 06:15:22 -07:00
2026-04-10 06:15:22 -07:00
2025-07-15 09:29:41 -07:00
2025-07-21 14:56:01 -07:00
2026-02-18 09:18:10 -08:00
2026-03-04 12:40:19 -08:00
2026-04-08 15:26:06 -07:00
2026-04-08 15:26:06 -07:00
2026-04-20 10:28:01 -07:00
2026-04-20 10:28:01 -07:00
2024-12-04 14:36:46 +00:00
2024-03-20 20:08:13 +00:00
2025-09-10 06:37:12 -07:00
2026-03-09 03:36:55 -07:00
2026-04-08 10:05:40 -07:00
2024-06-10 20:38:30 +00:00
2026-03-02 07:55:38 -08:00
2026-03-02 07:55:38 -08:00
2025-11-24 01:38:20 -08:00
2025-07-15 09:29:41 -07:00
2025-06-10 12:15:25 -07:00
2025-06-10 12:15:25 -07:00
2025-06-10 12:15:25 -07:00
2026-01-21 10:59:51 -08:00
2026-01-21 10:59:51 -08:00
2026-01-27 09:14:39 -08:00
2026-02-18 09:18:10 -08:00
2025-02-26 14:01:44 -08:00
2025-02-26 14:01:44 -08:00
2026-04-08 14:17:21 -07:00
2025-11-19 07:45:52 -08:00
2026-04-20 10:28:01 -07:00
2026-04-20 10:28:01 -07:00
2026-04-20 10:28:01 -07:00
2026-03-04 12:40:19 -08:00
2026-04-20 10:28:01 -07:00
2026-04-20 10:28:01 -07:00
2026-04-20 10:28:01 -07:00
2025-01-22 07:48:37 -08:00
2025-01-22 07:48:37 -08:00
2025-05-13 14:29:37 -07:00
2025-05-13 14:29:37 -07:00
2026-04-08 07:44:03 -07:00
2025-11-21 06:42:16 -08:00
2025-08-11 13:41:12 -07:00
2026-04-07 08:06:43 -07:00
2024-08-19 21:46:26 +00:00
2026-02-17 14:25:39 -08:00
2025-06-03 10:36:23 -07:00
2024-09-18 21:07:59 +00:00
2024-09-18 21:07:59 +00:00
2024-05-16 16:33:52 +00:00
2026-03-04 16:07:20 -08:00
2024-05-02 16:36:20 +00:00
2026-04-10 06:15:22 -07:00
2025-06-02 10:04:39 -07:00
2026-04-21 04:02:25 -07:00
2023-12-14 22:48:49 +00:00
2024-09-25 17:28:44 +00:00
2025-07-07 17:02:17 -07:00
2024-08-28 16:41:50 +00:00
2025-07-28 13:32:36 -07:00
2026-03-24 10:23:38 -07:00
2026-02-04 10:16:41 -08:00
2026-03-02 13:52:34 -08:00
2026-04-10 06:15:22 -07:00
2026-04-20 10:28:01 -07:00
2026-04-21 15:05:16 -07:00
2026-04-21 10:13:04 -07:00
2026-01-27 09:14:39 -08:00
2026-01-27 09:14:39 -08:00
2026-01-27 09:14:39 -08:00
2026-01-27 09:14:39 -08:00
2026-01-27 09:14:39 -08:00
2026-03-25 11:58:38 -07:00
2026-03-25 11:58:38 -07:00
2026-03-25 11:58:38 -07:00
2026-03-25 11:58:38 -07:00
2026-03-25 11:58:38 -07:00
2026-03-25 11:58:38 -07:00
2026-03-25 11:58:38 -07:00
2026-03-25 11:58:38 -07:00
2026-03-25 11:58:38 -07:00
2026-03-25 11:58:38 -07:00
2026-03-25 11:58:38 -07:00
2026-03-25 11:58:38 -07:00
2026-04-07 08:06:43 -07:00
2026-03-25 11:58:38 -07:00
2026-03-25 11:58:38 -07:00
2025-05-21 01:36:22 -07:00
2026-01-27 09:14:39 -08:00
2026-02-23 09:54:47 -08:00
2026-04-10 06:15:22 -07:00
2024-04-15 11:10:23 +00:00
2024-04-15 11:10:23 +00:00
2026-02-25 04:48:51 -08:00
2024-09-12 15:16:12 +00:00
2026-04-08 15:26:06 -07:00
2026-01-27 09:14:39 -08:00
2026-01-27 09:14:39 -08:00
2026-04-14 17:22:31 -07:00
2026-02-04 10:16:41 -08:00
2026-04-10 06:15:22 -07:00
2026-04-15 09:37:41 -07:00
2026-04-14 17:22:31 -07:00
2026-02-04 10:16:41 -08:00
2024-04-17 19:14:41 +00:00
2025-10-07 15:13:14 -07:00
2025-10-07 15:13:14 -07:00
2026-04-21 04:02:25 -07:00
2026-04-21 04:02:25 -07:00
2026-04-16 10:07:23 -07:00
2026-04-21 10:13:04 -07:00
2026-04-14 04:26:01 -07:00
2025-08-04 14:05:01 -07:00
2025-09-15 10:00:29 -07:00
2026-04-08 15:26:06 -07:00
2026-04-10 06:15:22 -07:00
2026-02-23 09:54:47 -08:00
2026-04-14 04:26:01 -07:00
2026-03-18 10:18:06 -07:00
2026-01-27 09:14:39 -08:00
2026-04-08 14:31:16 -07:00
2025-04-24 11:07:56 -07:00
2025-04-14 07:36:31 -07:00
2026-04-08 10:05:40 -07:00
2024-06-10 20:38:30 +00:00
2026-03-26 08:21:00 -07:00
2026-04-20 10:28:01 -07:00
2026-03-24 10:23:38 -07:00
2026-01-14 03:53:04 -08:00
2025-06-18 13:07:22 -07:00
2025-06-18 13:07:22 -07:00
2026-01-14 03:53:04 -08:00
2026-04-15 15:23:51 -07:00
2026-03-18 10:18:06 -07:00
2026-04-15 15:23:51 -07:00
2024-11-26 19:24:31 +00:00
2026-03-04 12:40:19 -08:00
2026-04-15 15:23:51 -07:00
2026-04-13 14:00:21 -07:00
2025-06-18 13:07:22 -07:00
2025-06-18 13:07:22 -07:00
2026-02-17 14:14:59 -08:00
2025-11-21 06:42:16 -08:00
2025-11-19 07:45:52 -08:00
2026-02-04 10:16:41 -08:00
2025-11-24 15:59:56 -08:00
2025-11-17 06:56:33 -08:00
2025-10-01 09:51:59 -07:00
2026-02-04 10:16:41 -08:00
2024-08-15 14:09:52 +00:00
2024-12-04 14:36:46 +00:00
2025-12-12 06:44:20 -08:00
2026-04-08 15:26:06 -07:00
2025-11-21 06:42:16 -08:00
2024-08-15 14:09:52 +00:00
2026-04-10 06:15:22 -07:00
2026-04-10 06:15:22 -07:00
2026-04-08 15:26:06 -07:00
2026-04-13 10:10:42 -07:00
2026-03-31 12:55:51 -07:00
2026-03-31 12:55:51 -07:00
2026-02-23 13:01:19 -08:00
2025-08-25 14:43:41 -07:00
2025-08-25 14:43:41 -07:00
2026-01-14 03:53:04 -08:00
2025-12-01 12:47:18 -08:00
2025-10-27 11:17:38 -07:00
2026-01-07 12:47:21 -08:00
2025-10-24 04:34:01 -07:00
2026-01-20 05:58:38 -08:00
2026-01-20 05:58:38 -08:00
2024-09-12 15:16:12 +00:00
2025-02-24 10:44:28 -08:00
2025-05-12 12:32:19 -07:00
2025-05-23 07:23:22 -07:00
2025-02-24 10:44:28 -08:00
2024-12-17 13:30:50 -08:00
2024-04-17 19:14:41 +00:00
2026-01-27 09:14:39 -08:00
2026-01-27 09:14:39 -08:00
2025-08-25 14:43:41 -07:00
2026-04-08 15:26:06 -07:00
2026-01-30 11:16:13 -08:00
2024-04-17 19:14:41 +00:00
2025-05-27 06:30:20 -07:00
2023-07-10 20:33:33 +00:00
2026-04-06 10:35:42 -07:00
2026-04-06 10:35:42 -07:00
2024-04-17 19:14:41 +00:00
2026-03-03 06:58:35 -08:00
2026-03-03 06:58:35 -08:00
2026-01-27 09:14:39 -08:00
2026-01-27 09:14:39 -08:00
2025-10-20 15:58:20 -07:00
2025-09-24 13:14:32 -07:00
2025-10-20 10:49:20 -07:00
2025-06-30 15:50:40 -07:00
2026-02-17 14:14:59 -08:00
2025-10-14 13:15:21 -07:00
2026-02-18 09:18:10 -08:00
2025-05-23 06:19:16 -07:00
2025-05-23 06:19:16 -07:00
2025-05-23 06:19:16 -07:00
2026-02-17 14:14:59 -08:00
2026-02-04 10:16:41 -08:00
2025-06-18 13:07:22 -07:00
2024-06-14 23:24:19 +00:00
2024-08-07 12:59:35 +00:00
2026-01-28 13:49:00 -08:00
2026-03-31 19:59:09 -07:00
2026-01-28 13:49:00 -08:00
2026-01-28 13:49:00 -08:00
2026-01-13 14:28:00 -08:00
2025-06-18 06:09:14 -07:00
2026-03-31 19:59:09 -07:00
2025-07-07 17:02:17 -07:00
2026-03-31 12:55:51 -07:00
2026-02-04 10:16:41 -08:00
2024-08-07 12:59:35 +00:00
2026-02-23 09:54:47 -08:00