Hi!
I wrote a simple function in flat assembler that returns true if point is in the box. The 1st and 2nd 16 byte vector describes the box, the 3rd vector is the point. It can be used to test whether one of the 1st box point is in the 2nd box. Or to test whether the 1st's midpoint is in a 2nd box that is larger by the half of the 1st.
format MS COFF
public _TestPoint
section ".text" code readable executable
_TestPoint:
movaps xmm0, dqword[esp + 36]
cmpps xmm0, dqword[esp + 4], 1
pshufb xmm0, dqword[_1]
movd eax, xmm0
test eax, eax
jnz _2
movaps xmm0, dqword[esp + 36]
cmpps xmm0, dqword[esp + 20], 6
pshufb xmm0, dqword[_1]
movd eax, xmm0
test eax, eax
jz _3
_2:
xor eax, eax
ret 48
_3:
mov eax, 1
ret 48
section ".data" data readable writeable
_1:
dq 004080C001010101h
dq 0101010101010101h