Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Terje Mathisen 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: References: <2024Sep10.094353@mips.complang.tuwien.ac.at> <8f031f2b5082d97582b1231a060f2b9f@www.novabbs.org> <8DgJO.171468$1m96.17060@fx15.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 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 -- - "almost all programming can be viewed as an exercise in caching"