The deck guns on the subs are, if I'm not mistaken, a very similar model to the "Bofors" AA guns on larger cruisers and battleships. So they are quite "dual purpose" in that sense. No reason why they shouldn't work on both-- assuming, as I am, that the AA guns on a battleship would be loaded with flak shells and not HE