From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 182FC3858D28 for ; Wed, 15 Feb 2023 18:42:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 182FC3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676486557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FiYzONYZYFRgM/LGhldG71OUJ5B+HXseneB3fTMeHBA=; b=BAnhWJJpSrXZn4fmnE0ENwia0yWG7BX2YXh25BfI2UorWgTdY9k3XGluDaHk79rRxZODB9 jxBdGcJ5T8zbzDegSmCB/enutmYxpncIQ87tvMQOHIv3bBfF65pl2hFTOQgJL6h55Faql0 vWzMM/8O6pvf8oSR75Pt3OkU7iFOyN4= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-668-tQfYyyQdMbCLgoa8-3dJ7w-1; Wed, 15 Feb 2023 13:42:36 -0500 X-MC-Unique: tQfYyyQdMbCLgoa8-3dJ7w-1 Received: by mail-qt1-f198.google.com with SMTP id c16-20020ac85190000000b003b841d1118aso11676879qtn.17 for ; Wed, 15 Feb 2023 10:42:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FiYzONYZYFRgM/LGhldG71OUJ5B+HXseneB3fTMeHBA=; b=HYeNC/BIfX4IwLDMbajpOkHCFviH4W6fAXsKpU5sWjo95RB2rIP+Sta4t2G2bqr5ID I4SizvDPkJ1q3UZIsPaLHdCrO/exZpXxcQiCOYs2ZhtNW3GGBbio9P1sLRhWIeJl4n7n QUYpXK9NQ7fTihtcsRk93ODDWIsmmJXtZTJhRFc7zjyfUYSvJcBB4E3WbaaA+orMVk2g 0Sc4T+RGlVlXKYjvV+leTb1nrIds9SmEAKkhiBc3+A9N6mKmW/9kmZz7FzIFtFn+y2nN dOBzV2l55nEVFr3IGMUnwk9kzCKqtSp3NVzoMfkNQQehQK/AqonMMqF+8d0+uMlb6zO0 2zvQ== X-Gm-Message-State: AO0yUKW3ouKWL+NolIVXzugawDEgoNVMQwGFWjkCeHgPvyEHw3ncclAa 4q7H1DXmD24jVRbjZNYoXW1OIDUMqIZZSrG8lST/DhWN72D8l9LUSePT/frlezbfJJpA6yxJDfb iV483sJbrsbGZwzIDqQ== X-Received: by 2002:a05:622a:15c1:b0:3b7:fb35:9163 with SMTP id d1-20020a05622a15c100b003b7fb359163mr4260531qty.30.1676486556207; Wed, 15 Feb 2023 10:42:36 -0800 (PST) X-Google-Smtp-Source: AK7set9cW339n+Azw+satBZAmeSRDHLeVBX/V3t5XMZJSs7quvz+vyZhcc9GUympw7pb4+7zly8Fpg== X-Received: by 2002:a05:622a:15c1:b0:3b7:fb35:9163 with SMTP id d1-20020a05622a15c100b003b7fb359163mr4260504qty.30.1676486555936; Wed, 15 Feb 2023 10:42:35 -0800 (PST) Received: from ?IPV6:2607:fea8:a263:f600::de2a? ([2607:fea8:a263:f600::de2a]) by smtp.gmail.com with ESMTPSA id l67-20020a37bb46000000b0071d0f1d01easm14362913qkf.57.2023.02.15.10.42.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Feb 2023 10:42:35 -0800 (PST) Message-ID: Date: Wed, 15 Feb 2023 13:42:33 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH 1/2]middle-end: Fix wrong overmatching of div-bitmask by using new optabs [PR108583] From: Andrew MacLeod To: Tamar Christina , Richard Biener , Richard Sandiford Cc: Tamar Christina via Gcc-patches , nd , "jlaw@ventanamicro.com" References: <77142b9b-7af8-eb04-e596-6dd2f97aff9a@redhat.com> In-Reply-To: <77142b9b-7af8-eb04-e596-6dd2f97aff9a@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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: On 2/15/23 12:50, Andrew MacLeod wrote: > > On 2/15/23 12:13, Tamar Christina wrote: >>> On 2/15/23 07:51, Tamar Christina wrote: > void > operator_plus::wi_fold (irange &r, tree type, >                         const wide_int &lh_lb, const wide_int &lh_ub, >                         const wide_int &rh_lb, const wide_int &rh_ub) > const > { >   wi::overflow_type ov_lb, ov_ub; >   signop s = TYPE_SIGN (type); > >   // Do whatever wideint magic is required to do this adds in higher > precision >   wide_int new_lb = wi::add (lh_lb, rh_lb, s, &ov_lb); >   wide_int new_ub = wi::add (lh_ub, rh_ub, s, &ov_ub); > >   r = int_range<2> (type, new_lb, new_ub); > } > > > The operator needs to be registered, I've attached the skeleton for > it.  you should just have to finish implementing wi_fold(). > > in theory :-) > You also mentioned earlier that some were tree codes, some were internal function calls?  We have some initial support for built in functions, but I am not familiar with all the various forms they can take.  We currently support CFN_ functions in   gimple-range-op.cc, gimple_range_op_handler::maybe_builtin_call () Basically this is part of a "gimple_range_op_handler"  wrapper for range-ops which can provide a range-ops class for stmts that don't map to a binary or unary form.. such as built in functions. If you get to the point where you need this for a builtin function, I can help you through that too.  Although someone may have to also help me through what differentiates the different kinds of internal function :-)    I presume they are all similar in some way. Andrew