Closed Bug 1480581 Opened Last year Closed Last year

EndianUtils.h needs to know that aarch64 windows is a thing

Categories

(Core :: MFBT, enhancement)

ARM64
Windows
enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

...because it has this giant conditional of architectures to determine endianness.

Or we could just use the endianness result from configure in this header and call it a day.
I took the lazy way out.
Attachment #8997245 - Flags: review?(jwalden+bmo)
Comment on attachment 8997245 [details] [diff] [review]
add an AArch64-specific case to EndianUtils.h

Review of attachment 8997245 [details] [diff] [review]:
-----------------------------------------------------------------

::: mfbt/EndianUtils.h
@@ +82,5 @@
>  #  pragma intrinsic(_byteswap_uint64)
>  #endif
>  
>  #if defined(_WIN64)
>  #  if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)

|| defined(_M_ARM64) ?
(In reply to Mike Hommey [:glandium] from comment #2)
> ::: mfbt/EndianUtils.h
> @@ +82,5 @@
> >  #  pragma intrinsic(_byteswap_uint64)
> >  #endif
> >  
> >  #if defined(_WIN64)
> >  #  if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)
> 
> || defined(_M_ARM64) ?

The arm case in the _WIN32 arm below was separate from the x86 case, so I was just following prior art.  I'm not particularly attached either way, though.  WDYT?
Assignee: nobody → nfroyd
I'm almost tempted to say at this point we could just say that Windows = little endian. It's very unlikely that a future windows platform would be big endian now. Waldo, what's your take?
Attachment #8997245 - Flags: review?(jwalden+bmo) → review+
I'd probably put good money on Windows we would ever target never ever being big-endian.  But as long as it isn't a serious hardship to divine endianness from architecture and not from target OS, I think we should keep doing that.
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/023e8e5e6fb2
add an AArch64-specific case to EndianUtils.h; r=Waldo
https://hg.mozilla.org/mozilla-central/rev/023e8e5e6fb2
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.