aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/Target/RISCV/RISCVGISel.rccdesc
blob: bd946befae07d23b74567bf8ad8fbc33d3d0726d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
selection_rules:
  -
    id: select_g_sllw
    priority: 100
    match:
      opcode: G_SLLW
      result_type: { kind: scalar, bits: 64 }
      operand_types:
        - { index: 1, kind: scalar, bits: 64 }
        - { index: 2, kind: scalar, bits: 64 }
      operand_banks:
        - { index: 0, bank: GPR }
        - { index: 1, bank: GPR }
        - { index: 2, bank: GPR }
    apply: { opcode: SLLW }
  -
    id: select_g_sraw
    priority: 100
    match:
      opcode: G_SRAW
      result_type: { kind: scalar, bits: 64 }
      operand_types:
        - { index: 1, kind: scalar, bits: 64 }
        - { index: 2, kind: scalar, bits: 64 }
      operand_banks:
        - { index: 0, bank: GPR }
        - { index: 1, bank: GPR }
        - { index: 2, bank: GPR }
    apply: { opcode: SRAW }
  -
    id: select_g_srlw
    priority: 100
    match:
      opcode: G_SRLW
      result_type: { kind: scalar, bits: 64 }
      operand_types:
        - { index: 1, kind: scalar, bits: 64 }
        - { index: 2, kind: scalar, bits: 64 }
      operand_banks:
        - { index: 0, bank: GPR }
        - { index: 1, bank: GPR }
        - { index: 2, bank: GPR }
    apply: { opcode: SRLW }
  -
    id: select_g_divw
    priority: 100
    match:
      opcode: G_DIVW
      result_type: { kind: scalar, bits: 64 }
      operand_types:
        - { index: 1, kind: scalar, bits: 64 }
        - { index: 2, kind: scalar, bits: 64 }
      operand_banks:
        - { index: 0, bank: GPR }
        - { index: 1, bank: GPR }
        - { index: 2, bank: GPR }
    apply: { opcode: DIVW }
  -
    id: select_g_divuw
    priority: 100
    match:
      opcode: G_DIVUW
      result_type: { kind: scalar, bits: 64 }
      operand_types:
        - { index: 1, kind: scalar, bits: 64 }
        - { index: 2, kind: scalar, bits: 64 }
      operand_banks:
        - { index: 0, bank: GPR }
        - { index: 1, bank: GPR }
        - { index: 2, bank: GPR }
    apply: { opcode: DIVUW }
  -
    id: select_g_remuw
    priority: 100
    match:
      opcode: G_REMUW
      result_type: { kind: scalar, bits: 64 }
      operand_types:
        - { index: 1, kind: scalar, bits: 64 }
        - { index: 2, kind: scalar, bits: 64 }
      operand_banks:
        - { index: 0, bank: GPR }
        - { index: 1, bank: GPR }
        - { index: 2, bank: GPR }
    apply: { opcode: REMUW }
  -
    id: select_g_fcvt_w_rv64_s32
    priority: 100
    match:
      opcode: G_FCVT_W_RV64
      result_type: { kind: scalar, bits: 64 }
      operand_types:
        - { index: 1, kind: scalar, bits: 32 }
      operand_banks:
        - { index: 0, bank: GPR }
        - { index: 1, bank: FPR }
    apply: { opcode: FCVT_W_S }
  -
    id: select_g_fcvt_w_rv64_s64
    priority: 100
    match:
      opcode: G_FCVT_W_RV64
      result_type: { kind: scalar, bits: 64 }
      operand_types:
        - { index: 1, kind: scalar, bits: 64 }
      operand_banks:
        - { index: 0, bank: GPR }
        - { index: 1, bank: FPR }
    apply: { opcode: FCVT_W_D }
  -
    id: select_g_fcvt_wu_rv64_s32
    priority: 100
    match:
      opcode: G_FCVT_WU_RV64
      result_type: { kind: scalar, bits: 64 }
      operand_types:
        - { index: 1, kind: scalar, bits: 32 }
      operand_banks:
        - { index: 0, bank: GPR }
        - { index: 1, bank: FPR }
    apply: { opcode: FCVT_WU_S }
  -
    id: select_g_fcvt_wu_rv64_s64
    priority: 100
    match:
      opcode: G_FCVT_WU_RV64
      result_type: { kind: scalar, bits: 64 }
      operand_types:
        - { index: 1, kind: scalar, bits: 64 }
      operand_banks:
        - { index: 0, bank: GPR }
        - { index: 1, bank: FPR }
    apply: { opcode: FCVT_WU_D }
  -
    id: select_g_fclass_s32
    priority: 100
    match:
      opcode: G_FCLASS
      result_type: { kind: scalar, bits: 64 }
      operand_types:
        - { index: 1, kind: scalar, bits: 32 }
      operand_banks:
        - { index: 0, bank: GPR }
        - { index: 1, bank: FPR }
    apply: { opcode: FCLASS_S }
  -
    id: select_g_fclass_s64
    priority: 100
    match:
      opcode: G_FCLASS
      result_type: { kind: scalar, bits: 64 }
      operand_types:
        - { index: 1, kind: scalar, bits: 64 }
      operand_banks:
        - { index: 0, bank: GPR }
        - { index: 1, bank: FPR }
    apply: { opcode: FCLASS_D }
  -
    id: select_g_icmp_ne_zero
    priority: 200
    match:
      opcode: G_ICMP
      result_type: { kind: scalar, bits: 64 }
      integer_predicate: { index: 1, value: ne }
      operand_types:
        - { index: 2, kind: scalar, bits: 64 }
      operand_banks:
        - { index: 0, bank: GPR }
        - { index: 2, bank: GPR }
      operand_def_constants:
        - { index: 3, value: 0 }
    apply:
      opcode: SLTU
      operands:
        - { operand: 0 }
        - { physical_register: X0, flags: [use] }
        - { operand: 2 }
      erase_operand_definitions: [3]