From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id BE2373858D28 for ; Tue, 1 Aug 2023 13:44:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BE2373858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3110ab7110aso5816044f8f.3 for ; Tue, 01 Aug 2023 06:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690897452; x=1691502252; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:cc:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=EG3I2SNftFt3+OQmnQdOXxbSF3KSEVltVN8XGmSuj2c=; b=WADyHPgkuwhLLE4Jcr4USGby8Q8/M8UsJ3Drku5TNCYg7GK0O3GrVaPMx7Mq3s6gja DeZA4rlkYXvYk6EepEOEjrqqTPwEVpgzKr3FXP/o1aot9Oc5qdiZhTNpQ5Chx+sHmGP+ fy8gV/jCQtbsbW8WRoTKcy8L/DaXSh3tRpVrwN94yrL/26+f3fP/RbHVr9srHsnqJONw rLF9TKHby1QMsPLsXrEJLgPwAedfKldu5jE9C9MXDIi92f5GMQCIV8l7PjeNePKkdoVS t1lMM7/ih9jEMVV7+P8jy05nz7ytgOPTl4J4HB9SZQuc2oliprRcK6rQMe6UD10KfueH x1lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690897452; x=1691502252; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:cc:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EG3I2SNftFt3+OQmnQdOXxbSF3KSEVltVN8XGmSuj2c=; b=W1aJS5j1jVn2fX8oBODXQSUWGmq0W09rCZ0QfrNSaSMh3xIl1D/7Pyp9M4I+E4g9bH ruTQ8WrmHiHKtr5iK2iV7PUO7aKT/MqVBaS5RoTqmp6OM1HLfBn0+DQUwuqgJ/TfEcwr ADcVvKijyX5/CkAdawhbbfdyMjTa6lE/rZZmt8mdFS02ag6q9DtzgdlhSv+fM4ukNkjQ SUguWjd85bXeUqRdrZl7IVi8YLtwwkUDpO8RpDmZOF5MU70ViXZ7Vpx0uT7SDUbv9ZXl llZeJeZTNJlhNLAzPNMSiKUPR81O9AoY+QY0rsGk+W6NuIueiHU+fhgAPJmUBFOSocDm Qjkg== X-Gm-Message-State: ABy/qLantMOFcz2r0VtdwOV8HB8T7ORC+KruURl2P5pVghQBxWR82Tn0 n4+iMsODb7Q0OY/FZUyLbME= X-Google-Smtp-Source: APBJJlGEBsqUkxPBbLHDhlSXyIQvhHQZwUi+r+H8wWvA8kNDOJv4TuemgMuvx6/wj2R1+xPy/qt8Vg== X-Received: by 2002:adf:ef05:0:b0:317:5252:57e7 with SMTP id e5-20020adfef05000000b00317525257e7mr2445703wro.21.1690897452110; Tue, 01 Aug 2023 06:44:12 -0700 (PDT) Received: from [192.168.1.23] (ip-046-005-130-086.um12.pools.vodafone-ip.de. [46.5.130.86]) by smtp.gmail.com with ESMTPSA id t8-20020adff048000000b00317878d83c6sm14036528wro.72.2023.08.01.06.44.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Aug 2023 06:44:11 -0700 (PDT) Message-ID: Date: Tue, 1 Aug 2023 15:44:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: rdapp.gcc@gmail.com Subject: Re: RISCV test infrastructure for d / v / zfh extensions Content-Language: en-US To: Joern Rennecke , GCC Patches References: From: Robin Dapp In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Joern, thanks, I believe this will help with testing. > +proc check_effective_target_riscv_v { } { > + return [check_no_compiler_messages riscv_ext_v assembly { > + #ifndef __riscv_v > + #error "Not __riscv_v" > + #endif > + }] > +} This can be replaced by riscv_vector or vice versa. > +# Return 1 if we can execute code when using dg-add-options riscv_v > + > +proc check_effective_target_riscv_v_ok { } { > + # If the target already supports v without any added options, > + # we may assume we can execute just fine. > + if { [check_effective_target_riscv_v] } { > + return 1 > + } > + > + # check if we can execute vector insns with the given hardware or > + # simulator > + set gcc_march [regsub {[[:alnum:]]*} [riscv_get_arch] &v] > + if { [check_runtime ${gcc_march}_exec { > + int main() { asm("vsetivli t0, 9, e8, m1, tu, ma"); return 0; } } "-march=${gcc_march}"] } { > + return 1 > + } > + > + # Possible future extensions: If the target is a simulator, dg-add-options > + # might change its config to make it allow vector insns, or we might use > + # options to set special elf flags / sections to effect that. > + > + return 0 > +} So in general we would add {dg-add-options riscv_v} for every test that requires compile-time vector support? For a run test we would check {dg-require-effective-target riscv_v_ok} before? Would it make sense to skip the first check here (check_effective_target_riscv_v) so we have a proper runtime check? Right now we assume the runtime can execute vector instructions if the compiler can emit them. You could replace riscv_vector_hw and riscv_zvfh_hw by your versions then and we'd have a clear separation between runtime and compile time. We would just need to make sure not to add "v" twice if it's already in the march string. > + if { [string equal $gcc_march "imafd"] } { > + set gcc_march "g" > + } Wouldn't we want to always replace "imafd" with "g" for simplicity/consistency and not just the exact string? > +proc add_options_for_riscv_v { flags } { > + if { [lsearch $flags -march=*] >= 0 } { > + # If there are multiple -march flags, we have to adjust all of them. > + # ??? Is there a way to make the match specific to a full list element? > + # as it is, we might match something inside a string. > + return [regsub -all -- {(-march=rv[[:digit:]]*[a-rt-uwy]*)v*} $flags \\1v ] Is iterating over the list elements and returning a new list not an option? Or would that break something else? Regards Robin