From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpbguseast2.qq.com (smtpbguseast2.qq.com [54.204.34.130]) by sourceware.org (Postfix) with ESMTPS id C46ED3858D35 for ; Wed, 6 Sep 2023 09:43:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C46ED3858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai X-QQ-mid: bizesmtp90t1693993414tkehhk9j Received: from [10.101.11.9] ( [121.35.183.224]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 06 Sep 2023 17:43:33 +0800 (CST) X-QQ-SSF: 01400000000000C0F000000A0000000 X-QQ-FEAT: IByDngDI/kGJrzQjXZ+kfnHT7OF+UFWLQtJopnAeRKkpzOxzg81YvBZw2SKqp hsPmwGl3VTkW2J2UkzTZfoYJ7ofphYYXtQG9MjQQY4xM30+8Nr6cgg3UKh+MZpKbYVatI8/ CznmUn2Ek0gTk8fuW74fstp/ktuLtEf9DN1hwofpwrGvkgOO2GYeV3MuP8oIXm5u50+53aZ zjBNzVYVgfNxInluNluQlbyWMDSuup4pACcKGgOX2YtHP5k4iORwvnT0FzXmwyWIBxC7Euv QdJLqQlQ7td4hwsjVgNXvrWvRg5NURq011aICfNVSlaSj/ebvns+5mkTfqdtZleQJ8JFFx4 JkMiaKOzeiFBzXHb07hqEMlDZcZAdxw1kJuTh85+8+uknfD9WfEVMMpwRthxq0/oLY3uccB X-QQ-GoodBg: 2 X-BIZMAIL-ID: 7146260464758631585 Message-ID: <5D71367462E7C90B+1c5abca3-4b8d-4bbd-8565-121586dd1e18@rivai.ai> Date: Wed, 6 Sep 2023 17:43:32 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] RISC-V: Add autovec FP binary operations. Content-Language: en-US To: Robin Dapp , gcc-patches Cc: palmer , Kito Cheng , jeffreyalaw , "juzhe.zhong" References: <46830e7e-c0b5-5f04-56ec-b2347a101001@gmail.com> <3593152A4AF6C445+E892D494-DF60-4B27-928D-14A269989B2B@rivai.ai> From: Lehua Ding In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvrgz:qybglogicsvrgz6a-0 X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA,KAM_DMARC_STATUS,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Robin, > +# Return 1 if the we can build a vector example with proper -march flags > +# and the current target can execute it, 0 otherwise. Cache the result. > + > +proc check_effective_target_riscv_vector_hw { } { > + > + return [check_runtime riscv_vector_hw32 { > + int main (void) > + { > + asm ("vsetivli zero,8,e16,m1,ta,ma"); > + asm ("vadd.vv v8,v8,v16" : : : "v8"); > + return 0; > + } > + } "-march=rv32gcv -mabi=ilp32d"] || [check_runtime riscv_vector_hw64 { > + int main (void) > + { > + asm ("vsetivli zero,8,e16,m1,ta,ma"); > + asm ("vadd.vv v8,v8,v16" : : : "v8"); > + return 0; > + } > + } "-march=rv64gcv -mabi=lp64d"] > +} > + > +# Return 1 if the we can build a Zvfh vector example with proper -march flags > +# and the current target can execute it, 0 otherwise. Cache the result. > + > +proc check_effective_target_riscv_zvfh_hw { } { > + if ![check_effective_target_riscv_vector_hw] then { > + return 0 > + } > + > + return [check_runtime riscv_zvfh_hw32 { > + int main (void) > + { > + asm ("vsetivli zero,8,e16,m1,ta,ma"); > + asm ("vfadd.vv v8,v8,v16" : : : "v8"); > + return 0; > + } > + } "-march=rv32gcv_zvfh -mabi=ilp32d"] > + || [check_runtime riscv_zvfh_hw64 { > + int main (void) > + { > + asm ("vsetivli zero,8,e16,m1,ta,ma"); > + asm ("vfadd.vv v8,v8,v16" : : : "v8"); > + return 0; > + } > + } "-march=rv64gcv_zvfh -mabi=lp64d"] May I ask if the compiler options "-march=rv64gcv_zvfh -mabi=lp64d" should be removed? Because we don't specify -march and -mabi when we run testcase (so but why we need to specify the -march and -mabi in this target check?), we run it with the default values. Assuming that the default is rv64gcv_zvfh_zfh, `riscv_vector` check will fail because compile and link with -march=rv64gcv will throw the following error if I doesn't compile a multilibs compilers. But in fact rv64gcv_zvfh_zfh contains rv64gcv, we should not let this case report link error.: riscv64-unknown-elf-gcc: fatal error: Cannot find suitable multilib set for '-march=rv64imafdcv_zicsr_zifencei_zve32f_zve32x_zve64d_zve64f_zve64x_zvl128b_zvl32b_zvl64b'/'-mabi=lp64d' I think we should use the default march and mabi to check whether we can compile and execute specified instructions. -- Best, Lehua