You have to do it this way for mobile (switching targets is too expensive to do more than strictly necessary) and any of the tiled/cluster lighting lighting methods anyways.
Cubemap sampling is pretty simple and the method is documented: old nVidia article on it, math and tables towards the bottom, the old GL extension documents for cube-textures also cover the same.
It's pretty branchy though, even with most of it just being tables.
An alternative to doing the branchy coordinate conversion in the shader is to prebuild two mip-less cubemaps, one for face selection and another for indirection (bitwise operators can make it one RGBA16 but that chops away alot of hardware). The face selection contains the multiplier to collapse the sampling vector on the axis, and the indirection is the coordinate remapping. A bit more branchiness can ditch the indirection cubemap (packing an index into the face-selection Alpha). altDevBlog article
Shipped that approach, worked fine even on toasters.