Jeff Epler
a809132921
py: Add MICROPY_USE_GCC_MUL_OVERFLOW_INTRINSIC.
...
Most MCUs apart from Cortex-M0 with Thumb 1 have an instruction
for computing the "high part" of a multiplication (e.g., the upper
32 bits of a 32x32 multiply).
When they do, gcc uses this to implement a small and fast
overflow check using the __builtin_mul_overflow intrinsic, which
is preferable to the guard division method previously used in smallint.c.
However, in contrast to the previous mp_small_int_mul_overflow
routine, which checks that the result fits not only within mp_int_t
but is SMALL_INT_FITS(), __builtin_mul_overflow only checks for
overflow of the C type. As a result, a slight change in the code
flow is needed for MP_BINARY_OP_MULTIPLY.
Other sites using mp_small_int_mul_overflow already had the
result value flow through to a SMALL_INT_FITS check so they didn't
need any additional changes.
Do similarly for the _ll and _ull multiply overflows checks.
Signed-off-by: Jeff Epler <jepler@gmail.com >
2025-10-01 09:23:05 +10:00
..
2025-05-13 10:36:47 +10:00
2025-07-01 15:34:29 +10:00
2025-07-04 16:07:04 +10:00
2025-06-16 14:02:30 +10:00
2024-06-21 15:06:07 +10:00
2025-09-19 15:51:37 +02:00
2025-09-19 15:52:20 +02:00
2025-08-19 12:40:29 +10:00
2025-07-04 16:07:04 +10:00
2024-03-19 10:31:36 +11:00
2025-07-04 16:07:04 +10:00
2024-03-19 10:31:36 +11:00
2025-07-04 16:07:04 +10:00
2025-07-01 15:34:29 +10:00
2025-07-04 16:07:04 +10:00
2022-03-28 15:43:09 +11:00
2025-05-13 10:36:47 +10:00
2025-07-08 11:03:22 -04:00
2025-08-12 14:34:19 +10:00
2019-09-02 13:14:27 +10:00
2025-08-01 13:35:44 +10:00
2025-02-11 16:42:14 +11:00
2025-07-25 10:56:02 +10:00
2025-08-22 13:30:46 +10:00
2025-09-10 07:46:06 -05:00
2025-02-11 16:42:14 +11:00
2024-08-14 12:55:45 +10:00
2024-08-14 12:55:45 +10:00
2025-05-13 10:36:47 +10:00
2025-06-10 13:43:03 +10:00
2025-01-02 11:49:10 +11:00
2024-07-18 12:35:42 +10:00
2025-08-01 13:35:44 +10:00
2024-12-10 12:04:14 +11:00
2024-03-04 10:27:07 +11:00
2025-09-19 15:52:20 +02:00
2025-05-09 18:31:40 +10:00
2025-05-29 12:12:39 +10:00
2022-05-23 15:43:06 +10:00
2025-07-04 16:07:04 +10:00
2025-07-04 16:07:04 +10:00
2024-06-21 15:06:07 +10:00
2022-05-23 15:43:06 +10:00
2022-05-23 15:43:06 +10:00
2024-03-07 14:20:42 +11:00
2022-05-23 15:43:06 +10:00
2022-05-23 15:43:06 +10:00
2025-08-01 00:47:33 +10:00
2025-08-01 00:47:33 +10:00
2022-02-24 18:08:43 +11:00
2022-05-25 13:04:45 +10:00
2025-07-25 10:56:57 +10:00
2023-09-15 12:19:13 +10:00
2020-06-16 23:18:01 +10:00
2024-07-18 12:44:44 +10:00
2024-07-18 12:44:44 +10:00
2025-09-15 14:54:09 +10:00
2025-09-15 14:54:09 +10:00
2025-09-15 14:54:09 +10:00
2025-09-15 14:54:09 +10:00
2025-09-15 14:54:09 +10:00
2025-09-15 14:54:09 +10:00
2025-09-10 17:24:56 +10:00
2024-03-07 14:20:42 +11:00
2025-10-01 09:23:05 +10:00
2024-12-10 11:28:38 +11:00
2025-08-15 01:24:53 +10:00
2025-09-26 14:38:05 +10:00
2024-03-07 14:20:42 +11:00
2024-03-07 14:20:42 +11:00
2024-03-07 14:20:42 +11:00
2024-03-07 14:20:42 +11:00
2024-03-07 14:20:42 +11:00
2024-03-07 14:20:42 +11:00
2025-06-17 10:15:59 +10:00
2025-06-24 00:30:08 +10:00
2025-07-25 10:56:57 +10:00
2024-03-07 14:20:42 +11:00
2025-07-22 23:22:05 +10:00
2024-08-14 12:55:45 +10:00
2025-10-01 09:23:05 +10:00
2023-06-08 17:54:11 +10:00
2025-07-30 11:47:43 +10:00
2025-08-01 00:47:33 +10:00
2025-08-01 00:47:33 +10:00
2017-07-31 18:35:40 +10:00
2025-09-19 10:06:18 +02:00
2025-02-03 15:02:02 +11:00
2025-06-16 12:11:07 +10:00
2024-06-24 14:07:00 +10:00
2024-05-24 13:50:57 +10:00
2025-05-13 10:36:47 +10:00
2025-05-13 10:36:47 +10:00
2025-05-13 10:36:47 +10:00
2025-05-13 10:36:47 +10:00
2025-05-13 10:36:47 +10:00
2025-05-13 10:36:47 +10:00
2025-05-13 10:36:47 +10:00
2025-05-13 10:36:47 +10:00
2023-06-02 21:47:34 +10:00
2025-05-13 10:36:47 +10:00
2025-05-13 10:36:47 +10:00
2025-05-13 10:36:47 +10:00
2025-05-13 10:36:47 +10:00
2025-07-25 10:56:02 +10:00
2025-09-16 10:51:40 +10:00
2025-07-24 14:55:34 +10:00
2025-03-06 12:52:35 +11:00
2024-03-07 14:20:42 +11:00
2024-03-07 14:20:42 +11:00
2025-07-31 11:38:35 +10:00
2025-07-25 11:00:41 +10:00
2024-03-07 14:20:42 +11:00
2025-07-18 10:59:21 -04:00
2025-07-06 00:06:34 +10:00
2025-08-01 00:47:33 +10:00
2024-11-04 11:21:56 +11:00
2025-07-25 10:56:02 +10:00
2024-03-07 14:20:42 +11:00
2024-03-07 14:20:42 +11:00
2022-09-19 19:06:15 +10:00
2024-03-07 14:20:42 +11:00
2025-08-01 00:47:33 +10:00
2025-02-11 16:51:50 +11:00
2024-04-22 10:34:01 +10:00
2024-08-14 12:55:45 +10:00
2017-07-31 18:35:40 +10:00
2024-03-07 14:20:42 +11:00
2025-07-29 01:14:35 +10:00
2025-07-28 23:58:46 +10:00
2025-09-28 23:24:24 +10:00
2024-06-24 14:07:00 +10:00
2025-06-16 13:43:47 +10:00
2022-09-19 19:06:15 +10:00
2024-03-07 14:20:42 +11:00
2025-08-19 13:00:45 +10:00
2023-06-14 19:03:46 +10:00
2025-07-25 10:56:02 +10:00
2022-09-19 19:06:15 +10:00
2024-03-07 14:20:42 +11:00
2024-03-07 14:20:42 +11:00
2024-03-07 14:20:42 +11:00
2024-03-07 14:20:42 +11:00
2025-09-26 13:34:57 +10:00
2024-03-07 14:20:42 +11:00
2025-08-15 01:21:25 +10:00
2024-03-07 14:20:42 +11:00
2024-03-07 14:20:42 +11:00
2024-03-07 14:20:42 +11:00
2025-05-13 12:16:35 +10:00
2024-03-15 13:37:31 +11:00
2024-03-07 14:20:42 +11:00
2017-06-09 17:33:01 +03:00
2024-03-07 14:20:42 +11:00
2025-04-21 17:37:39 +10:00
2025-04-24 15:55:06 +02:00
2025-08-19 12:58:02 +10:00
2022-09-19 19:06:16 +10:00
2024-03-07 14:20:42 +11:00
2024-03-07 14:20:42 +11:00
2020-03-26 01:21:04 +11:00
2020-03-26 01:21:04 +11:00
2025-08-15 11:38:20 +10:00
2022-04-14 22:44:56 +10:00
2025-10-01 09:23:05 +10:00
2025-08-01 00:47:33 +10:00
2025-01-29 12:39:05 +11:00
2017-07-31 18:35:40 +10:00
2025-06-16 23:27:50 +10:00
2025-09-19 11:11:31 +10:00
2025-07-06 00:06:34 +10:00
2025-02-11 16:42:14 +11:00
2025-09-16 13:04:42 +10:00
2025-02-11 16:42:14 +11:00
2021-07-15 00:12:41 +10:00
2020-02-28 10:33:03 +11:00
2024-12-23 13:04:54 +11:00
2024-12-23 13:04:54 +11:00
2025-03-06 12:52:35 +11:00
2024-12-23 13:04:54 +11:00
2025-02-25 16:11:33 +11:00
2025-06-19 17:23:42 +10:00
2022-03-10 10:58:33 +11:00
2024-09-19 18:00:44 +10:00
2024-09-19 18:00:44 +10:00
2024-02-16 12:48:02 +11:00
2025-10-01 09:23:05 +10:00
2025-10-01 09:23:05 +10:00
2025-07-06 00:05:47 +10:00
2025-06-04 11:31:12 +10:00
2024-03-26 22:52:25 +11:00
2024-02-16 14:17:01 +11:00
2024-07-18 12:51:29 +10:00
2025-07-08 11:03:22 -04:00
2025-10-01 09:23:05 +10:00
2025-10-01 09:23:05 +10:00
2024-08-14 12:55:45 +10:00
2024-08-14 12:55:45 +10:00
2025-09-26 00:24:08 +10:00
2025-09-11 12:43:02 +10:00
2024-03-07 14:20:42 +11:00
2017-09-06 16:43:09 +10:00
2024-11-20 17:38:39 +11:00
2024-12-10 11:28:38 +11:00
2025-07-24 14:55:34 +10:00
2020-10-22 11:47:36 +02:00
2024-03-07 14:20:42 +11:00
2019-02-06 00:19:00 +11:00