text:
//===- lib/MC/ARMELFStreamer.cpp - ELF Object Output for ARM --------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file assembles .s files and emits ARM ELF .o object files. Different
// from generic ELF streamer in emitting mapping symbols ($a, $t and $d) to
// delimit regions of data and code.
//
//===----------------------------------------------------------------------===//

#include "ARMArchName.h"
#include "ARMFPUName.h"
#include "ARMRegisterInfo.h"
#include "ARMUnwindOpAsm.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/Twine.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCELF.h"
#include "llvm/MC/MCELFStreamer.h"
#include "llvm/MC/MCELFSymbolFlags.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstPrinter.h"
#include "llvm/MC/MCObjectFileInfo.h"
#include "llvm/MC/MCObjectStreamer.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCValue.h"
#include "llvm/Support/ARMBuildAttributes.h"
#include "llvm/Support/ARMEHABI.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ELF.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>

using namespace llvm;

static std::string GetAEABIUnwindPersonalityName(unsigned Index) {
  assert(Index < ARM::EHABI::NUM_PERSONALITY_INDEX &&
         "Invalid personality index");
  return (Twine("__aeabi_unwind_cpp_pr") + Twine(Index)).str();
}

static const char *GetFPUName(unsigned ID) {
  switch (ID) {
  default:
    llvm_unreachable("Unknown FPU kind");
    break;
#define ARM_FPU_NAME(NAME, ID) case ARM::ID: return NAME;
#include "ARMFPUName.def"
  }
  return nullptr;
}

static const char *GetArchName(unsigned ID) {
  switch (ID) {
  default:
    llvm_unreachable("Unknown ARCH kind");
    break;
#define ARM_ARCH_NAME(NAME, ID, DEFAULT_CPU_NAME, DEFAULT_CPU_ARCH) \
  case ARM::ID: return NAME;
#define ARM_ARCH_ALIAS(NAME, ID) /* empty */
#include "ARMArchName.def"
  }
  return nullptr;
}

static const char *GetArchDefaultCPUName(unsigned ID) {
  switch (ID) {
  default:
    llvm_unreachable("Unknown ARCH kind");
    break;
#define ARM_ARCH_NAME(NAME, ID, DEFAULT_CPU_NAME, DEFAULT_CPU_ARCH) \
  case ARM::ID: return DEFAULT_CPU_NAME;
#define ARM_ARCH_ALIAS(NAME, ID) /* empty */
#include "ARMArchName.def"
  }
  return nullptr;
}

static unsigned GetArchDefaultCPUArch(unsigned ID) {
  switch (ID) {
  default:
    llvm_unreachable("Unknown ARCH kind");
    break;
#define ARM_ARCH_NAME(NAME, ID, DEFAULT_CPU_NAME, DEFAULT_CPU_ARCH) \
  case ARM::ID: return ARMBuildAttrs::DEFAULT_CPU_ARCH;
#define ARM_ARCH_ALIAS(NAME, ID) /* empty */
#include "ARMArchName.def"
  }
  return 0;
}

namespace {

class ARMELFStreamer;

class ARMTargetAsmStreamer : public ARMTargetStreamer {
  formatted_raw_ostream &OS;
  MCInstPrinter &InstPrinter;
  bool IsVerboseAsm;

  void emitFnStart() override;
  void emitFnEnd() override;
  void emitCantUnwind() override;
  void emitPersonality(const MCSymbol *Personality) override;
  void emitPersonalityIndex(unsigned Index) override;
  void emitHandlerData() override;
  void emitSetFP(unsigned FpReg, unsigned SpReg, int64_t Offset = 0) override;
  void emitMovSP(unsigned Reg, int64_t Offset = 0) override;
  void emitPad(int64_t Offset) override;
  void emitRegSave(const SmallVectorImpl<unsigned> &RegList,
                   bool isVector) override;
  void emitUnwindRaw(int64_t Offset,
                     const SmallVectorImpl<uint8_t> &Opcodes) override;

  void switchVendor(StringRef Vendor) override;
  void emitAttribute(unsigned Attribute, unsigned Value) override;
  void emitTextAttribute(unsigned Attribute, StringRef String) override;
  void emitIntTextAttribute(unsigned Attribute, unsigned IntValue,
                            StringRef StrinValue) override;
  void emitArch(unsigned Arch) override;
  void emitObjectArch(unsigned Arch) override;
  void emitFPU(unsigned FPU) override;
  void emitInst(uint32_t Inst, char Suffix = '\0') override;
  void finishAttributeSection() override;

  void AnnotateTLSDescriptorSequence(const MCSymbolRefExpr *SRE) override;
  void emitThumbSet(MCSymbol *Symbol, const MCExpr *Value) override;

public:
  ARMTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS,
                       MCInstPrinter &InstPrinter, bool VerboseAsm);
};

ARMTargetAsmStreamer::ARMTargetAsmStreamer(MCStreamer &S,
                                           formatted_raw_ostream &OS,
                                           MCInstPrinter &InstPrinter,
                                           bool VerboseAsm)
    : ARMTargetStreamer(S), OS(OS), InstPrinter(InstPrinter),
      IsVerboseAsm(VerboseAsm) {}
void ARMTargetAsmStreamer::emitFnStart() { OS << "\t.fnstart\n"; }
void ARMTargetAsmStreamer::emitFnEnd() { OS << "\t.fnend\n"; }
void ARMTargetAsmStreamer::emitCantUnwind() { OS << "\t.cantunwind\n"; }
void ARMTargetAsmStreamer::emitPersonality(const MCSymbol *Personality) {
  OS << "\t.personality " << Personality->getName() << '\n';
}
void ARMTargetAsmStreamer::emitPersonalityIndex(unsigned Index) {
  OS << "\t.personalityindex " << Index << '\n';
}
void ARMTargetAsmStreamer::emitHandlerData() { OS << "\t.handlerdata\n"; }
void ARMTargetAsmStreamer::emitSetFP(unsigned FpReg, unsigned SpReg,
                                     int64_t Offset) {
  OS << "\t.setfp\t";
  InstPrinter.printRegName(OS, FpReg);
  OS << ", ";
  InstPrinter.printRegName(OS, SpReg);
  if (Offset)
    OS << ", #" << Offset;
  OS << '\n';
}
void ARMTargetAsmStreamer::emitMovSP(unsigned Reg, int64_t Offset) {
  assert((Reg != ARM::SP && Reg != ARM::PC) &&
         "the operand of .movsp cannot be either sp or pc");

  OS << "\t.movsp\t";
  InstPrinter.printRegName(OS, Reg);
  if (Offset)
    OS << ", #" << Offset;
  OS << '\n';
}
void ARMTargetAsmStreamer::emitPad(int64_t Offset) {
  OS << "\t.pad\t#" << Offset << '\n';
}
void ARMTargetAsmStreamer::emitRegSave(const SmallVectorImpl<unsigned> &RegList,
                                       bool isVector) {
  assert(RegList.size() && "RegList should not be empty");
  if (isVector)
    OS << "\t.vsave\t{";
  else
    OS << "\t.save\t{";

  InstPrinter.printRegName(OS, RegList[0]);

  for (unsigned i = 1, e = RegList.size(); i != e; ++i) {
    OS << ", ";
    InstPrinter.printRegName(OS, RegList[i]);
  }

  OS << "}\n";
}
void ARMTargetAsmStreamer::switchVendor(StringRef Vendor) {
}
void ARMTargetAsmStreamer::emitAttribute(unsigned Attribute, unsigned Value) {
  OS << "\t.eabi_attribute\t" << Attribute << ", " << Twine(Value);
  if (IsVerboseAsm) {
    StringRef Name = ARMBuildAttrs::AttrTypeAsString(Attribute);
    if (!Name.empty())
      OS << "\t@ " << Name;
  }
  OS << "\n";
}
void ARMTargetAsmStreamer::emitTextAttribute(unsigned Attribute,
                                             StringRef String) {
  switch (Attribute) {
  case ARMBuildAttrs::CPU_name:
    OS << "\t.cpu\t" << String.lower();
    break;
  default:
    OS << "\t.eabi_attribute\t" << Attribute << ", \"" << String << "\"";
    if (IsVerboseAsm) {
      StringRef Name = ARMBuildAttrs::AttrTypeAsString(Attribute);
      if (!Name.empty())
        OS << "\t@ " << Name;
    }
    break;
  }
  OS << "\n";
}
void ARMTargetAsmStreamer::emitIntTextAttribute(unsigned Attribute,
                                                unsigned IntValue,
                                                StringRef StringValue) {
  switch (Attribute) {
  default: llvm_unreachable("unsupported multi-value attribute in asm mode");
  case ARMBuildAttrs::compatibility:
    OS << "\t.eabi_attribute\t" << Attribute << ", " << IntValue;
    if (!StringValue.empty())
      OS << ", \"" << StringValue << "\"";
    if (IsVerboseAsm)
      OS << "\t@ " << ARMBuildAttrs::AttrTypeAsString(Attribute);
    break;
  }
  OS << "\n";
}
void ARMTargetAsmStreamer::emitArch(unsigned Arch) {
  OS << "\t.arch\t" << GetArchName(Arch) << "\n";
}
void ARMTargetAsmStreamer::emitObjectArch(unsigned Arch) {
  OS << "\t.object_arch\t" << GetArchName(Arch) << '\n';
}
void ARMTargetAsmStreamer::emitFPU(unsigned FPU) {
  OS << "\t.fpu\t" << GetFPUName(FPU) << "\n";
}
void ARMTargetAsmStreamer::finishAttributeSection() {
}
void
ARMTargetAsmStreamer::AnnotateTLSDescriptorSequence(const MCSymbolRefExpr *S) {
  OS << "\t.tlsdescseq\t" << S->getSymbol().getName();
}

void ARMTargetAsmStreamer::emitThumbSet(MCSymbol *Symbol, const MCExpr *Value) {
  OS << "\t.thumb_set\t" << *Symbol << ", " << *Value << '\n';
}

void ARMTargetAsmStreamer::emitInst(uint32_t Inst, char Suffix) {
  OS << "\t.inst";
  if (Suffix)
    OS << "." << Suffix;
  OS << "\t0x" << utohexstr(Inst) << "\n";
}

void ARMTargetAsmStreamer::emitUnwindRaw(int64_t Offset,
                                      const SmallVectorImpl<uint8_t> &Opcodes) {
  OS << "\t.unwind_raw " << Offset;
  for (SmallVectorImpl<uint8_t>::const_iterator OCI = Opcodes.begin(),
                                                OCE = Opcodes.end();
       OCI != OCE; ++OCI)
    OS << ", 0x" << utohexstr(*OCI);
  OS << '\n';
}

class ARMTargetELFStreamer : public ARMTargetStreamer {
private:
  // This structure holds all attributes, accounting for
  // their string/numeric value, so we can later emmit them
  // in declaration order, keeping all in the same vector
  struct AttributeItem {
    enum {
      HiddenAttribute = 0,
      NumericAttribute,
      TextAttribute,
      NumericAndTextAttributes
    } Type;
    unsigned Tag;
    unsigned IntValue;
    StringRef StringValue;

    static bool LessTag(const AttributeItem &LHS, const AttributeItem &RHS) {
      return (LHS.Tag < RHS.Tag);
    }
  };

