From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 112f4a,836bcce47f69b8cc,start X-Google-Attributes: gid112f4a,public X-Google-Thread: 1164f8,f79df321ef1d2c00 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1992-06-21 15:25:50 PST Path: sparky!uunet!decwrl!pa.dec.com!nntpd2.cxo.dec.com!nntpd.lkg.dec.com!sousa.ltn.dec.com!human.enet.dec.com!supnik From: supnik@human.enet.dec.com (Bob Supnik) Newsgroups: comp.sys.dec Subject: Re: Porting to Alpha VMS Summary: Technique/penalty varied Keywords: unaligned, VAX Message-ID: <1203@sousa.ltn.dec.com> Date: 22 Jun 92 00:33:19 GMT References: <1992Jun11.094025.1991@lsl.co.uk> <1992Jun16.131316.23012@nntpd.lkg.dec.com> <1044@niktow.canisius.edu> <1992Jun19.152255.132@rlgsc.com> <1992Jun20.154427.56695@cc.usu.edu> Sender: newsa@sousa.ltn.dec.com Organization: Digital Equipment Corporation In article <1992Jun20.154427.56695@cc.usu.edu>, ivie@cc.usu.edu (CP/M lives!) writes... > [text deleted] >Yes, but it didn't have to perform the extra loads to get the instructions >to tell it how to mask and shift. > [text deleted] The implementation (and therefore cost) of unaligned varied considerably in the VAX line. In the 780 and 8800, to name two popular systems, unaligned references triggered a microtrap (a hardware-vectored subroutine call) to a microroutine that explicitly issued multiple loads, masked the data, and shifted it to proper form. Although the fetch penalty for the extra code was fixed (it came from ROM), there was a definite cost to draining the micropipeline, executing the routine, and restarting. In the VLSI VAX's and in the VAX 9000, in contrast, unaligned references were handled by hardware sequencing which issued the second load and merged and shifted the data. For Alpha, the fetch penalty will vary depending on whether the unaligned reference was detected at compile/translate time or dynamically at execution time. In the former case, the load/shift/mask code will be inline, and there is unlikely to be additional fetch penalty beyond the cost of the extra instructions, because of the instruction cache, instruction prefetcher, and similar mechanisms. In the latter case, the load/shift/mask code will be in PAL (at least in a VMS environment), and the PAL routine may or may not be in the instruction cache, depending on the frequency of unaligned access. Thus, for the former case, the penalty for unaligned access is similar to the VLSI VAX's and VAX 9000; for the latter case, the penalty can be severe. Hence the recommendation to (a) avoid unaligned if possible and (b) handle it if compile time if avoidance is not possible. Note that for all VAX's, unaligned references across a page boundary invoked a microtrap to check that both parts of the reference had sufficient memory management privileges to complete. This is not necessary on Alpha, except for translated VAX binary code, which must preserve the completion semantics of the original VAX instructions. Bob Supnik >Supnik@human.enet.dec.com >All opinions expressed are those of a hardline microcoder >and do not reflect those of Digital Equipment Corporation