1 !sum
2 # ShiftAllLeft — shift every element left by one amount. The amount is a
3 # scalar in the API, which the lowering broadcasts into the 64-bit lanes of the
4 # vector LSL (wide elements) shifts each narrower element by. LSL gives 0 for
5 # an amount of the element width or more, as the API does, so the amount needs
6 # no clamping. A constant amount below the element width becomes the immediate
7 # form, shiftAllLeftConst (sftimm).
8 - go: ShiftAllLeft
9 asm: "ZLSL"
10 sftimm: true
11 in:
12 - &int
13 go: $t
14 base: int|uint
15 - &wideShift
16 class: vreg
17 elemBits: 64
18 treatLikeAScalarOfSize: 64
19 name: shift
20 out:
21 - *int
22
23 # LSL has no wide form for 64-bit elements; LSL (vectors) takes the amount
24 # from each element of a vector instead, and gives 0 for 64 or more.
25 - go: ShiftAllLeft
26 asm: "ZLSL"
27 sftimm: true
28 in:
29 - &int64
30 go: $t
31 base: int|uint
32 elemBits: 64
33 - *wideShift
34 - class: mask # governing predicate
35 out:
36 - *int64
37
38 # shiftAllLeftConst — LSL (immediate, unpredicated), a shift by an amount
39 # below the element width. No API; sftimm lowers ShiftAllLeft to it.
40 - go: shiftAllLeftConst
41 asm: "ZLSL"
42 ssaVariant: "const"
43 in:
44 - class: immediate
45 - *int
46 out:
47 - *int
48
49 # ShiftLeft -- shift each element by the matching element of shift, LSL
50 # (vectors), which is predicated-only, like Div. An amount of the element
51 # width or more yields 0, as the API does. For 8- to 32-bit elements the
52 # machine ops take the variant "vec" to keep them apart from those of LSL
53 # (wide elements), which ShiftAllLeft uses; for 64-bit elements
54 # ShiftAllLeft uses this same instruction.
55 - go: ShiftLeft
56 asm: "ZLSL"
57 ssaVariant: "vec"
58 in:
59 - &shiftx
60 go: $t
61 base: int|uint
62 elemBits: 8|16|32
63 - &shiftv
64 go: $t
65 overwriteBase: uint
66 name: shift
67 - class: mask # governing predicate
68 out:
69 - *shiftx
70
71 - go: ShiftLeft
72 asm: "ZLSL"
73 in:
74 - &shiftx64
75 go: $t
76 base: int|uint
77 elemBits: 64
78 - *shiftv
79 - class: mask # governing predicate
80 out:
81 - *shiftx64
82
83 # ShiftRight -- LSR for unsigned and ASR for signed elements (vectors), the
84 # same shape as ShiftLeft. For an amount of the element width or more LSR
85 # yields 0 and ASR the sign, as the API does. As for ShiftLeft, 8- to 32-bit
86 # elements take the variant "vec" to keep them apart from the wide-element
87 # forms ShiftAllRight uses, and 64-bit elements share its op.
88 - go: ShiftRight
89 signed: false
90 asm: "ZLSR"
91 ssaVariant: "vec"
92 in:
93 - &shiftxu
94 go: $t
95 base: uint
96 elemBits: 8|16|32
97 - *shiftv
98 - class: mask # governing predicate
99 out:
100 - *shiftxu
101
102 - go: ShiftRight
103 signed: false
104 asm: "ZLSR"
105 in:
106 - &shiftxu64
107 go: $t
108 base: uint
109 elemBits: 64
110 - *shiftv
111 - class: mask # governing predicate
112 out:
113 - *shiftxu64
114
115 - go: ShiftRight
116 signed: true
117 asm: "ZASR"
118 ssaVariant: "vec"
119 in:
120 - &shiftxs
121 go: $t
122 base: int
123 elemBits: 8|16|32
124 - *shiftv
125 - class: mask # governing predicate
126 out:
127 - *shiftxs
128
129 - go: ShiftRight
130 signed: true
131 asm: "ZASR"
132 in:
133 - &shiftxs64
134 go: $t
135 base: int
136 elemBits: 64
137 - *shiftv
138 - class: mask # governing predicate
139 out:
140 - *shiftxs64
141
View as plain text