  StringRef CurrentVendor;
  unsigned FPU;
  unsigned Arch;
  unsigned EmittedArch;
  SmallVector<AttributeItem, 64> Contents;

  const MCSection *AttributeSection;

  AttributeItem *getAttributeItem(unsigned Attribute) {
    for (size_t i = 0; i < Contents.size(); ++i)
      if (Contents[i].Tag == Attribute)
        return &Contents[i];
    return nullptr;
  }

  void setAttributeItem(unsigned Attribute, unsigned Value,
                        bool OverwriteExisting) {
    // Look for existing attribute item
    if (AttributeItem *Item = getAttributeItem(Attribute)) {
      if (!OverwriteExisting)
        return;
      Item->Type = AttributeItem::NumericAttribute;
      Item->IntValue = Value;
      return;
    }

    // Create new attribute item
    AttributeItem Item = {
      AttributeItem::NumericAttribute,
      Attribute,
      Value,
      StringRef("")
    };
    Contents.push_back(Item);
  }

  void setAttributeItem(unsigned Attribute, StringRef Value,
                        bool OverwriteExisting) {
    // Look for existing attribute item
    if (AttributeItem *Item = getAttributeItem(Attribute)) {
      if (!OverwriteExisting)
        return;
      Item->Type = AttributeItem::TextAttribute;
      Item->StringValue = Value;
      return;
    }

    // Create new attribute item
    AttributeItem Item = {
      AttributeItem::TextAttribute,
      Attribute,
      0,
      Value
    };
    Contents.push_back(Item);
  }

  void setAttributeItems(unsigned Attribute, unsigned IntValue,
                         StringRef StringValue, bool OverwriteExisting) {
    // Look for existing attribute item
    if (AttributeItem *Item = getAttributeItem(Attribute)) {
      if (!OverwriteExisting)
        return;
      Item->Type = AttributeItem::NumericAndTextAttributes;
      Item->IntValue = IntValue;
      Item->StringValue = StringValue;
      return;
    }

    // Create new attribute item
    AttributeItem Item = {
      AttributeItem::NumericAndTextAttributes,
      Attribute,
      IntValue,
      StringValue
    };
    Contents.push_back(Item);
  }

  void emitArchDefaultAttributes();
  void emitFPUDefaultAttributes();

  ARMELFStreamer &getStreamer();

  void emitFnStart() override;
  void emitFnEnd() override;
  void emitCantUnwind() override;
  void emitPersonality(const MCSymbol *Personality) override;
  void emitPersonalityIndex(unsigned Index) override;
  void emitHandlerData() override;
  void emitSetFP(unsigned FpReg, unsigned SpReg, int64_t Offset = 0) override;
  void emitMovSP(unsigned Reg, int64_t Offset = 0) override;
  void emitPad(int64_t Offset) override;
  void emitRegSave(const SmallVectorImpl<unsigned> &RegList,
                   bool isVector) override;
  void emitUnwindRaw(int64_t Offset,
                     const SmallVectorImpl<uint8_t> &Opcodes) override;

  void switchVendor(StringRef Vendor) override;
  void emitAttribute(unsigned Attribute, unsigned Value) override;
  void emitTextAttribute(unsigned Attribute, StringRef String) override;
  void emitIntTextAttribute(unsigned Attribute, unsigned IntValue,
                            StringRef StringValue) override;
  void emitArch(unsigned Arch) override;
  void emitObjectArch(unsigned Arch) override;
  void emitFPU(unsigned FPU) override;
  void emitInst(uint32_t Inst, char Suffix = '\0') override;
  void finishAttributeSection() override;
  void emitLabel(MCSymbol *Symbol) override;

  void AnnotateTLSDescriptorSequence(const MCSymbolRefExpr *SRE) override;
  void emitThumbSet(MCSymbol *Symbol, const MCExpr *Value) override;

  size_t calculateContentSize() const;

public:
  ARMTargetELFStreamer(MCStreamer &S)
    : ARMTargetStreamer(S), CurrentVendor("aeabi"), FPU(ARM::INVALID_FPU),
      Arch(ARM::INVALID_ARCH), EmittedArch(ARM::INVALID_ARCH),
      AttributeSection(nullptr) {}
};

/// Extend the generic ELFStreamer class so that it can emit mapping symbols at
/// the appropriate points in the object files. These symbols are defined in the
/// ARM ELF ABI: infocenter.arm.com/help/topic/com.arm.../IHI0044D_aaelf.pdf.
///
/// In brief: $a, $t or $d should be emitted at the start of each contiguous
/// region of ARM code, Thumb code or data in a section. In practice, this
/// emission does not rely on explicit assembler directives but on inherent
/// properties of the directives doing the emission (e.g. ".byte" is data, "add
/// r0, r0, r0" an instruction).
///
/// As a result this system is orthogonal to the DataRegion infrastructure used
/// by MachO. Beware!
class ARMELFStreamer : public MCELFStreamer {
public:
  friend class ARMTargetELFStreamer;

  ARMELFStreamer(MCContext &Context, MCAsmBackend &TAB, raw_ostream &OS,
                 MCCodeEmitter *Emitter, bool IsThumb)
      : MCELFStreamer(Context, TAB, OS, Emitter), IsThumb(IsThumb),
        MappingSymbolCounter(0), LastEMS(EMS_None) {
    Reset();
  }

  ~ARMELFStreamer() {}

  void FinishImpl() override;

  // ARM exception handling directives
  void emitFnStart();
  void emitFnEnd();
  void emitCantUnwind();
  void emitPersonality(const MCSymbol *Per);
  void emitPersonalityIndex(unsigned index);
  void emitHandlerData();
  void emitSetFP(unsigned NewFpReg, unsigned NewSpReg, int64_t Offset = 0);
  void emitMovSP(unsigned Reg, int64_t Offset = 0);
  void emitPad(int64_t Offset);
  void emitRegSave(const SmallVectorImpl<unsigned> &RegList, bool isVector);
  void emitUnwindRaw(int64_t Offset, const SmallVectorImpl<uint8_t> &Opcodes);

  void ChangeSection(const MCSection *Section,
                     const MCExpr *Subsection) override {
    // We have to keep track of the mapping symbol state of any sections we
    // use. Each one should start off as EMS_None, which is provided as the
    // default constructor by DenseMap::lookup.
    LastMappingSymbols[getPreviousSection().first] = LastEMS;
    LastEMS = LastMappingSymbols.lookup(Section);

    MCELFStreamer::ChangeSection(Section, Subsection);
  }

  /// This function is the one used to emit instruction data into the ELF
  /// streamer. We override it to add the appropriate mapping symbol if
  /// necessary.
  void EmitInstruction(const MCInst& Inst,
                       const MCSubtargetInfo &STI) override {
    if (IsThumb)
      EmitThumbMappingSymbol();
    else
      EmitARMMappingSymbol();

    MCELFStreamer::EmitInstruction(Inst, STI);
  }

  void emitInst(uint32_t Inst, char Suffix) {
    unsigned Size;
    char Buffer[4];
    const bool LittleEndian = getContext().getAsmInfo()->isLittleEndian();

    switch (Suffix) {
    case '\0':
      Size = 4;

      assert(!IsThumb);
      EmitARMMappingSymbol();
      for (unsigned II = 0, IE = Size; II != IE; II++) {
        const unsigned I = LittleEndian ? (Size - II - 1) : II;
        Buffer[Size - II - 1] = uint8_t(Inst >> I * CHAR_BIT);
      }

      break;
    case 'n':
    case 'w':
      Size = (Suffix == 'n' ? 2 : 4);

      assert(IsThumb);
      EmitThumbMappingSymbol();
      for (unsigned II = 0, IE = Size; II != IE; II = II + 2) {
        const unsigned I0 = LittleEndian ? II + 0 : (Size - II - 1);
        const unsigned I1 = LittleEndian ? II + 1 : (Size - II - 2);
        Buffer[Size - II - 2] = uint8_t(Inst >> I0 * CHAR_BIT);
        Buffer[Size - II - 1] = uint8_t(Inst >> I1 * CHAR_BIT);
      }

      break;
    default:
      llvm_unreachable("Invalid Suffix");
    }

    MCELFStreamer::EmitBytes(StringRef(Buffer, Size));
  }

  /// This is one of the functions used to emit data into an ELF section, so the
  /// ARM streamer overrides it to add the appropriate mapping symbol ($d) if
  /// necessary.
  void EmitBytes(StringRef Data) override {
    EmitDataMappingSymbol();
    MCELFStreamer::EmitBytes(Data);
  }

  /// This is one of the functions used to emit data into an ELF section, so the
  /// ARM streamer overrides it to add the appropriate mapping symbol ($d) if
  /// necessary.
  void EmitValueImpl(const MCExpr *Value, unsigned Size,
                     const SMLoc &Loc) override {
    EmitDataMappingSymbol();
    MCELFStreamer::EmitValueImpl(Value, Size);
  }

  void EmitAssemblerFlag(MCAssemblerFlag Flag) override {
    MCELFStreamer::EmitAssemblerFlag(Flag);

    switch (Flag) {
    case MCAF_SyntaxUnified:
      return; // no-op here.
    case MCAF_Code16:
      IsThumb = true;
      return; // Change to Thumb mode
    case MCAF_Code32:
      IsThumb = false;
      return; // Change to ARM mode
    case MCAF_Code64:
      return;
    case MCAF_SubsectionsViaSymbols:
      return;
    }
  }

private:
  enum ElfMappingSymbol {
    EMS_None,
    EMS_ARM,
    EMS_Thumb,
    EMS_Data
  };

  void EmitDataMappingSymbol() {
    if (LastEMS == EMS_Data) return;
    EmitMappingSymbol("$d");
    LastEMS = EMS_Data;
  }

  void EmitThumbMappingSymbol() {
    if (LastEMS == EMS_Thumb) return;
    EmitMappingSymbol("$t");
    LastEMS = EMS_Thumb;
  }

  void EmitARMMappingSymbol() {
    if (LastEMS == EMS_ARM) return;
    EmitMappingSymbol("$a");
    LastEMS = EMS_ARM;
  }

  void EmitMappingSymbol(StringRef Name) {
    MCSymbol *Start = getContext().CreateTempSymbol();
    EmitLabel(Start);

    MCSymbol *Symbol =
      getContext().GetOrCreateSymbol(Name + "." +
                                     Twine(MappingSymbolCounter++));

    MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol);
    MCELF::SetType(SD, ELF::STT_NOTYPE);
    MCELF::SetBinding(SD, ELF::STB_LOCAL);
    SD.setExternal(false);
    AssignSection(Symbol, getCurrentSection().first);

