[ scummvm-Bugs-791741 ] SCUMM_NEED_ALIGNMENT detection bogus

SourceForge.net noreply at sourceforge.net
Wed Aug 20 09:13:26 CEST 2003


Bugs item #791741, was opened at 2003-08-20 09:13
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418820&aid=791741&group_id=37116

Category: Unknown Crash/Other
Group: All Games
Status: Open
Resolution: None
Priority: 5
Submitted By: Falk Hueffner (mellum)
Assigned to: Nobody/Anonymous (nobody)
Summary: SCUMM_NEED_ALIGNMENT detection bogus

Initial Comment:
SCUMM_NEED_ALIGNMENT tries to detect whether unaligned
 accesses "work". Unfortunately, this is bogus; many
systems, like Alpha, don't support unaligned accesses,
but catch them with a trap, fix them in kernel space
and continue. Therefore, it will appear they work; only
they slow down the program by a factor of 100. The only
reasonable method is to hardcode architectures where it
is known that unaligned accesses are OK and fast.
Anyway, I doubt it is of much use for code like this:

#if defined(SCUMM_NEED_ALIGNMENT)
			memcpy(dst, src, 8);
#else
			((uint32 *)dst)[0] = ((const uint32 *)src)[0];
			((uint32 *)dst)[1] = ((const uint32 *)src)[1];
#endif

If gcc doesn't generate optimal code for memcpy(dst,
src, 8) for your platform, you should rather file a bug
report against gcc than kludge around it.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418820&aid=791741&group_id=37116




More information about the Scummvm-tracker mailing list