aboutsummaryrefslogtreecommitdiff
path: root/gcc/defaults.h
diff options
context:
space:
mode:
authorJeff Law <jlaw@ventanamicro.com>2023-12-15 14:19:25 -0700
committerJeff Law <jlaw@ventanamicro.com>2023-12-15 14:29:30 -0700
commit082835836cf763e74ed2fdf9645ac4f1f94d6d4f (patch)
treeef8070341357e41a57869b9098e37b4c81f4e5cf /gcc/defaults.h
parenta1f0d227481fe143f8c15b3f268e2d5964a3c90a (diff)
downloadgcc-082835836cf763e74ed2fdf9645ac4f1f94d6d4f.zip
gcc-082835836cf763e74ed2fdf9645ac4f1f94d6d4f.tar.gz
gcc-082835836cf763e74ed2fdf9645ac4f1f94d6d4f.tar.bz2
Re: [PATCH] RISC-V: fix scalar crypto patterns
A handful of the scalar crypto instructions are supposed to take a constant integer argument 0..3 inclusive and one should accept 0..10. A suitable constraint was created and used for this purpose (D03 and DsA), but the operand's predicate is "register_operand". That's just wrong. This patch adds a new predicates "const_0_3_operand" and "const_0_10_operand" and fixes the relevant insns to use the appropriate predicate. It drops the now unnecessary constraints. The testsuite was broken in a way that made it consistent with the compiler, so the tests passed, when they really should have been issuing errors all along. This patch adjusts the existing tests so that they all expect a diagnostic on the invalid operand usage (including out of range constants). It adds new tests with proper constants, testing the extremes of valid values. PR target/110201 gcc/ * config/riscv/constraints.md (D03, DsA): Remove unused constraints. * config/riscv/predicates.md (const_0_3_operand): New predicate. (const_0_10_operand): Likewise. * config/riscv/crypto.md (riscv_aes32dsi): Use new predicate. Drop unnecessary constraint. (riscv_aes32dsmi, riscv_aes64im, riscv_aes32esi): Likewise. (riscv_aes32esmi, *riscv_<sm4_op>_si): Likewise. (riscv_<sm4_op>_di_extend, riscv_<sm4_op>_si): Likewise. gcc/testsuite * gcc.target/riscv/zknd32.c: Verify diagnostics are issued for invalid builtin arguments. * gcc.target/riscv/zknd64.c: Likewise. * gcc.target/riscv/zkne32.c: Likewise. * gcc.target/riscv/zkne64.c: Likewise. * gcc.target/riscv/zksed32.c: Likewise. * gcc.target/riscv/zksed64.c: Likewise. * gcc.target/riscv/zknd32-2.c: New test * gcc.target/riscv/zknd64-2.c: Likewise. * gcc.target/riscv/zkne32-2.c: Likewise. * gcc.target/riscv/zkne64-2.c: Likewise. * gcc.target/riscv/zksed32-2.c: Likewise. * gcc.target/riscv/zksed64-2.c: Likewise. Co-authored-by: Liao Shihua <shihua@iscas.ac.cn>
Diffstat (limited to 'gcc/defaults.h')
0 files changed, 0 insertions, 0 deletions