Hello Emil,
The FXOS8700CQ has an embedded function for Orientation Detection. This is an algorithm able to detect all six orientations. As mentioned in the datasheet section 12.9, you can refer to the application note AN4068 for further details.
I hope this information can be helpful and I apologize for the delayed response.
Have a great day,
Paulina