tor-browser

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

Constant-riscv-zicsr.h (1208B)


      1 // Copyright 2022 the V8 project authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 #ifndef jit_riscv64_constant_Constant_riscv64_zicsr_h_
      5 #define jit_riscv64_constant_Constant_riscv64_zicsr_h_
      6 
      7 #include "jit/riscv64/constant/Base-constant-riscv.h"
      8 namespace js {
      9 namespace jit {
     10 // RISCV CSR related bit mask and shift
     11 const int kFcsrFlagsBits = 5;
     12 const uint32_t kFcsrFlagsMask = (1 << kFcsrFlagsBits) - 1;
     13 const int kFcsrFrmBits = 3;
     14 const int kFcsrFrmShift = kFcsrFlagsBits;
     15 const uint32_t kFcsrFrmMask = ((1 << kFcsrFrmBits) - 1) << kFcsrFrmShift;
     16 const int kFcsrBits = kFcsrFlagsBits + kFcsrFrmBits;
     17 const uint32_t kFcsrMask = kFcsrFlagsMask | kFcsrFrmMask;
     18 
     19 enum OpcodeRISCVZICSR : uint32_t {
     20  // RV32/RV64 Zicsr Standard Extension
     21  RO_CSRRW = SYSTEM | (0b001 << kFunct3Shift),
     22  RO_CSRRS = SYSTEM | (0b010 << kFunct3Shift),
     23  RO_CSRRC = SYSTEM | (0b011 << kFunct3Shift),
     24  RO_CSRRWI = SYSTEM | (0b101 << kFunct3Shift),
     25  RO_CSRRSI = SYSTEM | (0b110 << kFunct3Shift),
     26  RO_CSRRCI = SYSTEM | (0b111 << kFunct3Shift),
     27 };
     28 }  // namespace jit
     29 }  // namespace js
     30 #endif  // jit_riscv64_constant_Constant_riscv64_zicsr_h_