3 ms·
> The storage order, the endianness, as given for my machine, is called little-endian. A system that has high-order representation digits first is called big-en
by eqvinox 2y ago
> The storage order, the endianness, as given for my machine, is called little-endian. A system that has high-order representation digits first is called big-endian. Both orders are commonly used by modern processor types. Some processors are even able to switch between the two orders on the fly.
Calling big endian "commonly used by modern processor types" when s390x is really the only one left is a bit of a stretch ;D
(Comments about everyone's favorite niche/dead BE architecture in 3… 2… 1…)
- ondra 2y agoMIPS is still quite alive in consumer networking hardware.
- eqvinox 2y agoTrue - but at the same time, about half¹ of it is mipsel, i.e. in little-endian mode :). It's also in decline, AFAICS there is very little new silicon development. ¹ on the OpenWRT table of hardware
- tonetegeatinst 2y agoLearning MIPS assembly currently using mars and QtSpim. Any recommended hardware I should use for bare metal development messing around? Hopefully priced like a SBC like the raspberry pi. Want to move from making basic programs like adding, messing with functions, etc and bring my MIPS assembly up to a real hardware environment.
- AntoniusBlock 2y agoMany routers use the MIPS ISA and they can be rooted to get shell access. That's what I did with an old Netgear router, which was like a very low spec SBC. If you have a PS2 lying around, you could try that.
- throwaway19972 2y ago"Modern" doesn't mean "currently widespread".
- eqvinox 2y agoIndeed, if it meant "currently widespread" there'd be a stronger argument for Big Endian with a lot of MIPS and PPC chugging away silently. But interpreting "modern" as recent development, BE is close to gone.
- throwaway19972 2y agoIs there some end to this criticism or do you have some stake in dismissing big endian architectures?
- eqvinox 2y agoUh, why so serious? I called it "a bit of a stretch ;D" - there was a reason for that smiley. I'm well aware BE is alive enough to be around. If you can't live without knowing, sure, my stake in dismissing big endian architectures is that I can't in fact dismiss BE architectures because I have users on it. And it's incredibly painful to test because while my users have such hardware, actually buying a good test platform or CI system is close to impossible. (It ended up being Freescale T4240-QDS devkits off eBay. Not a good sign when the best system you can get is from a company that doesn't exist anymore.) And at some point it's a question about network protocols/encodings being designed to a "network byte order" determined in the 80s to be big endian. When almost everything is LE, maybe new protocols should just stick with LE as well.
- pm215 2y agoTo be fair to IBM, with s390x they do have a "community cloud" programme where open source projects can apply to get a Linux s390x VM to use for things like CI: https://community.ibm.com/zsystems/l1cc/ https://community.ibm.com/zsystems/l1cc/ . But yeah, BE MIPS is super awkward because the target systems are all embedded things that are bad dev/CI machines.
- School-Cotton 2y agoIsn't Sparc big-endian?
- zifpanachr23 2y agoIs SPARC still seeing serious hardware development like s390x? I know it's still around but I can't recall the last time I heard of any new hardware.
- unilynx 2y agowell in a way all processors commonly use them... as big-endian is also the network byte order
- flohofwoe 2y ago...x86 CPUs actually have special mov instructions now to load big endian data. Not sure since when though (on godbolt it needs `-march=native`: https://www.godbolt.org/z/bWfhGx7xh https://www.godbolt.org/z/bWfhGx7xh ...without -march=native it's a mov and bswap (so not too bad either).
- cmovq 2y agoLooks like it was introduced with Haswell (2013). So it’s safe to use if you’re also compiling with AVX2.
- legends2k 2y agoArm is bi-endian and is alive in most phones. I agree with another GP's comment that modern doesn't mean popular/widely used.
- School-Cotton 2y agoI really doubt any mainstream smartphone runs their Arm chip in big-endian mode ever.
- legends2k 2y agoThat's besides the point. The book's author has a valid point. Being pedantic should be applied at all levels if you're going that route.
- eqvinox 2y agoThe problem about being pedantic is that you can choose different directions to be pedantic in. My "direction" is that code isn't written in a vacuum, it mixes with code millions of other people wrote and runs on machines millions of other people built. As such: My concern isn't that the phrasing in the book is wrong, and I have expressly not argued that. It's that it presents the issue as having no further depth, and these two choices as equivalent. They aren't. The "Some processors are even able to switch between the two orders on the fly." that follows makes it even worse, at least to me it really sounds like you needn't give any care. And the people reading this book are probably the people who should be aware of more real-world background on endianness, for the good of the next million of people dealing with what they produced.
- kelsey98765431 2y agoMipsBE is very common in edge devices on many networks. You may have 5 MipsBE devices in your home or office without realizing. It's almost never an issue so nobody cares, but they are common.
- unscaled 2y agoThe book does say "Both orders are commonly used by modern processor types". I'd say this sentence is quite misleading, since it would lead you to believe two falsehoods: 1. That both byte orders are equally prevalent in the wild, particularly in systems that are expected to run modern C code. 2. That both byte orders are equally likely to be found in "modern" (new or updated) processor design. It's not entirely incorrect, but a better phrasing could be used to clarify that little-endian is the more modern and common storage order, but you still cannot ignore big-endian.
- Keyframe 2y agowell, network byte order is a thing. Not a processor though.
- skissane 2y ago> Calling big endian "commonly used by modern processor types" when s390x is really the only one left is a bit of a stretch ;D POWER is bi-endian. In recent versions, Linux on POWER is little-endian (big-endian Linux on POWER used to be popular, until all the distros switched some years back), while AIX and IBM i are big-endian. AIX and IBM i are probably not quite as alive as IBM mainframes are, but AIX is still arguably more alive than Solaris or HP/UX are, to say nothing of the dozens of other commercial Unix systems that once existed. Likewise, IBM i is just hanging on, yet still much more alive than most competing legacy midrange platforms (e.g. HP MPE which has been officially desupported by the vendor, although you can still get third party support for it.)