$OpenBSD: patch-lib_Target_PowerPC_PPCSubtarget_h,v 1.5 2019/02/20 00:24:11 jca Exp $

When generating code for OpenBSD/powerpc, avoid unaligned floating-point
load and store instructions.  The vast majority of PowerPC CPUs that
OpenBSD runs on don't implement those and will generate an alignment
exceptions.  While we do emulate lfd and stfd (to work around GCC bugs),
we don't emulate lfs and stfs.  It is way more efficient to have the
compiler generate code that only uses aligned load and store instructions.

Index: lib/Target/PowerPC/PPCSubtarget.h
--- lib/Target/PowerPC/PPCSubtarget.h.orig
+++ lib/Target/PowerPC/PPCSubtarget.h
@@ -305,6 +305,7 @@ class PPCSubtarget : public PPCGenSubtargetInfo { (pub
   bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
   bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); }
   bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
+  bool isTargetOpenBSD() const { return TargetTriple.isOSOpenBSD(); }
 
   bool isDarwinABI() const { return isTargetMachO() || isDarwin(); }
   bool isSVR4ABI() const { return !isDarwinABI(); }
