Commit 6f563f28 by Adam P. Goucher

### Determine leaf direction

parent 5f0cd4b7
 ... ... @@ -2,20 +2,21 @@ * This file is #included into each outer-totalistic rule namespace. */ uint64_t r32_centre_to_u64(uint32_t* d) { uint64_t x = 0; uint64_t r32_centre_to_u64(uint32_t* d, int x, int y) { // Not written in inline assembly for a change (!) uint64_t z = 0; for (int i = 11; i >= 4; i--) { x = x << 8; x |= (d[i] >> 12) & 255; z = z << 8; z |= (d[i+y] >> (12+x)) & 255; } return x; return z; } void iter4_var_leaf(uint64_t * inleaf, uint64_t * centres) { /* * Find the 8-by-8 centre after iterating a 16-by-16 leaf for a * further 4 iterations in the rule. This returns both the * live cells and the history envelope. * further 4 iterations in the rule. This returns both the live * cells and the history envelope. */ int bis = apg::best_instruction_set(); uint32_t d[16]; ... ... @@ -23,24 +24,54 @@ uint32_t h[16]; std::memset(h, 0, 64); if (bis >= 10) { apg::z64_to_r32_centre_avx(inleaf, d); iterate_avx2_16_12(d, e, h, 0, 0, false); iterate_avx2_12_8(d+2, e+2, h+2, 0, 0, false); } else if (bis >= 9) { if (bis >= 9) { apg::z64_to_r32_centre_avx(inleaf, d); } else { apg::z64_to_r32_centre_ssse3(inleaf, d); } // BESZEL: centres[2] = r32_centre_to_u64(d, -1, -1); centres[3] = r32_centre_to_u64(d, 0, -2); centres[4] = r32_centre_to_u64(d, 1, -1); centres[5] = r32_centre_to_u64(d, 2, 0); // ULQOMA: centres[6] = r32_centre_to_u64(d, 1, 1); centres[7] = r32_centre_to_u64(d, 0, 2); centres[8] = r32_centre_to_u64(d, -1, 1); centres[9] = r32_centre_to_u64(d, -2, 0); if (bis >= 9) { iterate_avx_16_12(d, e, h, 0, 0, false); iterate_avx_12_8(d+2, e+2, h+2, 0, 0, false); } else { apg::z64_to_r32_centre_ssse3(inleaf, d); iterate_sse2_16_12(d, e, h, 0, 0, false); iterate_sse2_12_8(d+2, e+2, h+2, 0, 0, false); } centres[0] = r32_centre_to_u64(d); centres[1] = r32_centre_to_u64(h); centres[0] = r32_centre_to_u64(d, 0, 0); centres[1] = r32_centre_to_u64(h, 0, 0); } bool iterate_var_leaf(int n, uint64_t * inleaves, uint64_t * outleaf) { if (n == -4) { /* * This brings a whole new meaning to 'function overloading'. * I'm going to attempt to justify this by claiming that MINUS n * corresponds to MINUScule leaf iteration. So, for instance: * * iterate_var_leaf( 4, ...) <-- run a 32-by-32 tile 4 gens; * iterate_var_leaf(-4, ...) <-- run a 16-by-16 tile 4 gens; * * Oh, and it also stores the history layer because ... erm ... * negative timedeltas refer to history? */ iter4_var_leaf(inleaves, outleaf); return false; } bool nochange = false; int bis = apg::best_instruction_set(); uint32_t d[32]; ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!