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.129.124]) by sourceware.org (Postfix) with ESMTPS id 3905C3858D33 for ; Wed, 22 Feb 2023 16:41:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3905C3858D33 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=1677084115; 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=PDLOvosmOjKaMU4tv/GhHQTqdg10kNLoNbt7teJoJqQ=; b=VtXRZXIznhwPdhLy29AWgUkDi6A6oZqcAuphUa6rm3ZD4Fw28uAo+g2PFt10IwPlm7j2ee qwjE/mqt9zS2Z+9utuv7OSNszmE3K+IMbmwQSn8OI2ZyU4e5FteZgjRxAUkF5QQIsEvM0n Axrs5IzECxYFen0Vl9GdZR8+658pYF8= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-91-ZrZnza8EPPGw4tbQJwKtTg-1; Wed, 22 Feb 2023 11:41:53 -0500 X-MC-Unique: ZrZnza8EPPGw4tbQJwKtTg-1 Received: by mail-qk1-f198.google.com with SMTP id x4-20020a05620a448400b007283b33bfb3so3869123qkp.4 for ; Wed, 22 Feb 2023 08:41:53 -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=PDLOvosmOjKaMU4tv/GhHQTqdg10kNLoNbt7teJoJqQ=; b=Ha6eh8/keO739xnoSfsk3+sQFD5SdbRpU3Zk9I6VbgB/TSsuZSGVuxLfz1lq2hIB2J qlidi9Igl3WDPGgJEX4kSlhRSwVBPW3Jecxy+wnlWdbSn/S9mDkCMpRPNY0bANzKBiDZ Be0IWpAaasXzfido8glVtEQpsu4lOwW3Y8E7Avmcm0LY2EU3JPekbfo3t2bkHqD3v8ki +xnXD3/bBIp2imEpn+MlxtYSUB7EI+HPxSTgysm/QoVJId+K/DLiDmHqO+mxlk30n3y9 WTmf1BblAimsNkLcbJt6MvJ7tLnN0prst2DTZmCGKeaVPCpBSuZLzVziM9jR3G4pOo3F IZvQ== X-Gm-Message-State: AO0yUKW5Izyzx+dNroGtQMLHCXhJQ0WvOuZGyJT692KjMaHQA+E34byu NnrnT2DM0/1XPlahlbYYoYDNbcCnABd7Ya/S+UpoTT0anBVMYr3GMK40XCdzqaCdqDhZpPJ4Lox GSDlx7H/KHPxvILiNDg== X-Received: by 2002:a05:6214:27e9:b0:56e:9dd8:47f3 with SMTP id jt9-20020a05621427e900b0056e9dd847f3mr12406356qvb.13.1677084113397; Wed, 22 Feb 2023 08:41:53 -0800 (PST) X-Google-Smtp-Source: AK7set/vYXamKh3Ve8YL+6N4sRd+KbxSNZ3tHWGiS95J+hm7MLvwPMgDyxJxWgoMfnSkA4uLNp23EQ== X-Received: by 2002:a05:6214:27e9:b0:56e:9dd8:47f3 with SMTP id jt9-20020a05621427e900b0056e9dd847f3mr12406327qvb.13.1677084113091; Wed, 22 Feb 2023 08:41:53 -0800 (PST) Received: from ?IPV6:2607:fea8:a263:f600::de2a? ([2607:fea8:a263:f600::de2a]) by smtp.gmail.com with ESMTPSA id 80-20020a370653000000b006ff8a122a1asm923016qkg.78.2023.02.22.08.41.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Feb 2023 08:41:52 -0800 (PST) Message-ID: Date: Wed, 22 Feb 2023 11:41:51 -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: 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.1 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 13:42, Andrew MacLeod wrote: > > 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 > Oh yeah, and in case you haven't figured it out on your own, you'll have to remove WIDEN_MULT_EXPR from the range-ops init table.   This non-standard mechanism only gets checked if there is no standard range-op table entry for the tree code :-P Andrew Andrew