R600: Add helper functions.

Extract these from some of my other patches, since this
is the only thing really making them dependent on each other.

llvm-svn: 210627
2 files changed