Deutsch   English   Français   Italiano  
<vdbnlq$1pabr$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Terje Mathisen <terje.mathisen@tmsw.no>
Newsgroups: comp.arch
Subject: Re: is Vax addressing sane today
Date: Sun, 29 Sep 2024 16:19:38 +0200
Organization: A noiseless patient Spider
Lines: 65
Message-ID: <vdbnlq$1pabr$1@dont-email.me>
References: <vbd6b9$g147$1@dont-email.me>
 <2024Sep10.094353@mips.complang.tuwien.ac.at> <vckf9d$178f2$1@dont-email.me>
 <O2DHO.184073$kxD8.113118@fx11.iad> <vcso7k$2s2da$1@dont-email.me>
 <efXIO.169388$1m96.45507@fx15.iad>
 <8f031f2b5082d97582b1231a060f2b9f@www.novabbs.org>
 <8DgJO.171468$1m96.17060@fx15.iad> <vd7peh$12kpl$2@dont-email.me>
 <KWUJO.41016$vtH3.33971@fx07.iad> <86msjr2bec.fsf@linuxsc.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 29 Sep 2024 16:19:39 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="63dd6991b7f8a46945ad7660dd4fa367";
	logging-data="1878395"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/it+U2QxGOAkEywUxk+ZeiyPJsOgkxKGq35F0PBic/Ow=="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
 Firefox/91.0 SeaMonkey/2.53.19
Cancel-Lock: sha1:yyphUBOgJLqSvjslaWLE7yK3QSE=
In-Reply-To: <86msjr2bec.fsf@linuxsc.com>
Bytes: 3959

Tim Rentsch wrote:
> EricP <ThatWouldBeTelling@thevillage.com> writes:
> 
>> Lawrence D'Oliveiro wrote:
>>
>>> On Thu, 26 Sep 2024 13:13:02 -0400, EricP wrote:
>>>
>>>> I've always paid for mine.  My first C compiler came with the WinNT 3.5
>>>> beta in 1992 for $99 and came with the development kit,
>>>> editor, source code debugger, tools, documentation.
>>>> A few hundred bucks is not going to hurt my business.
>>>
>>> Given that GCC offers more features and generates better code than
>>> MSVC, the money may not matter to your business, but the quality of
>>> the product will.
>>
>> GCC is a compiler collection not a integrated development kit for Windows.
>> I have no knowledge of what state GCC was in in 1992 but it likely
>> did not support the MS enhancements for Win32 programming:
>> structured exception handling, various ABI's, inline assembler,
>> defined behavior for some of C's undefined behavior,
>> later first-class-type support for 64-bit signed and unsigned integers,
>> and most important:  integration with the GUI source code debugger.
>>
>> Plus come with necessary API headers, various link libraries and DLL's,
>> supporting applications, documentation.
>> You know... what a product looks like.
> 
> I am currently in the position of needing to take some code
> written for Linux/Unix and get it running in MS Windows.
> 
> My attempts to use MSVC have been frustrating, because of some
> limitations of that environment.  The two most prominent are
> these:  long double is only 64 bits, and there are no integer
> types of 128 bits that I could find.
> 
> Are there any MSVC folks here who can help with these problems?
> I am not an MSVC expert by any means and easily could have missed
> something.
> 
> I should mention that the code is written in C, not C++, and that
> is not something I am at liberty to change.
> 
I seem to remember finding something like __int128_t and __uint128_t 
inside MSVC?

And that by casting uint64_t parameters to the u128 variant, the 
compiler would generate the obvious MUL RDI and save RDX:RAX as the 
128-bit result:

uint128_t mulw(uint64_t a, uint64_t b)
{
   return (uint128_t) a * (uint128_t) b;
}

I.e. no subroutine call/zero overhead.

OTOH, getting optimal wide integer accumulators is a bit harder, needing 
compiler intrinsics to access the widening add with carry opcodes. (ADDX)

Terje

-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"