• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
        • Svex-decomposition-methodology
        • Sv-versus-esim
        • Svex-decomp
        • Svex-compose-dfs
        • Svex-compilation
        • Moddb
        • Svmods
        • Svstmt
        • Sv-tutorial
        • Expressions
          • Rewriting
          • Svex
          • Bit-blasting
          • Functions
          • 4vmask
          • Why-infinite-width
          • Svex-vars
          • Evaluation
          • Values
            • 4vec
            • 4vec-<<=
            • 3vec
            • 2vec
              • 2vec-p
              • If-2vec-p
                • 2vec->val
              • 2vecx
              • 2vecnatx
              • 4vec-x
              • 4vec-1x
              • 4vec-1z
              • 4vec-z
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • 2vec

    If-2vec-p

    Helper macro for writing optimized 4vec-operations.

    (if-2vec-p vars 2vec-body 4vec-body) is a macro for writing 4vec operations. Most of these operations can be optimized in the case where their arguments are two-valued. In the logic, this simply expands to 4vec-body. In the execution, it checks whether all of the arguments are 2vecs (which is fast), if so executes 2vec-body, and otherwise executes 4vec-body.