    const MCExpr *Value = MCSymbolRefExpr::Create(Start, getContext());
    Symbol->setVariableValue(Value);
  }

  void EmitThumbFunc(MCSymbol *Func) override {
    getAssembler().setIsThumbFunc(Func);
    EmitSymbolAttribute(Func, MCSA_ELF_TypeFunction);
  }

  // Helper functions for ARM exception handling directives
  void Reset();

  void EmitPersonalityFixup(StringRef Name);
  void FlushPendingOffset();
  void FlushUnwindOpcodes(bool NoHandlerData);

  void SwitchToEHSection(const char *Prefix, unsigned Type, unsigned Flags,
                         SectionKind Kind, const MCSymbol &Fn);
  void SwitchToExTabSection(const MCSymbol &FnStart);
  void SwitchToExIdxSection(const MCSymbol &FnStart);

  void EmitFixup(const MCExpr *Expr, MCFixupKind Kind);

  bool IsThumb;
  int64_t MappingSymbolCounter;

  DenseMap<const MCSection *, ElfMappingSymbol> LastMappingSymbols;
  ElfMappingSymbol LastEMS;

  // ARM Exception Handling Frame Information
  MCSymbol *ExTab;
  MCSymbol *FnStart;
  const MCSymbol *Personality;
  unsigned PersonalityIndex;
  unsigned FPReg; // Frame pointer register
  int64_t FPOffset; // Offset: (final frame pointer) - (initial $sp)
  int64_t SPOffset; // Offset: (final $sp) - (initial $sp)
  int64_t PendingOffset; // Offset: (final $sp) - (emitted $sp)
  bool UsedFP;
  bool CantUnwind;
  SmallVector<uint8_t, 64> Opcodes;
  UnwindOpcodeAssembler UnwindOpAsm;
};
} // end anonymous namespace

ARMELFStreamer &ARMTargetELFStreamer::getStreamer() {
  return static_cast<ARMELFStreamer &>(Streamer);
}

void ARMTargetELFStreamer::emitFnStart() { getStreamer().emitFnStart(); }
void ARMTargetELFStreamer::emitFnEnd() { getStreamer().emitFnEnd(); }
void ARMTargetELFStreamer::emitCantUnwind() { getStreamer().emitCantUnwind(); }
void ARMTargetELFStreamer::emitPersonality(const MCSymbol *Personality) {
  getStreamer().emitPersonality(Personality);
}
void ARMTargetELFStreamer::emitPersonalityIndex(unsigned Index) {
  getStreamer().emitPersonalityIndex(Index);
}
void ARMTargetELFStreamer::emitHandlerData() {
  getStreamer().emitHandlerData();
}
void ARMTargetELFStreamer::emitSetFP(unsigned FpReg, unsigned SpReg,
                                     int64_t Offset) {
  getStreamer().emitSetFP(FpReg, SpReg, Offset);
}
void ARMTargetELFStreamer::emitMovSP(unsigned Reg, int64_t Offset) {
  getStreamer().emitMovSP(Reg, Offset);
}
void ARMTargetELFStreamer::emitPad(int64_t Offset) {
  getStreamer().emitPad(Offset);
}
void ARMTargetELFStreamer::emitRegSave(const SmallVectorImpl<unsigned> &RegList,
                                       bool isVector) {
  getStreamer().emitRegSave(RegList, isVector);
}
void ARMTargetELFStreamer::emitUnwindRaw(int64_t Offset,
                                      const SmallVectorImpl<uint8_t> &Opcodes) {
  getStreamer().emitUnwindRaw(Offset, Opcodes);
}
void ARMTargetELFStreamer::switchVendor(StringRef Vendor) {
  assert(!Vendor.empty() && "Vendor cannot be empty.");

  if (CurrentVendor == Vendor)
    return;

  if (!CurrentVendor.empty())
    finishAttributeSection();

  assert(Contents.empty() &&
         ".ARM.attributes should be flushed before changing vendor");
  CurrentVendor = Vendor;

}
void ARMTargetELFStreamer::emitAttribute(unsigned Attribute, unsigned Value) {
  setAttributeItem(Attribute, Value, /* OverwriteExisting= */ true);
}
void ARMTargetELFStreamer::emitTextAttribute(unsigned Attribute,
                                             StringRef Value) {
  setAttributeItem(Attribute, Value, /* OverwriteExisting= */ true);
}
void ARMTargetELFStreamer::emitIntTextAttribute(unsigned Attribute,
                                                unsigned IntValue,
                                                StringRef StringValue) {
  setAttributeItems(Attribute, IntValue, StringValue,
                    /* OverwriteExisting= */ true);
}
void ARMTargetELFStreamer::emitArch(unsigned Value) {
  Arch = Value;
}
void ARMTargetELFStreamer::emitObjectArch(unsigned Value) {
  EmittedArch = Value;
}
void ARMTargetELFStreamer::emitArchDefaultAttributes() {
  using namespace ARMBuildAttrs;

  setAttributeItem(CPU_name, GetArchDefaultCPUName(Arch), false);
  if (EmittedArch == ARM::INVALID_ARCH)
    setAttributeItem(CPU_arch, GetArchDefaultCPUArch(Arch), false);
  else
    setAttributeItem(CPU_arch, GetArchDefaultCPUArch(EmittedArch), false);

  switch (Arch) {
  case ARM::ARMV2:
  case ARM::ARMV2A:
  case ARM::ARMV3:
  case ARM::ARMV3M:
  case ARM::ARMV4:
  case ARM::ARMV5:
    setAttributeItem(ARM_ISA_use, Allowed, false);
    break;

  case ARM::ARMV4T:
  case ARM::ARMV5T:
  case ARM::ARMV5TE:
  case ARM::ARMV6:
  case ARM::ARMV6J:
    setAttributeItem(ARM_ISA_use, Allowed, false);
    setAttributeItem(THUMB_ISA_use, Allowed, false);
    break;

  case ARM::ARMV6T2:
    setAttributeItem(ARM_ISA_use, Allowed, false);
    setAttributeItem(THUMB_ISA_use, AllowThumb32, false);
    break;

  case ARM::ARMV6Z:
  case ARM::ARMV6ZK:
    setAttributeItem(ARM_ISA_use, Allowed, false);
    setAttributeItem(THUMB_ISA_use, Allowed, false);
    setAttributeItem(Virtualization_use, AllowTZ, false);
    break;

  case ARM::ARMV6M:
    setAttributeItem(THUMB_ISA_use, Allowed, false);
    break;

  case ARM::ARMV7:
    setAttributeItem(THUMB_ISA_use, AllowThumb32, false);
    break;

  case ARM::ARMV7A:
    setAttributeItem(CPU_arch_profile, ApplicationProfile, false);
    setAttributeItem(ARM_ISA_use, Allowed, false);
    setAttributeItem(THUMB_ISA_use, AllowThumb32, false);
    break;

  case ARM::ARMV7R:
    setAttributeItem(CPU_arch_profile, RealTimeProfile, false);
    setAttributeItem(ARM_ISA_use, Allowed, false);
    setAttributeItem(THUMB_ISA_use, AllowThumb32, false);
    break;

  case ARM::ARMV7M:
    setAttributeItem(CPU_arch_profile, MicroControllerProfile, false);
    setAttributeItem(THUMB_ISA_use, AllowThumb32, false);
    break;

  case ARM::ARMV8A:
    setAttributeItem(CPU_arch_profile, ApplicationProfile, false);
    setAttributeItem(ARM_ISA_use, Allowed, false);
    setAttributeItem(THUMB_ISA_use, AllowThumb32, false);
    setAttributeItem(MPextension_use, Allowed, false);
    setAttributeItem(Virtualization_use, AllowTZVirtualization, false);
    break;

  case ARM::IWMMXT:
    setAttributeItem(ARM_ISA_use, Allowed, false);
    setAttributeItem(THUMB_ISA_use, Allowed, false);
    setAttributeItem(WMMX_arch, AllowWMMXv1, false);
    break;

  case ARM::IWMMXT2:
    setAttributeItem(ARM_ISA_use, Allowed, false);
    setAttributeItem(THUMB_ISA_use, Allowed, false);
    setAttributeItem(WMMX_arch, AllowWMMXv2, false);
    break;

  default:
    report_fatal_error("Unknown Arch: " + Twine(Arch));
    break;
  }
}
void ARMTargetELFStreamer::emitFPU(unsigned Value) {
  FPU = Value;
}
void ARMTargetELFStreamer::emitFPUDefaultAttributes() {
  switch (FPU) {
  case ARM::VFP:
  case ARM::VFPV2:
    setAttributeItem(ARMBuildAttrs::FP_arch,
                     ARMBuildAttrs::AllowFPv2,
                     /* OverwriteExisting= */ false);
    break;

  case ARM::VFPV3:
    setAttributeItem(ARMBuildAttrs::FP_arch,
                     ARMBuildAttrs::AllowFPv3A,
                     /* OverwriteExisting= */ false);
    break;

  case ARM::VFPV3_D16:
    setAttributeItem(ARMBuildAttrs::FP_arch,
                     ARMBuildAttrs::AllowFPv3B,
                     /* OverwriteExisting= */ false);
    break;

  case ARM::VFPV4:
    setAttributeItem(ARMBuildAttrs::FP_arch,
                     ARMBuildAttrs::AllowFPv4A,
                     /* OverwriteExisting= */ false);
    break;

  case ARM::VFPV4_D16:
    setAttributeItem(ARMBuildAttrs::FP_arch,
                     ARMBuildAttrs::AllowFPv4B,
                     /* OverwriteExisting= */ false);
    break;

  case ARM::FP_ARMV8:
    setAttributeItem(ARMBuildAttrs::FP_arch,
                     ARMBuildAttrs::AllowFPARMv8A,
                     /* OverwriteExisting= */ false);
    break;

  case ARM::NEON:
    setAttributeItem(ARMBuildAttrs::FP_arch,
                     ARMBuildAttrs::AllowFPv3A,
                     /* OverwriteExisting= */ false);
    setAttributeItem(ARMBuildAttrs::Advanced_SIMD_arch,
                     ARMBuildAttrs::AllowNeon,
                     /* OverwriteExisting= */ false);
    break;

  case ARM::NEON_VFPV4:
    setAttributeItem(ARMBuildAttrs::FP_arch,
                     ARMBuildAttrs::AllowFPv4A,
                     /* OverwriteExisting= */ false);
    setAttributeItem(ARMBuildAttrs::Advanced_SIMD_arch,
                     ARMBuildAttrs::AllowNeon2,
                     /* OverwriteExisting= */ false);
    break;

  case ARM::NEON_FP_ARMV8:
  case ARM::CRYPTO_NEON_FP_ARMV8:
    setAttributeItem(ARMBuildAttrs::FP_arch,
                     ARMBuildAttrs::AllowFPARMv8A,
                     /* OverwriteExisting= */ false);
    setAttributeItem(ARMBuildAttrs::Advanced_SIMD_arch,
                     ARMBuildAttrs::AllowNeonARMv8,
                     /* OverwriteExisting= */ false);
    break;

  case ARM::SOFTVFP:
    break;

  default:
    report_fatal_error("Unknown FPU: " + Twine(FPU));
    break;
  }
}
size_t ARMTargetELFStreamer::calculateContentSize() const {
  size_t Result = 0;
  for (size_t i = 0; i < Contents.size(); ++i) {
    AttributeItem item = Contents[i];
    switch (item.Type) {
    case AttributeItem::HiddenAttribute:
      break;
    case AttributeItem::NumericAttribute:
      Result += getULEB128Size(item.Tag);
      Result += getULEB128Size(item.IntValue);
      break;
    case AttributeItem::TextAttribute:
      Result += getULEB128Size(item.Tag);
      Result += item.StringValue.size() + 1; // string + '\0'
      break;
    case AttributeItem::NumericAndTextAttributes:
      Result += getULEB128Size(item.Tag);
      Result += getULEB128Size(item.IntValue);
      Result += item.StringValue.size() + 1; // string + '\0';
      break;
    }
  }
  return Result;
}
void ARMTargetELFStreamer::finishAttributeSection() {
  // <format-version>
  // [ <section-length> "vendor-name"
  // [ <file-tag> <size> <attribute>*
  //   | <section-tag> <size> <section-number>* 0 <attribute>*
  //   | <symbol-tag> <size> <symbol-number>* 0 <attribute>*
  //   ]+
  // ]*

  if (FPU != ARM::INVALID_FPU)
    emitFPUDefaultAttributes();

  if (Arch != ARM::INVALID_ARCH)
    emitArchDefaultAttributes();

  if (Contents.empty())
    return;

  std::sort(Contents.begin(), Contents.end(), AttributeItem::LessTag);

  ARMELFStreamer &Streamer = getStreamer();

  // Switch to .ARM.attributes section
  if (AttributeSection) {
    Streamer.SwitchSection(AttributeSection);
  } else {
    AttributeSection =
      Streamer.getContext().getELFSection(".ARM.attributes",
                                          ELF::SHT_ARM_ATTRIBUTES,
                                          0,
                                          SectionKind::getMetadata());
    Streamer.SwitchSection(AttributeSection);

    // Format version
    Streamer.EmitIntValue(0x41, 1);
  }

  // Vendor size + Vendor name + '\0'
  const size_t VendorHeaderSize = 4 + CurrentVendor.size() + 1;

  // Tag + Tag Size
  const size_t TagHeaderSize = 1 + 4;

  const size_t ContentsSize = calculateContentSize();

  Streamer.EmitIntValue(VendorHeaderSize + TagHeaderSize + ContentsSize, 4);
  Streamer.EmitBytes(CurrentVendor);
  Streamer.EmitIntValue(0, 1); // '\0'

  Streamer.EmitIntValue(ARMBuildAttrs::File, 1);
  Streamer.EmitIntValue(TagHeaderSize + ContentsSize, 4);

  // Size should have been accounted for already, now
  // emit each field as its type (ULEB or String)
  for (size_t i = 0; i < Contents.size(); ++i) {
    AttributeItem item = Contents[i];
    Streamer.EmitULEB128IntValue(item.Tag);
    switch (item.Type) {
    default: llvm_unreachable("Invalid attribute type");
    case AttributeItem::NumericAttribute:
      Streamer.EmitULEB128IntValue(item.IntValue);
      break;
    case AttributeItem::TextAttribute:
      Streamer.EmitBytes(item.StringValue.upper());
      Streamer.EmitIntValue(0, 1); // '\0'
      break;
    case AttributeItem::NumericAndTextAttributes:
      Streamer.EmitULEB128IntValue(item.IntValue);
      Streamer.EmitBytes(item.StringValue.upper());
      Streamer.EmitIntValue(0, 1); // '\0'
      break;
    }
  }

  Contents.clear();
  FPU = ARM::INVALID_FPU;
}

