-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix cv.shuffle.b.sci immediate operand
Issue [#68](#68) The built-in for `cv.shuffle.b.sci` takes an 8-bit immediate operand. The top two bits decides which `cv.shufflei*` instruction is used. The other six bits are printed. Files Changed: * config/riscv/constraints.md: Added new constraints to check the top two bits. * config/riscv/corev.md: Likewise. * config/riscv/riscv.cc: Added new operand type for printing the bottom six bits. * testsuite/gcc.target/riscv/cv-simd-shufflei0-sci-b-compile-1.c: Updated test. * testsuite/gcc.target/riscv/cv-simd-shufflei1-sci-b-compile-1.c: Likewise. * testsuite/gcc.target/riscv/cv-simd-shufflei2-sci-b-compile-1.c: Likewise. * testsuite/gcc.target/riscv/cv-simd-shufflei3-sci-b-compile-1.c: Likewise. * testsuite/gcc.target/riscv/cv-xcvsimd-march-compile-1.c: Likewise.
- Loading branch information
Mary Bennett
committed
Oct 4, 2023
1 parent
2e71b69
commit 276b330
Showing
8 changed files
with
79 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 12 additions & 3 deletions
15
gcc/testsuite/gcc.target/riscv/cv-simd-shufflei0-sci-b-compile-1.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-march=rv32i_xcvsimd -mabi=ilp32" } */ | ||
|
||
int foo1 (int a) | ||
int | ||
foo1 (int a) | ||
{ | ||
return __builtin_riscv_cv_simd_shuffle_sci_b(a, 0); | ||
return __builtin_riscv_cv_simd_shuffle_sci_b (a, 0); | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "cv\\.shufflei0\\.sci\\.b" 1 } } */ | ||
int | ||
foo2 (int a) | ||
{ | ||
return __builtin_riscv_cv_simd_shuffle_sci_b (a, 63); | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "cv\\.shufflei0\\.sci\\.b" 2 } } */ | ||
/* { dg-final { scan-assembler-times "cv\\.shufflei0\\.sci\\.b\t\[a-z\]\[0-99\],\[a-z\]\[0-99\],0" 1 } } */ | ||
/* { dg-final { scan-assembler-times "cv\\.shufflei0\\.sci\\.b\t\[a-z\]\[0-99\],\[a-z\]\[0-99\],63" 1 } } */ |
15 changes: 12 additions & 3 deletions
15
gcc/testsuite/gcc.target/riscv/cv-simd-shufflei1-sci-b-compile-1.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-march=rv32i_xcvsimd -mabi=ilp32" } */ | ||
|
||
int foo1 (int a) | ||
int | ||
foo1 (int a) | ||
{ | ||
return __builtin_riscv_cv_simd_shuffle_sci_b(a, 1); | ||
return __builtin_riscv_cv_simd_shuffle_sci_b (a, 64); | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "cv\\.shufflei1\\.sci\\.b" 1 } } */ | ||
int | ||
foo2 (int a) | ||
{ | ||
return __builtin_riscv_cv_simd_shuffle_sci_b (a, 127); | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "cv\\.shufflei1\\.sci\\.b" 2 } } */ | ||
/* { dg-final { scan-assembler-times "cv\\.shufflei1\\.sci\\.b\t\[a-z\]\[0-99\],\[a-z\]\[0-99\],0" 1 } } */ | ||
/* { dg-final { scan-assembler-times "cv\\.shufflei1\\.sci\\.b\t\[a-z\]\[0-99\],\[a-z\]\[0-99\],63" 1 } } */ |
15 changes: 12 additions & 3 deletions
15
gcc/testsuite/gcc.target/riscv/cv-simd-shufflei2-sci-b-compile-1.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-march=rv32i_xcvsimd -mabi=ilp32" } */ | ||
|
||
int foo1 (int a) | ||
unsigned int | ||
foo1 (unsigned int a) | ||
{ | ||
return __builtin_riscv_cv_simd_shuffle_sci_b(a, 2); | ||
return __builtin_riscv_cv_simd_shuffle_sci_b (a, 128); | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "cv\\.shufflei2\\.sci\\.b" 1 } } */ | ||
unsigned int | ||
foo2 (unsigned int a) | ||
{ | ||
return __builtin_riscv_cv_simd_shuffle_sci_b (a, 191); | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "cv\\.shufflei2\\.sci\\.b" 2 } } */ | ||
/* { dg-final { scan-assembler-times "cv\\.shufflei2\\.sci\\.b\t\[a-z\]\[0-99\],\[a-z\]\[0-99\],0" 1 } } */ | ||
/* { dg-final { scan-assembler-times "cv\\.shufflei2\\.sci\\.b\t\[a-z\]\[0-99\],\[a-z\]\[0-99\],63" 1 } } */ |
15 changes: 12 additions & 3 deletions
15
gcc/testsuite/gcc.target/riscv/cv-simd-shufflei3-sci-b-compile-1.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-march=rv32i_xcvsimd -mabi=ilp32" } */ | ||
|
||
int foo1 (int a) | ||
int | ||
foo1 (int a) | ||
{ | ||
return __builtin_riscv_cv_simd_shuffle_sci_b(a, 3); | ||
return __builtin_riscv_cv_simd_shuffle_sci_b (a, 192); | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "cv\\.shufflei3\\.sci\\.b" 1 } } */ | ||
int | ||
foo2 (int a) | ||
{ | ||
return __builtin_riscv_cv_simd_shuffle_sci_b (a, 255); | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "cv\\.shufflei3\\.sci\\.b" 2 } } */ | ||
/* { dg-final { scan-assembler-times "cv\\.shufflei3\\.sci\\.b\t\[a-z\]\[0-99\],\[a-z\]\[0-99\],0" 1 } } */ | ||
/* { dg-final { scan-assembler-times "cv\\.shufflei3\\.sci\\.b\t\[a-z\]\[0-99\],\[a-z\]\[0-99\],63" 1 } } */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters