[PATCH V2] RISC-V: Fix missing boolean_expression in zmmul extension

2024-05-23 Thread Liao Shihua
Update v1->v2 Add testcase for this patch. Missing boolean_expression TARGET_ZMMUL in riscv_rtx_costs() cause different instructions when multiplying an integer with a constant. ( https://github.com/riscv-collab/riscv-gnu-toolchain/issues/1482 ) int foo(int *ib) { *ib = *ib * 33938;

[PATCH] RISC-V: Fix missing boolean_expression in zmmul extension

2024-05-23 Thread Liao Shihua
Missing boolean_expression TARGET_ZMMUL in riscv_rtx_costs() casuse different instructions when multiplying an integer with a constant. ( https://github.com/riscv-collab/riscv-gnu-toolchain/issues/1482 ) int foo(int *ib) { *ib = *ib * 33938; return 0; } rv64im: lw a4,0(a1)

[PATCH v4 3/3] RISC-V: Add C intrinsic for Scalar Bitmanip Extension

2024-01-15 Thread Liao Shihua
This patch adds C intrinsics for Bitmanip Extension. RISCV_BUILTIN_NO_PREFIX is a new riscv_builtin_description like RISCV_BUILTIN. But it uses CODE_FOR_##INSN rather than CODE_FOR_riscv_##INSN. Changed orcb, clmul, brev8 pattern's mode form X to GPR because orcbsi, clmul_si, brev8_si are both

[PATCH v4 2/3] RISC-V: Add C intrinsic for Scalar Crypto Extension

2024-01-15 Thread Liao Shihua
This patch adds C intrinsics for Scalar Crypto Extension. gcc/ChangeLog: * config.gcc: Include riscv_crypto.h. * config/riscv/riscv_crypto.h: New file. gcc/testsuite/ChangeLog: * gcc.target/riscv/scalar_crypto_intrinsic-32.c: New test. *

[PATCH v4 1/3] RISC-V: Remove the Scalar Bitmanip and Crypto Built-In function testsuites

2024-01-15 Thread Liao Shihua
The serials patch provides a mapping from the RV intrinsics to the builtin names. There are some duplicates testsuites between intrinsic and built-in function. Remove the Scalar Bitmanip and Scalar Crypto Built-In function testsuites that will be included in the intrinsic functions.

[PATCH v4 0/3] RISC-V: Add intrinsics for Bitmanip and Scalar Crypto extensions

2024-01-15 Thread Liao Shihua
built-in and intrinsic. 4. Typo fix. Update v1 -> v2: 1. Rename *_intrinsic-* to *_intrinsic-XLEN. 2. Typo fix. 3. Intrinsics with immediate arguments will use marcos at O0 . It's a little patch add just provides a mapping from the RV intrinsics to the builtin names within GCC. Liao

[PATCH V3 3/3] RISC-V: Add C intrinsic for Scalar Bitmanip Extension

2023-12-25 Thread Liao Shihua
This patch adds C intrinsics for Bitmanip Extension. RISCV_BUILTIN_NO_PREFIX is a new riscv_builtin_description like RISCV_BUILTIN. But it uses CODE_FOR_##INSN rather than CODE_FOR_riscv_##INSN. Changed orcb, clmul, brev8 pattern's mode form X to GPR because orcbsi, clmul_si, brev8_si are both

[PATCH V3 2/3] RISC-V: Add C intrinsic for Scalar Crypto Extension

2023-12-25 Thread Liao Shihua
This patch adds C intrinsics for Scalar Crypto Extension. gcc/ChangeLog: * config.gcc: Include riscv_crypto.h. * config/riscv/riscv_crypto.h: New file. gcc/testsuite/ChangeLog: * gcc.target/riscv/scalar_crypto_intrinsic-32.c: New test. *

[PATCH V3 0/3] RISC-V: Add intrinsics for Bitmanip and Scalar Crypto extensions

2023-12-25 Thread Liao Shihua
insics with immediate arguments will use marcos at O0 . It's a little patch add just provides a mapping from the RV intrinsics to the builtin names within GCC. Liao Shihua (3): RISC-V: Remove the Scalar Bitmanip and Crypto Built-In function testsuites RISC-V: Add C intrinsic for Scalar Crypto Ext

[PATCH V3 1/3] RISC-V: Remove the Scalar Bitmanip and Crypto Built-In function testsuites

2023-12-25 Thread Liao Shihua
The serials patch provides a mapping from the RV intrinsics to the builtin names. There are some duplicates testsuites between intrinsic and built-in function. Remove the Scalar Bitmanip and Scalar Crypto Built-In function testsuites that will be included in the intrinsic functions.

Re: [PATCH] RISC-V: fix scalar crypto pattern

2023-12-14 Thread Liao Shihua
/pipermail/gcc-patches/2023-June/622233.html No problem. And I would tend to remove the D03 constraint if we used const_0_3_operand. BR Liao  Shihua

[PATCH] RISC-V: fix scalar crypto pattern

2023-12-13 Thread Liao Shihua
In Scalar Crypto Built-In functions, some require immediate parameters, But register_operand are incorrectly used in the pattern. E.g.: __builtin_riscv_aes64ks1i(rs1,1) Before: li a5,1 aes64ks1i a0,a0,a5 Assembler messages: Error: instruction aes64ks1i

[PATCH V2 2/2]RISC-V: Add C intrinsics of Bitmanip Extension

2023-12-07 Thread Liao Shihua
This patch adds C intrinsics for Bitmanip Extension. RISCV_BUILTIN_NO_PREFIX is a new riscv_builtin_description like RISCV_BUILTIN. But it uses CODE_FOR_##INSN rather than CODE_FOR_riscv_##INSN. gcc/ChangeLog: * config.gcc: Add riscv_bitmanip.h * config/riscv/riscv-builtins.cc

[PATCH V2 1/2] RISC-V: Add C intrinsics of Scalar Crypto Extension

2023-12-07 Thread Liao Shihua
This patch adds C intrinsics for Scalar Crypto Extension. gcc/ChangeLog: * config.gcc: Add riscv_crypto.h. * config/riscv/riscv_crypto.h: New file. gcc/testsuite/ChangeLog: * gcc.target/riscv/scalar_crypto_intrinsic-32.c: New test. *

[PATCH V2 0/2] RISC-V: Add intrinsics for Bitmanip and Scalar Crypto extensions

2023-12-07 Thread Liao Shihua
RV intrinsics to the builtin names within GCC. Liao Shihua (2): Add C intrinsics of Scalar Crypto Extension Add C intrinsics of Bitmanip Extension gcc/config.gcc| 2 +- gcc/config/riscv/riscv-builtins.cc| 22 ++ gcc/config/riscv/riscv-ftypes.

[PATCH 2/2] RISC-V: Add C intrinsics of Bitmanip Extension

2023-12-05 Thread Liao Shihua
This patch adds C intrinsics for Bitmanip Extension. RISCV_BUILTIN_NO_PREFIX is a new riscv_builtin_description like RISCV_BUILTIN. But it uses CODE_FOR_##INSN rather than CODE_FOR_riscv_##INSN. Some of the instructions are different to spec, see

[PATCH 1/2] RISC-V: Add C intrinsics of Scalar Crypto Extension

2023-12-05 Thread Liao Shihua
This patch adds C intrinsics for Scalar Crypto Extension. gcc/ChangeLog: * config.gcc: Add riscv_crypto.h. * config/riscv/riscv_crypto.h: New file. gcc/testsuite/ChangeLog: * gcc.target/riscv/scalar_crypto_intrinsic-1.c: New test. *

[PATCH 0/2] RISC-V: Add intrinsics for Bitmanip and Scalar Crypto extensions.

2023-12-05 Thread Liao Shihua
It's a little patch add just provides a mapping from the RV intrinsics to the builtin names within GCC. Liao Shihua (2): Add C intrinsics of Scalar Crypto Extension Add C intrinsics of Bitmanip Extension gcc/config.gcc| 2 +- gcc/config/riscv/riscv

Re: [PATCH] Add C intrinsics for scalar crypto extension

2023-11-29 Thread Liao Shihua
在 2023/11/29 23:03, Christoph Müllner 写道: On Mon, Nov 27, 2023 at 9:36 AM Liao Shihua wrote: This patch add C intrinsics for scalar crypto extension. Because of riscv-c-api (https://github.com/riscv-non-isa/riscv-c-api-doc/pull/44/files) includes zbkb/zbkc/zbkx's intrinsics in bit

[PATCH] Add C intrinsics for scalar crypto extension

2023-11-27 Thread Liao Shihua
This patch add C intrinsics for scalar crypto extension. Because of riscv-c-api (https://github.com/riscv-non-isa/riscv-c-api-doc/pull/44/files) includes zbkb/zbkc/zbkx's intrinsics in bit manipulation extension, this patch only support zkn*/zks*'s intrinsics. gcc/ChangeLog: *

[PATCH] Add bfloat16_t support for riscv

2023-06-15 Thread Liao Shihua
x86_64/i686/AArch64 has for a few months working std::bfloat16_t support, __bf16 there is no longer a storage only type, but can be used for arithmetics and is supported in libgcc and libstdc++. The patch adds similar support for RISC-V. __bf16 has been merged in psABI. The

Re: [RFC] RISC-V: Support risc-v bfloat16 This patch support bfloat16 in riscv like x86_64 and arm.

2023-06-01 Thread Liao Shihua
upport bfloat16_t in RISC-V port, but Zfbf extension's patch will be sent after it released. Liao Shihua 在 2023/6/1 14:51, Jin Ma 写道: hi, Are there any new developments about Zfb? Are there any plans to implement the Zvfbfmin and Zvfbfwma expansion? I see that Zfb is being reviewed in llvm, maybe we

Re: [RFC V2] RISC-V : Support rv64 ilp32

2023-05-19 Thread Liao Shihua
I was negligent and will make improvements in the next patch. Best Regards Liao Shihua

[RFC V2] RISC-V : Support rv64 ilp32

2023-05-18 Thread Liao Shihua
This patch support ilp32 on rv64. It remove option check when -march=rv64* -mabi=ilp32. And replace XLEN_SPEC in LINK_SPEC by ABI_LEN_SPEC. In addition, it some machine descriptions. The series kernel support in this link.

[RFC] RISC-V: Support risc-v bfloat16 This patch support bfloat16 in riscv like x86_64 and arm.

2023-03-07 Thread Liao Shihua
According to https://github.com/riscv/riscv-bfloat16 , zfbfmin extension depends on zfh/zfhmin extension. According to the discussion https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/367, this use __bf16 and use DF16b in riscv_mangle_type like x86. gcc\ChangeLog: *

[PATCH V3 4/5] RISC-V: Implement ZKNH extension

2023-02-20 Thread Liao Shihua
This patch supports Zknh extension. It includes instruction's machine description and built-in funtions. gcc/ChangeLog: * config/riscv/crypto.md (riscv_sha256sig0_): Add ZKNH's instructions. (riscv_sha256sig1_): (riscv_sha256sum0_): (riscv_sha256sum1_):

[PATCH V3 2/5] RISC-V: Implement ZBKB, ZBKC and ZBKX extensions

2023-02-20 Thread Liao Shihua
This patch supports Zkbk, Zbkc and Zkbx extension. It includes instruction's machine description and built-in funtions. It is worth mentioning that this patch only adds instructions in Zbkb but no longer in Zbb. If any instructions both in Zbb and Zbkb, they will be generated by code generator

[PATCH V3 3/5] RISC-V: Implement ZKND and ZKNE extensions

2023-02-20 Thread Liao Shihua
This patch supports Zkne and Zknd extension. It includes instruction's machine description and built-in funtions. gcc/ChangeLog: * config/riscv/constraints.md (D03): Add constants of bs and rnum. (DsA): * config/riscv/crypto.md (riscv_aes32dsi): Add ZKND's and ZKNE's

[PATCH V3 1/5] RISC-V: Add prototypes for RISC-V Crypto built-in functions

2023-02-20 Thread Liao Shihua
This patch adds prototypes for RISC-V Crypto built-in functions. gcc/ChangeLog: * config/riscv/riscv-builtins.cc (RISCV_FTYPE_NAME2): (RISCV_FTYPE_NAME3): (RISCV_ATYPE_QI): (RISCV_ATYPE_HI): (RISCV_FTYPE_ATYPES2): (RISCV_FTYPE_ATYPES3): *

[PATCH V3 0/5] RISC-V: Implement Scalar Cryptography Extension

2023-02-20 Thread Liao Shihua
/v1.0.0-scalar It works by Wu Siyu and Liao Shihua . Liao Shihua (5): Add prototypes for RISC-V Crypto built-in functions Implement ZBKB, ZBKC and ZBKX extensions Implement ZKND and ZKNE extensions Implement ZKNH extension Implement ZKSH and ZKSED extensions gcc/config/riscv/bitmanip.md

[PATCH V3 5/5] RISC-V: Implement ZKSH and ZKSED extensions

2023-02-20 Thread Liao Shihua
This patch supports Zksh and Zksed extension. It includes instruction's machine description and built-in funtions. gcc/ChangeLog: * config/riscv/crypto.md (riscv_sm3p0_): Add ZKSED's and ZKSH's instructions. (riscv_sm3p1_): (riscv_sm4ed_): (riscv_sm4ks_):

Re: Re: [PATCH V2 0/5] RISC-V: Implement Scalar Cryptography Extension

2023-02-16 Thread shihua
OK, I will send another one which remove riscv_scalar_crypto.h and update testcases with __builtin_riscv_XX -原始邮件- 发件人: "Kito Cheng" 发送时间: 2023-02-16 21:28:34 (星期四) 收件人: "Liao Shihua" 抄送: gcc-patches@gcc.gnu.org, jia...@iscas.ac.cn, m...@iki.fi, pal...

[PATCH V2 2/5] Implement ZBKB, ZBKC and ZBKX extensions

2023-02-15 Thread Liao Shihua
This patch support Zkbk, Zbkc and Zkbx extension. It includes instruction's machine description, built-in funtion, and intrinsics. It is worth mentioning that this patch only adds instructions in Zbkb but no longer in Zbb. If any instructions both in Zbb and Zbkb, they will be generated by

[PATCH V2 4/5] Implement ZKNH extensions

2023-02-15 Thread Liao Shihua
This patch support Zknh extension. It includes instruction's machine description, built-in funtion, and intrinsics. gcc/ChangeLog: * config/riscv/crypto.md (riscv_sha256sig0_):Add ZKNH's instructions. (riscv_sha256sig1_): Likewise. (riscv_sha256sum0_): Likewise.

[PATCH V2 3/5] Implement ZKND and ZKNE extensions

2023-02-15 Thread Liao Shihua
This patch support Zkne and Zknd extension. It includes instruction's machine description, built-in funtion, and intrinsics. gcc/ChangeLog: * config/riscv/constraints.md (D03): New constraints of bs. (DsA):New constraints of rnum. * config/riscv/crypto.md

[PATCH V2 0/5] RISC-V: Implement Scalar Cryptography Extension

2023-02-15 Thread Liao Shihua
can be found here: https://github.com/riscv/riscv-crypto/releases/tag/v1.0.0-scalar https://github.com/riscv-non-isa/riscv-c-api-doc/pull/31 It works by Wu Siyu and Liao Shihua . Liao Shihua (5): Add prototypes for RISC-V Crypto built-in functions Implement ZBKB, ZBKC and ZBKX extensions

[PATCH V2 5/5] Implement ZKSH and ZKSED extensions

2023-02-15 Thread Liao Shihua
This patch support Zksh and Zksed extension. It includes instruction's machine description, built-in funtion, and intrinsics. gcc/ChangeLog: * config/riscv/crypto.md (riscv_sm3p0_): Add ZKSH's and ZKSED's instructions. (riscv_sm3p1_): Likewise. (riscv_sm4ed_):

[PATCH V2 1/5] Add prototypes for RISC-V Crypto built-in functions

2023-02-15 Thread Liao Shihua
gcc/ChangeLog: * config/riscv/riscv-builtins.cc (RISCV_FTYPE_NAME2): New enumeration identifier. (RISCV_FTYPE_NAME3): Likewise. (RISCV_ATYPE_QI): New Argument types. (RISCV_ATYPE_HI): Likewise. (RISCV_FTYPE_ATYPES2): New RISCV_ATYPE.

[PATCH V2 2/5] Implement ZBKB, ZBKC and ZBKX extensions

2023-02-15 Thread Liao Shihua
This patch support Zkbk, Zbkc and Zkbx extension. It includes instruction's machine description, built-in funtion, and intrinsics. It is worth mentioning that this patch only adds instructions in Zbkb but no longer in Zbb. If any instructions both in Zbb and Zbkb, they will be generated by

[PATCH V2 4/5] Implement ZKNH extensions

2023-02-15 Thread Liao Shihua
This patch support Zknh extension. It includes instruction's machine description, built-in funtion, and intrinsics. gcc/ChangeLog: * config/riscv/crypto.md (riscv_sha256sig0_):Add ZKNH's instructions. (riscv_sha256sig1_): Likewise. (riscv_sha256sum0_): Likewise.

[PATCH V2 0/5] RISC-V: Implement Scalar Cryptography Extension

2023-02-15 Thread Liao Shihua
can be found here: https://github.com/riscv/riscv-crypto/releases/tag/v1.0.0-scalar https://github.com/riscv-non-isa/riscv-c-api-doc/pull/31 It works by Wu Siyu and Liao Shihua . Liao Shihua (5): Add prototypes for RISC-V Crypto built-in functions Implement ZBKB, ZBKC and ZBKX extensions

[PATCH V2 5/5] Implement ZKSH and ZKSED extensions

2023-02-15 Thread Liao Shihua
This patch support Zksh and Zksed extension. It includes instruction's machine description, built-in funtion, and intrinsics. gcc/ChangeLog: * config/riscv/crypto.md (riscv_sm3p0_): Add ZKSH's and ZKSED's instructions. (riscv_sm3p1_): Likewise. (riscv_sm4ed_):

[PATCH V2 3/5] Implement ZKND and ZKNE extensions

2023-02-15 Thread Liao Shihua
This patch support Zkne and Zknd extension. It includes instruction's machine description, built-in funtion, and intrinsics. gcc/ChangeLog: * config/riscv/constraints.md (D03): New constraints of bs. (DsA):New constraints of rnum. * config/riscv/crypto.md

[PATCH 1/5] Add prototypes for RISC-V Crypto built-in functions

2023-02-15 Thread Liao Shihua
Co-Authored-By: SiYu Wu --- gcc/config/riscv/riscv-builtins.cc | 8 gcc/config/riscv/riscv-ftypes.def | 10 ++ 2 files changed, 18 insertions(+) diff --git a/gcc/config/riscv/riscv-builtins.cc b/gcc/config/riscv/riscv-builtins.cc index 25ca407f9a9..ded91e17554 100644 ---

[PATCH 2/5] RISC-V: Implement ZBKB, ZBKC and ZBKX extensions

2023-02-13 Thread Liao Shihua
Implement ZBKB, ZBKC and ZBKX extensions. ZBKB is Bitmanip instructions for Cryptography. ZBKC is Carry-less multiply instructions. ZBKX is Crossbar permutation instructions. Only add Machine description and intrinsics of these instructions which are not defined in the first

[PATCH 3/5] RISC-V: Implement ZKND and ZKNE extensions

2023-02-13 Thread Liao Shihua
Implement ZKND and ZKNE extensions. ZKND is NIST Suite: AES Decryption. ZKNE is NIST Suite: AES Encryption. gcc/ChangeLog: * config/riscv/constraints.md (D03): New constraints of bs. (DsA):New constraints of rnum. * config/riscv/crypto.md

[PATCH 5/5] RISC-V: Implement ZKSH and ZKSED extensions

2023-02-13 Thread Liao Shihua
Implement ZKSH and ZKSED extensions. ZKSH is ShangMi Suite: SM3 Hash Function Instructions. ZKSED is ShangMi Suite: SM4 Block Cipher Instructions. gcc/ChangeLog: * config/riscv/crypto.md (riscv_sm3p0_): Add ZKSH's and ZKSED's instructions. (riscv_sm3p1_):

[PATCH 1/5] RISC-V: Add prototypes for RISC-V Crypto built-in functions

2023-02-13 Thread Liao Shihua
Add prototypes for RISC-V Crypto built-in functions . gcc/ChangeLog: * config/riscv/riscv-builtins.cc (RISCV_FTYPE_NAME2): New enumeration identifier. (RISCV_FTYPE_NAME3): Likewise. (RISCV_ATYPE_QI): New Argument types. (RISCV_ATYPE_HI): Likewise.

[PATCH 4/5] RISC-V: Implement ZKNH extensions

2023-02-13 Thread Liao Shihua
Implement ZKNH extensions. ZKNH is NIST Suite: Hash Function Instructions. gcc/ChangeLog: * config/riscv/crypto.md (riscv_sha256sig0_):Add ZKNH's instructions. (riscv_sha256sig1_): Likewise. (riscv_sha256sum0_): Likewise. (riscv_sha256sum1_):

[PATCH 0/5] RISC-V: Implement Scalar Cryptography Extension

2023-02-13 Thread Liao Shihua
This patch implement RISC-V Scalar Cryptography extension. It includes machine descrption , intrinsic and testcase . Liao Shihua (5): Add prototypes for RISC-V Crypto built-in functions Implement ZBKB, ZBKC and ZBKX extensions Implement ZKND and ZKNE extensions Implement ZKNH

[PATCH 0/5] RISC-V: Implement Scalar Cryptography Extension

2023-02-13 Thread Liao Shihua
This patch implement RISC-V Scalar Cryptography extension. It includes machine descrption , intrinsic and testcase . Liao Shihua (5): Add prototypes for RISC-V Crypto built-in functions Implement ZBKB, ZBKC and ZBKX extensions Implement ZKND and ZKNE extensions Implement ZKNH

Re: [RFC]RISC-V: Support RV64-ILP32

2022-12-27 Thread Liao Shihua
could easier test that? On Wed, Dec 28, 2022 at 2:25 AM Palmer Dabbelt wrote: On Tue, 27 Dec 2022 10:24:10 PST (-0800), gcc-patches@gcc.gnu.org wrote: On 12/12/22 23:49, shi...@iscas.ac.cn wrote: From: Liao Shihua This patch support rv64 insn in ilp32 ABI. It was inspired by aarch64

[RFC v2] Support RV64-ILP32

2022-12-27 Thread shihua
From: Liao Shihua patch v1<https://gcc.gnu.org/pipermail/gcc-patches/2022-December/608370.html> 1. use ABI_LEN_SPEC instead of ABI_LEN_SPEC This patch support rv64 insn in ilp32 ABI. It was inspired by aarch64 both support 64-bit and 32-bit ABI with the same set of instru

[RFC]RISC-V: Support RV64-ILP32

2022-12-12 Thread shihua
From: Liao Shihua This patch support rv64 insn in ilp32 ABI. It was inspired by aarch64 both support 64-bit and 32-bit ABI with the same set of instructions. gcc/ChangeLog: * config.gcc: Implememt ilp32* with rv64*. * config/riscv/riscv.cc (riscv_option_override

Re:[PATCH 1/1] RISC-V: Make R_RISCV_SUB6 conforms to riscv abi standard

2022-11-11 Thread shihua
LGTM,and I think it would be better to have a test example. > From: zengxiao > > This patch makes R_RISCV_SUB6 conforms to riscv abi standard. > R_RISCV_SUB6 only the lower 6 bits of the code are valid. > The proposed specification which can be found in 8.5. Relocations of, >

[Bug tree-optimization/106888] [RISCV] Negative optimization that excess andi instructions are generated in gcc.dg/pr90838.c

2022-09-08 Thread shihua at iscas dot ac.cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106888 --- Comment #1 from shihua at iscas dot ac.cn --- This patch is https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=c23a9c87cc62bd177fd0d4db6ad34b34e1b9a31f

[Bug regression/106888] New: [RISCV] Excess andi instructions are generated in gcc.dg/pr90838.c

2022-09-08 Thread shihua at iscas dot ac.cn via Gcc-bugs
Priority: P3 Component: regression Assignee: unassigned at gcc dot gnu.org Reporter: shihua at iscas dot ac.cn Target Milestone: --- After this patch( https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=c23a9c87cc62bd177fd0d4db6ad34b34e1b9a31f),gcc.dg/pr90838.c

[PATCH 1/1 V5] RISC-V: Support Zmmul extension

2022-07-12 Thread shihua
From: LiaoShihua gcc/ChangeLog: * common/config/riscv/riscv-common.cc: Add Zmmul. * config/riscv/riscv-opts.h (MASK_ZMMUL): New. (TARGET_ZMMUL): Ditto. * config/riscv/riscv.cc (riscv_option_override):Ditto. * config/riscv/riscv.md: Add Zmmul *

[PATCH 0/1 V5] RISC-V: Support Zmmul extension

2022-07-12 Thread shihua
From: LiaoShihua Zmmul extension is Multiply only extension for RISC-V.It implements the multiplication subset of the M extension. The encodings are identical to those of the corresponding M-extension instructions. LiaoShihua (1): RISC-V: Support Zmmul extension

[PATCH 0/1 V4] RISC-V: Support Zmmul extension

2022-07-12 Thread shihua
From: LiaoShihua Zmmul extension is Multiply only extension for RISC-V.It implements the multiplication subset of the M extension. The encodings are identical to those of the corresponding M-extension instructions. When You both use M extension add Zmmul extension, it will warning

[PATCH 1/1 V4] RISC-V: Support Zmmul extension

2022-07-12 Thread shihua
From: LiaoShihua gcc\ChangeLog: * common/config/riscv/riscv-common.cc: Add zmmul. * config/riscv/riscv-opts.h (MASK_ZMMUL): New. (TARGET_ZMMUL): Ditto. * config/riscv/riscv.cc (riscv_option_override): Prohibit division if Zmmul is present. *

[PATCH 1/1 V3] RISC-V: Support Zmmul extension

2022-07-11 Thread shihua
From: LiaoShihua gcc/ChangeLog: * common/config/riscv/riscv-common.cc: * config/riscv/riscv-c.cc (riscv_cpu_cpp_builtins): * config/riscv/riscv-opts.h (MASK_ZMMUL): (TARGET_ZMMUL): * config/riscv/riscv.cc (riscv_option_override): *

[PATCH 0/1 V3] RISC-V: Support Zmmul extension

2022-07-11 Thread shihua
From: LiaoShihua Zmmul extension is Multiply only extension for RISC-V.It implements the multiplication subset of the M extension. The encodings are identical to those of the corresponding M-extension instructions. When You both use M extension add Zmmul extension, it will warning

[PATCH] RISC-V: Implement ZTSO extension.

2022-03-15 Thread shihua
From: LiaoShihua ZTSO is the extension of tatol store order model. This extension adds no new instructions to the ISA, and you can use it with arch "ztso". If you use it, TSO flag will be generate in the ELF header. gcc/ChangeLog: *

[PATCH] RISC-V: Handle combine extension in canonical ordering.

2022-03-07 Thread shihua
From: LiaoShihua The crypto extension have several shorthand extensions that don't consist of any extra instructions. Take zk for example, while the extension would imply zkn, zkr, zkt. The 3 extensions should also combine back into zk to maintain the canonical order in isa strings. This

[PATCH 3/5 V1] RISC-V:Implement intrinsics for Crypto extension

2022-02-23 Thread shihua
From: LiaoShihua These headers are in https://github.com/rvkrypto/rvkrypto-fips . gcc/ChangeLog: * config.gcc: Add extra_headers. * config/riscv/riscv_crypto.h: New file. * config/riscv/riscv_crypto_scalar.h: New file. * config/riscv/rvk_asm_intrin.h:

[PATCH 4/5 V1] RISC-V:Implement testcases for Crypto extension

2022-02-23 Thread shihua
From: LiaoShihua These testcases use intrinsics . gcc/testsuite/ChangeLog: * gcc.target/riscv/zbkb32.c: New test. * gcc.target/riscv/zbkb64.c: New test. * gcc.target/riscv/zbkc32.c: New test. * gcc.target/riscv/zbkc64.c: New test. *

[PATCH 1/5 V1] RISC-V:Implement instruction patterns for Crypto extension

2022-02-23 Thread shihua
..591066fac3b --- /dev/null +++ b/gcc/config/riscv/crypto.md @@ -0,0 +1,383 @@ +;; Machine description for K extension. +;; Copyright (C) 2022 Free Software Foundation, Inc. +;; Contributed by SiYu Wu (s...@isrc.iscas.ac.cn) and ShiHua Liao (shi...@iscas.ac.cn). + +;; This file is part of GCC. + +;; GCC

[PATCH 2/5 V1] RISC-V:Implement built-in instructions for Crypto extension

2022-02-23 Thread shihua
From: LiaoShihua gcc/ChangeLog: * config/riscv/riscv-builtins.cc (RISCV_FTYPE_NAME2): Defined new function prototypes. (RISCV_FTYPE_NAME3): Ditto. (AVAIL): Defined new riscv_builtin_avail for crypto extension. (RISCV_ATYPE_SI): Defined new argument type.

[PATCH 0/5 V1] RISC-V:Implement Crypto extension's instruction patterns and it's intrinsics

2022-02-23 Thread shihua
. The definitions of intrinsic functions come from https://github.com/rvkrypto/rvkrypto-fips . This work is done by Liao Shihua and Wu Siyu. LiaoShihua (5): RISC-V:Implement instruction patterns for Crypto extensions RISC-V:Implement built-in instructions for Crypto extensions RISC-V:Implement

[PATCH 5/5 V1] RISC-V:Implement architecture extension test macros for Crypto extension

2022-02-23 Thread shihua
From: LiaoShihua gcc/ChangeLog: * config/riscv/riscv-c.cc (riscv_cpu_cpp_builtins):Add __riscv_zks, __riscv_zk, __riscv_zkn gcc/testsuite/ChangeLog: * gcc.target/riscv/predef-17.c: New test. --- gcc/config/riscv/riscv-c.cc| 9

[PATCH] RISC-V:Add support for ZMMUL extension

2022-02-13 Thread shihua
From: LiaoShihua ZMMUL extension is Multiply only extension for RISC-V.It implements the multiplication subset of the M extension. The encodings are identical to those of the corresponding M-extension instructions. When You both use M extension add ZMMUL extension, it will

[PATCH] RISC-V: Update testcases info with new implement info

2022-01-19 Thread shihua
From: LiaoShihua After commit 591b6e00d1bfe12932ca31530d5859f95db8a35a " riscv: fix -Wformat-diag errors ", some strings in implement was changed. This patch update the check info in testcases to sync with it. gcc/testsuite/ChangeLog: * gcc.target/riscv/arch-9.c: Update the

[PATCH 1/1] Fixed fast_float build error in NEWLIB

2022-01-18 Thread shihua
From: LiaoShihua When I built riscv-gcc with newlib, it will be terminated with message "fatal error: endian.h: No such file or directory". So, fixed it in fast_float.h. libstdc++-v3\ChangeLog: * src/c++17/fast_float/fast_float.h (defined):fast_float.h will include with using newlib

[Bug c/103872] New: testcase fail in gcc.dg/analyzer/pr103526.c on riscv64-unknown-elf-gcc

2021-12-30 Thread shihua at iscas dot ac.cn via Gcc-bugs
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: shihua at iscas dot ac.cn Target Milestone: --- analyzer can not properly detects the non-free'd pointer as escaping via the return value in riscv*-**-gcc riscv64-unknown-elf-gcc

[PATCH] fixed testcase fail in pr102892-2.c fixed tesccase fail in gcc.dg/pr102892-1.c

2021-12-29 Thread shihua
From: LiaoShihua * gcc.dg/pr102892-2.c: Add definition of function foo() which declared in pr102892-1.c --- gcc/testsuite/gcc.dg/pr102892-2.c | 5 + 1 file changed, 5 insertions(+) diff --git a/gcc/testsuite/gcc.dg/pr102892-2.c b/gcc/testsuite/gcc.dg/pr102892-2.c index

[PATCH] fixed testcase fail gcc.dg/analyzer/pr103526.c leak

2021-12-29 Thread shihua
From: LiaoShihua following 'false' branch in line 20, 'tmp.word_state' leaks in line 26. So free 'tmp.word_state' before return 'rval'. gcc/testsuite\ChangeLog: * gcc.dg/analyzer/pr103526.c: --- gcc/testsuite/gcc.dg/analyzer/pr103526.c | 3 ++- 1 file changed, 2 insertions(+),

[PATCH V2] fixed testcase riscv/pr103302.c

2021-12-23 Thread shihua
From: LiaoShihua because riscv32 not support __int128, so skip if int128 not support. gcc/testsuite\ChangeLog: * gcc.target/riscv/pr103302.c: skip if int128 not support --- gcc/testsuite/gcc.target/riscv/pr103302.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH] fixed testcase riscv/pr103302.c

2021-12-22 Thread shihua
From: LiaoShihua because riscv32 not support __int128, so skip if -march=rv32*. gcc/testsuite\ChangeLog: * gcc.target/riscv/pr103302.c: skip if -march=rv32* --- gcc/testsuite/gcc.target/riscv/pr103302.c | 1 + 1 file changed, 1 insertion(+) diff --git

RISCV: Add zmmul extension

2021-10-26 Thread shihua
From: Liaoshihua --- gcc/common/config/riscv/riscv-common.c | 3 +++ gcc/config/riscv/riscv-c.c | 2 +- gcc/config/riscv/riscv-opts.h | 3 +++ gcc/config/riscv/riscv.c | 5 - gcc/config/riscv/riscv.md | 30 +-