Repository navigation
Conversation
Each backend had its own copy of the little- and big-endian loads: iso_read_le16/32 in the ISO 9660 backend, with Rock Ridge wrapping it, udf_le16/32/64 for UDF, hfs_be16/32/64 for HFS and HFS+, store helpers in the CDDA backend, and open-coded byte assembly in session.c, charset.c and the host file media. Only the ISO copy loaded its field with one move on the 68020. Put them in one place, include/odfs/byteorder.h, as odfs_le16/32/64, odfs_be16/32/64 and odfs_put_le16/32 and odfs_put_be16/32. The 68020 load is kept for odfs_le32, so the UDF backend now gets it too: the 68020 build shrinks by 832 bytes, all of it in udf.o. The 68000 and ROM builds differ only in charset.c, where the UTF-16 decode now takes the address of the code unit and GCC allocates registers a little differently. The endian tests move from test_iso9660.c to a new test_byteorder.c, which also covers the big-endian, 64-bit and store helpers and loads at odd addresses. handler_main.c still builds its SCSI fields by hand: its packet loop is sensitive to any change in code generation.
GCC keeps to aligned accesses on every m68k, so a field at an
arbitrary offset is assembled byte by byte, about seven instructions
for a long. The 68020 and later allow word and long accesses at any
address, and odfs_le32() already used one move.l there. Do the same
for odfs_le16() (move.w and a byte swap), odfs_be16() and odfs_be32()
(a plain move), and so for the 64-bit loads built from them.
That mostly helps HFS and HFS+, which are big-endian throughout, and
UDF. The 68020 build shrinks by another 1848 bytes, 2680 against
main. The 68000 and ROM builds do not change.
CDBench on the 68040 rig, 68020 build, main -> this:
UDF fixture seq read 168676 -> 172411 KiB/s
Discovery 5498 -> 5617 entries/s
same offset 85 -> 80 us
HFS fixture Discovery 6119 -> 6477 entries/s
small o+r 390 -> 384 us
ISO fixture unchanged on every figure
The HFS fixture is the CDBench tree in an Apple partition map, made
with hdiutil makehybrid -hfs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #62.
Commits
iso_read_le16/32, Rock Ridge's wrapper,udf_le16/32/64,hfs_be16/32/64), CDDA had its own store helpers, andsession.c,charset.cand the host file media assembled bytes by hand. They're all ininclude/odfs/byteorder.hnow:odfs_le16/32/64,odfs_be16/32/64,odfs_put_le16/32,odfs_put_be16/32.move.lload moves withodfs_le32, so UDF gets it too: the 020 build shrinks by 832 bytes, all of it inudf.o.charset.c, where the register allocation changed.tests/unit/test_byteorder.c, which also covers big-endian, 64-bit, stores and odd addresses.ODFS_M68K_UNALIGNED_OK,odfs_le16becomesmove.wplus a byte swap, andodfs_be16/odfs_be32become a plainmove. The 020 build shrinks by another 1848 bytes (2680 against main), mostly in HFS, HFS+ and UDF. The 68000 and ROM builds don't change.handler_main.cstill builds its SCSI fields by hand: any change in code generation in its packet loop moves CDBench.CDBench (68040 rig, 68020 build, main → this)
The HFS fixture is the CDBench tree in an Apple partition map, made with
hdiutil makehybrid -hfs.Testing
Host:
make check,golden-checkandmalformed-checkpass. All OS3 targets build within their size limits.Guest regression tool (5028 checks), ISO, UDF and HFS images, with main and this branch:
The output is identical between main and this branch on every platform and image. ISO passes everywhere. The 896 failures on HFS (and UDF on OS3) are the tool's check for ISO's upper-case names, and they're the same on main.
AROS:
List ALLoutput identical for all three images.AmiFUSE integration test passes.