<div dir="ltr"><div>We should throw away this one, I'll retry, see below:<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 13 sept. 2019 à 20:00, <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br>
Nicolas Cellier uploaded a new version of VMMaker to project VM Maker:<br>
<a href="http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2562.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2562.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: VMMaker.oscog-nice.2562<br>
Author: nice<br>
Time: 13 September 2019, 7:58:12.809297 pm<br>
UUID: 86118d22-2779-3e4a-8c91-733adca6fbd1<br>
Ancestors: VMMaker.oscog-eem.2561<br>
<br>
Attempt to avoid fetching BitBlt source past end boundary.<br>
<br>
This happens when we preload next source word.<br>
We preload next source word when we think that first source word does not contain enough pixels to fill first dest word.<br>
<br>
But this cannot happen if first source word contains more pixels than the whole BitBlt width (bbW).<br>
<br>
Note that the temp variable startBits is 1 based, thus we can use bbW <= startBits rather than bbW < startBits to check if the whole BitBlt width fit on 1st word (both for dest nWord = 1 and src when testing the need for preload).<br>
<br>
=============== Diff against VMMaker.oscog-eem.2561 ===============<br>
<br>
Item was changed:<br>
----- Method: BitBltSimulation>>destMaskAndPointerInit (in category 'setup') -----<br>
destMaskAndPointerInit<br>
"Compute masks for left and right destination words"<br>
| startBits pixPerM1 endBits |<br>
<inline: true><br>
pixPerM1 := destPPW - 1. "A mask, assuming power of two"<br>
"how many pixels in first word"<br>
startBits := destPPW - (dx bitAnd: pixPerM1).<br>
"how many pixels in last word"<br>
endBits := (dx + bbW - 1 bitAnd: pixPerM1) + 1.<br>
destMSB<br>
ifTrue:<br>
[mask1 := AllOnes >> (32 - (startBits * destDepth)).<br>
mask2 := AllOnes << (32 - (endBits * destDepth))] <br>
ifFalse:<br>
[mask1 := AllOnes << (32 - (startBits * destDepth)).<br>
mask2 := AllOnes >> (32 - (endBits * destDepth))].<br>
self cCode: [] inSmalltalk:<br>
[mask1 := mask1 bitAnd: 16rFFFFFFFF.<br>
mask2 := mask2 bitAnd: 16rFFFFFFFF].<br>
<br>
"determine number of words stored per line; merge masks if only 1"<br>
+ bbW <= startBits<br>
- bbW < startBits<br>
ifTrue: [mask1 := mask1 bitAnd: mask2.<br>
mask2 := 0.<br>
nWords := 1]<br>
ifFalse: [nWords := bbW - startBits + pixPerM1 // destPPW + 1].<br>
hDir := vDir := 1. "defaults for no overlap with source"<br>
<br>
"calculate byte addr and delta, based on first word of data"<br>
"Note pitch is bytes and nWords is longs, not bytes"<br>
destIndex := destBits + (dy * destPitch) + ((dx // destPPW) * 4).<br>
destDelta := destPitch * vDir - (4 * (nWords * hDir)) "byte addr delta"!<br>
<br>
Item was changed:<br>
----- Method: BitBltSimulation>>sourceSkewAndPointerInit (in category 'setup') -----<br>
sourceSkewAndPointerInit<br>
"This is only used when source and dest are same depth,<br>
ie, when the barrel-shift copy loop is used."<br>
| sxLowBits dxLowBits pixPerM1 startBits m1 |<br>
<inline: true><br>
<var: 'm1' type: #'unsigned int'><br>
self assert: (destPPW = sourcePPW and: [destMSB = sourceMSB and: [destDepth = sourceDepth]]).<br>
pixPerM1 := destPPW - 1. "A mask, assuming power of two"<br>
sxLowBits := sx bitAnd: pixPerM1.<br>
dxLowBits := dx bitAnd: pixPerM1.<br>
"how many pixels in first word"<br>
startBits := hDir > 0<br>
ifTrue: [sourcePPW - (sx bitAnd: pixPerM1)]<br>
ifFalse: [(sx + bbW - 1 bitAnd: pixPerM1) + 1].<br>
m1 := destMSB<br>
ifTrue: [AllOnes >> (32 - (startBits * destDepth))] <br>
ifFalse: [AllOnes << (32 - (startBits * destDepth))].<br>
+ preload := bbW <= startBits and: [(m1 bitAnd: mask1) ~= mask1]. "i.e. there are some missing bits"<br>
- preload := (m1 bitAnd: mask1) ~= mask1. "i.e. there are some missing bits"<br></blockquote><div>Ah stupid! We must preload if it does not fit, that is bbW > startBits!!!</div><div>Let me retry...<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
"calculate right-shift skew from source to dest"<br>
skew := destDepth * (sourceMSB ifTrue: [sxLowBits - dxLowBits] ifFalse: [dxLowBits - sxLowBits]). " -32..32 "<br>
preload ifTrue: <br>
[skew := skew < 0 ifTrue: [skew + 32] ifFalse: [skew - 32]].<br>
<br>
"Calc byte addr and delta from longWord info"<br>
sourceIndex := sourceBits + (sy * sourcePitch) + ((sx // (32 // sourceDepth)) * 4).<br>
"calculate increments from end of 1 line to start of next"<br>
sourceDelta := (sourcePitch * vDir) - (4 * (nWords * hDir)).<br>
<br>
preload ifTrue: "Compensate for extra source word fetched"<br>
[sourceDelta := sourceDelta - (4 * hDir)].<br>
<br>
self deny: (preload and: [skew = 0]).<br>
self assert: (skew between: -31 and: 31)!<br>
<br>
</blockquote></div></div>