tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Lowering-arm.h (4316B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
      2 * vim: set ts=8 sts=2 et sw=2 tw=80:
      3 * This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef jit_arm_Lowering_arm_h
      8 #define jit_arm_Lowering_arm_h
      9 
     10 #include "jit/shared/Lowering-shared.h"
     11 
     12 namespace js {
     13 namespace jit {
     14 
     15 class LIRGeneratorARM : public LIRGeneratorShared {
     16 protected:
     17  LIRGeneratorARM(MIRGenerator* gen, MIRGraph& graph, LIRGraph& lirGraph)
     18      : LIRGeneratorShared(gen, graph, lirGraph) {}
     19 
     20  // Returns a box allocation with type set to reg1 and payload set to reg2.
     21  LBoxAllocation useBoxFixed(MDefinition* mir, Register reg1, Register reg2,
     22                             bool useAtStart = false);
     23 
     24  // x86 has constraints on what registers can be formatted for 1-byte
     25  // stores and loads; on ARM all registers are okay.
     26  LAllocation useByteOpRegister(MDefinition* mir);
     27  LAllocation useByteOpRegisterAtStart(MDefinition* mir);
     28  LAllocation useByteOpRegisterOrNonDoubleConstant(MDefinition* mir);
     29  LDefinition tempByteOpRegister();
     30 
     31  inline LDefinition tempToUnbox() { return LDefinition::BogusTemp(); }
     32 
     33  bool needTempForPostBarrier() { return false; }
     34 
     35  void lowerUntypedPhiInput(MPhi* phi, uint32_t inputPosition, LBlock* block,
     36                            size_t lirIndex);
     37  void lowerInt64PhiInput(MPhi* phi, uint32_t inputPosition, LBlock* block,
     38                          size_t lirIndex);
     39  void defineInt64Phi(MPhi* phi, size_t lirIndex);
     40 
     41  void lowerForShift(LInstructionHelper<1, 2, 0>* ins, MDefinition* mir,
     42                     MDefinition* lhs, MDefinition* rhs);
     43  void lowerUrshD(MUrsh* mir);
     44 
     45  void lowerPowOfTwoI(MPow* mir);
     46 
     47  void lowerForALU(LInstructionHelper<1, 1, 0>* ins, MDefinition* mir,
     48                   MDefinition* input);
     49  void lowerForALU(LInstructionHelper<1, 2, 0>* ins, MDefinition* mir,
     50                   MDefinition* lhs, MDefinition* rhs);
     51 
     52  void lowerForALUInt64(LInstructionHelper<INT64_PIECES, INT64_PIECES, 0>* ins,
     53                        MDefinition* mir, MDefinition* input);
     54  void lowerForALUInt64(
     55      LInstructionHelper<INT64_PIECES, 2 * INT64_PIECES, 0>* ins,
     56      MDefinition* mir, MDefinition* lhs, MDefinition* rhs);
     57  void lowerForMulInt64(LMulI64* ins, MMul* mir, MDefinition* lhs,
     58                        MDefinition* rhs);
     59  template <class LInstr>
     60  void lowerForShiftInt64(LInstr* ins, MDefinition* mir, MDefinition* lhs,
     61                          MDefinition* rhs);
     62 
     63  void lowerForFPU(LInstructionHelper<1, 1, 0>* ins, MDefinition* mir,
     64                   MDefinition* input);
     65  void lowerForFPU(LInstructionHelper<1, 2, 0>* ins, MDefinition* mir,
     66                   MDefinition* lhs, MDefinition* rhs);
     67 
     68  void lowerBuiltinInt64ToFloatingPoint(MBuiltinInt64ToFloatingPoint* ins);
     69  void lowerWasmBuiltinTruncateToInt64(MWasmBuiltinTruncateToInt64* ins);
     70  void lowerWasmBuiltinTruncateToInt32(MWasmBuiltinTruncateToInt32* ins);
     71  void lowerTruncateDToInt32(MTruncateToInt32* ins);
     72  void lowerTruncateFToInt32(MTruncateToInt32* ins);
     73  void lowerDivI(MDiv* div);
     74  void lowerModI(MMod* mod);
     75  void lowerDivI64(MDiv* div);
     76  void lowerWasmBuiltinDivI64(MWasmBuiltinDivI64* div);
     77  void lowerModI64(MMod* mod);
     78  void lowerWasmBuiltinModI64(MWasmBuiltinModI64* mod);
     79  void lowerUDivI64(MDiv* div);
     80  void lowerUModI64(MMod* mod);
     81  void lowerMulI(MMul* mul, MDefinition* lhs, MDefinition* rhs);
     82  void lowerUDiv(MDiv* div);
     83  void lowerUMod(MMod* mod);
     84  void lowerWasmSelectI(MWasmSelect* select);
     85  void lowerWasmSelectI64(MWasmSelect* select);
     86 
     87  void lowerBigIntPtrLsh(MBigIntPtrLsh* ins);
     88  void lowerBigIntPtrRsh(MBigIntPtrRsh* ins);
     89  void lowerBigIntPtrDiv(MBigIntPtrDiv* ins);
     90  void lowerBigIntPtrMod(MBigIntPtrMod* ins);
     91 
     92  void lowerAtomicLoad64(MLoadUnboxedScalar* ins);
     93  void lowerAtomicStore64(MStoreUnboxedScalar* ins);
     94 
     95  LTableSwitch* newLTableSwitch(const LAllocation& in,
     96                                const LDefinition& inputCopy);
     97  LTableSwitchV* newLTableSwitchV(const LBoxAllocation& in);
     98 
     99  void lowerPhi(MPhi* phi);
    100 };
    101 
    102 using LIRGeneratorSpecific = LIRGeneratorARM;
    103 
    104 }  // namespace jit
    105 }  // namespace js
    106 
    107 #endif /* jit_arm_Lowering_arm_h */