void ARMTargetELFStreamer::emitLabel(MCSymbol *Symbol) {
  ARMELFStreamer &Streamer = getStreamer();
  if (!Streamer.IsThumb)
    return;

  const MCSymbolData &SD = Streamer.getOrCreateSymbolData(Symbol);
  unsigned Type = MCELF::GetType(SD);
  if (Type == ELF_STT_Func || Type == ELF_STT_GnuIFunc)
    Streamer.EmitThumbFunc(Symbol);
}

void
ARMTargetELFStreamer::AnnotateTLSDescriptorSequence(const MCSymbolRefExpr *S) {
  getStreamer().EmitFixup(S, FK_Data_4);
}

void ARMTargetELFStreamer::emitThumbSet(MCSymbol *Symbol, const MCExpr *Value) {
  if (const MCSymbolRefExpr *SRE = dyn_cast<MCSymbolRefExpr>(Value)) {
    const MCSymbol &Sym = SRE->getSymbol();
    if (!Sym.isDefined()) {
      getStreamer().EmitAssignment(Symbol, Value);
      return;
    }
  }

  getStreamer().EmitThumbFunc(Symbol);
  getStreamer().EmitAssignment(Symbol, Value);
}

void ARMTargetELFStreamer::emitInst(uint32_t Inst, char Suffix) {
  getStreamer().emitInst(Inst, Suffix);
}

void ARMELFStreamer::FinishImpl() {
  MCTargetStreamer &TS = *getTargetStreamer();
  ARMTargetStreamer &ATS = static_cast<ARMTargetStreamer &>(TS);
  ATS.finishAttributeSection();

  MCELFStreamer::FinishImpl();
}

inline void ARMELFStreamer::SwitchToEHSection(const char *Prefix,
                                              unsigned Type,
                                              unsigned Flags,
                                              SectionKind Kind,
                                              const MCSymbol &Fn) {
  const MCSectionELF &FnSection =
    static_cast<const MCSectionELF &>(Fn.getSection());

  // Create the name for new section
  StringRef FnSecName(FnSection.getSectionName());
  SmallString<128> EHSecName(Prefix);
  if (FnSecName != ".text") {
    EHSecName += FnSecName;
  }

  // Get .ARM.extab or .ARM.exidx section
  const MCSectionELF *EHSection = nullptr;
  if (const MCSymbol *Group = FnSection.getGroup()) {
    EHSection = getContext().getELFSection(
      EHSecName, Type, Flags | ELF::SHF_GROUP, Kind,
      FnSection.getEntrySize(), Group->getName());
  } else {
    EHSection = getContext().getELFSection(EHSecName, Type, Flags, Kind);
  }
  assert(EHSection && "Failed to get the required EH section");

  // Switch to .ARM.extab or .ARM.exidx section
  SwitchSection(EHSection);
  EmitCodeAlignment(4);
}

inline void ARMELFStreamer::SwitchToExTabSection(const MCSymbol &FnStart) {
  SwitchToEHSection(".ARM.extab",
                    ELF::SHT_PROGBITS,
                    ELF::SHF_ALLOC,
                    SectionKind::getDataRel(),
                    FnStart);
}

inline void ARMELFStreamer::SwitchToExIdxSection(const MCSymbol &FnStart) {
  SwitchToEHSection(".ARM.exidx",
                    ELF::SHT_ARM_EXIDX,
                    ELF::SHF_ALLOC | ELF::SHF_LINK_ORDER,
                    SectionKind::getDataRel(),
                    FnStart);
}
void ARMELFStreamer::EmitFixup(const MCExpr *Expr, MCFixupKind Kind) {
  MCDataFragment *Frag = getOrCreateDataFragment();
  Frag->getFixups().push_back(MCFixup::Create(Frag->getContents().size(), Expr,
                                              Kind));
}

void ARMELFStreamer::Reset() {
  ExTab = nullptr;
  FnStart = nullptr;
  Personality = nullptr;
  PersonalityIndex = ARM::EHABI::NUM_PERSONALITY_INDEX;
  FPReg = ARM::SP;
  FPOffset = 0;
  SPOffset = 0;
  PendingOffset = 0;
  UsedFP = false;
  CantUnwind = false;

  Opcodes.clear();
  UnwindOpAsm.Reset();
}

void ARMELFStreamer::emitFnStart() {
  assert(FnStart == nullptr);
  FnStart = getContext().CreateTempSymbol();
  EmitLabel(FnStart);
}

void ARMELFStreamer::emitFnEnd() {
  assert(FnStart && ".fnstart must precedes .fnend");

  // Emit unwind opcodes if there is no .handlerdata directive
  if (!ExTab && !CantUnwind)
    FlushUnwindOpcodes(true);

  // Emit the exception index table entry
  SwitchToExIdxSection(*FnStart);

  if (PersonalityIndex < ARM::EHABI::NUM_PERSONALITY_INDEX)
    EmitPersonalityFixup(GetAEABIUnwindPersonalityName(PersonalityIndex));

  const MCSymbolRefExpr *FnStartRef =
    MCSymbolRefExpr::Create(FnStart,
                            MCSymbolRefExpr::VK_ARM_PREL31,
                            getContext());

  EmitValue(FnStartRef, 4);

  if (CantUnwind) {
    EmitIntValue(ARM::EHABI::EXIDX_CANTUNWIND, 4);
  } else if (ExTab) {
    // Emit a reference to the unwind opcodes in the ".ARM.extab" section.
    const MCSymbolRefExpr *ExTabEntryRef =
      MCSymbolRefExpr::Create(ExTab,
                              MCSymbolRefExpr::VK_ARM_PREL31,
                              getContext());
    EmitValue(ExTabEntryRef, 4);
  } else {
    // For the __aeabi_unwind_cpp_pr0, we have to emit the unwind opcodes in
    // the second word of exception index table entry.  The size of the unwind
    // opcodes should always be 4 bytes.
    assert(PersonalityIndex == ARM::EHABI::AEABI_UNWIND_CPP_PR0 &&
           "Compact model must use __aeabi_unwind_cpp_pr0 as personality");
    assert(Opcodes.size() == 4u &&
           "Unwind opcode size for __aeabi_unwind_cpp_pr0 must be equal to 4");
    uint64_t Intval = Opcodes[0] |
                      Opcodes[1] << 8 |
                      Opcodes[2] << 16 |
                      Opcodes[3] << 24;
    EmitIntValue(Intval, Opcodes.size());
  }

  // Switch to the section containing FnStart
  SwitchSection(&FnStart->getSection());

  // Clean exception handling frame information
  Reset();
}

void ARMELFStreamer::emitCantUnwind() { CantUnwind = true; }

// Add the R_ARM_NONE fixup at the same position
void ARMELFStreamer::EmitPersonalityFixup(StringRef Name) {
  const MCSymbol *PersonalitySym = getContext().GetOrCreateSymbol(Name);

  const MCSymbolRefExpr *PersonalityRef = MCSymbolRefExpr::Create(
      PersonalitySym, MCSymbolRefExpr::VK_ARM_NONE, getContext());

  visitUsedExpr(*PersonalityRef);
  MCDataFragment *DF = getOrCreateDataFragment();
  DF->getFixups().push_back(MCFixup::Create(DF->getContents().size(),
                                            PersonalityRef,
                                            MCFixup::getKindForSize(4, false)));
}

void ARMELFStreamer::FlushPendingOffset() {
  if (PendingOffset != 0) {
    UnwindOpAsm.EmitSPOffset(-PendingOffset);
    PendingOffset = 0;
  }
}

