From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id 21D6C3858C62 for ; Thu, 13 Jul 2023 12:19:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 21D6C3858C62 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-ej1-x632.google.com with SMTP id a640c23a62f3a-9926623e367so100567866b.0 for ; Thu, 13 Jul 2023 05:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689250747; x=1691842747; 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=EYik/0F5TOP9COIYC4Y7BzVu6bMmBIY5m1qqLhRrAk0=; b=CfjMYAICwH/9ky5PKN5+dDjQCxauOu+SfQZwqxACY8G3nhCPIbqbgYgjUch0v3xyEE T8sJa3qJCb2pybqZs2m91VizrjcCnoGfyCiCNgSVlNBhWBLsqxT4SUcz+h7gr/aGMiUR J70n2tHUDeoYX+UR3VcqiDVl+3n1Rv66VBDafEFz3ZI0gFvWJqxC3JgmfnzFydQbwJnx qe8INZ9lwKpGZTzvweIZFOtITeoskDqJZ/iToggJuit9sAsbD/VSRYQwpC9kwjaza9IK mJfjn2PHQVd6IPqAzTOK1O0lKs4xbSsbW4Y4vkhBGtHfIO8BQHqfl2vTO9FqqDnkZDb+ 5qIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689250747; x=1691842747; 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=EYik/0F5TOP9COIYC4Y7BzVu6bMmBIY5m1qqLhRrAk0=; b=FycYvk4gQUtqA0XKBRFS73rvbeaGYuZ+YDdf9RIkiEiUjzAM+U9Pdw03MUO6aqf6/W XpmCRF4kdO/0aauNM73WgV+WQnPa4kev4PY5n2eXin01rtKmzNrQjzUrHgwATeeptMJe AiPZwBagSW4f/z3TrW0zUtUKqZZR4jxZY4MBivqy0rxmpXaECCHiny2t/KuVy0hf4/Gs nf/FUag93erLm/9fyTiPmykuZfQZ4cvTb9BY+HiGxUq8gJ1OVRq0qQ6rIbAvkZq3C6B3 JlMGK8sZA4AG/UWKE2wnPRoFBJdaxA38dODSmJXZqW7d8BKVooJKEJTs3J6t0z8BRZBf G7vA== X-Gm-Message-State: ABy/qLbxdKfSX/Ahhu7HZpcBnaLRSwowqcb0uhMxevSerQBGnc7dO5Tf rNXt05LhpdsDvOl26oNS1HY= X-Google-Smtp-Source: APBJJlHt9U10ow1ctsi6Lz0wDtpLOY25LdnzLhFOGWZta6mPysxRGXqLJ1/+JNuPCM2H5O1GDcm+/w== X-Received: by 2002:a17:906:5e51:b0:973:ca9c:3e43 with SMTP id b17-20020a1709065e5100b00973ca9c3e43mr1197135eju.45.1689250747411; Thu, 13 Jul 2023 05:19:07 -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 a18-20020a17090680d200b00992d70cc8acsm3867805ejx.112.2023.07.13.05.19.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Jul 2023 05:19:06 -0700 (PDT) Message-ID: Date: Thu, 13 Jul 2023 14:19:06 +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, gcc-patches Subject: Re: [PATCH] vect: Handle demoting FLOAT and promoting FIX_TRUNC. Content-Language: en-US To: Richard Biener References: From: Robin Dapp In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.3 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: > Can you add testcases? Also the current restriction is because > the variants you add are not always correct and I don't see any > checks that the intermediate type doesn't lose significant bits? The testcases I wanted to add with a follow-up RISC-V patch but I can also try an aarch64 one. So for my understanding, please correct, we have: promoting int -> float, should always be safe. We currently vectorize this with WIDEN and NONE. demoting float -> int, this is safe as long as the float value can be represented in the int type, otherwise we must trap. We currently vectorize this on x86 using NARROW (regardless of -ftrapping-math) and using NONE only with -fno-trapping-math. demoting int -> float, this is safe as long as the intermediate types can hold the initial value? How is this different to demoting e.g. int64_t -> int8_t? We currently do not vectorize this with either NARROW or NONE. LLVM vectorizes but only with their default(?) -fno-trapping-math. Yet I don't see how we could trap here? promoting float -> int, this is safe as long as the float value can be represented (as above)? We currently vectorize this (regardless of -ftrapping-math) with WIDEN but not NONE. So apart from unifying the -ftrapping-math behavior I think only the third variant is somewhat critical? Regards Robin