• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
        • Program-execution
        • Sdm-instruction-set-summary
        • Tlb
        • Running-linux
        • Introduction
        • Asmtest
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
          • X86isa-state
          • Syscalls
          • Cpuid
          • Linear-memory
          • Rflag-specifications
          • Characterizing-undefined-behavior
          • App-view
          • Top-level-memory
          • X86-decoder
          • Physical-memory
          • Decoding-and-spec-utils
          • Instructions
            • Two-byte-opcodes
            • One-byte-opcodes
            • Fp-opcodes
            • Instruction-semantic-functions
              • Sar-spec
              • Shr-spec
              • Sal/shl-spec
              • Rol-spec
              • Ror-spec
              • Rcl-spec
              • Rcr-spec
              • Simd-sub-spec
              • Simd-add-spec
              • Imul-spec
              • Mul-spec
              • Idiv-spec
              • Div-spec
              • Shrd-spec
              • Shld-spec
              • Gpr-arith/logic-spec
              • Shrx-spec
              • Shlx-spec
              • Sarx-spec
              • Floating-point-specifications
                • Floating-point-converts
                  • Sse-cvt-fp1-to-fp2-special
                    • Sse-cvt-fp-to-int
                    • Sse-cvt-int-to-fp
                    • Sp-sse-cvt-int-to-fp
                    • Dp-sse-cvt-int-to-fp
                    • Sp-sse-cvt-fp-to-int
                    • Dp-sse-cvt-fp-to-int
                    • Sse-cvt-sp-to-dp
                    • Sse-cvt-fp-to-int-special
                    • Sse-cvt-dp-to-sp
                    • Rat-round-to-int
                    • Denormalp
                    • Rat-round-to-int-ru
                    • Rat-round-to-int-rd
                    • Rat-round-to-int-rz
                    • Rat-round-to-int-rn
                  • Floating-point-arithmetic-specifications
                  • Basic-floating-point-utilities
                  • Floating-point-comparison-specifications
              • X86-illegal-instruction
              • Implemented-opcodes
              • Opcode-maps
              • X86-general-protection
              • X86-device-not-available
              • X86-step-unimplemented
              • Privileged-opcodes
              • Three-byte-opcodes
            • Register-readers-and-writers
            • X86-modes
            • Segmentation
            • Other-non-deterministic-computations
            • Environment
            • Paging
          • Implemented-opcodes
          • To-do
          • Proof-utilities
          • Peripherals
          • Model-validation
          • Modelcalls
          • Concrete-simulation-examples
          • Utils
          • Debugging-code-proofs
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Floating-point-converts

    Sse-cvt-fp1-to-fp2-special

    Check whether the operand is SNaN or QNaN and then return corresponding result. Also handle the infinities.

    Signature
    (sse-cvt-fp1-to-fp2-special kind sign implicit 
                                frac frac-width1 exp-width2 frac-width2) 
     
      → 
    (mv * * * * * *)
    Arguments
    frac — Guard (natp frac).
    frac-width1 — Guard (posp frac-width1).
    exp-width2 — Guard (posp exp-width2).
    frac-width2 — Guard (posp frac-width2).

    Definitions and Theorems

    Function: sse-cvt-fp1-to-fp2-special

    (defun sse-cvt-fp1-to-fp2-special
           (kind sign implicit
                 frac frac-width1 exp-width2 frac-width2)
     (declare (type (unsigned-byte 1) sign)
              (type (unsigned-byte 1) implicit))
     (declare (xargs :guard (and (natp frac)
                                 (posp frac-width1)
                                 (posp exp-width2)
                                 (posp frac-width2))))
     (let ((__function__ 'sse-cvt-fp1-to-fp2-special))
      (declare (ignorable __function__))
      (let ((invalid (eq kind 'snan)))
       (cond
           ((eq kind 'snan)
            (let ((exp-width exp-width2)
                  (frac-width frac-width2)
                  (nan-frac-bits
                       (ash (part-select frac
                                         :low 0
                                         :high (nfix (- frac-width1 2)))
                            (- frac-width2 frac-width1))))
              (flag-make-special-bp 'qnan
                                    nan-frac-bits sign invalid)))
           ((or (eq kind 'qnan) (eq kind 'indef))
            (let ((exp-width exp-width2)
                  (frac (ash frac (- frac-width2 frac-width1))))
              (mv t sign (fp-max-exp exp-width)
                  implicit frac invalid)))
           ((eq kind 'inf)
            (let ((exp-width exp-width2)
                  (frac-width frac-width2))
              (flag-make-special-bp 'inf
                                    0 sign invalid)))
           (t (mv nil 0 0 0 0 invalid))))))

    Theorem: integerp-sse-cvt-fp1-to-fp2-special-1

    (defthm integerp-sse-cvt-fp1-to-fp2-special-1
      (implies
           (integerp sign)
           (integerp (mv-nth 1
                             (sse-cvt-fp1-to-fp2-special
                                  kind sign implicit frac
                                  frac-width1 exp-width2 frac-width2))))
      :rule-classes :type-prescription)

    Theorem: integerp-sse-cvt-fp1-to-fp2-special-2

    (defthm integerp-sse-cvt-fp1-to-fp2-special-2
     (integerp
      (mv-nth
       2
       (sse-cvt-fp1-to-fp2-special kind sign implicit frac
                                   frac-width1 exp-width2 frac-width2)))
     :rule-classes :type-prescription)

    Theorem: integerp-sse-cvt-fp1-to-fp2-special-3

    (defthm integerp-sse-cvt-fp1-to-fp2-special-3
      (implies
           (integerp implicit)
           (integerp (mv-nth 3
                             (sse-cvt-fp1-to-fp2-special
                                  kind sign implicit frac
                                  frac-width1 exp-width2 frac-width2))))
      :rule-classes :type-prescription)

    Theorem: integerp-sse-cvt-fp1-to-fp2-special-4

    (defthm integerp-sse-cvt-fp1-to-fp2-special-4
     (integerp
      (mv-nth
       4
       (sse-cvt-fp1-to-fp2-special kind sign implicit frac
                                   frac-width1 exp-width2 frac-width2)))
     :rule-classes :type-prescription)