void ARMELFStreamer::FlushUnwindOpcodes(bool NoHandlerData) {
  // Emit the unwind opcode to restore $sp.
  if (UsedFP) {
    const MCRegisterInfo *MRI = getContext().getRegisterInfo();
    int64_t LastRegSaveSPOffset = SPOffset - PendingOffset;
    UnwindOpAsm.EmitSPOffset(LastRegSaveSPOffset - FPOffset);
    UnwindOpAsm.EmitSetSP(MRI->getEncodingValue(FPReg));
  } else {
    FlushPendingOffset();
  }

  // Finalize the unwind opcode sequence
  UnwindOpAsm.Finalize(PersonalityIndex, Opcodes);

  // For compact model 0, we have to emit the unwind opcodes in the .ARM.exidx
  // section.  Thus, we don't have to create an entry in the .ARM.extab
  // section.
  if (NoHandlerData && PersonalityIndex == ARM::EHABI::AEABI_UNWIND_CPP_PR0)
    return;

  // Switch to .ARM.extab section.
  SwitchToExTabSection(*FnStart);

  // Create .ARM.extab label for offset in .ARM.exidx
  assert(!ExTab);
  ExTab = getContext().CreateTempSymbol();
  EmitLabel(ExTab);

  // Emit personality
  if (Personality) {
    const MCSymbolRefExpr *PersonalityRef =
      MCSymbolRefExpr::Create(Personality,
                              MCSymbolRefExpr::VK_ARM_PREL31,
                              getContext());

    EmitValue(PersonalityRef, 4);
  }

  // Emit unwind opcodes
  assert((Opcodes.size() % 4) == 0 &&
         "Unwind opcode size for __aeabi_cpp_unwind_pr0 must be multiple of 4");
  for (unsigned I = 0; I != Opcodes.size(); I += 4) {
    uint64_t Intval = Opcodes[I] |
                      Opcodes[I + 1] << 8 |
                      Opcodes[I + 2] << 16 |
                      Opcodes[I + 3] << 24;
    EmitIntValue(Intval, 4);
  }

  // According to ARM EHABI section 9.2, if the __aeabi_unwind_cpp_pr1() or
  // __aeabi_unwind_cpp_pr2() is used, then the handler data must be emitted
  // after the unwind opcodes.  The handler data consists of several 32-bit
  // words, and should be terminated by zero.
  //
  // In case that the .handlerdata directive is not specified by the
  // programmer, we should emit zero to terminate the handler data.
  if (NoHandlerData && !Personality)
    EmitIntValue(0, 4);
}

void ARMELFStreamer::emitHandlerData() { FlushUnwindOpcodes(false); }

void ARMELFStreamer::emitPersonality(const MCSymbol *Per) {
  Personality = Per;
  UnwindOpAsm.setPersonality(Per);
}

void ARMELFStreamer::emitPersonalityIndex(unsigned Index) {
  assert(Index < ARM::EHABI::NUM_PERSONALITY_INDEX && "invalid index");
  PersonalityIndex = Index;
}

void ARMELFStreamer::emitSetFP(unsigned NewFPReg, unsigned NewSPReg,
                               int64_t Offset) {
  assert((NewSPReg == ARM::SP || NewSPReg == FPReg) &&
         "the operand of .setfp directive should be either $sp or $fp");

  UsedFP = true;
  FPReg = NewFPReg;

  if (NewSPReg == ARM::SP)
    FPOffset = SPOffset + Offset;
  else
    FPOffset += Offset;
}

void ARMELFStreamer::emitMovSP(unsigned Reg, int64_t Offset) {
  assert((Reg != ARM::SP && Reg != ARM::PC) &&
         "the operand of .movsp cannot be either sp or pc");
  assert(FPReg == ARM::SP && "current FP must be SP");

  FlushPendingOffset();

  FPReg = Reg;
  FPOffset = SPOffset + Offset;

  const MCRegisterInfo *MRI = getContext().getRegisterInfo();
  UnwindOpAsm.EmitSetSP(MRI->getEncodingValue(FPReg));
}

void ARMELFStreamer::emitPad(int64_t Offset) {
  // Track the change of the $sp offset
  SPOffset -= Offset;

  // To squash multiple .pad directives, we should delay the unwind opcode
  // until the .save, .vsave, .handlerdata, or .fnend directives.
  PendingOffset -= Offset;
}

void ARMELFStreamer::emitRegSave(const SmallVectorImpl<unsigned> &RegList,
                                 bool IsVector) {
  // Collect the registers in the register list
  unsigned Count = 0;
  uint32_t Mask = 0;
  const MCRegisterInfo *MRI = getContext().getRegisterInfo();
  for (size_t i = 0; i < RegList.size(); ++i) {
    unsigned Reg = MRI->getEncodingValue(RegList[i]);
    assert(Reg < (IsVector ? 32U : 16U) && "Register out of range");
    unsigned Bit = (1u << Reg);
    if ((Mask & Bit) == 0) {
      Mask |= Bit;
      ++Count;
    }
  }

  // Track the change the $sp offset: For the .save directive, the
  // corresponding push instruction will decrease the $sp by (4 * Count).
  // For the .vsave directive, the corresponding vpush instruction will
  // decrease $sp by (8 * Count).
  SPOffset -= Count * (IsVector ? 8 : 4);

  // Emit the opcode
  FlushPendingOffset();
  if (IsVector)
    UnwindOpAsm.EmitVFPRegSave(Mask);
  else
    UnwindOpAsm.EmitRegSave(Mask);
}

void ARMELFStreamer::emitUnwindRaw(int64_t Offset,
                                   const SmallVectorImpl<uint8_t> &Opcodes) {
  FlushPendingOffset();
  SPOffset = SPOffset - Offset;
  UnwindOpAsm.EmitRaw(Opcodes);
}

namespace llvm {

MCStreamer *createMCAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS,
                                bool isVerboseAsm, bool useDwarfDirectory,
                                MCInstPrinter *InstPrint, MCCodeEmitter *CE,
                                MCAsmBackend *TAB, bool ShowInst) {
  MCStreamer *S = llvm::createAsmStreamer(
      Ctx, OS, isVerboseAsm, useDwarfDirectory, InstPrint, CE, TAB, ShowInst);
  new ARMTargetAsmStreamer(*S, OS, *InstPrint, isVerboseAsm);
  return S;
}

MCStreamer *createARMNullStreamer(MCContext &Ctx) {
  MCStreamer *S = llvm::createNullStreamer(Ctx);
  new ARMTargetStreamer(*S);
  return S;
}

  MCELFStreamer* createARMELFStreamer(MCContext &Context, MCAsmBackend &TAB,
                                      raw_ostream &OS, MCCodeEmitter *Emitter,
                                      bool RelaxAll, bool NoExecStack,
                                      bool IsThumb) {
    ARMELFStreamer *S = new ARMELFStreamer(Context, TAB, OS, Emitter, IsThumb);
    new ARMTargetELFStreamer(*S);
    // FIXME: This should eventually end up somewhere else where more
    // intelligent flag decisions can be made. For now we are just maintaining
    // the status quo for ARM and setting EF_ARM_EABI_VER5 as the default.
    S->getAssembler().setELFHeaderEFlags(ELF::EF_ARM_EABI_VER5);

    if (RelaxAll)
      S->getAssembler().setRelaxAll(true);
    if (NoExecStack)
      S->getAssembler().setNoExecStack(true);
    return S;
  }

}


text:
DVD-Ken Burns American Storyteller Thomas Jefferson
View All Gifts for this series.
Give online or call Member Services at (205) 328-8756 Ext. 0136 or (800) 239-5233 Ext. 0136.
Returning from France, Jefferson strives to preserve the fragile new U.S. government and helps create the first political party, in bitter struggles with the Federalists. He becomes vice president in 1797, and the third U.S. president in 1801. His Louisiana Purchase doubles the nation's size, but he faces controversy and scandal, finally retiring to his beloved Monticello in 1809. His last years are spent founding the University of Virginia.
Quantity: How many DVD-Ken Burns American Storyteller Thomas Jefferson would you like? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
Support APT Online to receive this gift Please select how you would like to contibute $72.00 or more.
One Time Donation of $72.00
Become an APT sustainer with a $6.00 on-going monthly contribution
Please note an additional $7 will be added to your contribution for shipping and handling.
You are donating $72.00. Please click here if you would you like to increase this donation. If not, simply hit the continue button below.
You are donating $6.00 a month. Please click here if you would like to increase your monthly donation? If not, simply hit the continue button below.
Select an amount to ADD to your donation:
Add $600 (an extra $50 each month) Add $300 (an extra $25 each month) Add $150 (an extra $15 each month) Add $120 (an extra $10 each month) Add $108 (an extra $9 each month) Add $96 (an extra $8 each month) Add $84 (an extra $7 each month) Add $72 (an extra $6 each month) Add $60 (an extra $5 each month) Add $48 (an extra $4 each month) Add $36 (an extra $3 each month) Add $24 (an extra $2 each month) Add $12 (an extra $1 each month) None
Set Your Own Amount
Additional Donation

redpajama_set_name: RedPajamaCommonCrawl


