]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
SPARC: Add functional comments for VIS4B instructions
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 7 Dec 2024 18:53:53 +0000 (19:53 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Sat, 7 Dec 2024 18:58:11 +0000 (19:58 +0100)
gcc/
* config/sparc/sparc.md (VIS4B instructions): Add comments.

gcc/config/sparc/sparc.md

index 5fd18b3ca27c612180d2e962be5ffa6c95aef564..159518d4b8fd3913e5633990662df5fed1b82c2f 100644 (file)
   [(set_attr "type" "fp")
    (set_attr "fptype" "double")])
 
-;; VIS4B instructions.
+;; VIS4B instructions (specified in the unpublished OSA 2017)
 
 (define_mode_iterator DUMODE [V8QI V4HI V2SI])
 
+;; Unpack a DUMODE right-justified value from {8,4,2} consecutive bitfields of (opnd 1):
+;; for  0 <= (opnd 2) <= 7 : V8QI value from 8 consecutive bitfields of (opnd 2) + 1 bits
+;; for  8 <= (opnd 2) <= 15: V4HI value from 4 consecutive bitfields of (opnd 2) + 1 bits
+;; for 16 <= (opnd 2) <= 31: V2SI value from 2 consecutive bitfields of (opnd 2) + 1 bits
 (define_insn "dictunpack<DUMODE:vbits>"
   [(set (match_operand:DUMODE 0 "register_operand" "=e")
         (unspec:DUMODE [(match_operand:DF 1 "register_operand" "e")
   [(set_attr "type" "fga")
    (set_attr "subtype" "other")])
 
+;; Same as fpcmp but the {8,4,2}-bit result is shifted left by (opnd 3) * {8,4,2}
 (define_insn "fpcmp<fpcmpcond:code><FPCMP:vbits><P:mode>shl"
   [(set (match_operand:P 0 "register_operand" "=r")
         (unspec:P [(fpcmpcond:FPCMP (match_operand:FPCMP 1 "register_operand" "e")
    "fpcmp<fpcmpcond:code><FPCMP:vbits>shl\t%1, %2, %3, %0"
    [(set_attr "type" "viscmp")])
 
+;; Same as fpcmpu but the {8,4,2}-bit result is shifted left by (opnd 3) * {8,4,2}
 (define_insn "fpcmpu<fpcmpucond:signed_code><FPCMP:vbits><P:mode>shl"
   [(set (match_operand:P 0 "register_operand" "=r")
         (unspec:P [(fpcmpucond:FPCMP (match_operand:FPCMP 1 "register_operand" "e")
    "fpcmpu<fpcmpucond:signed_code><FPCMP:vbits>shl\t%1, %2, %3, %0"
    [(set_attr "type" "viscmp")])
 
+;; Dual Equal comparison: the unshifted result is the OR of two EQ comparisons
+;; of (opnd 1) with 1) the 32-bit highpart of (opnd 2) concatenated with itself
+;; and 2) the 32-bit lowpart of (opnd 2) concatenated with itself.
 (define_insn "fpcmpde<FPCMP:vbits><P:mode>shl"
   [(set (match_operand:P 0 "register_operand" "=r")
         (unspec:P [(match_operand:FPCMP 1 "register_operand" "e")
    "fpcmpde<FPCMP:vbits>shl\t%1, %2, %3, %0"
    [(set_attr "type" "viscmp")])
 
+;; Unsigned Range comparison: the unshifted result is True if (opnd 1) lies in
+;; partitioned unsigned range (LB,HB) with LB) the 32-bit highpart of (opnd 2)
+;; concatenated with itself and HB) the 32-bit lowpart of (opnd 2) concatenated
+;; with itself.
 (define_insn "fpcmpur<FPCMP:vbits><P:mode>shl"
   [(set (match_operand:P 0 "register_operand" "=r")
         (unspec:P [(match_operand:FPCMP 1 "register_operand" "e")