• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
        • Soft
        • Bv
        • Imp-language
        • Ethereum
        • Event-macros
        • Java
        • Riscv
          • Specification
            • Semantics
            • Features
            • Instructions
            • Encoding
            • States
            • Reads-over-writes
            • Semantics-equivalences
              • Exec-xori-alt-defs
                • Exec-ori-alt-defs
                • Exec-andi-alt-defs
                • Exec-addi-alt-defs
                • Exec-xor-alt-defs
                • Exec-or-alt-defs
                • Exec-and-alt-defs
                • Exec-add-alt-defs
                • Exec-sll-alt-defs
                • Exec-sub-alt-defs
              • Decoding
              • Execution
            • Executable
            • Specialized
            • Optimized
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Semantics-equivalences

    Exec-xori-alt-defs

    Equivalent semantic definitions of XORI.

    Definitions and Theorems

    Theorem: exec-xori-alt-def-signed-signed

    (defthm exec-xori-alt-def-signed-signed
      (equal (exec-xori rd rs1 imm stat feat)
             (b* ((rs1-operand (read-xreg-signed (ubyte5-fix rs1)
                                                 stat feat))
                  (imm-operand (logext 12 (ubyte12-fix imm)))
                  (result (logxor rs1-operand imm-operand))
                  (stat (write-xreg (ubyte5-fix rd)
                                    result stat feat))
                  (stat (inc4-pc stat feat)))
               stat)))

    Theorem: exec-xori-alt-def-unsigned-signed

    (defthm exec-xori-alt-def-unsigned-signed
      (equal (exec-xori rd rs1 imm stat feat)
             (b* ((rs1-operand (read-xreg-unsigned (ubyte5-fix rs1)
                                                   stat feat))
                  (imm-operand (logext 12 (ubyte12-fix imm)))
                  (result (logxor rs1-operand imm-operand))
                  (stat (write-xreg (ubyte5-fix rd)
                                    result stat feat))
                  (stat (inc4-pc stat feat)))
               stat)))

    Theorem: exec-xori-alt-def-signed-unsigned

    (defthm exec-xori-alt-def-signed-unsigned
      (equal (exec-xori rd rs1 imm stat feat)
             (b* ((rs1-operand (read-xreg-signed (ubyte5-fix rs1)
                                                 stat feat))
                  (imm-operand (loghead (feat->xlen feat)
                                        (logext 12 (ubyte12-fix imm))))
                  (result (logxor rs1-operand imm-operand))
                  (stat (write-xreg (ubyte5-fix rd)
                                    result stat feat))
                  (stat (inc4-pc stat feat)))
               stat)))