As a general rule of thumb, it's almost always better to use a LUT for anything. I mean... a single or operation between to operands would take one 8-1 mergerr, one rom and then an 1-8 splitter, or 3 nand gates. But a XOR would take the same merger,splitter and rom, or 4 nands. So even for this thing, a rom is better performance wise. The only situation were gates are better, is when you want to invert up to 2 lines, or and 2 ops.
Ill make a video soon about how to use them and how to think in state machines in general