Page 386 - ARM 64 Bit Assembly Language
P. 386

376 Chapter 10

                  qshrn     Saturating Shift Right Narrow,
                  qrshrn    Saturating Rounding Shift Right Narrow,
                  sqshrun   Signed Saturating Shift Right Unsigned Narrow, and
                  sqrshrun Signed Saturating Rounding Shift Right Unsigned Immediate.

                  10.8.3.1 Syntax

                       (s|u)q{r}shrn    Vd.Td, Vn.Ts, #shift
                       sq{r}shrun       Vd.Td2, Vn.Ts2, #shift

                  •  If 2 is present, the Td/Ts is 16b/8h, 8h/4s,or 4s/2d
                  •  If 2 is not present, the Td/Ts is 8b/8h, 4h/4s,or 2s/2d to elsize(Td).
                  •  shift is in the range 1 to size(Td).
                  10.8.3.2 Operations

                   Name           Effect                            Description
                   xq{r}shrn      if r is present then              Each element of Vm is shifted right
                                   Vd[] ←                           with sign extension by the imme-
                                         Vm[]   imm  ≺              diate value, optionally rounded,
                                  else                              then saturated and narrowed, and
                                   Vd[] ←                           stored in the corresponding ele-
                                        Vm[]   imm ≺                ment of Vd.
                                  end if
                   sq{r}shrun     if r is present then              Each element of Vm is shifted right
                                   Vd[] ←                           with zero extension by the imme-
                                         Vm[]   imm  ≺              diate value, optionally rounded,
                                  else                              then saturated and narrowed, and
                                   Vd[] ←                           stored in the corresponding ele-
                                        Vm[]   imm ≺                ment of Vd.
                                  end if

                  10.8.3.3 Examples

                1     uqshrn      v1.4h,v6.4s,#4  // shift, saturate and narrow
                2     sqrshrn     v1.8b,v6.8h,#4  // shift, round, saturate, and narrow


                  10.8.4 Shift left or right by variable

                  These instructions shift each element in a vector left or right, using the least significant byte
                  of the corresponding element of a second vector as the shift amount:
   381   382   383   384   385   386   387   388   389   390   391