git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Sebastian Schuberth <sschuberth@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>,
	Daniel Gurney <dgurney99@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] compat/bswap.h: detect ARM64 when using MSVC
Date: Tue, 10 Nov 2020 17:44:21 +0100	[thread overview]
Message-ID: <CAHGBnuM3JeffB73coQhVOC03tiWhg2VY=teSr-Jmnx5-aX48BA@mail.gmail.com> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.2011101418550.18437@tvgsbejvaqbjf.bet>

On Tue, Nov 10, 2020 at 2:58 PM Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:

> > -#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
> > +#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM64))

> I Cc:ed Sebastian, to confirm my hunch: Looking a bit above that hunk, I
> see that this merely imitates the way things are done for GCC:
>
>     #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))

I believe my intention was not necessarily to imitate the way things
are done for GCC, but to independently be on the safe side by checking
that this code is only used on x86-style / little-endian architecture.

> > As far as I know, Windows has always run on little-endian hardware.
>
> I think that depends on your point of view... IIRC an early version of
> Windows NT (or was it still VMS Plus?) ran on DEC Alpha, which I seem to
> _vaguely_ remember was big-endian.

IMO, strictly speaking, from a semantic point of view this is not
about which OS we are running on, but about which compiler is being
used. So the question here is: Can MSVC compile for a non-little
endian target platform (incl. things like cross-compilation)? And
AFAIK the answer is yes, it could in the past / still can nowadays.

> Short version: while I managed to convince myself that _currently_ there
> are no big-endian platforms that we can support via MSVC, I would like to
> stay within the boundaries of caution and _not_ drop those `defined(_M_*)`
> parts.

Same here, I'd prefer to keep these for explicitness, and for
consistency with the GCC check.

-- 
Sebastian Schuberth

  reply	other threads:[~2020-11-10 16:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-07 22:19 [PATCH] compat/bswap.h: detect ARM64 when using MSVC Daniel Gurney
2020-11-07 22:47 ` brian m. carlson
2020-11-07 23:23   ` Daniel Gurney
2020-11-10 13:58   ` Johannes Schindelin
2020-11-10 16:44     ` Sebastian Schuberth [this message]
2020-11-10 23:38     ` brian m. carlson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHGBnuM3JeffB73coQhVOC03tiWhg2VY=teSr-Jmnx5-aX48BA@mail.gmail.com' \
    --to=sschuberth@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=dgurney99@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).