Do I write "non-power of two" or "non-power-of-two", where I assume "power of two" is a non-hyphenated compound word?
I believe this is a case where understandibility should triumph over grammatical correctness. The rules of grammar probably indicate the first, but to my mind that makes it unclear whether the 'non' modifies the entire phrase or merely the first word. The second form is clearer, and so preferred.
To change the example: if you negate "He had a big city style" to be "He had a non-big city style" implies that he had a style of a city, but not a big one. "He had a non-big-city style" would mean that he had a style that was not of a big city.
(Personally I would recommend not using 'non' in either of these cases)