text:
HomeHealthcareAre You a Workaholic? Here's How to Tell If You're Addicted to Work
Are You a Workaholic? Here's How to Tell If You're Addicted to Work
Daily Anime Tuesday, December 08, 2020
Growing up, my father was always working.
Many nights, he'd leave before I would wake up for school and he'd return at 7:30 p.m. at night — or later. Other times, he'd be away working for weeks at a time.
He often brought work home with him at night and on family trips, and he talked about it all of the time. Most of his friends were colleagues, and he struggled to unplug from work, even around family.
When he retired, it didn't take long for him to try to work again. He became a consultant for a while. Then he started turning daily chores into work.
He didn't know what to do with himself when he no longer had something to do every day. He still spends hours in front of his computer every day, "working."
As a child, I thought this work ethic was normal. It was what successful people did: They worked all the time. Long hours and little work-life balance were just the price of getting ahead and earning a good salary.
As a result, I tried emulating it.
I thought the hours you put into something dictated your success. That it was the "true" measure of your dedication to getting ahead.
As a student, I'd spend hours on homework, essays, or studying in the library. I didn't go to parties or spend time with friends. I'd stay up all night and acted like doing that was some sort of badge of honor, a sure sign I would one day be just as successful as my father.
I thought calling yourself a "workaholic" was a good thing.
The only problem: I couldn't keep this up.
This kind of work ethic was neither healthy nor a good thing. And it was only years later that the long hours, high stress, and little sleep started affecting my health.
That's when I realized there was a problem.
What is workaholism?
The term "workaholism" was first used in 1971 by psychologist Wayne Oates, and he defined it as a compulsion or an uncontrollable need to work incessantly.
Since then, psychologists and mental health researchers have squabbled over the definition.
Though it isn't a formally recognized diagnosable disorder in the new edition of the Diagnostic and Statistical Manual of Mental Disorders (DSM-5), one thing is clear: It's very much a real mental health condition and it can have a very real impact on people's lives.
"Work addiction is a complex condition in which an individual develops a psychological, emotional, and social dependence on work," explains Matt Glowiak, a licensed clinical professional counselor in Illinois. "It is chronic and progressive."
Dr. Brian Wind, clinical psychologist and chief clinical officer at an addiction treatment center, agrees.
"People with work addiction often work compulsively at the expense of other aspects of their lives," he explains. "They may work long hours even when it is not needed, sacrifice sleep to get work done, and be paranoid about their work performance. They may be obsessive about thinking of ways to free up more time for work and become stressed if they are stopped from working."
Long hours vs work addiction
Work addiction is not the same as merely working long hours, which is part of what makes it so hard to spot
Even back in 1998, the United States was believed to have some of highest rates of people working more than 50 hours per week, but that doesn't mean we're a nation of workaholics.
Certain professions simply rely on long work hours. Just because someone has one of those jobs doesn't mean they're necessarily addicted to what they do.
However, "our culture rewards people who work hard," Wind explains. This means that if we do have a problem, we may not realize it.
"We may be getting praise and recognition from supervisors and teammates, which encourages us to work harder without recognizing that we have an addiction," Wind says. "We may justify our behavior by saying that we have ambition and are working towards achieving success."
So what's the difference between someone who merely works long hours and a true workaholic? The person addicted to work struggles to psychologically detach from work, even when they're away from the office.
Workaholism and health problems
When you struggle to detach from work, you ruminate. This can lead to high levels of stress, anxiety, depression, and sleep problems, according to a 2012 studyTrusted Source.
Under chronic stress, your body begins to see impacts, such as high blood pressure and high cortisol levels, according to a 2013 research review.
This puts you at greater risk of cardiovascular disease, diabetes, and even death.
In addition, work addiction can impact your relationships, leading to:
Sometimes, workaholism can coexist with another mental health condition, such as obsessive-compulsive disorder (OCD) or bipolar disorder.
Work addiction is treatable
Treatment is possible, but you have to recognize you have a problem first.
"I often tell my clients 'It's hard to read the label from inside the bottle,'" says Terry McDougall, an author and career coach who works with clients to find more work-life balance in their lives.
"They simply don't have enough distance from themselves to see what is actually happening. They are so focused on getting their validation through work that they may fail to see the cost to relationships or their health," says McDougall.
Their actions may even be related to a survival response.
"Often high achievers can become work addicted, and it is because they have been rewarded for many years for delaying gratification, and it becomes a habit," he continues. "People who have driven themselves to excel through school and their career — and who have been rewarded for it — may have a hard time understanding that they will not be endangered if they slow down."
It doesn't help that workaholics often grow up in families with other workaholics, which makes that around-the-clock behavior seem normal. It becomes a deeply ingrained value that's hard to shake.
Workaholism can also develop out of trauma, because work can become a coping mechanism to help them get through. "[But] if the trauma is not resolved, it can be hard to stop the behavior that they used to cope with the trauma," McDougall says.
For example, he worked with a client who started working full-time while caring for her sick mother and sister as a teenager.
"At the time, it was a necessity to ensure her survival," McDougall says. "However, much later when she was on her own and doing well in her career, she still held the same underlying belief that she might not survive if she didn't work herself so hard."
Coping with work addiction
Once you recognize that you may have a problem, there are things you can do to try to develop a healthier work ethic:
1. Set a 'stop time' for work and stick to it
"This forces us to stop for a certain time and wait until the next day to start again," Wind explains. "It can help us make time to relax and unwind."
It's a good idea to make yourself stop for lunch, too.
Admittedly, for a person who feels a compulsive need to work, this is often the most difficult step. But try to remember that you can work smarter to keep your workday shorter.
"Intelligent, efficient work is as — if not more — productive than spending additional time on something," Glowiak says.
A person addicted to work might be inclined to think that time dictates success, but the reality is, if that work can be done in less time more efficiently, that's the better way to work.
So, setting time limits on yourself can force work efficiency.
"There are many tasks that do require a specific set of time, and that is OK," Glowiak says. "In most cases, though, we can be more efficient. This is not about taking shortcuts or sacrificing work but eliminating nonsense to reclaim our lives. Once we set boundaries and stand firm, others will adjust and follow."
2. Schedule activities after your workday is over
For example, plan to go for a walk, meditate, write in a journal, or make dinner after work. Creating a routine, Wind explains, can help give workaholics structure and keep them engaged, even when they're not actually working.
"It is important that one finds what works for oneself — this will be different for everyone," says Glowiak. "But when such activities are found, they may serve as a health distraction from work."
3. Make time for friends and family
If it helps, schedule that time on your calendar at first so you don't forget. Taking the time for them will help mend relationships and help you recover.
4. Seek help from a therapist or counselor if you're struggling
They can work with you to understand your compulsive need to work and help you work to minimize the negative effects of overworking. If you also have a coexisting mental health condition, such as OCD or bipolar disorder, they can help develop a treatment plan that works for you.
You can also try inpatient and outpatient rehabilitation programs, as well as group therapy options such as Workaholics Anonymous.
If you're addicted to work, you'll feel a compulsive need to do your job. When you're away from it, you'll find it difficult to "turn off," which can affect your mental and physical health as well as your personal relationships.
The good news is, there's help. If you think work addiction applies to you, know that you do have options.
"The most successful people know that their time is valuable, but they continue to make time for activities outside work," Wind says. "A healthy work-life balance can make a person happier, energized, and more refreshed, which in turn leads to more creativity and efficiency at work."
Health Healthcare


What's the structure for the analysis paper?
You merely have to indicate your unique information and newspaper attribute . The next step is obtaining a copy so you may read it Once you have found the citation for a newspaper which is linked to your science undertaking. Any sort of academic paper that you're searching for in academic paper into a reflection paper are available here.
Registration is free although you do have to register pre written papers to see the complete text of the content. The student needs A great deal of prior Term Paper to compose the Term Paper properly. Just how many pages it is crucial to compose and what the deadline is.
There is a database of free sample research papers it is likely to use to boost your own essays. Our skilled writers are getting more advanced in their usage of proofreading and sculpting tools like editing and more. Furthermore, there are custom composing businesses and sites that may provide students about how to compose papers that are original with tips.
Critics say that the costs are essential to guarantee the grade of the research. It can help you become connected with clients you have experience and ample writing skills. Our on-line paper authors are always dedicated to supplying solutions you may anticipate to you.
Academic Papers Writers Who For the Best Result there her explanation are numerous reasons why EssayStudio is better to order written by papers papers, but I want to name some of them that have a meaning for virtually any pupil. Needless to say, the natural strategy of action is to compose your study papers all. So, of producing an effective research, the practice is not simple!
In these conditions, don't be afraid to speak without any delay to us to receive your perfect paper by an expert writer, who's ready to finish your job, however frightening it is! Then you need a specialist opinion to generate the. You will receive the proper alternate and the explanation if you click on any mistake highlighted.
The creator of the world's biggest source for obtaining scientific research have obstructed access to this website in Russia. Education is crucial, and every assignment is the major concern of student. I want to name some of these that have a significance for any student, although there are a number of reasons why it's much better to purchase on EssayStudio.
Our specialized and writers compose a number of model newspapers such as custom essays. Essay provider provides editing services and the writing. You'll be searching for a expert essay writing support which won't only produce legitimate and essays that are well written, but one which is going to deliver on.
Let our writing service give a opportunity to concentrate on things which are important to you and solve your topics. Prices It goes without saying that any type of work ought to http://qbios.gatech.edu/y-protein-might-matter-glaucoma be rewarded in a suitable way. Preparing a speech for overall public differs from explaining how something works to your grandma since you have to use style and another tone.
Recognition that is academic and success do not need to involve lots of struggle and pain. With a large number of writing jobs, you may always have an chance to have a salary that is competitive and also work with a massive choice of subjects. You are giving yourself the opportunity to work that you should finish by yourself when you choose to hire a individual to compose a paper for cash online.
The most often encountered newspaper writing service that the huge majority of our clients require is essay writing. Essay supplier provides the writing and editing services. Try out the cited above if you're searching for essay writing companies.
When you get an essay from us, because essay assistance given by our authors is customized based on your needs you're certain to relish approach. It's often plagiarized When it's too good to be true. To develop the essay a writer must edit it and make certain the storyline is exceptional.
Our website is just one of the help that is most appropriate for essay. On-line essay writing services are always offered. Pay for essay writing online a price that is decent and select an writer who will supply an original and complete college paper in yield.
The most frequently encountered paper writing service that the huge majority of our clients need is essay writing. On the lookout for essay writing services that are top isn't straightforward. Try out the mentioned previously if you are searching for essay writing businesses.
You merely have to indicate your information and newspaper attribute . Whatever the case, appropriate writing skills are essential for completion of the ideal paper. Any sort of paper that you're looking for in academic paper into a reflection paper are available here.
Many pupils have already confirmed our tool is a convenient and fantastic feature which helped them discover and fix errors that could result in a failure. You are grabbing the interest of the consumer by making the port colorful and attractive. Right product growth one ought to centre on web.
In the event that you ought to think you're a good journalist, we now have some news for you. You could be described as a author it's sensible your consumer isn't. On the flip side, our writers advise a student settles on a fascinating topic handling will be discovered by them.
ResearchGate provides a service which assists academics to do that. Writing experience is an additional problem that lots of students face. Please choose the most suitable area of the name or research of the course.


text:
If You Want Customers to Be Passionate About Your Brand, Follow These 10 Commandments
You must connect with customers on an emotional level to become a 'passion brand'
By Michael Olguin | Mar 16, 2018
Every brand desires to be loved by consumers, because they know that brand love translates to growth and increased revenue. But excitement and enthusiasm for brands doesn't happen by chance. Why do people love Harley-Davidson? Why is there such an attachment to Tesla? Why will women pay premium prices for Lululemon? Because each has built its brand from the outside in -- by identifying what their customers want, combined with what the brand value proposition is and delivering upon it -- to truly become a "passion brand."
The following 10 Commandments can help any company, whether a startup or heritage brand looking to redefine itself, make that leap to become beloved:
1. Understand who you are and who you aren't
When working hard to become a passion brand, it's important that the company understands the value it brings to the consumer. Brands need to ask themselves why they are relevant to their target audience. It's more than just talking about features and benefits; it's about enabling the consumer to become emotionally attached so the brand becomes part of their lifestyle. Conversely, avoid being something you're not. If you're an indulgent food brand, don't try to position yourself as healthy. Instead, create a backstory around the fun experience of consuming the product. Consumers recognize when brands are trying to mislead them.
2. Clearly define your target consumer -- don't try to be all things to all people
Conduct a deep dive into what your product or service offers and who benefits the most from it. Rather than rationalize why every consumer would love your brand, challenge yourself to ask who truly lives a better life because of it -- this drives emotion. That's who your target audience is. Focus on your bull's-eye with all your energy, support and marketing.
3. Build an ownable narrative
The most difficult, yet most valuable, part of creating a passion brand is building a narrative that is reflective of the brand but also completely relevant to the end user. Shazi Visram, founder and "chairmom" of the board of Happy Family, not only wanted to convey her knowledge of the natural baby food space and be positioned as an expert, she also wanted to be positioned as a mompreneur and eventually have her company acquired. All of this happened.
The lesson here is that you need to take inventory of all the assets you have to work with to build that narrative. Do you have a founders' story? Are you creating a new category? Does your product have unique ingredients? Every brand is different; therefore, how you build and, more important, tell your story will make all the difference in the world.
4. Talk with your consumer, not at them
Today, consumers are smart, informed, opinionated and willing to share their thoughts with the world. It's imperative that passion brands embrace the power today's consumer wields by being open and honest in everything they do. When something goes wrong -- a product recall, for example -- be direct about what happened, why it happened and how it will be averted in the future. This transparencywill build trust and a connection to the brand from target consumers.
5. Be disciplined and focused
When you are a small, growing brand or one that's looking to reinvent itself, you must be smart about every decision. Wrong decisions can not only derail plans but also distract you from your overall objectives. Be sure to clearly define what you are trying to accomplish, what it will take to get there and what resources will be dedicated to ensure it happens. When time, budget and energy are limited, you can't afford to be undisciplined.
6. Create a "reason to believe"
Love for a brand typically grows from a small group of extremely passionate consumers who truly believe in its mission, the quality of its product(s) and the way the brand communicates. For example, Method wanted to reinvent the hand soap category by creating a cleaner, greener and more vertically integrated offering, which it did to create an amazing passion brand. Thus, it is inherent upon any company desiring to be perceived as a passion brand to create a "reason to believe" -- a passion point that consumers can rally around. If you don't form a reason to believe, then you become a commodity, which all brands should fear.
7. Ensure your leaders are likable, believable and accessible
Senior management must build trust and confidence in all constituencies, including employees, customers, buyers, retailers and any other stakeholder. For example, when our client Justin Gold, CEO of Justin's nut butter, speaks about his brand, the natural food category or anything related to organics, he conveys authenticity, credibility and honesty. To some leaders, this comes somewhat naturally; others have to work at it. Either way, the importance of approachability shouldn't be ignored. When uncertainty in leadership exists, it trickles down to the marketplace in both direct and indirect ways.
8. Be consistent in all communication
Passion brands are consistent in everything they do. Their PR efforts are linked to their social strategy, which is aligned with their creative campaign and supported by an overarching brand narrative. This type of 360-degree communication ensures that the consumer will receive the same messages regardless of which touch point they enter. Continuity is extremely important when you're trying to win over the consumer and establish a passion brand.
9. Find a North Star
Passion brands are constantly moving forward through innovation, technology, data or anything else that allows them to look at the bigger picture so they don't lose their focus -- this is their North Star. They desire to be the best in all they do, which means they never compromise who they are or what they do.
10. Stand for something beyond profits
Most passion brands believe in a greater good. They are driven by things that go beyond being profitable. It could be the community, underserved markets or countries, or humankind in a broader sense. This noble gesture typically yields greater trust from consumers. For example, passion brand Patagonia fights to reduce greenhouse emissions, while Vita Coco is committed to re-invigorating coconut farming communities.
As consumers are challenged to find their "passion" in order to live a fulfilled life, so too should brands aspiring to maximize their relationship with target audiences. When companies are driven to fully connect with consumers on an emotional level, they have the potential to become a true passion brand.
This article originally appeared on Entrepreneur.com. Minor edits have been done by the Entrepreneur.com.ph editors
Trep Life branding branding strategies entrepus
What Trying to Be a Morning Person Taught Me About Decision-Making and Fear
13 Things Millennials Should Know Before Their First Real Job


