150
|
1
|
|
2 .. _gmir-opcodes:
|
|
3
|
|
4 Generic Opcodes
|
|
5 ===============
|
|
6
|
|
7 .. contents::
|
|
8 :local:
|
|
9
|
|
10 .. note::
|
|
11
|
|
12 This documentation does not yet fully account for vectors. Many of the
|
|
13 scalar/integer/floating-point operations can also take vectors.
|
|
14
|
|
15 Constants
|
|
16 ---------
|
|
17
|
|
18 G_IMPLICIT_DEF
|
|
19 ^^^^^^^^^^^^^^
|
|
20
|
|
21 An undefined value.
|
|
22
|
|
23 .. code-block:: none
|
|
24
|
|
25 %0:_(s32) = G_IMPLICIT_DEF
|
|
26
|
|
27 G_CONSTANT
|
|
28 ^^^^^^^^^^
|
|
29
|
|
30 An integer constant.
|
|
31
|
|
32 .. code-block:: none
|
|
33
|
|
34 %0:_(s32) = G_CONSTANT i32 1
|
|
35
|
|
36 G_FCONSTANT
|
|
37 ^^^^^^^^^^^
|
|
38
|
|
39 A floating point constant.
|
|
40
|
|
41 .. code-block:: none
|
|
42
|
|
43 %0:_(s32) = G_FCONSTANT float 1.0
|
|
44
|
|
45 G_FRAME_INDEX
|
|
46 ^^^^^^^^^^^^^
|
|
47
|
|
48 The address of an object in the stack frame.
|
|
49
|
|
50 .. code-block:: none
|
|
51
|
|
52 %1:_(p0) = G_FRAME_INDEX %stack.0.ptr0
|
|
53
|
|
54 G_GLOBAL_VALUE
|
|
55 ^^^^^^^^^^^^^^
|
|
56
|
|
57 The address of a global value.
|
|
58
|
|
59 .. code-block:: none
|
|
60
|
|
61 %0(p0) = G_GLOBAL_VALUE @var_local
|
|
62
|
|
63 G_BLOCK_ADDR
|
|
64 ^^^^^^^^^^^^
|
|
65
|
|
66 The address of a basic block.
|
|
67
|
|
68 .. code-block:: none
|
|
69
|
|
70 %0:_(p0) = G_BLOCK_ADDR blockaddress(@test_blockaddress, %ir-block.block)
|
|
71
|
|
72 Integer Extension and Truncation
|
|
73 --------------------------------
|
|
74
|
|
75 G_ANYEXT
|
|
76 ^^^^^^^^
|
|
77
|
|
78 Extend the underlying scalar type of an operation, leaving the high bits
|
|
79 unspecified.
|
|
80
|
|
81 .. code-block:: none
|
|
82
|
|
83 %1:_(s32) = G_ANYEXT %0:_(s16)
|
|
84
|
|
85 G_SEXT
|
|
86 ^^^^^^
|
|
87
|
|
88 Sign extend the underlying scalar type of an operation, copying the sign bit
|
|
89 into the newly-created space.
|
|
90
|
|
91 .. code-block:: none
|
|
92
|
|
93 %1:_(s32) = G_SEXT %0:_(s16)
|
|
94
|
|
95 G_SEXT_INREG
|
|
96 ^^^^^^^^^^^^
|
|
97
|
|
98 Sign extend the value from an arbitrary bit position, copying the sign bit
|
|
99 into all bits above it. This is equivalent to a shl + ashr pair with an
|
|
100 appropriate shift amount. $sz is an immediate (MachineOperand::isImm()
|
|
101 returns true) to allow targets to have some bitwidths legal and others
|
|
102 lowered. This opcode is particularly useful if the target has sign-extension
|
|
103 instructions that are cheaper than the constituent shifts as the optimizer is
|
|
104 able to make decisions on whether it's better to hang on to the G_SEXT_INREG
|
|
105 or to lower it and optimize the individual shifts.
|
|
106
|
|
107 .. code-block:: none
|
|
108
|
|
109 %1:_(s32) = G_SEXT_INREG %0:_(s32), 16
|
|
110
|
|
111 G_ZEXT
|
|
112 ^^^^^^
|
|
113
|
|
114 Zero extend the underlying scalar type of an operation, putting zero bits
|
|
115 into the newly-created space.
|
|
116
|
|
117 .. code-block:: none
|
|
118
|
|
119 %1:_(s32) = G_ZEXT %0:_(s16)
|
|
120
|
|
121 G_TRUNC
|
|
122 ^^^^^^^
|
|
123
|
|
124 Truncate the underlying scalar type of an operation. This is equivalent to
|
|
125 G_EXTRACT for scalar types, but acts elementwise on vectors.
|
|
126
|
|
127 .. code-block:: none
|
|
128
|
|
129 %1:_(s16) = G_TRUNC %0:_(s32)
|
|
130
|
|
131 Type Conversions
|
|
132 ----------------
|
|
133
|
|
134 G_INTTOPTR
|
|
135 ^^^^^^^^^^
|
|
136
|
|
137 Convert an integer to a pointer.
|
|
138
|
|
139 .. code-block:: none
|
|
140
|
|
141 %1:_(p0) = G_INTTOPTR %0:_(s32)
|
|
142
|
|
143 G_PTRTOINT
|
|
144 ^^^^^^^^^^
|
|
145
|
|
146 Convert a pointer to an integer.
|
|
147
|
|
148 .. code-block:: none
|
|
149
|
|
150 %1:_(s32) = G_PTRTOINT %0:_(p0)
|
|
151
|
|
152 G_BITCAST
|
|
153 ^^^^^^^^^
|
|
154
|
|
155 Reinterpret a value as a new type. This is usually done without changing any
|
|
156 bits but this is not always the case due a sublety in the definition of the
|
|
157 :ref:`LLVM-IR Bitcast Instruction <i_bitcast>`.
|
|
158
|
|
159 .. code-block:: none
|
|
160
|
|
161 %1:_(s64) = G_BITCAST %0:_(<2 x s32>)
|
|
162
|
|
163 G_ADDRSPACE_CAST
|
|
164 ^^^^^^^^^^^^^^^^
|
|
165
|
|
166 Convert a pointer to an address space to a pointer to another address space.
|
|
167
|
|
168 .. code-block:: none
|
|
169
|
|
170 %1:_(p1) = G_ADDRSPACE_CAST %0:_(p0)
|
|
171
|
|
172 .. caution::
|
|
173
|
|
174 :ref:`i_addrspacecast` doesn't mention what happens if the cast is simply
|
|
175 invalid (i.e. if the address spaces are disjoint).
|
|
176
|
|
177 Scalar Operations
|
|
178 -----------------
|
|
179
|
|
180 G_EXTRACT
|
|
181 ^^^^^^^^^
|
|
182
|
|
183 Extract a register of the specified size, starting from the block given by
|
|
184 index. This will almost certainly be mapped to sub-register COPYs after
|
|
185 register banks have been selected.
|
|
186
|
|
187 G_INSERT
|
|
188 ^^^^^^^^
|
|
189
|
|
190 Insert a smaller register into a larger one at the specified bit-index.
|
|
191
|
|
192 G_MERGE_VALUES
|
|
193 ^^^^^^^^^^^^^^
|
|
194
|
|
195 Concatenate multiple registers of the same size into a wider register.
|
|
196 The input operands are always ordered from lowest bits to highest:
|
|
197
|
|
198 .. code-block:: none
|
|
199
|
|
200 %0:(s32) = G_MERGE_VALUES %bits_0_7:(s8), %bits_8_15:(s8),
|
|
201 %bits_16_23:(s8), %bits_24_31:(s8)
|
|
202
|
|
203 G_UNMERGE_VALUES
|
|
204 ^^^^^^^^^^^^^^^^
|
|
205
|
|
206 Extract multiple registers of the specified size, starting from blocks given by
|
|
207 indexes. This will almost certainly be mapped to sub-register COPYs after
|
|
208 register banks have been selected.
|
|
209 The output operands are always ordered from lowest bits to highest:
|
|
210
|
|
211 .. code-block:: none
|
|
212
|
|
213 %bits_0_7:(s8), %bits_8_15:(s8),
|
|
214 %bits_16_23:(s8), %bits_24_31:(s8) = G_UNMERGE_VALUES %0:(s32)
|
|
215
|
|
216 G_BSWAP
|
|
217 ^^^^^^^
|
|
218
|
|
219 Reverse the order of the bytes in a scalar.
|
|
220
|
|
221 .. code-block:: none
|
|
222
|
|
223 %1:_(s32) = G_BSWAP %0:_(s32)
|
|
224
|
|
225 G_BITREVERSE
|
|
226 ^^^^^^^^^^^^
|
|
227
|
|
228 Reverse the order of the bits in a scalar.
|
|
229
|
|
230 .. code-block:: none
|
|
231
|
|
232 %1:_(s32) = G_BITREVERSE %0:_(s32)
|
|
233
|
|
234 Integer Operations
|
|
235 -------------------
|
|
236
|
|
237 G_ADD, G_SUB, G_MUL, G_AND, G_OR, G_XOR, G_SDIV, G_UDIV, G_SREM, G_UREM
|
|
238 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
239
|
|
240 These each perform their respective integer arithmetic on a scalar.
|
|
241
|
|
242 .. code-block:: none
|
|
243
|
|
244 %2:_(s32) = G_ADD %0:_(s32), %1:_(s32)
|
|
245
|
173
|
246 G_SADDSAT, G_UADDSAT, G_SSUBSAT, G_USUBSAT
|
|
247 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
248
|
|
249 Signed and unsigned addition and subtraction with saturation.
|
|
250
|
|
251 .. code-block:: none
|
|
252
|
|
253 %2:_(s32) = G_SADDSAT %0:_(s32), %1:_(s32)
|
|
254
|
150
|
255 G_SHL, G_LSHR, G_ASHR
|
|
256 ^^^^^^^^^^^^^^^^^^^^^
|
|
257
|
|
258 Shift the bits of a scalar left or right inserting zeros (sign-bit for G_ASHR).
|
|
259
|
|
260 G_ICMP
|
|
261 ^^^^^^
|
|
262
|
|
263 Perform integer comparison producing non-zero (true) or zero (false). It's
|
|
264 target specific whether a true value is 1, ~0U, or some other non-zero value.
|
|
265
|
|
266 G_SELECT
|
|
267 ^^^^^^^^
|
|
268
|
|
269 Select between two values depending on a zero/non-zero value.
|
|
270
|
|
271 .. code-block:: none
|
|
272
|
|
273 %5:_(s32) = G_SELECT %4(s1), %6, %2
|
|
274
|
|
275 G_PTR_ADD
|
|
276 ^^^^^^^^^
|
|
277
|
|
278 Add a scalar offset in addressible units to a pointer. Addressible units are
|
|
279 typically bytes but this may vary between targets.
|
|
280
|
|
281 .. code-block:: none
|
|
282
|
|
283 %1:_(p0) = G_PTR_ADD %0:_(p0), %1:_(s32)
|
|
284
|
|
285 .. caution::
|
|
286
|
|
287 There are currently no in-tree targets that use this with addressable units
|
|
288 not equal to 8 bit.
|
|
289
|
|
290 G_PTR_MASK
|
|
291 ^^^^^^^^^^
|
|
292
|
|
293 Zero the least significant N bits of a pointer.
|
|
294
|
|
295 .. code-block:: none
|
|
296
|
|
297 %1:_(p0) = G_PTR_MASK %0, 3
|
|
298
|
|
299 G_SMIN, G_SMAX, G_UMIN, G_UMAX
|
|
300 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
301
|
|
302 Take the minimum/maximum of two values.
|
|
303
|
|
304 .. code-block:: none
|
|
305
|
|
306 %5:_(s32) = G_SMIN %6, %2
|
|
307
|
|
308 G_UADDO, G_SADDO, G_USUBO, G_SSUBO, G_SMULO, G_UMULO
|
|
309 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
310
|
|
311 Perform the requested arithmetic and produce a carry output in addition to the
|
|
312 normal result.
|
|
313
|
|
314 .. code-block:: none
|
|
315
|
|
316 %3:_(s32), %4:_(s1) = G_UADDO %0, %1
|
|
317
|
|
318 G_UADDE, G_SADDE, G_USUBE, G_SSUBE
|
|
319 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
320
|
|
321 Perform the requested arithmetic and consume a carry input in addition to the
|
|
322 normal input. Also produce a carry output in addition to the normal result.
|
|
323
|
|
324 .. code-block:: none
|
|
325
|
|
326 %4:_(s32), %5:_(s1) = G_UADDE %0, %1, %3:_(s1)
|
|
327
|
|
328 G_UMULH, G_SMULH
|
|
329 ^^^^^^^^^^^^^^^^
|
|
330
|
|
331 Multiply two numbers at twice the incoming bit width (signed) and return
|
|
332 the high half of the result.
|
|
333
|
|
334 .. code-block:: none
|
|
335
|
|
336 %3:_(s32) = G_UMULH %0, %1
|
|
337
|
|
338 G_CTLZ, G_CTTZ, G_CTPOP
|
|
339 ^^^^^^^^^^^^^^^^^^^^^^^
|
|
340
|
|
341 Count leading zeros, trailing zeros, or number of set bits.
|
|
342
|
|
343 .. code-block:: none
|
|
344
|
|
345 %2:_(s33) = G_CTLZ_ZERO_UNDEF %1
|
|
346 %2:_(s33) = G_CTTZ_ZERO_UNDEF %1
|
|
347 %2:_(s33) = G_CTPOP %1
|
|
348
|
|
349 G_CTLZ_ZERO_UNDEF, G_CTTZ_ZERO_UNDEF
|
|
350 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
351
|
|
352 Count leading zeros or trailing zeros. If the value is zero then the result is
|
|
353 undefined.
|
|
354
|
|
355 .. code-block:: none
|
|
356
|
|
357 %2:_(s33) = G_CTLZ_ZERO_UNDEF %1
|
|
358 %2:_(s33) = G_CTTZ_ZERO_UNDEF %1
|
|
359
|
|
360 Floating Point Operations
|
|
361 -------------------------
|
|
362
|
|
363 G_FCMP
|
|
364 ^^^^^^
|
|
365
|
|
366 Perform floating point comparison producing non-zero (true) or zero
|
|
367 (false). It's target specific whether a true value is 1, ~0U, or some other
|
|
368 non-zero value.
|
|
369
|
|
370 G_FNEG
|
|
371 ^^^^^^
|
|
372
|
|
373 Floating point negation.
|
|
374
|
|
375 G_FPEXT
|
|
376 ^^^^^^^
|
|
377
|
|
378 Convert a floating point value to a larger type.
|
|
379
|
|
380 G_FPTRUNC
|
|
381 ^^^^^^^^^
|
|
382
|
|
383 Convert a floating point value to a narrower type.
|
|
384
|
|
385 G_FPTOSI, G_FPTOUI, G_SITOFP, G_UITOFP
|
|
386 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
387
|
|
388 Convert between integer and floating point.
|
|
389
|
|
390 G_FABS
|
|
391 ^^^^^^
|
|
392
|
|
393 Take the absolute value of a floating point value.
|
|
394
|
|
395 G_FCOPYSIGN
|
|
396 ^^^^^^^^^^^
|
|
397
|
|
398 Copy the value of the first operand, replacing the sign bit with that of the
|
|
399 second operand.
|
|
400
|
|
401 G_FCANONICALIZE
|
|
402 ^^^^^^^^^^^^^^^
|
|
403
|
|
404 See :ref:`i_intr_llvm_canonicalize`.
|
|
405
|
|
406 G_FMINNUM
|
|
407 ^^^^^^^^^
|
|
408
|
|
409 Perform floating-point minimum on two values.
|
|
410
|
|
411 In the case where a single input is a NaN (either signaling or quiet),
|
|
412 the non-NaN input is returned.
|
|
413
|
|
414 The return value of (FMINNUM 0.0, -0.0) could be either 0.0 or -0.0.
|
|
415
|
|
416 G_FMAXNUM
|
|
417 ^^^^^^^^^
|
|
418
|
|
419 Perform floating-point maximum on two values.
|
|
420
|
|
421 In the case where a single input is a NaN (either signaling or quiet),
|
|
422 the non-NaN input is returned.
|
|
423
|
|
424 The return value of (FMAXNUM 0.0, -0.0) could be either 0.0 or -0.0.
|
|
425
|
|
426 G_FMINNUM_IEEE
|
|
427 ^^^^^^^^^^^^^^
|
|
428
|
|
429 Perform floating-point minimum on two values, following the IEEE-754 2008
|
|
430 definition. This differs from FMINNUM in the handling of signaling NaNs. If one
|
|
431 input is a signaling NaN, returns a quiet NaN.
|
|
432
|
|
433 G_FMAXNUM_IEEE
|
|
434 ^^^^^^^^^^^^^^
|
|
435
|
|
436 Perform floating-point maximum on two values, following the IEEE-754 2008
|
|
437 definition. This differs from FMAXNUM in the handling of signaling NaNs. If one
|
|
438 input is a signaling NaN, returns a quiet NaN.
|
|
439
|
|
440 G_FMINIMUM
|
|
441 ^^^^^^^^^^
|
|
442
|
|
443 NaN-propagating minimum that also treat -0.0 as less than 0.0. While
|
|
444 FMINNUM_IEEE follow IEEE 754-2008 semantics, FMINIMUM follows IEEE 754-2018
|
|
445 draft semantics.
|
|
446
|
|
447 G_FMAXIMUM
|
|
448 ^^^^^^^^^^
|
|
449
|
|
450 NaN-propagating maximum that also treat -0.0 as less than 0.0. While
|
|
451 FMAXNUM_IEEE follow IEEE 754-2008 semantics, FMAXIMUM follows IEEE 754-2018
|
|
452 draft semantics.
|
|
453
|
|
454 G_FADD, G_FSUB, G_FMUL, G_FDIV, G_FREM
|
|
455 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
456
|
|
457 Perform the specified floating point arithmetic.
|
|
458
|
|
459 G_FMA
|
|
460 ^^^^^
|
|
461
|
|
462 Perform a fused multiply add (i.e. without the intermediate rounding step).
|
|
463
|
|
464 G_FMAD
|
|
465 ^^^^^^
|
|
466
|
|
467 Perform a non-fused multiply add (i.e. with the intermediate rounding step).
|
|
468
|
|
469 G_FPOW
|
|
470 ^^^^^^
|
|
471
|
|
472 Raise the first operand to the power of the second.
|
|
473
|
|
474 G_FEXP, G_FEXP2
|
|
475 ^^^^^^^^^^^^^^^
|
|
476
|
|
477 Calculate the base-e or base-2 exponential of a value
|
|
478
|
|
479 G_FLOG, G_FLOG2, G_FLOG10
|
|
480 ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
481
|
|
482 Calculate the base-e, base-2, or base-10 respectively.
|
|
483
|
|
484 G_FCEIL, G_FCOS, G_FSIN, G_FSQRT, G_FFLOOR, G_FRINT, G_FNEARBYINT
|
|
485 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
486
|
|
487 These correspond to the standard C functions of the same name.
|
|
488
|
|
489 G_INTRINSIC_TRUNC
|
|
490 ^^^^^^^^^^^^^^^^^
|
|
491
|
|
492 Returns the operand rounded to the nearest integer not larger in magnitude than the operand.
|
|
493
|
|
494 G_INTRINSIC_ROUND
|
|
495 ^^^^^^^^^^^^^^^^^
|
|
496
|
|
497 Returns the operand rounded to the nearest integer.
|
|
498
|
|
499 Vector Specific Operations
|
|
500 --------------------------
|
|
501
|
|
502 G_CONCAT_VECTORS
|
|
503 ^^^^^^^^^^^^^^^^
|
|
504
|
|
505 Concatenate two vectors to form a longer vector.
|
|
506
|
|
507 G_BUILD_VECTOR, G_BUILD_VECTOR_TRUNC
|
|
508 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
509
|
|
510 Create a vector from multiple scalar registers. No implicit
|
|
511 conversion is performed (i.e. the result element type must be the
|
|
512 same as all source operands)
|
|
513
|
|
514 The _TRUNC version truncates the larger operand types to fit the
|
|
515 destination vector elt type.
|
|
516
|
|
517 G_INSERT_VECTOR_ELT
|
|
518 ^^^^^^^^^^^^^^^^^^^
|
|
519
|
|
520 Insert an element into a vector
|
|
521
|
|
522 G_EXTRACT_VECTOR_ELT
|
|
523 ^^^^^^^^^^^^^^^^^^^^
|
|
524
|
|
525 Extract an element from a vector
|
|
526
|
|
527 G_SHUFFLE_VECTOR
|
|
528 ^^^^^^^^^^^^^^^^
|
|
529
|
|
530 Concatenate two vectors and shuffle the elements according to the mask operand.
|
|
531 The mask operand should be an IR Constant which exactly matches the
|
|
532 corresponding mask for the IR shufflevector instruction.
|
|
533
|
|
534 Memory Operations
|
|
535 -----------------
|
|
536
|
|
537 G_LOAD, G_SEXTLOAD, G_ZEXTLOAD
|
|
538 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
539
|
|
540 Generic load. Expects a MachineMemOperand in addition to explicit
|
|
541 operands. If the result size is larger than the memory size, the
|
|
542 high bits are undefined, sign-extended, or zero-extended respectively.
|
|
543
|
|
544 Only G_LOAD is valid if the result is a vector type. If the result is larger
|
|
545 than the memory size, the high elements are undefined (i.e. this is not a
|
|
546 per-element, vector anyextload)
|
|
547
|
|
548 G_INDEXED_LOAD
|
|
549 ^^^^^^^^^^^^^^
|
|
550
|
|
551 Generic indexed load. Combines a GEP with a load. $newaddr is set to $base + $offset.
|
|
552 If $am is 0 (post-indexed), then the value is loaded from $base; if $am is 1 (pre-indexed)
|
|
553 then the value is loaded from $newaddr.
|
|
554
|
|
555 G_INDEXED_SEXTLOAD
|
|
556 ^^^^^^^^^^^^^^^^^^
|
|
557
|
|
558 Same as G_INDEXED_LOAD except that the load performed is sign-extending, as with G_SEXTLOAD.
|
|
559
|
|
560 G_INDEXED_ZEXTLOAD
|
|
561 ^^^^^^^^^^^^^^^^^^
|
|
562
|
|
563 Same as G_INDEXED_LOAD except that the load performed is zero-extending, as with G_ZEXTLOAD.
|
|
564
|
|
565 G_STORE
|
|
566 ^^^^^^^
|
|
567
|
|
568 Generic store. Expects a MachineMemOperand in addition to explicit operands.
|
|
569
|
|
570 G_INDEXED_STORE
|
|
571 ^^^^^^^^^^^^^^^
|
|
572
|
|
573 Combines a store with a GEP. See description of G_INDEXED_LOAD for indexing behaviour.
|
|
574
|
|
575 G_ATOMIC_CMPXCHG_WITH_SUCCESS
|
|
576 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
577
|
|
578 Generic atomic cmpxchg with internal success check. Expects a
|
|
579 MachineMemOperand in addition to explicit operands.
|
|
580
|
|
581 G_ATOMIC_CMPXCHG
|
|
582 ^^^^^^^^^^^^^^^^
|
|
583
|
|
584 Generic atomic cmpxchg. Expects a MachineMemOperand in addition to explicit
|
|
585 operands.
|
|
586
|
|
587 G_ATOMICRMW_XCHG, G_ATOMICRMW_ADD, G_ATOMICRMW_SUB, G_ATOMICRMW_AND, G_ATOMICRMW_NAND, G_ATOMICRMW_OR, G_ATOMICRMW_XOR, G_ATOMICRMW_MAX, G_ATOMICRMW_MIN, G_ATOMICRMW_UMAX, G_ATOMICRMW_UMIN, G_ATOMICRMW_FADD, G_ATOMICRMW_FSUB
|
|
588 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
589
|
|
590 Generic atomicrmw. Expects a MachineMemOperand in addition to explicit
|
|
591 operands.
|
|
592
|
|
593 G_FENCE
|
|
594 ^^^^^^^
|
|
595
|
|
596 .. caution::
|
|
597
|
|
598 I couldn't find any documentation on this at the time of writing.
|
|
599
|
|
600 Control Flow
|
|
601 ------------
|
|
602
|
|
603 G_PHI
|
|
604 ^^^^^
|
|
605
|
|
606 Implement the φ node in the SSA graph representing the function.
|
|
607
|
|
608 .. code-block:: none
|
|
609
|
|
610 %1(s8) = G_PHI %7(s8), %bb.0, %3(s8), %bb.1
|
|
611
|
|
612 G_BR
|
|
613 ^^^^
|
|
614
|
|
615 Unconditional branch
|
|
616
|
|
617 G_BRCOND
|
|
618 ^^^^^^^^
|
|
619
|
|
620 Conditional branch
|
|
621
|
|
622 G_BRINDIRECT
|
|
623 ^^^^^^^^^^^^
|
|
624
|
|
625 Indirect branch
|
|
626
|
|
627 G_BRJT
|
|
628 ^^^^^^
|
|
629
|
|
630 Indirect branch to jump table entry
|
|
631
|
|
632 G_JUMP_TABLE
|
|
633 ^^^^^^^^^^^^
|
|
634
|
|
635 .. caution::
|
|
636
|
|
637 I found no documentation for this instruction at the time of writing.
|
|
638
|
|
639 G_INTRINSIC, G_INTRINSIC_W_SIDE_EFFECTS
|
|
640 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
641
|
|
642 Call an intrinsic
|
|
643
|
|
644 The _W_SIDE_EFFECTS version is considered to have unknown side-effects and
|
|
645 as such cannot be reordered across other side-effecting instructions.
|
|
646
|
|
647 .. note::
|
|
648
|
|
649 Unlike SelectionDAG, there is no _VOID variant. Both of these are permitted
|
|
650 to have zero, one, or multiple results.
|
|
651
|
|
652 Variadic Arguments
|
|
653 ------------------
|
|
654
|
|
655 G_VASTART
|
|
656 ^^^^^^^^^
|
|
657
|
|
658 .. caution::
|
|
659
|
|
660 I found no documentation for this instruction at the time of writing.
|
|
661
|
|
662 G_VAARG
|
|
663 ^^^^^^^
|
|
664
|
|
665 .. caution::
|
|
666
|
|
667 I found no documentation for this instruction at the time of writing.
|
|
668
|
|
669 Other Operations
|
|
670 ----------------
|
|
671
|
|
672 G_DYN_STACKALLOC
|
|
673 ^^^^^^^^^^^^^^^^
|
|
674
|
173
|
675 Dynamically realigns the stack pointer to the specified size and alignment.
|
|
676 An alignment value of `0` or `1` mean no specific alignment.
|
150
|
677
|
|
678 .. code-block:: none
|
|
679
|
|
680 %8:_(p0) = G_DYN_STACKALLOC %7(s64), 32
|