this is so well known in fact that arm gcc defaults to this when a proper constant exists if you do division or modulus operator...