Commit 824d48e
committed
[PATCH][GCC] arm: Fix MVE scalar shift intrinsics code-gen.
This patch modifies the MVE scalar shift RTL patterns. The current patterns
have wrong constraints and predicates due to which the values returned from
MVE scalar shift instructions are overwritten in the code-gen.
example:
$ cat x.c
int32_t foo(int64_t acc, int shift)
{
return sqrshrl_sat48 (acc, shift);
}
Code-gen before applying this patch:
$ arm-none-eabi-gcc -march=armv8.1-m.main+mve -mfloat-abi=hard -O2 -S
$ cat x.s
foo:
push {r4, r5}
sqrshrl r0, r1, gcc-mirror#48, r2 ----> (a)
mov r0, r4 ----> (b)
pop {r4, r5}
bx lr
Code-gen after applying this patch:
foo:
sqrshrl r0, r1, gcc-mirror#48, r2
bx lr
In the current compiler the return value (r0) from sqrshrl (a) is getting
overwritten by the mov statement (b).
This patch fixes above issue.
2020-06-12 Srinath Parvathaneni <[email protected]>
gcc/
* config/arm/mve.md (mve_uqrshll_sat<supf>_di): Correct the predicate
and constraint of all the operands.
(mve_sqrshrl_sat<supf>_di): Likewise.
(mve_uqrshl_si): Likewise.
(mve_sqrshr_si): Likewise.
(mve_uqshll_di): Likewise.
(mve_urshrl_di): Likewise.
(mve_uqshl_si): Likewise.
(mve_urshr_si): Likewise.
(mve_sqshl_si): Likewise.
(mve_srshr_si): Likewise.
(mve_srshrl_di): Likewise.
(mve_sqshll_di): Likewise.
* config/arm/predicates.md (arm_low_register_operand): Define.
gcc/testsuite/
* gcc.target/arm/mve/intrinsics/mve_scalar_shifts1.c: New test.
* gcc.target/arm/mve/intrinsics/mve_scalar_shifts2.c: Likewise.
* gcc.target/arm/mve/intrinsics/mve_scalar_shifts3.c: Likewise.
* gcc.target/arm/mve/intrinsics/mve_scalar_shifts4.c: Likewise.
(cherry picked from commit 6af5987)1 parent 934a5fa commit 824d48e
File tree
6 files changed
+185
-36
lines changed- gcc
- config/arm
- testsuite/gcc.target/arm/mve/intrinsics
6 files changed
+185
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11344 | 11344 | | |
11345 | 11345 | | |
11346 | 11346 | | |
11347 | | - | |
11348 | | - | |
11349 | | - | |
| 11347 | + | |
| 11348 | + | |
| 11349 | + | |
11350 | 11350 | | |
11351 | 11351 | | |
11352 | 11352 | | |
| |||
11356 | 11356 | | |
11357 | 11357 | | |
11358 | 11358 | | |
11359 | | - | |
11360 | | - | |
11361 | | - | |
| 11359 | + | |
| 11360 | + | |
| 11361 | + | |
11362 | 11362 | | |
11363 | 11363 | | |
11364 | 11364 | | |
| |||
11368 | 11368 | | |
11369 | 11369 | | |
11370 | 11370 | | |
11371 | | - | |
11372 | | - | |
11373 | | - | |
| 11371 | + | |
| 11372 | + | |
| 11373 | + | |
11374 | 11374 | | |
11375 | 11375 | | |
11376 | 11376 | | |
| |||
11380 | 11380 | | |
11381 | 11381 | | |
11382 | 11382 | | |
11383 | | - | |
11384 | | - | |
11385 | | - | |
| 11383 | + | |
| 11384 | + | |
| 11385 | + | |
11386 | 11386 | | |
11387 | 11387 | | |
11388 | 11388 | | |
| |||
11392 | 11392 | | |
11393 | 11393 | | |
11394 | 11394 | | |
11395 | | - | |
11396 | | - | |
11397 | | - | |
| 11395 | + | |
| 11396 | + | |
| 11397 | + | |
11398 | 11398 | | |
11399 | 11399 | | |
11400 | 11400 | | |
| |||
11403 | 11403 | | |
11404 | 11404 | | |
11405 | 11405 | | |
11406 | | - | |
11407 | | - | |
11408 | | - | |
| 11406 | + | |
| 11407 | + | |
| 11408 | + | |
11409 | 11409 | | |
11410 | 11410 | | |
11411 | 11411 | | |
| |||
11415 | 11415 | | |
11416 | 11416 | | |
11417 | 11417 | | |
11418 | | - | |
11419 | | - | |
11420 | | - | |
| 11418 | + | |
| 11419 | + | |
| 11420 | + | |
11421 | 11421 | | |
11422 | 11422 | | |
11423 | 11423 | | |
| |||
11426 | 11426 | | |
11427 | 11427 | | |
11428 | 11428 | | |
11429 | | - | |
11430 | | - | |
11431 | | - | |
| 11429 | + | |
| 11430 | + | |
| 11431 | + | |
11432 | 11432 | | |
11433 | 11433 | | |
11434 | 11434 | | |
| |||
11438 | 11438 | | |
11439 | 11439 | | |
11440 | 11440 | | |
11441 | | - | |
11442 | | - | |
11443 | | - | |
| 11441 | + | |
| 11442 | + | |
| 11443 | + | |
11444 | 11444 | | |
11445 | 11445 | | |
11446 | 11446 | | |
| |||
11449 | 11449 | | |
11450 | 11450 | | |
11451 | 11451 | | |
11452 | | - | |
11453 | | - | |
11454 | | - | |
| 11452 | + | |
| 11453 | + | |
| 11454 | + | |
11455 | 11455 | | |
11456 | 11456 | | |
11457 | 11457 | | |
| |||
11461 | 11461 | | |
11462 | 11462 | | |
11463 | 11463 | | |
11464 | | - | |
11465 | | - | |
11466 | | - | |
| 11464 | + | |
| 11465 | + | |
| 11466 | + | |
11467 | 11467 | | |
11468 | 11468 | | |
11469 | 11469 | | |
| |||
11473 | 11473 | | |
11474 | 11474 | | |
11475 | 11475 | | |
11476 | | - | |
11477 | | - | |
11478 | | - | |
| 11476 | + | |
| 11477 | + | |
| 11478 | + | |
11479 | 11479 | | |
11480 | 11480 | | |
11481 | 11481 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
158 | 170 | | |
159 | 171 | | |
160 | 172 | | |
| |||
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments