From 52aa478e15cdb40244e05f3fe8949db9a451a6cd Mon Sep 17 00:00:00 2001 From: Anatoly Trosinenko Date: Tue, 14 May 2024 18:43:02 +0300 Subject: [PATCH] [EraVM][AsmParser] Migrate to new asm syntax --- lld/test/ELF/eravm-code-reloc.s | 60 ++--- .../Target/EraVM/AsmParser/EraVMAsmParser.cpp | 36 +++ llvm/lib/Target/EraVM/EraVMInstrFormats.td | 4 +- llvm/lib/Target/EraVM/EraVMInstrInfo.td | 25 +- llvm/lib/Target/EraVM/EraVMOpcodes.td | 105 ++++---- .../EraVM/MCTargetDesc/EraVMInstPrinter.cpp | 25 +- llvm/test/CodeGen/EraVM/adjsp.ll | 6 +- llvm/test/CodeGen/EraVM/apint-assert.ll | 2 +- llvm/test/CodeGen/EraVM/array.ll | 26 +- llvm/test/CodeGen/EraVM/as3_nullptr_bug.ll | 2 +- llvm/test/CodeGen/EraVM/bytes2cells.ll | 4 +- .../test/CodeGen/EraVM/calling-convensions.ll | 100 ++++---- llvm/test/CodeGen/EraVM/compound.ll | 2 +- llvm/test/CodeGen/EraVM/context-remat.ll | 24 +- llvm/test/CodeGen/EraVM/cse-sub-cmp.ll | 16 +- llvm/test/CodeGen/EraVM/cxa_throw.ll | 4 +- llvm/test/CodeGen/EraVM/def-spill.ll | 24 +- .../CodeGen/EraVM/dollar-id-unparentesized.ll | 12 +- llvm/test/CodeGen/EraVM/exception-handling.ll | 14 +- llvm/test/CodeGen/EraVM/farcall-spill.ll | 14 +- llvm/test/CodeGen/EraVM/fold-add-to-select.ll | 4 +- .../EraVM/fold-similar-instructions.ll | 4 +- llvm/test/CodeGen/EraVM/frame_memory.ll | 4 +- llvm/test/CodeGen/EraVM/gasleft-no-sink.ll | 8 +- llvm/test/CodeGen/EraVM/globals.ll | 4 +- llvm/test/CodeGen/EraVM/hoist-flag-setting.ll | 2 +- llvm/test/CodeGen/EraVM/immediate-remat.ll | 8 +- llvm/test/CodeGen/EraVM/indexed-memops.ll | 24 +- llvm/test/CodeGen/EraVM/intrinsic.ll | 98 ++++---- llvm/test/CodeGen/EraVM/large_offset.ll | 4 +- .../EraVM/machinesink-inst-with-cp-operand.ll | 4 +- .../CodeGen/EraVM/memcpy-expansion-asm.ll | 68 +++--- llvm/test/CodeGen/EraVM/memintrinsics.ll | 20 +- .../CodeGen/EraVM/memmove-expansion-asm.ll | 52 ++-- llvm/test/CodeGen/EraVM/overflow-branch.ll | 48 ++-- llvm/test/CodeGen/EraVM/overflow-neg.ll | 4 +- llvm/test/CodeGen/EraVM/overflow.ll | 50 ++-- llvm/test/CodeGen/EraVM/pointer.ll | 24 +- llvm/test/CodeGen/EraVM/ptradd.ll | 64 ++--- llvm/test/CodeGen/EraVM/ptrpack.ll | 64 ++--- llvm/test/CodeGen/EraVM/ptrshrink.ll | 64 ++--- llvm/test/CodeGen/EraVM/reload-use.ll | 18 +- llvm/test/CodeGen/EraVM/rol.ll | 20 +- llvm/test/CodeGen/EraVM/ror.ll | 20 +- llvm/test/CodeGen/EraVM/select-zero.ll | 4 +- llvm/test/CodeGen/EraVM/selectcc.ll | 50 ++-- llvm/test/CodeGen/EraVM/selectcc_fatptr.ll | 4 +- .../separate-const-offset-from-gep-bug.ll | 4 +- llvm/test/CodeGen/EraVM/stack-address.ll | 16 +- llvm/test/CodeGen/EraVM/storage.ll | 4 +- llvm/test/CodeGen/EraVM/transient.ll | 4 +- llvm/test/CodeGen/EraVM/uma.ll | 38 +-- llvm/test/CodeGen/EraVM/zeroinitializer.ll | 2 +- .../asm-parser/arith-instructions-errors.s | 54 ++--- llvm/test/MC/EraVM/asm-parser/events.s | 32 +-- llvm/test/MC/EraVM/asm-parser/far-calls.s | 120 +++++----- llvm/test/MC/EraVM/asm-parser/far-returns.s | 24 +- .../EraVM/asm-parser/misc-operands-errors.s | 90 ++++--- llvm/test/MC/EraVM/asm-parser/misc.s | 96 ++++---- .../MC/EraVM/asm-parser/mnemonic-errors.s | 145 +++++++----- llvm/test/MC/EraVM/asm-parser/near-calls.s | 29 +-- llvm/test/MC/EraVM/asm-parser/near-returns.s | 96 ++++---- .../asm-parser/ptr-instructions-errors.s | 112 ++++----- .../MC/EraVM/asm-parser/ptr-instructions.s | 224 +++++++++--------- llvm/test/MC/EraVM/asm-parser/sp-changes.s | 105 ++++---- llvm/test/MC/EraVM/asm-parser/storage.s | 32 +-- llvm/test/MC/EraVM/asm-parser/uma.s | 128 +++++----- llvm/test/MC/EraVM/decoding/events.txt | 8 +- llvm/test/MC/EraVM/decoding/far-calls.txt | 24 +- llvm/test/MC/EraVM/decoding/misc.txt | 26 +- llvm/test/MC/EraVM/decoding/near-calls.txt | 2 +- llvm/test/MC/EraVM/decoding/nop.txt | 50 ++-- .../MC/EraVM/decoding/ptr-instructions.txt | 96 ++++---- llvm/test/MC/EraVM/decoding/returns.txt | 16 +- llvm/test/MC/EraVM/decoding/sp-changes.txt | 16 +- llvm/test/MC/EraVM/decoding/storage.txt | 8 +- llvm/test/MC/EraVM/decoding/uma.txt | 36 +-- llvm/test/MC/EraVM/encoding/data.ll | 4 +- llvm/test/MC/EraVM/encoding/events.s | 16 +- llvm/test/MC/EraVM/encoding/far-calls.s | 48 ++-- llvm/test/MC/EraVM/encoding/misc.s | 49 ++-- llvm/test/MC/EraVM/encoding/named-constants.s | 16 +- llvm/test/MC/EraVM/encoding/near-calls.s | 14 +- .../test/MC/EraVM/encoding/ptr-instructions.s | 192 +++++++-------- llvm/test/MC/EraVM/encoding/returns.s | 32 +-- llvm/test/MC/EraVM/encoding/sp-changes.s | 32 +-- llvm/test/MC/EraVM/encoding/storage.s | 16 +- llvm/test/MC/EraVM/encoding/uma.s | 80 +++---- .../Inputs/eravm-basic.ll.expected | 4 +- 89 files changed, 1736 insertions(+), 1647 deletions(-) diff --git a/lld/test/ELF/eravm-code-reloc.s b/lld/test/ELF/eravm-code-reloc.s index 5f55544cf1d5..474a94cdd06f 100644 --- a/lld/test/ELF/eravm-code-reloc.s +++ b/lld/test/ELF/eravm-code-reloc.s @@ -66,24 +66,24 @@ foo_local: .type caller_g,@function .globl caller_g caller_g: - near_call r1, @foo, @handler - far_call r3, r4, @foo + call r1, @foo, @handler + callf r3, r4, @foo add @.OUTLINED_FUNCTION_RET0, r0, stack-[1] jump @foo_local .OUTLINED_FUNCTION_RET0: jump @label - ret.ok.to_label r1, @label - ret.revert.to_label r1, @label - ret.panic.to_label @label + retl r1, @label + revl r1, @label + pncl @label .globl label label: jump code[@jump_table + 1] ret ; INPUT-LABEL: : -; INPUT-NEXT: 00 00 00 00 00 01 04 0f near_call r1, 0, 0 +; INPUT-NEXT: 00 00 00 00 00 01 04 0f call r1, 0, 0 ; INPUT-NEXT: R_ERAVM_16_SCALE_8 handler ; INPUT-NEXT: R_ERAVM_16_SCALE_8 foo -; INPUT-NEXT: 00 00 00 00 00 43 04 21 far_call r3, r4, 0 +; INPUT-NEXT: 00 00 00 00 00 43 04 21 callf r3, r4, 0 ; INPUT-NEXT: R_ERAVM_16_SCALE_8 foo ; INPUT-NEXT: 00 01 00 00 00 00 00 3d add 0, r0, stack-[1 + r0] ; INPUT-NEXT: R_ERAVM_16_SCALE_8 .text+0x40 @@ -91,11 +91,11 @@ label: ; INPUT-NEXT: R_ERAVM_16_SCALE_8 .text+0x18 ; INPUT-NEXT: 00 00 00 00 00 00 01 3d jump 0 ; INPUT-NEXT: R_ERAVM_16_SCALE_8 label -; INPUT-NEXT: 00 00 00 00 00 01 04 2e ret.ok.to_label r1, 0 +; INPUT-NEXT: 00 00 00 00 00 01 04 2e retl 0 ; INPUT-NEXT: R_ERAVM_16_SCALE_8 label -; INPUT-NEXT: 00 00 00 00 00 01 04 30 ret.revert.to_label r1, 0 +; INPUT-NEXT: 00 00 00 00 00 01 04 30 revl 0 ; INPUT-NEXT: R_ERAVM_16_SCALE_8 label -; INPUT-NEXT: 00 00 00 00 00 00 04 32 ret.panic.to_label 0 +; INPUT-NEXT: 00 00 00 00 00 00 04 32 pncl 0 ; INPUT-NEXT: R_ERAVM_16_SCALE_8 label ; INPUT-LABEL: