1# Copyright (c) 2021-2022 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14doc: | 15 opcode 16 Opcode of the instruction 17 18 signature 19 Describes signature of the instruction. Properties of the operands are separated by '-' symbol. 20 For info about operand tokens see the 'legend' section 21 22 Note: any check instructions might be eliminated by optimizer, thus operand checks (nc, zc, bc, ngc) qualifiers have 23 not mandatory meaning. 24 25 base 26 C++ base that represent this opcode. In far future if we managed to generate also instruction classes, 27 this field become redundant 28 29 flags 30 Properties of the instruction, such as: arithmetic, binop, throw, etc 31 32 modes 33 Modes which the instruction can be used in 34 35templates: 36 # Templates aim to reduce boilerplate in instruction description. 37 # Templates are denoted by a '$' symbol in the first character of the string. 38 verify_unary: 39 - equal_common_types 40 - float_src_eq_dst_size 41 - integer_src_ge_dst_size 42 verify_binary_int: 43 - equal_common_types 44 - integer_src_ge_dst_size 45 verify_binary: 46 - equal_common_types 47 - integer_src_ge_dst_size 48 - float_src_eq_dst_size 49 50instructions: 51 ############################################################################## 52 # Arithmetic/comparison instructions 53 # 54 - opcode: Neg 55 base: UnaryOperation 56 signature: [d-number, number] 57 flags: [acc_write, acc_read, ifcvt] 58 description: Negate the value. 59 verification: 60 - $verify_unary 61 62 - opcode: Abs 63 base: UnaryOperation 64 signature: [d-number, number] 65 flags: [acc_write, ifcvt] 66 description: Get absolute value. 67 verification: 68 - $verify_unary 69 70 - opcode: Sqrt 71 base: UnaryOperation 72 signature: [d-float, float] 73 flags: [acc_write, ifcvt] 74 description: Get square root value. 75 verification: 76 - $verify_unary 77 78 - opcode: Not 79 base: UnaryOperation 80 signature: [d-int-bool, int-bool] 81 flags: [acc_write, acc_read, ifcvt] 82 description: Bitwise NOT. 83 verification: 84 - $verify_binary_int 85 86 - opcode: Add 87 base: BinaryOperation 88 signature: [d-number-ptr, number-ptr, number-ptr] 89 flags: [commutative, acc_write, acc_read, ifcvt] 90 description: Add two inputs. 91 verification: 92 - $verify_binary 93 94 - opcode: Sub 95 base: BinaryOperation 96 signature: [d-number-ptr, number-ptr, number-ptr] 97 flags: [acc_write, acc_read, ifcvt] 98 description: Substitute two inputs. 99 verification: 100 - $verify_binary 101 102 - opcode: Mul 103 base: BinaryOperation 104 signature: [d-number, number, number] 105 flags: [commutative, acc_write, acc_read, ifcvt] 106 description: Multiply two inputs. 107 verification: 108 - $verify_binary 109 110 - opcode: Div 111 base: BinaryOperation 112 signature: [d-number, number, number-zc] 113 flags: [acc_write, acc_read] 114 description: Divide two inputs. 115 verification: 116 - $verify_binary 117 118 - opcode: Mod 119 base: BinaryOperation 120 signature: [d-number, number, number-zc] 121 flags: [acc_write, acc_read] 122 description: Modulo instruction. 123 verification: 124 - $verify_binary_int 125 126 - opcode: Min 127 base: BinaryOperation 128 signature: [d-number, number, number] 129 flags: [commutative, ifcvt] 130 modes: [jit_aot, irtoc] 131 description: Get minimum from two inputs. If either value is NaN, then the result is NaN. Negative zero is strictly smaller than positive zero. 132 133 - opcode: Max 134 base: BinaryOperation 135 signature: [d-number, number, number] 136 flags: [commutative, ifcvt] 137 modes: [jit_aot, irtoc] 138 description: Get maximum from two inputs. If either value is NaN, then the result is NaN. Negative zero is strictly smaller than positive zero. 139 140 - opcode: Shl 141 base: BinaryOperation 142 signature: [d-int, int, int] 143 flags: [acc_write, acc_read, ifcvt] 144 description: Shift left. 145 verification: 146 - $verify_binary_int 147 148 - opcode: Shr 149 base: BinaryOperation 150 signature: [d-int, int, int] 151 flags: [acc_write, acc_read, ifcvt] 152 description: Shift right. 153 verification: 154 - $verify_binary_int 155 156 - opcode: AShr 157 base: BinaryOperation 158 signature: [d-int, int, int] 159 flags: [acc_write, acc_read, ifcvt] 160 description: Arithmetic shift left. 161 verification: 162 - $verify_binary_int 163 164 - opcode: And 165 base: BinaryOperation 166 signature: [d-int-bool, int-bool, int-bool] 167 flags: [commutative, acc_write, acc_read, ifcvt] 168 description: Bitwise AND. 169 verification: 170 - $verify_binary_int 171 172 - opcode: Or 173 base: BinaryOperation 174 signature: [d-int-bool, int-bool, int-bool] 175 flags: [commutative, acc_write, acc_read, ifcvt] 176 description: Bitwise OR. 177 verification: 178 - $verify_binary_int 179 180 - opcode: Xor 181 base: BinaryOperation 182 signature: [d-int-bool, int-bool, int-bool] 183 flags: [commutative, acc_write, acc_read, ifcvt] 184 description: Bitwise XOR. 185 verification: 186 - $verify_binary_int 187 188 - opcode: Compare 189 base: CompareInst 190 signature: [d-bool, real, real] 191 flags: [acc_read, acc_write, ifcvt] 192 description: Compare two integer or reference values according to condition code(for reference only CC_EQ). 193 194 - opcode: Cmp 195 base: CmpInst 196 signature: [d-int, number, number] 197 flags: [acc_read, acc_write, ifcvt] 198 description: Compare two float or integer values. 199 200 - opcode: CompareAnyType 201 base: CompareAnyTypeInst 202 signature: [d-bool, any] 203 flags: [acc_read, acc_write, ifcvt] 204 description: Compare any type value and type. 205 206 - opcode: CastAnyTypeValue 207 base: CastAnyTypeValueInst 208 signature: [d-real, any] 209 flags: [acc_read, acc_write] 210 description: Cast any dynamic type value to compiler type value. 211 212 - opcode: CastValueToAnyType 213 base: CastValueToAnyTypeInst 214 signature: [d-any, real] 215 flags: [acc_read, acc_write, no_cse] 216 description: Cast compiler type value to any dynamic type value. 217 218 - opcode: Cast 219 base: CastInst 220 signature: [d-real-any, real-any] 221 flags: [acc_read, acc_write, ifcvt] 222 description: Cast value from one type to another. Don't support casts from float32/64 to int8/16 and bool. 223 224 - opcode: Constant 225 base: ConstantInst 226 signature: [d-i32-i64-f32-f64] 227 flags: [no_cse, ifcvt] 228 description: Constant value. 229 verification: 230 - start_block_instruction 231 232 - opcode: Parameter 233 base: ParameterInst 234 signature: [d-real-any] 235 flags: [no_cse, no_hoist] 236 description: Method's parameter. 237 verification: 238 - start_block_instruction 239 240 - opcode: NullPtr 241 base: FixedInputsInst0 242 signature: [d-ref] 243 flags: [no_cse, no_hoist, ifcvt] 244 description: Null pointer. 245 verification: 246 - start_block_instruction 247 248 ############################################################################## 249 # Object/array instructions 250 # 251 - opcode: NewArray 252 base: NewArrayInst 253 signature: [d-ref, ref, int-ngc, save_state] 254 flags: [can_throw, no_dce, no_hoist, no_cse, alloc, require_state, runtime_call, mem_barrier] 255 description: Create new array with non-negative size specified by first input. 256 fields: 257 - type_id: TypeId 258 259 - opcode: NewObject 260 base: NewObjectInst 261 signature: [d-ref, ref, save_state] 262 flags: [can_throw, no_dce, no_hoist, no_cse, alloc, require_state, runtime_call, mem_barrier] 263 description: Create new object. 264 fields: 265 - type_id: TypeId 266 267 - opcode: InitObject 268 base: CallInst 269 signature: [d-ref, real-dyn, save_state] 270 flags: [can_throw, no_dce, no_hoist, no_cse, alloc, require_state, runtime_call, acc_write] 271 description: Create new object and then call default constructor for it. 272 fields: 273 - type_id: TypeId 274 275 - opcode: LoadArray 276 base: LoadInst 277 signature: [d-real, ref-nc, int-bc] 278 flags: [load, no_hoist, no_cse, acc_read, acc_write] 279 description: Load value from array. 280 281 - opcode: LoadCompressedStringChar 282 base: LoadCompressedStringCharInst 283 signature: [d-u16, ref-nc, int-bc, int] 284 flags: [load, no_cse, acc_read, acc_write] 285 description: Load char from string while string compression is enable. 286 287 - opcode: StoreArray 288 base: StoreInst 289 signature: [ref-nc, int-bc, real] 290 flags: [store, no_dce, no_hoist, no_cse, acc_read] 291 description: Store value in array. 292 293 - opcode: LoadObject 294 base: LoadObjectInst 295 signature: [d-real, ref-nc] 296 flags: [load, no_hoist, no_cse, acc_write] 297 description: Load value from object's field. 298 fields: 299 - field_id: TypeId 300 301 - opcode: Load 302 base: LoadMemInst 303 signature: [d-real, ptr-ref, int] 304 flags: [native, low_level, load, no_hoist, no_cse] 305 modes: [jit_aot, irtoc] 306 description: Load value from memory by offset. If Load is volatile, the address must have the normal alignment(by size of loaded value) 307 308 - opcode: LoadI 309 base: LoadMemInstI 310 signature: [d-real, ptr-ref] 311 flags: [native, low_level, load, no_hoist, no_cse] 312 modes: [irtoc] 313 description: Load value from memory by immediate offset. If Load is volatile, the address must have the normal alignment(by size of loaded value) 314 315 - opcode: Store 316 base: StoreMemInst 317 signature: [ptr-ref, int, real] 318 flags: [native, low_level, store, no_dce, no_hoist, no_cse] 319 modes: [jit_aot, irtoc] 320 description: Store value in memory by offset. If Store is volatile, the address must have the normal alignment(by size of stored value) 321 322 - opcode: StoreI 323 base: StoreMemInstI 324 signature: [ptr-ref, real] 325 flags: [native, low_level, store, no_dce, no_hoist, no_cse] 326 modes: [irtoc] 327 description: Store value in memory by immediate offset. If Store is volatile, the address must have the normal alignment(by size of stored value) 328 329 - opcode: UnresolvedLoadObject 330 base: UnresolvedLoadObjectInst 331 signature: [d-real, ref-nc, save_state] 332 flags: [load, can_throw, no_dce, no_cse, no_hoist, barrier, require_state, runtime_call, implicit_runtime_call] 333 modes: [jit_aot] 334 description: Load value from object's unresolved field. 335 field: 336 - field_id: TypeId 337 338 - opcode: StoreObject 339 base: StoreObjectInst 340 signature: [ref-nc, real] 341 flags: [store, no_dce, no_hoist, no_cse, acc_read] 342 description: Store value in object's field. 343 fields: 344 - field_id: TypeId 345 346 - opcode: UnresolvedStoreObject 347 base: UnresolvedStoreObjectInst 348 signature: [ref-nc, real, save_state] 349 flags: [store, can_throw, no_dce, no_cse, no_hoist, barrier, require_state, runtime_call, implicit_runtime_call] 350 modes: [jit_aot] 351 description: Load value from object's unresolved field. 352 field: 353 - field_id: TypeId 354 355 - opcode: LoadStatic 356 base: LoadStaticInst 357 signature: [d-real, ref] 358 flags: [load, no_hoist, no_cse, acc_write] 359 description: Load static field from class. 360 fields: 361 - field_id: TypeId 362 363 - opcode: UnresolvedLoadStatic 364 base: UnresolvedLoadStaticInst 365 signature: [d-real, save_state] 366 flags: [load, can_throw, no_dce, no_hoist, no_cse, barrier, require_state, runtime_call, implicit_runtime_call] 367 modes: [jit_aot] 368 description: Load unresolved static field from class. 369 fields: 370 - field_id: TypeId 371 372 - opcode: StoreStatic 373 base: StoreStaticInst 374 signature: [ref, real] 375 flags: [store, no_dce, no_hoist, no_cse, acc_read] 376 description: Store value into static field. 377 fields: 378 - field_id: TypeId 379 380 - opcode: UnresolvedStoreStatic 381 base: UnresolvedStoreStaticInst 382 signature: [real, save_state] 383 flags: [store, can_throw, no_dce, no_hoist, no_cse, barrier, require_state, runtime_call, implicit_runtime_call] 384 modes: [jit_aot] 385 description: Store value into unresolved static field. 386 fields: 387 - field_id: TypeId 388 389 - opcode: LenArray 390 base: LengthMethodInst 391 signature: [d-int, ref-nc] 392 flags: [acc_write] 393 description: Get length of array. 394 395 - opcode: LoadString 396 base: LoadFromPool 397 signature: [d-ref, save_state] 398 flags: [load, can_throw, no_hoist, no_cse, require_state, runtime_call, acc_write] 399 description: Load string from pool. 400 401 - opcode: LoadConstArray 402 base: LoadConstArrayInst 403 signature: [d-ref, save_state] 404 flags: [load, can_throw, no_hoist, no_dce, no_cse, require_state, barrier, runtime_call] 405 description: Creates a new constant array by id and fills its contents (array elements are literals). 406 407 - opcode: FillConstArray 408 base: FillConstArrayInst 409 signature: [ref, save_state] 410 flags: [store, no_hoist, no_dce, no_cse, no_dst, require_state, barrier, runtime_call] 411 description: Fill constant array by contents (array elements are literals). 412 413 - opcode: LoadType 414 base: LoadFromPool 415 signature: [d-ref, save_state] 416 flags: [load, can_throw, no_hoist, no_cse, require_state, runtime_call, acc_write] 417 description: Load type from pool. 418 419 - opcode: UnresolvedLoadType 420 base: LoadFromPool 421 signature: [d-ref, save_state] 422 flags: [load, can_throw, no_dce, no_hoist, barrier, no_cse, require_state, runtime_call, implicit_runtime_call] 423 modes: [jit_aot] 424 description: Load unresolved type from pool. 425 426 - opcode: CheckCast 427 base: CheckCastInst 428 signature: [ref, ref, save_state] 429 flags: [can_throw, no_dce, no_hoist, no_cse, require_state, runtime_call, acc_read] 430 description: >- 431 If an object in the first input can't be cast to the type in the second input ClassCastException is thrown. 432 'null' object reference can be cast to every type. 433 fields: 434 - type_id: TypeId 435 436 - opcode: IsInstance 437 base: IsInstanceInst 438 signature: [d-bool, ref, ref, save_state] 439 flags: [require_state, runtime_call, acc_read, acc_write] 440 description: >- 441 Returns 1 if an object in the first input can be cast to the type in the second input, else returns 0. 442 'null' object is not an instance of any class. 443 fields: 444 - type_id: TypeId 445 446 - opcode: InitClass 447 base: ClassInst 448 signature: [save_state] 449 flags: [can_throw, no_hoist, barrier, no_dce, require_state, runtime_call] 450 description: Calls initialization of the class before inlined function 451 fields: 452 - type_id: TypeId 453 454 - opcode: LoadClass 455 base: ClassInst 456 signature: [d-ref, save_state] 457 flags: [can_throw, no_hoist, barrier, no_dce, require_state, runtime_call] 458 description: Loads class 459 fields: 460 - type_id: TypeId 461 462 - opcode: LoadAndInitClass 463 base: ClassInst 464 signature: [d-ref, save_state] 465 flags: [can_throw, no_dce, no_hoist, barrier, require_state, runtime_call] 466 description: Calls initialization of the class before LoadStatic and StoreStatc 467 fields: 468 - type_id: TypeId 469 470 - opcode: UnresolvedLoadAndInitClass 471 base: ClassInst 472 signature: [d-ref, save_state] 473 flags: [can_throw, no_dce, no_cse, no_hoist, barrier, require_state, runtime_call, implicit_runtime_call] 474 modes: [jit_aot] 475 description: Calls initialization of the class that wasn't resolved during compilation before LoadStatic and StoreStatc 476 fields: 477 - type_id: TypeId 478 479 - opcode: GetInstanceClass 480 base: FixedInputsInst1 481 signature: [d-ref, ref] 482 flags: [ref_special] 483 description: >- 484 Get class from the input object. Each object holds reference to the class on the specific offset. 485 This instruction reads this reference from the input object. 486 487 - opcode: ClassImmediate 488 base: ClassImmediateInst 489 signature: [d-ref] 490 flags: [ref_special, no_cse, ifcvt, no_hoist] 491 description: >- 492 Get class object from the immediate. 493 494 ############################################################################## 495 # Check instructions 496 # 497 - opcode: NullCheck 498 base: NullCheckInst 499 signature: [d-ref-pseudo, ref, save_state] 500 flags: [can_throw, is_check, no_dce, no_hoist, no_cse, require_state] 501 description: Check object is not null. 502 503 - opcode: BoundsCheck 504 base: BoundsCheckInst 505 signature: [d-int-pseudo, int, int, save_state] 506 flags: [can_throw, is_check, no_dce, no_cse, no_hoist, require_state, acc_read] 507 description: Check that value is within specified bounds. 508 509 - opcode: RefTypeCheck 510 base: FixedInputsInst3 511 signature: [d-ref-pseudo, ref, ref, save_state] 512 flags: [can_throw, no_dce, is_check, no_hoist, no_cse, require_state, runtime_call] 513 description: Check that the type of the stored Reference matches the type of the array. 514 515 - opcode: ZeroCheck 516 base: FixedInputsInst2 517 signature: [d-int-pseudo, int, save_state] 518 flags: [can_throw, is_check, no_dce, no_cse, no_hoist, require_state] 519 description: Check that integer value is not zero. 520 521 - opcode: NegativeCheck 522 base: FixedInputsInst2 523 signature: [d-int-pseudo, int, save_state] 524 flags: [can_throw, is_check, no_dce, no_cse, no_hoist, require_state] 525 description: Check that integer value is less than zero. 526 527 - opcode: AnyTypeCheck 528 base: AnyTypeCheckInst 529 signature: [d-any-pseudo, any, save_state] 530 flags: [can_throw, no_dce, is_check, no_hoist, require_state, runtime_call, can_deoptimize] 531 description: Compare any type value and type and deoptimize if the types are different 532 533 - opcode: Deoptimize 534 base: DeoptimizeInst 535 signature: [save_state] 536 flags: [cf, can_throw, no_dce, no_cse, no_hoist, require_state, barrier, can_deoptimize, terminator] 537 modes: [jit_aot] 538 description: Unconditionally switch to interpreter. 539 540 - opcode: DeoptimizeIf 541 base: DeoptimizeIfInst 542 signature: [int-bool, save_state] 543 flags: [can_throw, no_dce, no_cse, no_hoist, require_state, acc_read, barrier, can_deoptimize] 544 modes: [jit_aot] 545 description: Jump to interpreter if value is true. 546 547 - opcode: DeoptimizeCompare 548 base: DeoptimizeCompareInst 549 signature: [int-bool-ref, int-bool-ref, save_state] 550 flags: [can_throw, no_dce, no_cse, no_hoist, require_state, acc_read, barrier, can_deoptimize, low_level] 551 modes: [jit_aot] 552 description: Compare and jump to interpreter if the result is true. 553 554 - opcode: DeoptimizeCompareImm 555 base: DeoptimizeCompareImmInst 556 signature: [int-bool-ref, save_state] 557 flags: [can_throw, no_dce, no_cse, no_hoist, require_state, acc_read, barrier, can_deoptimize, low_level] 558 modes: [jit_aot] 559 description: Compare and jump to interpreter if the result is true. 560 561 - opcode: IsMustDeoptimize 562 base: Inst 563 signature: [d-bool] 564 flags: [no_cse, no_hoist] 565 modes: [jit_aot] 566 description: Check whether current method must be deoptimized. 567 568 ############################################################################## 569 # Control flow instructions 570 # 571 - opcode: ReturnVoid 572 base: FixedInputsInst0 573 signature: [] 574 flags: [cf, no_dce, no_hoist, no_cse, barrier, terminator] 575 description: Return from method. 576 577 - opcode: Return 578 base: FixedInputsInst1 579 signature: [real-any] 580 flags: [cf, no_dce, no_hoist, no_cse, barrier, acc_read, terminator] 581 description: Return value from method. 582 583 - opcode: ReturnInlined 584 base: ReturnInlinedInst 585 signature: [save_state] 586 flags: [no_dce, no_hoist, no_cse, barrier, require_state, acc_read] 587 modes: [jit_aot] 588 description: Return from inlined method. 589 590 - opcode: Throw 591 base: ThrowInst 592 signature: [ref, save_state] 593 flags: [cf, can_throw, no_dce, no_hoist, no_cse, barrier, require_state, terminator] 594 modes: [jit_aot, bytecode_opt] 595 description: Throw an exception. It also might raise NullReferenceException if the exception is null. 596 597 - opcode: IndirectJump 598 base: FixedInputsInst1 599 signature: [ptr] 600 flags: [native, cf, no_dce, no_hoist, no_cse, barrier, low_level] 601 modes: [irtoc] 602 description: Jump execution to specified offset using a register. 603 604 ############################################################################## 605 # Call instructions 606 # 607 - opcode: CallStatic 608 base: CallInst 609 signature: [d-real-void, real-dyn, save_state] 610 flags: [can_throw, no_dce, no_hoist, no_cse, barrier, require_state, runtime_call, call, acc_write, acc_read] 611 description: Calls static method. 612 613 - opcode: UnresolvedCallStatic 614 base: CallInst 615 signature: [d-real-void, real-dyn, save_state] 616 flags: [can_throw, no_dce, no_hoist, no_cse, barrier, require_state, runtime_call, call, implicit_runtime_call] 617 modes: [jit_aot] 618 description: Calls static method that was not resolved during compilation 619 620 - opcode: CallVirtual 621 base: CallInst 622 signature: [d-real-void, ref-nc, real-dyn, save_state] 623 flags: [can_throw, no_dce, no_hoist, no_cse, barrier, require_state, runtime_call, call, acc_write, acc_read] 624 description: Calls virtual method. First input is an object reference. 625 626 - opcode: UnresolvedCallVirtual 627 base: CallInst 628 signature: [d-real-void, ref-nc, real-dyn, save_state] 629 flags: [can_throw, no_dce, no_hoist, no_cse, barrier, require_state, runtime_call, call, implicit_runtime_call] 630 modes: [jit_aot] 631 description: Calls virtual method that was not resolved during compilation. First input is an object reference. 632 633 - opcode: CallDynamic 634 base: CallInst 635 signature: [d-any-void, any-dyn, save_state] 636 flags: [can_throw, no_dce, no_hoist, no_cse, barrier, require_state, runtime_call, call] 637 description: Calls dynamic method. 638 639 - opcode: CallIndirect 640 base: CallIndirectInst 641 signature: [d-real-void, ptr, real-dyn] 642 flags: [can_throw, no_dce, no_hoist, no_cse, barrier, call, low_level] 643 modes: [irtoc] 644 description: Low-level call by the address given from the first input. 645 646 - opcode: Call 647 base: CallInst 648 signature: [ d-real-void, real-dyn ] 649 flags: [ can_throw, no_dce, no_hoist, no_cse, barrier, call, low_level ] 650 description: | 651 Low-level call. Target function can be specified by the different ways. Currently, it supports only string name of 652 the target function, which will be resolved during linking phase of the host compiler. 653 654 - opcode: MultiArray 655 base: CallInst 656 signature: [d-ref, ref, int-ngc-dyn, save_state] 657 flags: [can_throw, no_dce, no_hoist, no_cse, barrier, require_state, runtime_call, mem_barrier] 658 modes: [jit_aot, irtoc] 659 description: Creates MultiDimensional Array(a[X][Y][Z]). First input is class. Next inputs - size of arrayes(X, Y, Z). 660 661 - opcode: Monitor 662 base: MonitorInst 663 signature: [ref-nc, save_state] 664 flags: [can_throw, no_dce, no_hoist, no_cse, barrier, require_state, runtime_call, acc_read] 665 modes: [jit_aot, bytecode_opt] 666 description: Enable or disable monitor for the object(If field "Exit" is set, the monitor is disabled) 667 668 - opcode: Intrinsic 669 base: IntrinsicInst 670 signature: [d-real-void, real-dyn] 671 flags: [no_dce, no_hoist, no_cse, barrier, require_state, runtime_call] 672 description: Call runtime intrinsics directly. 673 674 - opcode: Builtin 675 base: IntrinsicInst 676 signature: [d-real-void, real-dyn] 677 flags: [] 678 description: Expand known intrinsics using Encoder 679 680 ############################################################################## 681 # Low-level instructions 682 # 683 - opcode: AddI 684 base: BinaryImmOperation 685 signature: [d-number-ptr, real-ptr] 686 flags: [low_level, acc_write, acc_read, ifcvt] 687 description: Add an immediate to a value, the value may be a pointer as well 688 689 - opcode: SubI 690 base: BinaryImmOperation 691 signature: [d-number-ptr, number-ptr] 692 flags: [low_level, acc_write, acc_read, ifcvt] 693 description: Add immediate from value. 694 695 - opcode: MulI 696 base: BinaryImmOperation 697 signature: [d-int, int] 698 flags: [low_level, acc_write, acc_read, ifcvt] 699 modes: [bytecode_opt] 700 description: Multiply value with immediate. 701 702 - opcode: DivI 703 base: BinaryImmOperation 704 signature: [d-int, int] 705 flags: [low_level, acc_write, acc_read, ifcvt] 706 modes: [bytecode_opt] 707 description: Divide value with immediate. 708 709 - opcode: ModI 710 base: BinaryImmOperation 711 signature: [d-int, int] 712 flags: [low_level, acc_write, acc_read, ifcvt] 713 modes: [bytecode_opt] 714 description: Modulo instruction with immediate. 715 716 - opcode: ShlI 717 base: BinaryImmOperation 718 signature: [d-int, int] 719 flags: [low_level, acc_write, acc_read, ifcvt] 720 description: Shift left. 721 722 - opcode: ShrI 723 base: BinaryImmOperation 724 signature: [d-int, int] 725 flags: [low_level, acc_write, acc_read, ifcvt] 726 description: Shift right. 727 728 - opcode: AShrI 729 base: BinaryImmOperation 730 signature: [d-int, int] 731 flags: [low_level, acc_write, acc_read, ifcvt] 732 description: Arithmetic shift right. 733 734 - opcode: AndI 735 base: BinaryImmOperation 736 signature: [d-int-bool, int-bool] 737 flags: [low_level, acc_write, acc_read, ifcvt] 738 description: Bitwise AND. 739 740 - opcode: OrI 741 base: BinaryImmOperation 742 signature: [d-int-bool, int-bool] 743 flags: [low_level, acc_write, acc_read, ifcvt] 744 description: Bitwise OR. 745 746 - opcode: XorI 747 base: BinaryImmOperation 748 signature: [d-int-bool, int-bool] 749 flags: [low_level, acc_write, acc_read, ifcvt] 750 description: Bitwise XOR. 751 752 - opcode: MAdd 753 base: FixedInputsInst3 754 signature: [d-number, number, number, number] 755 flags: [low_level, ifcvt] 756 modes: [jit_aot, irtoc] 757 description: Multiply-accumulate. 758 759 - opcode: MSub 760 base: FixedInputsInst3 761 signature: [d-number, number, number, number] 762 flags: [low_level, ifcvt] 763 modes: [jit_aot, irtoc] 764 description: Multiply-subtract. 765 766 - opcode: MNeg 767 base: BinaryOperation 768 signature: [d-number, number, number] 769 flags: [low_level, ifcvt] 770 modes: [jit_aot, irtoc] 771 description: Negated multiply. 772 773 - opcode: OrNot 774 base: BinaryOperation 775 signature: [d-int-bool, int-bool, int-bool] 776 flags: [low_level, ifcvt] 777 modes: [jit_aot, irtoc] 778 description: Bitwise OR of first operand and result of bitwise NOT of seconds operand. 779 780 - opcode: AndNot 781 base: BinaryOperation 782 signature: [d-int, int-bool, int-bool] 783 flags: [low_level, ifcvt] 784 modes: [jit_aot, irtoc] 785 description: Bitwise AND of first operand and result of bitwise NOT of seconds operand. 786 787 - opcode: XorNot 788 base: BinaryOperation 789 signature: [d-int-bool, int-bool, int-bool] 790 flags: [low_level, ifcvt] 791 modes: [jit_aot, irtoc] 792 description: Bitwise XOR of first operand and result of bitwise NOT of seconds operand. 793 794 - opcode: AndSR 795 base: BinaryShiftedRegisterOperation 796 signature: [d-int, int, int] 797 flags: [low_level, ifcvt] 798 modes: [jit_aot, irtoc] 799 description: Bitwise AND between first operand and shifted value of second operand. 800 801 - opcode: OrSR 802 base: BinaryShiftedRegisterOperation 803 signature: [d-int, int, int] 804 flags: [low_level, ifcvt] 805 modes: [jit_aot, irtoc] 806 description: Bitwise OR between first operand and shifted value of second operand. 807 808 - opcode: XorSR 809 base: BinaryShiftedRegisterOperation 810 signature: [d-int, int, int] 811 flags: [low_level, ifcvt] 812 modes: [jit_aot, irtoc] 813 description: Bitwise XOR between first operand and shifted value of second operand. 814 815 - opcode: AndNotSR 816 base: BinaryShiftedRegisterOperation 817 signature: [d-int, int, int] 818 flags: [low_level, ifcvt] 819 modes: [jit_aot, irtoc] 820 description: Bitwise AND between first operand and NOT of shifted value of second operand. 821 822 - opcode: OrNotSR 823 base: BinaryShiftedRegisterOperation 824 signature: [d-int, int, int] 825 flags: [low_level, ifcvt] 826 modes: [jit_aot, irtoc] 827 description: Bitwise OR between first operand and NOT of shifted value of second operand. 828 829 - opcode: XorNotSR 830 base: BinaryShiftedRegisterOperation 831 signature: [d-int, int, int] 832 flags: [low_level, ifcvt] 833 modes: [jit_aot, irtoc] 834 description: Bitwise XOR between first operand and NOT of shifted value of second operand. 835 836 - opcode: AddSR 837 base: BinaryShiftedRegisterOperation 838 signature: [d-int, int, int] 839 flags: [low_level, ifcvt] 840 modes: [jit_aot, irtoc] 841 description: Add first operand with shifted value of second operand. 842 843 - opcode: SubSR 844 base: BinaryShiftedRegisterOperation 845 signature: [d-int, int, int] 846 flags: [low_level, ifcvt] 847 modes: [jit_aot, irtoc] 848 description: Subtract shifted value of second operand from first operand. 849 850 - opcode: NegSR 851 base: UnaryShiftedRegisterOperation 852 signature: [d-int, int] 853 flags: [low_level, ifcvt] 854 modes: [jit_aot, irtoc] 855 description: Shift and then negate operands value. 856 857 - opcode: BoundsCheckI 858 base: BoundsCheckInstI 859 signature: [d-int-pseudo, int, save_state] 860 flags: [can_throw, is_check, no_dce, no_hoist, no_cse, require_state, low_level] 861 description: Check that value is within specified bounds. 862 863 - opcode: LoadArrayI 864 base: LoadInstI 865 signature: [d-real, ref-nc] 866 flags: [load, no_hoist, no_cse, low_level, acc_read, acc_write] 867 modes: [jit_aot, irtoc] 868 description: Load value from array. 869 870 - opcode: LoadCompressedStringCharI 871 base: LoadCompressedStringCharInstI 872 signature: [d-u16, ref-nc, int] 873 flags: [load, no_cse, low_level, acc_read, acc_write] 874 description: Load char from string while string compression is enable. 875 876 - opcode: StoreArrayI 877 base: StoreInstI 878 signature: [ref-nc, real] 879 flags: [store, no_dce, no_hoist, no_cse, low_level, acc_read] 880 modes: [jit_aot] 881 description: Store value in array. 882 883 - opcode: LoadArrayPair 884 base: LoadArrayPairInst 885 signature: [d-real, ref-nc, int-bc] 886 flags: [load, no_hoist, no_cse, low_level, acc_write] 887 modes: [jit_aot, irtoc] 888 description: Load several values at a time from array. 889 890 - opcode: LoadArrayPairI 891 base: LoadArrayPairInstI 892 signature: [d-real, ref-nc] 893 flags: [load, no_hoist, no_cse, low_level, acc_write] 894 modes: [jit_aot, irtoc] 895 description: Load several values at a time from array at immediate index. 896 897 - opcode: LoadPairPart 898 base: LoadPairPartInst 899 signature: [d-real-pseudo, real] 900 flags: [load, low_level, acc_write, no_hoist, no_cse] 901 modes: [jit_aot, irtoc] 902 description: Load element from vector. 903 904 - opcode: StoreArrayPair 905 base: StoreArrayPairInst 906 signature: [ref-nc, int-bc, real, real] 907 flags: [store, no_dce, no_hoist, no_cse, low_level, acc_read] 908 modes: [jit_aot, irtoc] 909 description: Store several values at a time to array. 910 911 - opcode: StoreArrayPairI 912 base: StoreArrayPairInstI 913 signature: [ref-nc, real, real] 914 flags: [store, no_dce, no_hoist, no_cse, low_level, acc_read] 915 modes: [jit_aot, irtoc] 916 description: Store several values at a time to array at immediate index. 917 918 - opcode: ReturnI 919 base: ReturnInstI 920 signature: [] 921 flags: [cf, no_dce, no_hoist, no_cse, barrier, low_level, acc_read, terminator] 922 modes: [jit_aot, irtoc] 923 description: Return value from method. 924 925 ############################################################################## 926 # Special pseudo instructions 927 # 928 - opcode: Phi 929 base: PhiInst 930 signature: [d-real-ref, real-ref-dyn] 931 flags: [no_cse, no_hoist] 932 description: Phi instruction 933 934 - opcode: SpillFill 935 base: SpillFillInst 936 signature: [] 937 flags: [no_cse, no_dce] 938 description: Pseudo instruction that inserted by Register Allocator. 939 940 - opcode: SaveState 941 base: SaveStateInst 942 signature: [d-real-pseudo, real-dyn] 943 flags: [no_hoist, no_cse] 944 description: >- 945 Contains information about virtual registers that must be saved before leaving compiled code. Constructed for all 946 call instructions and all instructions that can throw. 947 948 - opcode: SafePoint 949 base: SaveStateInst 950 signature: [real-dyn] 951 flags: [no_dce, no_hoist, no_cse, barrier, runtime_call] 952 description: GC safepoint instruction. 953 codegen: 954 - ld_16 tmp_u16, safepoint_state 955 - jneq tmp_u16, 0x0, safepoint_label 956 - bind back_safepoint_label 957 958 - opcode: SaveStateDeoptimize 959 base: SaveStateInst 960 signature: [d-real-pseudo, real-dyn] 961 flags: [no_dce, no_hoist, no_cse, barrier] 962 modes: [jit_aot, bytecode_opt] 963 description: >- 964 Contains information about virtual registers that must be saved before leaving compiled code. Constructed for all 965 loop pre-headers. 966 967 - opcode: SaveStateOsr 968 base: SaveStateInst 969 signature: [d-real-pseudo, real-dyn] 970 flags: [no_dce, no_hoist, no_cse, barrier] 971 modes: [jit_aot] 972 description: >- 973 Contains information about virtual registers to fill OSR stackmaps. Constructed for all loop headers in OSR mode. 974 975 - opcode: Select 976 base: SelectInst 977 signature: [d-real, real, real, real, real] 978 flags: [low_level, ifcvt] 979 modes: [jit_aot, irtoc] 980 description: Select which value to move to destination based on comparison. 981 982 - opcode: SelectImm 983 base: SelectImmInst 984 signature: [d-real, real, real, real] 985 flags: [low_level, ifcvt] 986 modes: [jit_aot, irtoc] 987 description: Select which value to move to destination based on comparison with immediate. 988 989 - opcode: AddOverflow 990 base: BinaryOverflowInst 991 signature: [d-int, int, int] 992 flags: [cf, no_dce, no_hoist, no_cse, barrier, acc_read] 993 modes: [jit_aot, irtoc] 994 description: Add two values and check result to Overflow, in case of overflow and CC is EQ jump to true edge 995 996 - opcode: SubOverflow 997 base: BinaryOverflowInst 998 signature: [d-int, int, int] 999 flags: [cf, no_dce, no_hoist, no_cse, barrier, acc_read] 1000 modes: [jit_aot, irtoc] 1001 description: Sub two values and check result to Overflow, in case of overflow and CC is EQ jump to true edge 1002 1003 - opcode: AddOverflowCheck 1004 base: FixedInputsInst3 1005 signature: [d-int, int, int, save_state] 1006 flags: [no_dce, no_hoist, no_cse, barrier, acc_read, require_state, can_deoptimize] 1007 modes: [jit_aot] 1008 description: Add two values, deoptimize if overflow occurred. 1009 1010 - opcode: SubOverflowCheck 1011 base: FixedInputsInst3 1012 signature: [d-int, int, int, save_state] 1013 flags: [no_dce, no_hoist, no_cse, barrier, acc_read, require_state, can_deoptimize] 1014 modes: [jit_aot] 1015 description: Sub two values, deoptimize if overflow occurred. 1016 1017 - opcode: If 1018 base: IfInst 1019 signature: [real, real] 1020 flags: [cf, no_dce, no_hoist, no_cse, barrier, low_level, acc_read] 1021 description: Performs compare and jump. 1022 1023 - opcode: IfImm 1024 base: IfImmInst 1025 signature: [real] 1026 flags: [cf, no_dce, no_hoist, no_cse, barrier, acc_read] 1027 description: Performs compare with immediate and jump. 1028 1029 - opcode: NOP 1030 base: FixedInputsInst0 1031 signature: [] 1032 flags: [no_dst, ifcvt] 1033 description: Pseudo instruction, that replaces instruction to be deleted. 1034 1035 - opcode: Try 1036 base: TryInst 1037 signature: [] 1038 flags: [no_dce, no_hoist, no_cse, barrier] 1039 modes: [jit_aot, bytecode_opt] 1040 description: Pseudo instruction, inserted in the beginning of try-block. 1041 1042 - opcode: CatchPhi 1043 base: CatchPhiInst 1044 signature: [d-real-ref, real-ref-dyn] 1045 flags: [no_hoist, no_cse] 1046 modes: [jit_aot, bytecode_opt] 1047 description: >- 1048 Pseudo instruction, which is inserted in the Catch handler basic block, and defines virtual registers at each throwing 1049 instruction of the appropriate try-block. 1050 1051 - opcode: LiveIn 1052 base: Inst 1053 signature: [d-real] 1054 flags: [no_dce, no_hoist, no_cse, low_level] 1055 modes: [irtoc] 1056 description: Pseudo instruction, that define live-in register. 1057 1058 - opcode: LiveOut 1059 base: FixedInputsInst1 1060 signature: [d-real, real] 1061 flags: [no_dce, no_hoist, no_cse, low_level] 1062 modes: [irtoc] 1063 description: Pseudo instruction, that define live-out register. 1064 1065pseudo_instructions: 1066 - opcode: Else 1067 flags: [pseudo, cf] 1068 - opcode: While 1069 flags: [pseudo, cf] 1070 - opcode: Goto 1071 flags: [pseudo, cf] 1072 - opcode: Label 1073 flags: [pseudo, cf] 1074 - opcode: Register 1075 signature: [d-real] 1076 flags: [pseudo] 1077 - opcode: WhilePhi 1078 flags: [pseudo] 1079 1080types: 1081 - name: i8 1082 - name: i16 1083 - name: i32 1084 - name: i64 1085 - name: u8 1086 - name: u16 1087 - name: u32 1088 - name: u64 1089 - name: f32 1090 - name: f64 1091 - name: bool 1092 - name: ref 1093 - name: ptr 1094 - name: void 1095 - name: any 1096 1097arch_info: 1098- name: arm64 1099 regs_count: 32 1100 temp_regs: [16, 17, 20] 1101 fp_regs_count: 32 1102 fp_temp_regs: [30, 31] 1103 1104- name: arm32 1105 regs_count: 16 1106 temp_regs: [8, 9, 12] 1107 fp_regs_count: 32 1108 fp_temp_regs: [14, 15] 1109 1110- name: x86_64 1111 regs_count: 16 1112 temp_regs: [12, 13, 14] 1113 fp_regs_count: 16 1114 fp_temp_regs: [13, 14, 15] 1115 1116legend: 1117 "Operand tokens": 1118 d: operand is a destination, operand is a source when 'd' is not specified 1119 i8: signed 8-bit integer 1120 i16: signed 16-bit integer 1121 i32: signed 32-bit integer 1122 i64: signed 64-bit integer 1123 u8: unsigned 8-bit integer 1124 u16: unsigned 16-bit integer 1125 u32: unsigned 32-bit integer 1126 u64: unsigned 64-bit integer 1127 f32: single precision float 1128 f64: double precision float 1129 bool: boolean type 1130 ref: object reference type 1131 ptr: pointer type 1132 void: void type 1133 int: type union of [bool, i8, i16, i32, i64, u8, u16, u32, u64] 1134 float: type union of [f32, f64] 1135 number: type union of [int, float] 1136 real: type union of [number, ref] 1137 any: the type is not statically defined(For dynamic languages) 1138 pseudo: pseudo destination - instruction doesn't actually write to the register 1139 zc: zero check - input must be the ZeroCheck instruction 1140 bc: bounds check - input must be the BoundsCheck instruction 1141 nc: null check - input must be the NullCheck instruction 1142 ngc: negative check - input should be the NegativeCheck instruction 1143 save_state: definition of the given input must be SaveState instruction 1144 dyn: dynamic operands, means that operand can repeat zero or more times 1145 1146verification: 1147 equal_type_classes: | 1148 Type classes of instruction's operands are equal. Type classes are int, float, ref (see operand_tokens for info) 1149 float_src_eq_dst_size: | 1150 If instrucion's type is float then size of source operands shall be equal to size of destination. 1151 integer_src_ge_dst_size: | 1152 If instrucion's type is integer then size of source operands shall be greater than or equal to size of destination. 1153 start_block_instruction: | 1154 Instruction can only reside in start basic block. 1155 1156flags: 1157 cf: Instruction affects control flow 1158 terminator: Execution will be terminated at the given instruction 1159 load: Instruction loads from memory 1160 store: Instruction stores into memory 1161 can_throw: Instruction can throw exception 1162 call: Call instruction. 1163 is_check: Instruction has runtime-checks and has `can_throw` flag 1164 no_dce: Instruction that can't be deleted on DCE 1165 no_cse: Instruction has unique vn class and CSE can't be applied 1166 no_dst: Instruction has no destination operand 1167 pseudo_dst: Instruction has pseudo destination operand, i.e. it doesn't affect on dataflow 1168 implicit_runtime_call: Instruction may call runtime before loading source, which can be moved by GC during that call 1169 low_level: Low level instruction 1170 no_hoist: Instruction can't be hoisted 1171 barrier: Instruction is a barrier for scheduling 1172 ref_special: Instruction which can not be moved throught runtime calls 1173 ifcvt: Instruction can be used in if-conversion 1174 require_state: Instruction may call runtime, thus, it requires SaveState in the inputs 1175 runtime_call: Instruction must call runtime 1176 commutative: Instruction is commutative(Add, OR, And e.t.c.) 1177 alloc: Instruction that allocates a new object on the heap 1178 acc_read: Read the accumulator register 1179 acc_write: Write the accumulator register 1180 heap_inv: Invalidates heap 1181 mem_barrier: we need encode memory barrier after the instruction(for return.void before) 1182 native: Instruction is used to generate unmanaged (native) code 1183 can_deoptimize: deoptimization may occur with jump to the interpreter 1184 1185modes: 1186 jit_aot: JIT or AOT compiler 1187 bytecode_opt: Bytecode optimizer 1188 irtoc: Ir-To-Code tool 1189