I'll point out that this is the same way that FPGAs implement arbitrary logic functions, as lookup tables (LUTs).
Neither is typically done in practice except for specialized purposes like FPGAs and the instruction described in this article. High-speed registers and static RAM are sometimes built with logic but it's more common to build them directly with transistors than with gates.
http://www.righto.com/2017/01/die-photos-and-reverse-enginee...