Christophe Leroy
41d65207de
powerpc/atomics: Use immediate operand when possible
...
Today we get the following code generation for atomic operations:
c001bb2c: 39 20 00 01 li r9,1
c001bb30: 7d 40 18 28 lwarx r10,0,r3
c001bb34: 7d 09 50 50 subf r8,r9,r10
c001bb38: 7d 00 19 2d stwcx. r8,0,r3
c001c7a8: 39 40 00 01 li r10,1
c001c7ac: 7d 00 18 28 lwarx r8,0,r3
c001c7b0: 7c ea 42 14 add r7,r10,r8
c001c7b4: 7c e0 19 2d stwcx. r7,0,r3
By allowing GCC to choose between immediate or regular operation,
we get:
c001bb2c: 7d 20 18 28 lwarx r9,0,r3
c001bb30: 39 49 ff ff addi r10,r9,-1
c001bb34: 7d 40 19 2d stwcx. r10,0,r3
--
c001c7a4: 7d 40 18 28 lwarx r10,0,r3
c001c7a8: 39 0a 00 01 addi r8,r10,1
c001c7ac: 7d 00 19 2d stwcx. r8,0,r3
For "and", the dot form has to be used because "andi" doesn't exist.
For logical operations we use unsigned 16 bits immediate.
For arithmetic operations we use signed 16 bits immediate.
On pmac32_defconfig, it reduces the text by approx another 8 kbytes.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/2ec558d44db8045752fe9dbd29c9ba84bab6030b.1632236981.git.christophe.leroy@csgroup.eu
2021-11-30 11:45:57 +11:00
..
2021-11-05 08:15:46 -07:00
2021-10-28 00:41:29 +11:00
2021-08-27 00:56:52 +10:00
2019-05-30 11:26:32 -07:00
2017-11-02 11:10:55 +01:00
2020-01-25 12:18:51 -05:00
2021-08-25 13:35:49 +10:00
2021-10-09 00:15:59 +11:00
2021-11-24 21:08:58 +11:00
2019-05-24 17:27:11 +02:00
2021-11-30 11:45:57 +11:00
2017-11-02 11:10:55 +01:00
2021-06-10 21:44:57 +10:00
2021-11-30 11:45:50 +11:00
2017-11-02 11:10:55 +01:00
2019-06-07 19:00:14 +10:00
2021-09-01 21:25:43 +10:00
2019-05-30 11:26:32 -07:00
2020-10-25 14:51:49 -07:00
2021-04-14 23:04:19 +10:00
2019-05-30 11:26:32 -07:00
2017-11-02 11:10:55 +01:00
2021-06-16 00:16:47 +10:00
2020-12-04 01:01:10 +11:00
2021-05-26 13:20:52 +02:00
2018-08-08 00:32:25 +10:00
2021-10-07 18:52:33 +11:00
2021-09-08 15:32:35 -07:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:26:32 -07:00
2020-12-09 17:00:54 +11:00
2021-04-08 21:17:42 +10:00
2019-12-09 13:54:34 -06:00
2021-03-14 20:32:24 +11:00
2020-11-19 14:49:56 +11:00
2019-05-30 11:26:32 -07:00
2019-04-30 22:37:48 +10:00
2021-01-29 10:05:51 +05:30
2021-11-29 22:48:32 +11:00
2021-02-09 00:10:49 +11:00
2020-07-29 23:47:54 +10:00
2019-08-20 21:22:15 +10:00
2017-11-02 11:10:55 +01:00
2020-07-29 21:02:09 +10:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2021-03-01 12:33:31 +11:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:26:35 -07:00
2021-02-09 00:02:12 +11:00
2020-10-08 21:17:15 +11:00
2020-08-11 14:13:24 -07:00
2019-06-05 17:30:28 +02:00
2020-09-11 09:14:43 +02:00
2020-04-01 14:30:50 +11:00
2021-08-10 23:14:55 +10:00
2018-07-30 22:48:17 +10:00
2020-07-10 12:00:01 +02:00
2019-05-30 11:26:35 -07:00
2020-10-07 22:34:47 +11:00
2020-12-05 21:49:52 +11:00
2019-08-30 09:40:15 +10:00
2019-06-05 17:37:07 +02:00
2020-07-27 00:01:31 +10:00
2020-07-29 21:08:12 +10:00
2021-06-10 22:12:12 +10:00
2017-11-02 11:10:55 +01:00
2021-08-15 13:49:24 +10:00
2020-05-04 22:29:58 +10:00
2019-09-14 00:04:45 +10:00
2017-11-02 11:10:55 +01:00
2021-01-20 15:58:19 +11:00
2021-08-13 22:04:27 +10:00
2021-04-22 20:59:15 +10:00
2020-05-12 19:34:53 +03:00
2017-08-10 23:32:12 +10:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2021-04-07 10:56:52 +02:00
2019-05-30 11:26:32 -07:00
2021-03-23 14:08:18 -04:00
2021-03-26 23:19:43 +11:00
2017-11-02 11:10:55 +01:00
2020-07-29 23:47:53 +10:00
2021-06-25 00:06:55 +10:00
2017-11-02 11:10:55 +01:00
2021-01-24 10:34:53 -08:00
2019-05-24 17:39:01 +02:00
2021-02-11 23:35:06 +11:00
2021-06-23 00:19:08 +10:00
2021-03-24 14:09:30 +11:00
2019-05-30 11:26:35 -07:00
2019-01-14 20:39:27 +11:00
2020-09-15 22:13:20 +10:00
2021-06-25 00:06:56 +10:00
2021-03-24 14:09:29 +11:00
2017-11-02 11:10:55 +01:00
2020-08-25 01:31:33 +10:00
2017-11-02 11:10:55 +01:00
2020-04-30 12:35:26 +10:00
2020-07-16 13:12:46 +10:00
2017-11-02 11:10:55 +01:00
2021-06-17 00:09:06 +10:00
2021-10-07 19:54:55 +11:00
2019-05-30 11:26:32 -07:00
2017-11-02 11:10:55 +01:00
2019-08-27 13:03:34 +10:00
2021-10-09 00:15:59 +11:00
2021-10-22 15:22:05 +11:00
2019-05-30 11:26:32 -07:00
2018-03-13 15:50:37 +11:00
2021-08-12 22:21:57 +10:00
2018-01-19 22:37:01 +11:00
2017-11-02 11:10:55 +01:00
2021-06-15 23:35:57 +10:00
2021-04-25 21:29:04 +10:00
2021-04-14 23:04:16 +10:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-07-29 23:47:53 +10:00
2021-10-22 15:22:05 +11:00
2017-11-02 11:10:55 +01:00
2021-03-24 14:09:30 +11:00
2018-10-20 13:26:47 +11:00
2021-09-30 21:24:06 -04:00
2021-06-17 00:09:09 +10:00
2021-11-24 21:09:02 +11:00
2019-06-05 17:30:28 +02:00
2021-11-24 21:09:02 +11:00
2021-02-10 14:31:08 +11:00
2020-07-28 12:34:52 +10:00
2021-11-24 21:08:59 +11:00
2019-06-19 17:09:55 +02:00
2020-07-29 21:02:09 +10:00
2019-06-05 17:30:28 +02:00
2021-06-25 14:47:19 +10:00
2021-11-24 21:09:02 +11:00
2020-12-04 01:01:22 +11:00
2021-11-24 21:09:03 +11:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2021-06-25 00:06:55 +10:00
2019-11-24 15:06:33 -08:00
2020-07-10 12:00:01 +02:00
2019-05-30 11:26:39 -07:00
2021-11-29 22:49:26 +11:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:26:32 -07:00
2021-01-31 22:35:49 +11:00
2017-11-02 11:10:55 +01:00
2021-10-04 11:47:24 +02:00
2021-08-10 23:14:55 +10:00
2020-08-24 14:12:54 +10:00
2019-04-08 12:09:27 +01:00
2021-06-23 00:19:08 +10:00
2021-08-10 23:14:56 +10:00
2021-06-29 10:53:55 -07:00
2020-06-05 12:39:30 -07:00
2020-09-25 00:36:41 +09:00
2019-05-24 17:27:12 +02:00
2017-11-02 11:10:55 +01:00
2018-05-25 12:04:42 +10:00
2019-05-24 17:27:12 +02:00
2019-06-05 17:37:18 +02:00
2017-11-02 11:10:55 +01:00
2019-06-05 17:37:17 +02:00
2019-05-30 11:26:32 -07:00
2018-10-21 19:32:07 +11:00
2019-06-05 17:37:17 +02:00
2021-02-09 00:02:12 +11:00
2019-05-30 11:26:32 -07:00
2017-11-02 11:10:55 +01:00
2021-11-25 11:25:30 +11:00
2021-05-02 23:35:32 +10:00
2021-06-25 00:06:56 +10:00
2020-12-09 23:48:14 +11:00
2020-04-10 15:36:21 -07:00
2020-07-27 00:01:30 +10:00
2021-10-09 00:15:59 +11:00
2017-11-02 11:10:55 +01:00
2019-06-05 17:37:06 +02:00
2021-08-10 23:14:57 +10:00
2021-05-02 23:35:32 +10:00
2020-08-04 23:15:59 +10:00
2019-05-30 11:26:32 -07:00
2021-04-20 14:22:23 +10:00
2021-02-09 01:09:44 +11:00
2021-07-01 11:06:03 -07:00
2019-05-03 01:20:23 +10:00
2021-10-22 15:22:06 +11:00
2021-07-02 12:54:34 -07:00
2021-02-09 01:09:44 +11:00
2021-05-12 11:07:38 +10:00
2019-05-30 11:26:32 -07:00
2018-05-25 12:04:41 +10:00
2021-08-25 16:37:18 +10:00
2019-05-30 11:26:32 -07:00
2020-12-04 01:01:30 +11:00
2021-08-10 23:15:01 +10:00
2019-07-13 16:08:36 -07:00
2019-05-24 17:27:12 +02:00
2021-11-29 23:15:20 +11:00
2021-11-25 11:25:31 +11:00
2021-10-12 17:50:12 -05:00
2021-06-25 00:06:55 +10:00
2021-10-15 11:25:14 +02:00
2021-08-13 22:04:27 +10:00
2021-06-10 21:44:58 +10:00
2019-05-30 11:26:39 -07:00
2019-06-05 17:37:07 +02:00
2019-07-13 16:08:36 -07:00
2021-05-28 22:54:27 +10:00
2021-09-03 22:54:12 +10:00
2020-07-27 00:01:29 +10:00
2021-05-26 13:20:52 +02:00
2020-01-23 21:31:14 +11:00
2019-05-30 11:26:32 -07:00
2021-02-11 23:35:12 +11:00
2018-07-30 22:48:17 +10:00
2021-08-25 16:37:17 +10:00
2018-05-25 12:04:43 +10:00
2019-05-30 11:26:32 -07:00
2020-12-08 21:41:02 +11:00
2021-11-25 11:25:33 +11:00
2017-11-02 11:10:55 +01:00
2020-11-20 11:16:35 -08:00
2021-11-06 13:30:38 -07:00
2019-11-12 12:25:49 +11:00
2021-10-07 19:52:58 +11:00
2019-11-13 00:33:22 +11:00
2019-05-30 11:26:32 -07:00
2021-06-21 21:13:21 +10:00
2020-04-01 14:30:51 +11:00
2021-11-29 17:41:52 +11:00
2018-12-04 19:45:01 +11:00
2017-11-02 11:10:55 +01:00
2020-04-01 13:42:13 +11:00
2020-07-26 23:34:26 +10:00
2021-10-30 16:37:28 +02:00
2020-05-26 22:22:21 +10:00
2021-09-30 16:13:11 +02:00
2020-07-27 00:01:32 +10:00
2020-11-22 10:48:22 -08:00
2020-07-27 00:01:23 +10:00
2021-03-26 23:19:43 +11:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:39 -07:00
2021-01-29 10:05:51 +05:30
2021-06-25 14:47:18 +10:00
2018-10-03 15:40:03 +10:00
2018-08-08 00:32:30 +10:00
2021-10-22 15:22:05 +11:00
2020-10-06 11:18:04 +02:00
2020-09-14 23:07:14 +10:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2021-11-24 21:09:01 +11:00
2020-10-06 23:22:23 +11:00
2021-09-14 16:06:20 +02:00
2021-08-23 19:28:21 +10:00
2019-02-23 22:31:39 +11:00
2019-05-03 01:20:23 +10:00
2021-08-27 00:56:54 +10:00
2019-05-30 11:26:32 -07:00
2021-09-30 16:13:10 +02:00
2021-11-24 21:08:57 +11:00
2020-12-04 01:01:10 +11:00
2021-07-08 11:48:23 -07:00
2018-07-30 22:48:21 +10:00
2018-05-24 16:04:02 +10:00
2021-08-27 00:56:54 +10:00
2019-06-19 17:09:55 +02:00
2019-05-01 16:45:05 +10:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2021-10-09 00:15:59 +11:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-11-28 17:02:31 +11:00
2019-11-28 17:02:31 +11:00
2017-11-02 11:10:55 +01:00
2021-08-23 19:28:20 +10:00
2021-06-17 00:09:00 +10:00
2018-10-19 15:09:04 +11:00
2021-06-20 21:58:57 +10:00
2021-04-14 23:04:44 +10:00
2020-12-04 01:01:19 +11:00
2020-04-23 10:50:26 +09:00
2017-11-02 11:10:55 +01:00
2021-04-20 14:22:24 +10:00
2021-04-30 11:20:40 -07:00
2021-08-10 23:14:59 +10:00
2021-08-10 23:15:02 +10:00
2021-08-10 23:15:02 +10:00
2021-02-09 00:10:50 +11:00
2018-05-25 12:04:38 +10:00
2019-05-30 11:26:35 -07:00