text:
Home News Child abuse laws expanded to give more protection to teenage athletes
Child abuse laws expanded to give more protection to teenage athletes
Emily Kate Lipman
It will be illegal for sports coaches and faith leaders to have sex with young people under 18
Plans to close the legal loophole have been proposed to the Government, making it illegal for sports coaches and faith leaders to have sexual relationships with 16 and 17-year-olds who are in their care.
The new amendment to the Police, Crime, Sentencing and Courts Bill was announced in Parliament on March 9th, after the NSPCC's 'Close the Loophole' campaign had built both political and public support for the law change since launching in 2017.
Audio: Baroness Grey-Thompson talks about grooming in sport.
The legal loophole in the Position-of-Trust law, which currently applies to roles including teachers and doctors, will be extended to cover sports coaches and faith leaders.
Although the age of consent is 16, the new law will mean that it will be a criminal offence for people in these professions to engage in sexual relationships with young people under the age of 18.
After the success of his charity's campaign, Peter Wanless, CEO of the NSPCC, had hailed the decision as a "landmark step."
The NSPCC started campaigning for the law change in 2017 [Credit: NSPCC]
"We are delighted that after relentless campaigning, the Government has finally listened to our calls and agreed to close this legal loophole."
"Children and young people can return to the extracurricular activities they love without being at risk of grooming by the very adults they should look to for support and guidance," he said.
The Govt have made commitments today to make it illegal for sports coaches & religious leaders to have sex with 16 & 17-year-olds in their care. This sends a clear message that when returning to extra-curricular activities young people should be protected from grooming. (1/2)
— NSPCC (@NSPCC) March 9, 2021
Welcome news from MoJ but we should never forget it was the bravery of others speaking out about abuse they suffered that led to this. Their stories/need to close the loophole for future athletes certainly inspired me, @SarahChampionMP @Tanni_GT to keep fighting with @NSPCC https://t.co/LYX4cwb0fd
— Tracey Crouch (@tracey_crouch) March 9, 2021
The NSPCC's campaign has attracted attention from politicians in both houses of Parliament, with former Paralympic gold medalist and member of the House of Lords Baroness Grey-Thompson helping to lead the campaign for the law amendment.
Along with MP's Sarah Champion and Tracey Crouch, Baroness Grey-Thompson has spent the past five years campaigning to make it illegal for sport coaches to coerce young people under the age of 18 into having a sexual relationship with them.
"i will do everything in my power to make sure that both chambers understand the power dynamic that exists in sport"
baroness grey-thompson, house of lords
During Baroness Grey-Thompson's time in sport, she has heard from young women who have experienced coercive relationships by their sports coaches.
"The cases that have come to me are a coach who's in their mid-thirties, who has coached the young woman since she was nine, and on the day of her sixteenth birthday turns up with a bunch of flowers and says I want to go out with you," she added.
Baroness Grey-Thompson also revealed that although the proposed legislation is "a big step forward," the bill will still need to go through both chambers in order to be passed.
"I will do everything in my power to make sure that both chambers understand the power dynamic that exists in sport," she said.
Child Abuse Organisations and Contact Details:
ChildLine – 0800 1111
National Society for the Prevention of Cruelty to Children (NSPCC) – 0808 800 500
The Children's Society – 020 7841 4400
The National Association for People Abused in Childhood (NAPAC) – 0808 801 0331
Previous articleFootball Index appoints administrators as company suspends trading
Next articleFrom Meghan Markle to Sarah Everard, women are still not equal


