From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by sourceware.org (Postfix) with ESMTPS id 28F873949F1F for ; Fri, 6 May 2022 10:01:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 28F873949F1F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f41.google.com with SMTP id i67-20020a1c3b46000000b003946c466c17so131278wma.4 for ; Fri, 06 May 2022 03:01:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=WxsbAxuTNouKUEqC03i9xuYkZG44epJykhDivAwVTE8=; b=B8nFHZb4ZhUX8rsc4D5/yo5i2hJnvxTYJHBcZF5BTmTXeoXNmxAcTMhlxLupBNnlgt Uto6oGaDJ4wjOXt/jTUZkVyzijqr4vs0PhuPXDHiA77AQ4upX56vUYE5Zc0WCPeiqaOg XeBT1IvycnkClb6i1MgCtEjVCtXWhoQjcGHpLM4lOVcTsXhy0wb8xivBnpl1D0FClr6g 530+Yy1WGnwYFS7ltrlj87wrIzGXkW+cbJZEfT6Z/lPHm6Xnpeok9xBVEJqB6CoDPBfe 6QM8j5XT4bJEIQ7JyGCvw5tNbPD9UaUCAfzBvR9tASVrkGDYbJFg5Lu7t7NsUe8FwwWB T6Tg== X-Gm-Message-State: AOAM533sNJNK9r5v+qz26otebT9D/Pg95UG+3dAfepnz+e+nX+wlK52t NGMvfdx0VdTTiQJDN6pqedg= X-Google-Smtp-Source: ABdhPJx15pKZQv6rSD10O4VldfJ/v0bJKLwGhARBTEBLLliamjOfDb8RMBOzK0lKW9ckRn+xDsYGNQ== X-Received: by 2002:a05:600c:1552:b0:394:52a9:e48a with SMTP id f18-20020a05600c155200b0039452a9e48amr9106254wmg.45.1651831269016; Fri, 06 May 2022 03:01:09 -0700 (PDT) Received: from ?IPV6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id e4-20020adfe384000000b0020c5253d923sm3221425wrm.111.2022.05.06.03.01.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 May 2022 03:01:07 -0700 (PDT) Message-ID: Date: Fri, 6 May 2022 11:01:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: 32-bit archs, want64=true, and gas integers Content-Language: en-US To: Jan Beulich Cc: Hans-Peter Nilsson , binutils@sourceware.org, Alan Modra References: <20220504075628.81292-1-luis.machado@arm.com> <88ada15d-c371-df10-368e-f1c9fb91c289@arm.com> <20220504143703.58AD620462@pchp3.se.axis.com> <7fc3846e-6498-ee3b-efce-a28efe9ce519@palves.net> <0c7d04f6-06fe-3f8e-93ea-f33418213be4@suse.com> From: Pedro Alves In-Reply-To: <0c7d04f6-06fe-3f8e-93ea-f33418213be4@suse.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2022 10:01:12 -0000 On 2022-05-06 10:55, Jan Beulich wrote: > On 06.05.2022 11:00, Pedro Alves wrote: >> Looking at the "Numbers" chapter in the manual: >> >> https://sourceware.org/binutils/docs/as/Numbers.html >> >> we have: >> >> "Integers are numbers that would fit into an int in the C language. Bignums are integers, but they are stored in more than 32 bits." >> >> I note it says "more than 32 bits", not "32 bits or more". >> >> By my reading of the "Integers" and "Bignums" subsections, these integers are always signed. Maybe >> that should be explicitly said in the manual, instead of introducing signed vs unsigned numbers? >> >> And then, couldn't we make gas use int32_t for integers, and int64_t for Bignums (and clarify in the manual >> that "more than 32 bits" is exactly "64 bits"? IOW, use int64_t instead of bfd_vma in the >> expression evaluation stuff. > > Bignums are quite a bit wider than 64 bits, and on 64-bit architectures > using just int32_t for integers is definitely insufficient (there are > pretty limited operations one can do on bignums). I'm afraid the doc is > simply outdated in talking about "int in C language"; it's more like > "long", and even then only in Unix-like environments, so it would likely > be even better to talk about {,u}intptr_t. But why {,u}intptr_t? Why does it have to be the size of a pointer, which raises the question of -- which pointer, host or target? And if you support multiple targets, which target? Couldn't gas always use int64_t for integers instead? Effectively it would be the same as if you always built gas with --enable-64-bit-bfd, except it wouldn't force 64-bit bfd_vma. Pedro Alves > > Jan > >> That way, gas would be following what it documents, and 32-bit or 64-bit bfd would make no difference, >> and we'd get rid of a subtle host / --enable-64-bit-bfd -dependent behavior change for 32-bit ports. >> >> Pedro Alves >> >