diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-03-26 19:22:50 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-03-26 19:22:50 +0100 |
| commit | 83338a2f753ebbb7ba7b154cc60b2f427b6121b0 (patch) | |
| tree | 149efb6a0b835fd6b3d89f7fd7808f8eed8e0288 /src/arch/neon.h | |
| parent | 56048d13b73ec6e6a9c59d62e82f41e69a3994bd (diff) | |
| download | nissy-core-83338a2f753ebbb7ba7b154cc60b2f427b6121b0.tar.gz nissy-core-83338a2f753ebbb7ba7b154cc60b2f427b6121b0.zip | |
Added inverse coordinate for CO
this is necessary for DR coordinate
Diffstat (limited to 'src/arch/neon.h')
| -rw-r--r-- | src/arch/neon.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/arch/neon.h b/src/arch/neon.h index d5f5f8b..fc0e612 100644 --- a/src/arch/neon.h +++ b/src/arch/neon.h | |||
| @@ -219,6 +219,25 @@ coord_co(cube_t c) | |||
| 219 | return ret; | 219 | return ret; |
| 220 | } | 220 | } |
| 221 | 221 | ||
| 222 | STATIC_INLINE cube_t | ||
| 223 | invcoord_co(int64_t coord) | ||
| 224 | { | ||
| 225 | int64_t co, c, i, p; | ||
| 226 | uint8_t mem[8]; | ||
| 227 | cube_t cube; | ||
| 228 | |||
| 229 | for (i = 0, p = 0, c = coord; i < 8; i++, c /= 3) { | ||
| 230 | co = i == 7 ? ((3 - (p % 3)) % 3) : (c % 3); | ||
| 231 | p += co; | ||
| 232 | mem[i] = i + (co << COSHIFT); | ||
| 233 | } | ||
| 234 | |||
| 235 | cube.corner = vld1_u8(mem); | ||
| 236 | cube.edge = SOLVED_CUBE.edge; | ||
| 237 | |||
| 238 | return cube; | ||
| 239 | } | ||
| 240 | |||
| 222 | STATIC_INLINE int64_t | 241 | STATIC_INLINE int64_t |
| 223 | coord_csep(cube_t c) | 242 | coord_csep(cube_t c) |
| 224 | { | 243 | { |