text:
Q: Where can I find documentation of Python-Future imports that are incompletely implemented? I recently discovered that the round function available in future does not support negative digit rounding, which is incompatible with builtin round:
>>> from builtins import round
>>> round(4781, -2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/future/builtins/newround.py", line 33, in newround
    raise NotImplementedError('negative ndigits not supported yet')
NotImplementedError: negative ndigits not supported yet

This somewhat limits the usefulness of the Python-Future quick-start recommendation:

The easiest way is to start each new module with these lines:
from __future__ import (absolute_import, division,
                        print_function, unicode_literals)
from builtins import *

Then write standard Python 3 code.

I can't find the round incompatibility documented anywhere, and wonder what other functions or types behave differently or have non-implemented features. What other gotchas are there? Where are these incompatibilities documented?

A: There is no such list.
The Python-Future project is entirely separate from the Python project, so you indeed won't find any implementation gaps in the Python-Future project listed in the official Python documentation.
It is unfortunate that the reference documentation for round() fails to mention this gap in the implementation. An oblique reference to the newround module docstring isn't helpful either, as it too is very scant on details.
You'll have to ask the Python-Future project for such a list, you could try to file an issue to ask them to make such a list.
In the intervening time, you could search for NotImplementedError references in the source code. This will yield an incomplete list, as there may be short-comings in the implementation not covered by raising that exception.

On a personal note, I would recommend against using Python-Future; the project's philosophy of backporting everything without regard for suitability or performance is ill-suited for production code; for example, their super() implementation has to rely on full scans of all attributes on the class MRO to locate the relevant class to use as the first argumant, making it slow and cumbersome. Just because you can make it work somehow doesn't mean you should.
That their implementations are incomplete without clear indication where the gaps are only makes it harder to change my view on the project.

redpajama_set_name: RedPajamaStackExchange


text:
The American Journal of Tropical Medicine and Hygiene
Synopsis of Clinical Laboratory Methods
W. E. Bray. 2nd edition. Pp. 408, 51 text illustrations and 17 color plates. C. V. Mosby Co., St. Louis, Mo., 1938
Author: Chas. G. Sinclair
Experimental Lesions Induced in the Rabbit with the Acid-Fast Chromogenic Bacillus (Duval) from Human Leprosy
Author: Joseph R. Kriz
Researches in Polynesia and Melanesia. An account of investigations in Samoa, Tonga, the Ellice Group, and the New Hebrides, in 1924, 1925. Parts V–VII. (Relating to Human Diseases and Welfare.)
By Patrick A. Buxton, M.R.C.S., D.T.M. & H. Formerly Milner Research Fellow; Director of Entomology; London School of Hygiene and Tropical Medicine. London, W.C.1. November, 1928. Pages xi and 139, with seven figures and twenty-eight tables in the text, followed by twenty-seven plates of photographs
Author: Paul A. Schule
Studies on Trachoma
V. Clinical Observations in a Field Trial of Bivalent Trachoma Vaccine at Three Dosage Levels in Saudi Arabia
Authors: R. L. Nichols, S. D. Bell Jr., E. S. Murray, N. A. Haddad, and A. A. Bobb
Can Daytime Use of Bed Nets Not Treated with Insecticide Reduce the Risk of Dengue Hemorrhagic Fever Among Children in Vietnam?
Authors: Ataru Tsuzuki, Vu Dinh Thiem, Motoi Suzuki, Hideki Yanai, Toru Matsubayashi, Lay-Myint Yoshida, Le Huu Tho, Truong Tan Minh, Dang Duc Anh, Paul E. Kilgore, Masahiro Takagi, and Koya Ariyoshi
Experimental Infections of Rickettsia Prowazeki among Domestic Livestock and Ticks
R. Ormsbee, W. Burgdorfer, M. Peacock, and P. Hildebrandt
U. S. Department of Health, Education, and Welfare, Public Health Service, National Institutes of Health, National Institute of Allergy and Infectious Diseases, Rocky Mountain Laboratory, Naval Medical Research Unit No. 3, Department of the Navy, Hamilton, Montana 59840
Verification of infections in young sheep, goats, camels, and donkeys after inoculation with Rickettsia prowazeki was unsuccessful. Rickettsiae could not be isolated from peripheral blood or other tissues of the domestic animals, although similar isolation in guinea pigs and Microtus was successful. Antibody response in sheep and goats varied with the size of the inoculum. Injection of similar quantities of live or dead R. prowazeki into young sheep produced similar agglutinin and complement-fixing serum antibody responses. Thus, antibody response alone is not certain evidence of infection in domestic animals. Infection of the ticks Dermacentor andersoni, Hyalomma dromedarii, Hyalomma anatolicum excavatum, Rhipicephalus simus, Ornithodoros moubata, Ornithodoros turicata, and Ornithodoros lahorensis by feeding on rickettsemic Microtus, guinea pigs, and gerbils was unsuccessful, although intracoelomic inoculation produced generalized infections in D. andersoni and H. dromedarii but not in H. a. excavatum. Failure to produce rickettsemia in domestic animals and to infect ticks by feeding on rickettsemic Microtus suggests that neither domestic animals nor ticks are importantly involved in the epidemiological cycle of epidemic typhus.
* Present address: Armed Forces Institute of Pathology, Walter Reed Medical Center, Washington, D. C.
Copyright © 1971 by The American Society of Tropical Medicine and Hygiene 1971
https://www.ajtmh.org/abstract/journals/tpmd/20/1/article-p117.xml


text:
Disney's A Frozen Heart FAIRY TALE 2.0 Giveaway
Books October 22, 2015	by Willie Pena	0Comments
Disney-Hyperion has released three new titles as part of their Fairy Tale 2.0 campaign, each with a unique twist on popular stories: A Whole New World, Red's Untold Tale, and A Frozen Heart.
To enter to win our Fairy Tale 2.0 Prize Pack, scroll down. But first, let's check out the new titles!
A FROZEN HEART
by Elizabeth Rudnick
Told in alternating chapters from both Anna's and Hans' perspectives, A Frozen Heart takes a sophisticated look at events of Frozen, exploring the couple's backstories, motivations, and doomed relationship.
Elizabeth Rudnick has written over thirty books, including the original novel Tweet Heart and tie-ins such as Frankenweenie: A Novel; Oz: The Great and Powerful; and the best-selling junior novel based on Pirates of the Caribbean: Dead Man's Chest. She lives on Cape Cod with her husband and two lovable mutts, Jack and Ginger.
by Liz Braswell
In stores now!
What if Aladdin had never found the lamp? This first book in the A Twisted Tale line will explore a dark and daring version of Disney's Aladdin. When Jafar steals the Genie's lamp, he uses his first two wishes to become sultan and the most powerful sorcerer in the world. Agrabah lives in fear, waiting for his third and final wish. To stop the power-mad ruler, Aladdin and the deposed princess Jasmine must unite the people of Agrabah in rebellion. But soon their fight for freedom threatens to tear the kingdom apart in a costly civil war. What happens next? A Street Rat becomes a leader. A princess becomes a revolutionary. And readers will never look at the story of Aladdin in the same way again.
ONCE UPON A TIME: RED'S UNTOLD TALE
by Wendy Toliver
Red is 16 and lives with Granny in a cottage in the village, where boarding up the house and hiding during Wolfstime is a means of survival. Red help's Granny with Granny's baked good business, catering as well as door-to-door sales. Red has a constant internal battle between her wild side and her strict, overprotective upbringing, and the issue of "control" as she discovers she has a hot temper when the "mean girls" push her too far. ("When we learn to control it, we needn't fear it," Rumpelstiltskin says in the series.) She has flashbacks to her 13th year when she received her cloak and the nickname "Red." She is plagued by nightmares that she doesn't understand, but the Once Upon a Time fans will recognize them as her wolf side coming out. Red balances the difficult times with Granny at home and the girls at school with an emerging and satisfying romance with Peter.
Learn more on Disney Books
Follow Disney on Twitter and Instagram
Follow the #FairyTale2pt0 hashtag to find other giveaways across the web!
FAIRY TALE 2.0 PRIZING
Copy of A Frozen Heart
plus FAIRY TALE 2.0 tank, notepad, cosmetic pouch & pillow.
Giveaway open to US addresses only.
Prizing and samples provided by Disney-Hyperion.
1. Follow @teenswannaknow on Instagram
2. Look out for and "Like" our "Like this post to enter!" photo(s), to be posted between now and 10/30. We may post more than one photo.
3. We will pick a random winner on 10/31. Winner will be DM'd and must respond within 72 hours or a new winner will be chosen.
4. Winners must reside in the United States.
BIG Summer Book Giveaway!
'Every Last Word' Prize Pack Giveaway from Disney Publishing


To add or enroll users by training plan, you must have an administrative access. Please follow the given steps below or if you would like to watch video tutorial please click on the link given below.
Click on Enroll Users by Training plan and then follow the required steps.


Per the City it can be divided to result in four lots. Great location to be close to everything, yet have some acreage for privacy. Property is located between the 4500 and 4600 block of Godwin Blvd and across Godwin from Kingsdale Rd. Owner/Agent/Related parties. Information is not guaranteed, buyer to do their own due diligence.


We believe that man was created in the image of God, the supreme being in God's creation, for the purpose of knowing God and worshipping him. Man has a problem in that his sin nature keeps him from fulfilling this ultimate purpose.
We believe that baptism is the first step of obedience in the Christian life. It is not necessary for salvation, but an outward expression of a personal commitment to God. We believe in water immersion as the Biblical model of baptism.
We believe that Jesus Christ is the son of God, yet co-equal with God. He came to earth to provide a way for man to have a relationship with God. He did this through his death on the cross, and his resurrection, three days later. We believe that He one day will return as the sovereign King.
We believe that man is an eternal being. He will either exist with God in heaven, or separated by sin from God in hell. We believe that heaven and hell are the two places of eternal existence.
We believe the Scriptures, both Old and New Testaments, are the inspired Word of God, without error in the original writings, the complete revelation of His will for the Salvation of men, and the Divine and final authority for Christian faith and life.
We believe that the ministry of the Holy Spirit is to glorify the Lord Jesus Christ; and during this age to convict men; regenerate the believing sinner; indwell, guide, gift, instruct, and empower the believer for godly living and service. We believe that all the gifts of the Holy Spirit described in the Scriptures are still given to believers by the Holy Spirit today.
We believe that salvation is a free gift from God to man, made possible by the sacrificial death of Jesus. Salvation can only be received by repentance of sin and faith in Jesus. We believe this act is a one-time occurrence in a person's life.
Two Rivers Church is a member of the Evangelical Free Church of America (EFCA).


Michael Fabiano Exciting American Operatic Tenor – by Charles H. Riggs, III and Geoffrey Riggs.
Michael Fabiano is a tenor whom many consider to be among the most exciting American operatic personalities to emerge in years. Possessed of a dark and expressive lirico spinto voice, he made an immediate impression on New York City's opera lovers with a superb performance at the Met Finals in 2007.
Fabiano has gone on to more than fulfill that early promise. A concert performance in Verdi's Lombardi at David Geffen Hall, spectacularly successful last-minute assumptions of the tenor leads in Boheme and Lucia di Lammermoor, an innovative interpretation of Don Jose in this year's Aix-en-Provence production of Carmen — all of these dramatic and high-visibility events have helped build a career which may soon rank with this generation's greatest, if it is not already there.
Non-operatically, most notable was his recent decision to become a pilot. As with all things, Fabiano has taken this craft seriously, and flies several times a month. He calls himself a risk-taker in all things, operatically or aeronautically.
One particularly notable example of that was his assumption of the fearsome eponymous hero of Donizetti's Poliuto. Fabiano points out that Donizetti's orchestral texture for the opera is not particularly fearsome for the most part, and he was quite satisfied with the results. So were the critics.
Every great singer shows special affinity for one or two composers, Fabiano's for Donizetti being very clear, with phrasing that conveys both the essence of the moment and the journey ahead. In an uncanny way, this also lets the spectator "see" before and after, thanks to the Fabiano gift at internalizing the Donizetti "narrative", a gift attained by all too few in any composer. That is what stamps Fabiano as a true artist, not just a superb vocalist.
Fabiano has a totally distinctive sound, and one can spot that sound immediately. Yet alongside its individuality, the sound is also a virtual signature for a remarkably vivid and keen persona, marking a level of close identity between intrinsic sound and apt persona not all that common among even the most famous singers. Nothing from the Fabiano voice is abstract: always specific, in the moment, it's impossible to distinguish the sound from the feelings expressed. He is a singer equally distinguished for vivid communication and individual timbre. In him, we have a textbook example of the lirico spinto tenor, a sweet lyric core to the sound but with the needed resilience to sustain the occasional vehement outburst without compromising musical values.
What's to come? Fabiano has said one of his goals is to sing pretty much every single tenor role Verdi ever composed. He has already tackled one of Verdi's most demanding tenor roles, Don Carlo. Is there a Gustavo in his future? Or an Alvaro? Stay tuned. Fabiano is an artist whose skill and fame continues to grow, a triumphant journey that is still unfolding.
Don Carlo Moving Moment with Michael Fabiano and Mariusz Kwiecien. San Francisco Opera.
In Conversation with Michael Fabiano Exciting American Operatic Tenor.
Geoffrey Riggs and his wife, Liz, are joint webmasters for www.operacast.com dedicated to daily listings of all feature-length web-streamed opera on the Internet. Geoffrey Riggs' available publications include "The Assoluta Voice in Opera" (2003).
Charles H. Riggs, III is one of a pair of identical twins who are dyed-in-the-wool opera fans, and have been since earliest childhood. Charles worked as a network graphics editor for thirty years, and is now enjoying retirement by getting to see as many operas as he can.
Join the club today – events, Galas, receptions,newsletters,giveaways!!!


Atlas Venture, a Cambridge, Mass.-based venture capital firm, has signed a multi-year partnership with Shire Human Genetic Therapies, a Dublin, Ireland-based, publicly traded, biopharmaceutical company, to explore investment opportunities in start ups that are developing rare disease therapeutics.
The partnership will leverage Shire's capabilities and knowledge in R&D of rare diseases and Atlas' network and expertise in the formation and growth of young companies to identify strategic investments in businesses developing drugs for the treatment of rare genetic diseases.
Under the terms of the deal, professionals from both the firms will work closely together to advance the collaboration effort.
Founded in 1980, Atlas Venture has invested in over 350 early stage technology and life sciences businesses in more than 16 different countries.
Shire focuses on attention deficit hyperactivity disorder, human genetic therapies, gastrointestinal diseases and regenerative medicine as well as opportunities in other therapeutic areas through acquisitions.


text:
Sherry Elmira Duvall
Born: Sat., Jul. 17, 1948
Died: Sat., Jun. 20, 2020
Home Page All Obituaries
Express Sympathy
Sherry Elmira Duvall, 71, of Broad Top City, formerly of New Castle, DE. Passed away on June 20, 2020 at UMPC Altoona Hospital.
Born in Broad Top City on July 17, 1948, a daughter of the late Jess and Madeline (Rourke) Duvall.
She was united in married to Kenneth Duvall who preceded her in death.
She is survived by a daughter, Kendra Duvall, granddaughter, Cassandra Duvall both of Needles, CA., a brother Lynn, husband of Nancy Duvall, a sister, Rhonda, wife of Jerry Thompson, a niece Andrea Thompson, all of Broad Top City, a nephew, Doug Duvall of York. And a sister-in-law, Helen Shehan of Delaware.
Along with her parents and husband, she was preceded in death by a daughter, Kimberly Burns and a son-in-law John Burns.
She was a graduate of Tussey Mt. High School and the Harrisburg Polyclinic School of Nursing. She had been employed at the R.N. Wilmington General Hospital.
Services will be private at the convenience of the family. Interment will take place in the I.O.O.F. Cemetery, Broad Top City, PA.
In lieu of flowers, memorial contributions can be made to the Curtis A. Heath Funeral Hoe Inc. P.O. Box 214, Broad Top City, PA. 16621 to assist the family with final expenses.
Arrangements are under the direction of the Curtis A. Heath Funeral Home Inc. 5010 Railroad Ave. Broad Top City, PA. 16621. Online condolences can be made at, www.caheathfh.com.
Click to send flowers using our local area florist
Free delivery to our funeral home & save on wire fees View/Sign the Condolence Book
You have items in your basket. Click here to review and/or checkout
Allows family to respond to your message.Emails are not published at this web site.
Message of condolence:
Please note: messages are subject to review before being posted at this web site
Add Condolence Cancel
Copyright © 2021 Curtis A. Heath Funeral Home, Inc.. All Rights Reserved. | Website by CFS |