I can't readily think of an application in which this is a performance-critical computation, so I'd be tempted to optimise for size, but in the more general sense of "how to quickly obtain the modulus of dividing by 7", this becomes a much more practical use.
Well, maybe sometimes you need to format lots and lots of RFC 822 timestamps, or some other format that explicitly includes day-of-week.