public static void VerifyBinOp <T>(IPolyrand random, int blocks, Vector128BinOp <T> inXOp, Func <T, T, T> primalOp) where T : unmanaged { var blocklen = Span128 <T> .BlockLength; var lhs = random.ReadOnlySpan128 <T>(blocks); Claim.eq(blocks * blocklen, lhs.Length); var rhs = random.ReadOnlySpan128 <T>(blocks); Claim.eq(blocks * blocklen, rhs.Length); var expect = Span128.AllocBlocks <T>(blocks); Claim.eq(blocks, expect.BlockCount); var actual = Span128.AllocBlocks <T>(blocks); Claim.eq(blocks, actual.BlockCount); var tmp = new T[blocklen]; for (var block = 0; block < blocks; block++) { var offset = block * blocklen; for (var i = 0; i < blocklen; i++) { tmp[i] = primalOp(lhs[offset + i], rhs[offset + i]); } var vExpect = Vec128.LoadVector <T>(ref tmp[0]); var vX = lhs.LoadVec128(block); var vY = rhs.LoadVec128(block); var vActual = inXOp(vX, vY); Claim.eq(vExpect, vActual); ginx.store(vExpect, ref expect.Block(block)); ginx.store(vActual, ref actual.Block(block)); } Claim.eq(expect, actual); }