From 7081b8fc10f9909fd31fcc26da54badc2f00ad7a Mon Sep 17 00:00:00 2001 From: Trevor Elliott Date: Sat, 31 Aug 2024 08:54:13 -0700 Subject: [PATCH] Revert "Upgrade regalloc2 to 0.9.4 (#9191)" (#9193) This reverts commit 098430f3c8fd7bb92968402beef0670d08023fba. --- Cargo.lock | 15 +- Cargo.toml | 2 +- cranelift/codegen/src/machinst/vcode.rs | 2 +- .../isa/aarch64/call-pauth-bkey.clif | 8 +- .../filetests/isa/aarch64/call-pauth.clif | 8 +- .../filetests/filetests/isa/aarch64/call.clif | 80 +++--- .../filetests/filetests/isa/aarch64/fma.clif | 12 +- .../isa/aarch64/return-call-indirect.clif | 8 +- .../filetests/isa/aarch64/return-call.clif | 68 ++--- .../filetests/isa/aarch64/shuffle.clif | 8 +- .../filetests/isa/aarch64/stack.clif | 60 ++--- .../filetests/isa/aarch64/tail-call-conv.clif | 8 +- .../filetests/isa/aarch64/tls-elf-gd.clif | 8 +- .../filetests/isa/aarch64/tls-macho.clif | 16 +- .../isa/aarch64/user_stack_maps.clif | 140 +++++----- .../filetests/isa/pulley32/call.clif | 12 +- .../filetests/isa/pulley64/call.clif | 12 +- .../filetests/isa/riscv64/amodes.clif | 36 ++- .../filetests/isa/riscv64/arithmetic.clif | 10 +- .../filetests/isa/riscv64/bitrev.clif | 127 +++++---- .../filetests/isa/riscv64/bswap.clif | 106 ++++---- .../filetests/filetests/isa/riscv64/call.clif | 60 ++--- .../isa/riscv64/return-call-indirect.clif | 24 +- .../filetests/isa/riscv64/return-call.clif | 92 +++---- .../filetests/isa/riscv64/stack.clif | 112 ++++---- .../filetests/isa/riscv64/tail-call-conv.clif | 236 ++++++++--------- .../isa/riscv64/user_stack_maps.clif | 108 ++++---- .../filetests/filetests/isa/riscv64/zca.clif | 68 ++--- .../filetests/filetests/isa/riscv64/zcb.clif | 18 +- .../filetests/isa/s390x/arithmetic.clif | 178 +++++++------ .../filetests/isa/s390x/call-tail.clif | 38 +-- .../filetests/isa/s390x/multivalue-ret.clif | 26 +- .../isa/s390x/return-call-indirect.clif | 48 ++-- .../filetests/isa/s390x/return-call.clif | 150 +++++------ .../filetests/isa/s390x/struct-arg.clif | 24 +- .../filetests/isa/s390x/user_stack_maps.clif | 80 +++--- .../filetests/isa/x64/call-conv.clif | 86 +++--- .../filetests/filetests/isa/x64/fastcall.clif | 4 +- .../filetests/filetests/isa/x64/fma-call.clif | 8 +- .../filetests/filetests/isa/x64/i128.clif | 20 +- .../isa/x64/return-call-indirect.clif | 40 +-- .../filetests/isa/x64/return-call.clif | 84 +++--- .../filetests/isa/x64/struct-arg.clif | 48 ++-- .../filetests/isa/x64/struct-ret.clif | 4 +- .../filetests/isa/x64/tail-call-conv.clif | 244 +++++++++--------- .../filetests/filetests/isa/x64/udiv.clif | 12 +- .../filetests/filetests/isa/x64/udivrem.clif | 20 +- .../filetests/filetests/isa/x64/urem.clif | 12 +- .../filetests/isa/x64/user_stack_maps.clif | 82 +++--- .../filetests/filetests/isa/x64/winch.clif | 12 +- supply-chain/audits.toml | 2 +- supply-chain/imports.lock | 7 - 52 files changed, 1422 insertions(+), 1271 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 43ba46419336..764f9d0c05c8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1387,6 +1387,15 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + [[package]] name = "hashbrown" version = "0.14.3" @@ -2283,11 +2292,11 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.9.4" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3060e21243fead477032ee2824bd68dfc70596b3333317e5295f6afb1d779d" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.13.2", "log", "rustc-hash", "serde", diff --git a/Cargo.toml b/Cargo.toml index 5d653ed3564f..89e720681c24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -246,7 +246,7 @@ byte-array-literals = { path = "crates/wasi-preview1-component-adapter/byte-arra # Bytecode Alliance maintained dependencies: # --------------------------- -regalloc2 = "0.9.4" +regalloc2 = "0.9.3" # cap-std family: target-lexicon = "0.12.16" diff --git a/cranelift/codegen/src/machinst/vcode.rs b/cranelift/codegen/src/machinst/vcode.rs index de49327f25bb..f2f9fe73b3ae 100644 --- a/cranelift/codegen/src/machinst/vcode.rs +++ b/cranelift/codegen/src/machinst/vcode.rs @@ -1297,7 +1297,7 @@ impl RegallocFunction for VCode { fn block_insns(&self, block: BlockIndex) -> InstRange { let range = self.block_ranges.get(block.index()); - InstRange::new(InsnIndex::new(range.start), InsnIndex::new(range.end)) + InstRange::forward(InsnIndex::new(range.start), InsnIndex::new(range.end)) } fn block_succs(&self, block: BlockIndex) -> &[BlockIndex] { diff --git a/cranelift/filetests/filetests/isa/aarch64/call-pauth-bkey.clif b/cranelift/filetests/filetests/isa/aarch64/call-pauth-bkey.clif index 9b37ca1521b5..d919b28dace0 100644 --- a/cranelift/filetests/filetests/isa/aarch64/call-pauth-bkey.clif +++ b/cranelift/filetests/filetests/isa/aarch64/call-pauth-bkey.clif @@ -63,8 +63,8 @@ block0(v0: i64): ; stp fp, lr, [sp, #-16]! ; mov fp, sp ; block0: -; load_ext_name x3, TestCase(%g)+0 ; mov x0, x2 +; load_ext_name x3, TestCase(%g)+0 ; blr x3 ; mov x2, x0 ; ldp fp, lr, [sp], #16 @@ -76,11 +76,11 @@ block0(v0: i64): ; stp x29, x30, [sp, #-0x10]! ; mov x29, sp ; block1: ; offset 0xc -; ldr x3, #0x14 -; b #0x1c +; mov x0, x2 +; ldr x3, #0x18 +; b #0x20 ; .byte 0x00, 0x00, 0x00, 0x00 ; reloc_external Abs8 %g 0 ; .byte 0x00, 0x00, 0x00, 0x00 -; mov x0, x2 ; blr x3 ; mov x2, x0 ; ldp x29, x30, [sp], #0x10 diff --git a/cranelift/filetests/filetests/isa/aarch64/call-pauth.clif b/cranelift/filetests/filetests/isa/aarch64/call-pauth.clif index 736cafe2e0c3..5e11b77d4f21 100644 --- a/cranelift/filetests/filetests/isa/aarch64/call-pauth.clif +++ b/cranelift/filetests/filetests/isa/aarch64/call-pauth.clif @@ -64,8 +64,8 @@ block0(v0: i64): ; stp fp, lr, [sp, #-16]! ; mov fp, sp ; block0: -; load_ext_name x3, TestCase(%g)+0 ; mov x0, x2 +; load_ext_name x3, TestCase(%g)+0 ; blr x3 ; mov x2, x0 ; ldp fp, lr, [sp], #16 @@ -77,11 +77,11 @@ block0(v0: i64): ; stp x29, x30, [sp, #-0x10]! ; mov x29, sp ; block1: ; offset 0xc -; ldr x3, #0x14 -; b #0x1c +; mov x0, x2 +; ldr x3, #0x18 +; b #0x20 ; .byte 0x00, 0x00, 0x00, 0x00 ; reloc_external Abs8 %g 0 ; .byte 0x00, 0x00, 0x00, 0x00 -; mov x0, x2 ; blr x3 ; mov x2, x0 ; ldp x29, x30, [sp], #0x10 diff --git a/cranelift/filetests/filetests/isa/aarch64/call.clif b/cranelift/filetests/filetests/isa/aarch64/call.clif index ee69a6a2819a..102dc4f4e021 100644 --- a/cranelift/filetests/filetests/isa/aarch64/call.clif +++ b/cranelift/filetests/filetests/isa/aarch64/call.clif @@ -529,9 +529,9 @@ block0(v0: i64): ; stp fp, lr, [sp, #-16]! ; mov fp, sp ; block0: +; mov x1, x0 ; movz x2, #42 ; load_ext_name x4, TestCase(%f11)+0 -; mov x1, x0 ; mov x0, x2 ; blr x4 ; ldp fp, lr, [sp], #16 @@ -542,12 +542,12 @@ block0(v0: i64): ; stp x29, x30, [sp, #-0x10]! ; mov x29, sp ; block1: ; offset 0x8 +; mov x1, x0 ; mov x2, #0x2a -; ldr x4, #0x14 -; b #0x1c +; ldr x4, #0x18 +; b #0x20 ; .byte 0x00, 0x00, 0x00, 0x00 ; reloc_external Abs8 %f11 0 ; .byte 0x00, 0x00, 0x00, 0x00 -; mov x1, x0 ; mov x0, x2 ; blr x4 ; ldp x29, x30, [sp], #0x10 @@ -583,9 +583,9 @@ block0(v0: i64): ; stp fp, lr, [sp, #-16]! ; mov fp, sp ; block0: +; mov x2, x0 ; movz x3, #42 ; load_ext_name x4, TestCase(%f12)+0 -; mov x2, x0 ; mov x0, x3 ; blr x4 ; ldp fp, lr, [sp], #16 @@ -596,12 +596,12 @@ block0(v0: i64): ; stp x29, x30, [sp, #-0x10]! ; mov x29, sp ; block1: ; offset 0x8 +; mov x2, x0 ; mov x3, #0x2a -; ldr x4, #0x14 -; b #0x1c +; ldr x4, #0x18 +; b #0x20 ; .byte 0x00, 0x00, 0x00, 0x00 ; reloc_external Abs8 %f12 0 ; .byte 0x00, 0x00, 0x00, 0x00 -; mov x2, x0 ; mov x0, x3 ; blr x4 ; ldp x29, x30, [sp], #0x10 @@ -637,9 +637,9 @@ block0(v0: i64): ; stp fp, lr, [sp, #-16]! ; mov fp, sp ; block0: +; mov x1, x0 ; movz x2, #42 ; load_ext_name x4, TestCase(%f13)+0 -; mov x1, x0 ; mov x0, x2 ; blr x4 ; ldp fp, lr, [sp], #16 @@ -650,12 +650,12 @@ block0(v0: i64): ; stp x29, x30, [sp, #-0x10]! ; mov x29, sp ; block1: ; offset 0x8 +; mov x1, x0 ; mov x2, #0x2a -; ldr x4, #0x14 -; b #0x1c +; ldr x4, #0x18 +; b #0x20 ; .byte 0x00, 0x00, 0x00, 0x00 ; reloc_external Abs8 %f13 0 ; .byte 0x00, 0x00, 0x00, 0x00 -; mov x1, x0 ; mov x0, x2 ; blr x4 ; ldp x29, x30, [sp], #0x10 @@ -698,12 +698,12 @@ block0(v0: i128, v1: i64): ; mov fp, sp ; sub sp, sp, #16 ; block0: +; mov x6, x2 ; str x0, [sp] -; str x1, [sp, #8] -; load_ext_name x8, TestCase(%f14)+0 ; mov x4, x0 +; str x1, [sp, #8] ; mov x5, x1 -; mov x6, x2 +; load_ext_name x8, TestCase(%f14)+0 ; mov x2, x4 ; mov x3, x5 ; blr x8 @@ -717,15 +717,15 @@ block0(v0: i128, v1: i64): ; mov x29, sp ; sub sp, sp, #0x10 ; block1: ; offset 0xc +; mov x6, x2 ; stur x0, [sp] +; mov x4, x0 ; stur x1, [sp, #8] -; ldr x8, #0x1c -; b #0x24 +; mov x5, x1 +; ldr x8, #0x28 +; b #0x30 ; .byte 0x00, 0x00, 0x00, 0x00 ; reloc_external Abs8 %f14 0 ; .byte 0x00, 0x00, 0x00, 0x00 -; mov x4, x0 -; mov x5, x1 -; mov x6, x2 ; mov x2, x4 ; mov x3, x5 ; blr x8 @@ -770,12 +770,12 @@ block0(v0: i128, v1: i64): ; mov fp, sp ; sub sp, sp, #16 ; block0: +; mov x6, x2 ; str x0, [sp] -; str x1, [sp, #8] -; load_ext_name x8, TestCase(%f15)+0 ; mov x4, x0 +; str x1, [sp, #8] ; mov x5, x1 -; mov x6, x2 +; load_ext_name x8, TestCase(%f15)+0 ; mov x2, x4 ; mov x3, x5 ; blr x8 @@ -789,15 +789,15 @@ block0(v0: i128, v1: i64): ; mov x29, sp ; sub sp, sp, #0x10 ; block1: ; offset 0xc +; mov x6, x2 ; stur x0, [sp] +; mov x4, x0 ; stur x1, [sp, #8] -; ldr x8, #0x1c -; b #0x24 +; mov x5, x1 +; ldr x8, #0x28 +; b #0x30 ; .byte 0x00, 0x00, 0x00, 0x00 ; reloc_external Abs8 %f15 0 ; .byte 0x00, 0x00, 0x00, 0x00 -; mov x4, x0 -; mov x5, x1 -; mov x6, x2 ; mov x2, x4 ; mov x3, x5 ; blr x8 @@ -836,8 +836,8 @@ block0(v0: i64): ; stp fp, lr, [sp, #-16]! ; mov fp, sp ; block0: -; load_ext_name x3, TestCase(%g)+0 ; mov x8, x0 +; load_ext_name x3, TestCase(%g)+0 ; blr x3 ; ldp fp, lr, [sp], #16 ; ret @@ -847,11 +847,11 @@ block0(v0: i64): ; stp x29, x30, [sp, #-0x10]! ; mov x29, sp ; block1: ; offset 0x8 -; ldr x3, #0x10 -; b #0x18 +; mov x8, x0 +; ldr x3, #0x14 +; b #0x1c ; .byte 0x00, 0x00, 0x00, 0x00 ; reloc_external Abs8 %g 0 ; .byte 0x00, 0x00, 0x00, 0x00 -; mov x8, x0 ; blr x3 ; ldp x29, x30, [sp], #0x10 ; ret @@ -867,13 +867,13 @@ block0(v0: i64): ; VCode: ; stp fp, lr, [sp, #-16]! ; mov fp, sp -; str x24, [sp, #-16]! +; str x23, [sp, #-16]! ; block0: -; mov x24, x8 +; mov x23, x8 ; load_ext_name x2, TestCase(%g)+0 ; blr x2 -; mov x8, x24 -; ldr x24, [sp], #16 +; mov x8, x23 +; ldr x23, [sp], #16 ; ldp fp, lr, [sp], #16 ; ret ; @@ -881,16 +881,16 @@ block0(v0: i64): ; block0: ; offset 0x0 ; stp x29, x30, [sp, #-0x10]! ; mov x29, sp -; str x24, [sp, #-0x10]! +; str x23, [sp, #-0x10]! ; block1: ; offset 0xc -; mov x24, x8 +; mov x23, x8 ; ldr x2, #0x18 ; b #0x20 ; .byte 0x00, 0x00, 0x00, 0x00 ; reloc_external Abs8 %g 0 ; .byte 0x00, 0x00, 0x00, 0x00 ; blr x2 -; mov x8, x24 -; ldr x24, [sp], #0x10 +; mov x8, x23 +; ldr x23, [sp], #0x10 ; ldp x29, x30, [sp], #0x10 ; ret diff --git a/cranelift/filetests/filetests/isa/aarch64/fma.clif b/cranelift/filetests/filetests/isa/aarch64/fma.clif index a0b714d09d4b..d44099cec743 100644 --- a/cranelift/filetests/filetests/isa/aarch64/fma.clif +++ b/cranelift/filetests/filetests/isa/aarch64/fma.clif @@ -358,28 +358,28 @@ block0(v0: f32x4, v1: f32x4, v2: f32x4): ; VCode: ; block0: +; mov v31.16b, v1.16b ; movz w6, #7452 ; movk w6, w6, #7966, LSL #16 ; dup v17.4s, w6 -; mov v31.16b, v1.16b ; mov v30.16b, v31.16b ; tbl v19.16b, { v30.16b, v31.16b }, v17.16b -; mov v22.16b, v0.16b +; mov v23.16b, v0.16b ; mov v0.16b, v2.16b -; fmla v0.4s, v0.4s, v22.4s, v19.4s +; fmla v0.4s, v0.4s, v23.4s, v19.4s ; ret ; ; Disassembled: ; block0: ; offset 0x0 +; mov v31.16b, v1.16b ; mov w6, #0x1d1c ; movk w6, #0x1f1e, lsl #16 ; dup v17.4s, w6 -; mov v31.16b, v1.16b ; mov v30.16b, v31.16b ; tbl v19.16b, {v30.16b, v31.16b}, v17.16b -; mov v22.16b, v0.16b +; mov v23.16b, v0.16b ; mov v0.16b, v2.16b -; fmla v0.4s, v22.4s, v19.4s +; fmla v0.4s, v23.4s, v19.4s ; ret function %f64x2_splat0(f64x2, f64x2, f64x2) -> f64x2 { diff --git a/cranelift/filetests/filetests/isa/aarch64/return-call-indirect.clif b/cranelift/filetests/filetests/isa/aarch64/return-call-indirect.clif index ca0c1fcd48e7..319ea508ba06 100644 --- a/cranelift/filetests/filetests/isa/aarch64/return-call-indirect.clif +++ b/cranelift/filetests/filetests/isa/aarch64/return-call-indirect.clif @@ -228,8 +228,8 @@ block0: ; stp x19, x20, [sp, #-16]! ; sub sp, sp, #16 ; block0: -; movz x3, #10 -; str x3, [sp] +; movz x2, #10 +; str x2, [sp] ; movz x3, #15 ; movz x4, #20 ; movz x5, #25 @@ -295,8 +295,8 @@ block0: ; stp x19, x20, [sp, #-0x10]! ; sub sp, sp, #0x10 ; block1: ; offset 0x30 -; mov x3, #0xa -; stur x3, [sp] +; mov x2, #0xa +; stur x2, [sp] ; mov x3, #0xf ; mov x4, #0x14 ; mov x5, #0x19 diff --git a/cranelift/filetests/filetests/isa/aarch64/return-call.clif b/cranelift/filetests/filetests/isa/aarch64/return-call.clif index 46a9ce746ca3..1e018b3c4a84 100644 --- a/cranelift/filetests/filetests/isa/aarch64/return-call.clif +++ b/cranelift/filetests/filetests/isa/aarch64/return-call.clif @@ -463,18 +463,18 @@ block2: ; stp x19, x20, [sp, #-16]! ; sub sp, sp, #16 ; block0: -; movz x3, #10 -; str x3, [sp] +; movz x14, #10 +; str x14, [sp] ; movz x3, #15 ; movz x4, #20 ; movz x5, #25 ; movz x6, #30 ; movz x7, #35 -; movz x25, #40 -; movz x21, #45 -; movz x28, #50 -; movz x27, #55 -; movz x26, #60 +; movz x21, #40 +; movz x28, #45 +; movz x27, #50 +; movz x26, #55 +; movz x25, #60 ; movz x24, #65 ; movz x23, #70 ; movz x22, #75 @@ -493,11 +493,11 @@ block2: ; cbnz x2, label2 ; b label1 ; block1: ; movz x2, #140 -; str x25, [sp, #112] -; str x21, [sp, #120] -; str x28, [sp, #128] -; str x27, [sp, #136] -; str x26, [sp, #144] +; str x21, [sp, #112] +; str x28, [sp, #120] +; str x27, [sp, #128] +; str x26, [sp, #136] +; str x25, [sp, #144] ; str x24, [sp, #152] ; str x23, [sp, #160] ; str x22, [sp, #168] @@ -519,11 +519,11 @@ block2: ; return_call_ind x1 new_stack_arg_size:176 x2=x2 x3=x3 x4=x4 x5=x5 x6=x6 x7=x7 ; block2: ; ldr x2, [sp] -; str x25, [sp, #128] -; str x21, [sp, #136] -; str x28, [sp, #144] -; str x27, [sp, #152] -; str x26, [sp, #160] +; str x21, [sp, #128] +; str x28, [sp, #136] +; str x27, [sp, #144] +; str x26, [sp, #152] +; str x25, [sp, #160] ; str x24, [sp, #168] ; str x23, [sp, #176] ; str x22, [sp, #184] @@ -557,18 +557,18 @@ block2: ; stp x19, x20, [sp, #-0x10]! ; sub sp, sp, #0x10 ; block1: ; offset 0x30 -; mov x3, #0xa -; stur x3, [sp] +; mov x14, #0xa +; stur x14, [sp] ; mov x3, #0xf ; mov x4, #0x14 ; mov x5, #0x19 ; mov x6, #0x1e ; mov x7, #0x23 -; mov x25, #0x28 -; mov x21, #0x2d -; mov x28, #0x32 -; mov x27, #0x37 -; mov x26, #0x3c +; mov x21, #0x28 +; mov x28, #0x2d +; mov x27, #0x32 +; mov x26, #0x37 +; mov x25, #0x3c ; mov x24, #0x41 ; mov x23, #0x46 ; mov x22, #0x4b @@ -587,11 +587,11 @@ block2: ; cbnz x2, #0x12c ; block2: ; offset 0xa0 ; mov x2, #0x8c -; stur x25, [sp, #0x70] -; stur x21, [sp, #0x78] -; stur x28, [sp, #0x80] -; stur x27, [sp, #0x88] -; stur x26, [sp, #0x90] +; stur x21, [sp, #0x70] +; stur x28, [sp, #0x78] +; stur x27, [sp, #0x80] +; stur x26, [sp, #0x88] +; stur x25, [sp, #0x90] ; stur x24, [sp, #0x98] ; stur x23, [sp, #0xa0] ; stur x22, [sp, #0xa8] @@ -623,11 +623,11 @@ block2: ; br x1 ; block3: ; offset 0x12c ; ldur x2, [sp] -; stur x25, [sp, #0x80] -; stur x21, [sp, #0x88] -; stur x28, [sp, #0x90] -; stur x27, [sp, #0x98] -; stur x26, [sp, #0xa0] +; stur x21, [sp, #0x80] +; stur x28, [sp, #0x88] +; stur x27, [sp, #0x90] +; stur x26, [sp, #0x98] +; stur x25, [sp, #0xa0] ; stur x24, [sp, #0xa8] ; stur x23, [sp, #0xb0] ; stur x22, [sp, #0xb8] diff --git a/cranelift/filetests/filetests/isa/aarch64/shuffle.clif b/cranelift/filetests/filetests/isa/aarch64/shuffle.clif index b20ceee6d052..d22518b02aeb 100644 --- a/cranelift/filetests/filetests/isa/aarch64/shuffle.clif +++ b/cranelift/filetests/filetests/isa/aarch64/shuffle.clif @@ -10,17 +10,17 @@ block0(v0: i8x16, v1: i8x16): ; VCode: ; block0: -; ldr q3, [const(0)] ; mov v30.16b, v0.16b ; mov v31.16b, v1.16b +; ldr q3, [const(0)] ; tbl v0.16b, { v30.16b, v31.16b }, v3.16b ; ret ; ; Disassembled: ; block0: ; offset 0x0 -; ldr q3, #0x20 ; mov v30.16b, v0.16b ; mov v31.16b, v1.16b +; ldr q3, #0x20 ; tbl v0.16b, {v30.16b, v31.16b}, v3.16b ; ret ; .byte 0x00, 0x00, 0x00, 0x00 @@ -541,17 +541,17 @@ block0(v0: i8x16, v1: i8x16): ; VCode: ; block0: -; ldr q3, [const(0)] ; mov v30.16b, v0.16b ; mov v31.16b, v1.16b +; ldr q3, [const(0)] ; tbl v0.16b, { v30.16b, v31.16b }, v3.16b ; ret ; ; Disassembled: ; block0: ; offset 0x0 -; ldr q3, #0x20 ; mov v30.16b, v0.16b ; mov v31.16b, v1.16b +; ldr q3, #0x20 ; tbl v0.16b, {v30.16b, v31.16b}, v3.16b ; ret ; .byte 0x00, 0x00, 0x00, 0x00 diff --git a/cranelift/filetests/filetests/isa/aarch64/stack.clif b/cranelift/filetests/filetests/isa/aarch64/stack.clif index 12b9788ec195..cd2fd150b9cb 100644 --- a/cranelift/filetests/filetests/isa/aarch64/stack.clif +++ b/cranelift/filetests/filetests/isa/aarch64/stack.clif @@ -463,28 +463,28 @@ block0(v0: i8): ; add x0, x0, #31 ; ldr x7, [sp, #1208] ; add x7, x7, #33 -; ldr x10, [sp, #1200] -; add x8, x10, #35 -; ldr x13, [sp, #1192] -; add x9, x13, #37 -; ldr x1, [sp, #1184] -; add x10, x1, #39 -; ldr x3, [sp, #1176] -; add x11, x3, #31 -; ldr x6, [sp, #1168] -; add x12, x6, #33 +; ldr x9, [sp, #1200] +; add x8, x9, #35 +; ldr x12, [sp, #1192] +; add x9, x12, #37 +; ldr x15, [sp, #1184] +; add x10, x15, #39 +; ldr x2, [sp, #1176] +; add x11, x2, #31 +; ldr x5, [sp, #1168] +; add x12, x5, #33 ; ldr x13, [sp, #1160] ; add x13, x13, #35 ; ldr x14, [sp, #1152] ; add x14, x14, #37 ; ldr x15, [sp, #1144] ; add x15, x15, #39 -; ldr x2, [sp, #1136] -; ldr x4, [sp, #1128] -; add x1, x2, x4 +; ldr x1, [sp, #1136] +; ldr x3, [sp, #1128] +; add x1, x1, x3 ; ldr x2, [sp, #1112] -; ldr x3, [sp, #1120] -; add x2, x3, x2 +; ldr x6, [sp, #1120] +; add x2, x6, x2 ; ldr x3, [sp, #1096] ; ldr x4, [sp, #1104] ; add x3, x4, x3 @@ -641,28 +641,28 @@ block0(v0: i8): ; add x0, x0, #0x1f ; ldr x7, [sp, #0x4b8] ; add x7, x7, #0x21 -; ldr x10, [sp, #0x4b0] -; add x8, x10, #0x23 -; ldr x13, [sp, #0x4a8] -; add x9, x13, #0x25 -; ldr x1, [sp, #0x4a0] -; add x10, x1, #0x27 -; ldr x3, [sp, #0x498] -; add x11, x3, #0x1f -; ldr x6, [sp, #0x490] -; add x12, x6, #0x21 +; ldr x9, [sp, #0x4b0] +; add x8, x9, #0x23 +; ldr x12, [sp, #0x4a8] +; add x9, x12, #0x25 +; ldr x15, [sp, #0x4a0] +; add x10, x15, #0x27 +; ldr x2, [sp, #0x498] +; add x11, x2, #0x1f +; ldr x5, [sp, #0x490] +; add x12, x5, #0x21 ; ldr x13, [sp, #0x488] ; add x13, x13, #0x23 ; ldr x14, [sp, #0x480] ; add x14, x14, #0x25 ; ldr x15, [sp, #0x478] ; add x15, x15, #0x27 -; ldr x2, [sp, #0x470] -; ldr x4, [sp, #0x468] -; add x1, x2, x4 +; ldr x1, [sp, #0x470] +; ldr x3, [sp, #0x468] +; add x1, x1, x3 ; ldr x2, [sp, #0x458] -; ldr x3, [sp, #0x460] -; add x2, x3, x2 +; ldr x6, [sp, #0x460] +; add x2, x6, x2 ; ldr x3, [sp, #0x448] ; ldr x4, [sp, #0x450] ; add x3, x4, x3 diff --git a/cranelift/filetests/filetests/isa/aarch64/tail-call-conv.clif b/cranelift/filetests/filetests/isa/aarch64/tail-call-conv.clif index 9a9da0b515c7..1f5dd3f61328 100644 --- a/cranelift/filetests/filetests/isa/aarch64/tail-call-conv.clif +++ b/cranelift/filetests/filetests/isa/aarch64/tail-call-conv.clif @@ -243,8 +243,8 @@ block0: ; stp x19, x20, [sp, #-16]! ; sub sp, sp, #16 ; block0: -; movz x3, #10 -; str x3, [sp] +; movz x2, #10 +; str x2, [sp] ; movz x3, #15 ; movz x4, #20 ; movz x5, #25 @@ -311,8 +311,8 @@ block0: ; stp x19, x20, [sp, #-0x10]! ; sub sp, sp, #0x10 ; block1: ; offset 0x20 -; mov x3, #0xa -; stur x3, [sp] +; mov x2, #0xa +; stur x2, [sp] ; mov x3, #0xf ; mov x4, #0x14 ; mov x5, #0x19 diff --git a/cranelift/filetests/filetests/isa/aarch64/tls-elf-gd.clif b/cranelift/filetests/filetests/isa/aarch64/tls-elf-gd.clif index 7f185e4b2e81..e3761f258d74 100644 --- a/cranelift/filetests/filetests/isa/aarch64/tls-elf-gd.clif +++ b/cranelift/filetests/filetests/isa/aarch64/tls-elf-gd.clif @@ -14,10 +14,10 @@ block0(v0: i32): ; stp fp, lr, [sp, #-16]! ; mov fp, sp ; block0: -; mov x6, x0 +; mov x5, x0 ; elf_tls_get_addr x0, x3, userextname0 ; mov x1, x0 -; mov x0, x6 +; mov x0, x5 ; ldp fp, lr, [sp], #16 ; ret ; @@ -26,7 +26,7 @@ block0(v0: i32): ; stp x29, x30, [sp, #-0x10]! ; mov x29, sp ; block1: ; offset 0x8 -; mov x6, x0 +; mov x5, x0 ; adrp x0, #0 ; reloc_external Aarch64TlsDescAdrPage21 u1:0 0 ; ldr x3, [x0] ; reloc_external Aarch64TlsDescLd64Lo12 u1:0 0 ; add x0, x0, #0 ; reloc_external Aarch64TlsDescAddLo12 u1:0 0 @@ -34,7 +34,7 @@ block0(v0: i32): ; mrs x3, tpidr_el0 ; add x0, x0, x3 ; mov x1, x0 -; mov x0, x6 +; mov x0, x5 ; ldp x29, x30, [sp], #0x10 ; ret diff --git a/cranelift/filetests/filetests/isa/aarch64/tls-macho.clif b/cranelift/filetests/filetests/isa/aarch64/tls-macho.clif index 23a20eb52ce1..5a74b0948444 100644 --- a/cranelift/filetests/filetests/isa/aarch64/tls-macho.clif +++ b/cranelift/filetests/filetests/isa/aarch64/tls-macho.clif @@ -13,21 +13,21 @@ block0(v0: i32): ; VCode: ; stp fp, lr, [sp, #-16]! ; mov fp, sp -; str x25, [sp, #-16]! +; str x24, [sp, #-16]! ; stp d14, d15, [sp, #-16]! ; stp d12, d13, [sp, #-16]! ; stp d10, d11, [sp, #-16]! ; stp d8, d9, [sp, #-16]! ; block0: -; mov x25, x0 +; mov x24, x0 ; macho_tls_get_addr x0, userextname0 ; mov x1, x0 -; mov x0, x25 +; mov x0, x24 ; ldp d8, d9, [sp], #16 ; ldp d10, d11, [sp], #16 ; ldp d12, d13, [sp], #16 ; ldp d14, d15, [sp], #16 -; ldr x25, [sp], #16 +; ldr x24, [sp], #16 ; ldp fp, lr, [sp], #16 ; ret ; @@ -35,24 +35,24 @@ block0(v0: i32): ; block0: ; offset 0x0 ; stp x29, x30, [sp, #-0x10]! ; mov x29, sp -; str x25, [sp, #-0x10]! +; str x24, [sp, #-0x10]! ; stp d14, d15, [sp, #-0x10]! ; stp d12, d13, [sp, #-0x10]! ; stp d10, d11, [sp, #-0x10]! ; stp d8, d9, [sp, #-0x10]! ; block1: ; offset 0x1c -; mov x25, x0 +; mov x24, x0 ; adrp x0, #0 ; reloc_external MachOAarch64TlsAdrPage21 u1:0 0 ; ldr x0, [x0] ; reloc_external MachOAarch64TlsAdrPageOff12 u1:0 0 ; ldr x1, [x0] ; blr x1 ; mov x1, x0 -; mov x0, x25 +; mov x0, x24 ; ldp d8, d9, [sp], #0x10 ; ldp d10, d11, [sp], #0x10 ; ldp d12, d13, [sp], #0x10 ; ldp d14, d15, [sp], #0x10 -; ldr x25, [sp], #0x10 +; ldr x24, [sp], #0x10 ; ldp x29, x30, [sp], #0x10 ; ret diff --git a/cranelift/filetests/filetests/isa/aarch64/user_stack_maps.clif b/cranelift/filetests/filetests/isa/aarch64/user_stack_maps.clif index 531ecb748afe..e51a2e507a72 100644 --- a/cranelift/filetests/filetests/isa/aarch64/user_stack_maps.clif +++ b/cranelift/filetests/filetests/isa/aarch64/user_stack_maps.clif @@ -34,39 +34,45 @@ block0: ; VCode: ; stp fp, lr, [sp, #-16]! ; mov fp, sp -; str x28, [sp, #-16]! -; stp x19, x21, [sp, #-16]! +; str x24, [sp, #-16]! +; stp x19, x22, [sp, #-16]! ; sub sp, sp, #16 ; block0: -; movz w19, #0 -; movz w28, #1 -; movz w21, #2 -; mov x8, sp -; str w19, [x8] +; movz w9, #0 +; movz w8, #1 +; movz w0, #2 +; mov x10, sp +; str w9, [x10] +; mov x24, x9 ; add x9, sp, #4 -; str w28, [x9] +; str w8, [x9] +; mov x19, x8 ; add x10, sp, #8 -; str w21, [x10] -; mov x0, x19 +; str w0, [x10] +; mov x22, x0 +; mov x0, x24 ; bl 0 ; ; UserStackMap { by_type: [(types::I32, CompoundBitSet {0, 4, 8})], sp_to_sized_stack_slots: None } ; mov x12, sp -; str w28, [x12] -; add x13, sp, #4 -; str w21, [x13] ; mov x0, x19 +; str w0, [x12] +; add x13, sp, #4 +; mov x0, x22 +; str w0, [x13] +; mov x0, x24 ; bl 0 ; ; UserStackMap { by_type: [(types::I32, CompoundBitSet {0, 4})], sp_to_sized_stack_slots: None } ; mov x15, sp -; str w21, [x15] -; mov x0, x28 +; mov x0, x22 +; str w0, [x15] +; mov x0, x19 ; bl 0 ; ; UserStackMap { by_type: [(types::I32, CompoundBitSet {0})], sp_to_sized_stack_slots: None } -; mov x0, x21 +; mov x0, x22 ; bl 0 ; add sp, sp, #16 -; ldp x19, x21, [sp], #16 -; ldr x28, [sp], #16 +; ldp x19, x22, [sp], #16 +; ldr x24, [sp], #16 ; ldp fp, lr, [sp], #16 ; ret ; @@ -74,36 +80,42 @@ block0: ; block0: ; offset 0x0 ; stp x29, x30, [sp, #-0x10]! ; mov x29, sp -; str x28, [sp, #-0x10]! -; stp x19, x21, [sp, #-0x10]! +; str x24, [sp, #-0x10]! +; stp x19, x22, [sp, #-0x10]! ; sub sp, sp, #0x10 ; block1: ; offset 0x14 -; mov w19, #0 -; mov w28, #1 -; mov w21, #2 -; mov x8, sp -; str w19, [x8] +; mov w9, #0 +; mov w8, #1 +; mov w0, #2 +; mov x10, sp +; str w9, [x10] +; mov x24, x9 ; add x9, sp, #4 -; str w28, [x9] +; str w8, [x9] +; mov x19, x8 ; add x10, sp, #8 -; str w21, [x10] -; mov x0, x19 -; bl #0x3c ; reloc_external Call u0:0 0 +; str w0, [x10] +; mov x22, x0 +; mov x0, x24 +; bl #0x48 ; reloc_external Call u0:0 0 ; mov x12, sp -; str w28, [x12] -; add x13, sp, #4 -; str w21, [x13] ; mov x0, x19 -; bl #0x54 ; reloc_external Call u0:0 0 +; str w0, [x12] +; add x13, sp, #4 +; mov x0, x22 +; str w0, [x13] +; mov x0, x24 +; bl #0x68 ; reloc_external Call u0:0 0 ; mov x15, sp -; str w21, [x15] -; mov x0, x28 -; bl #0x64 ; reloc_external Call u0:0 0 -; mov x0, x21 -; bl #0x6c ; reloc_external Call u0:0 0 +; mov x0, x22 +; str w0, [x15] +; mov x0, x19 +; bl #0x7c ; reloc_external Call u0:0 0 +; mov x0, x22 +; bl #0x84 ; reloc_external Call u0:0 0 ; add sp, sp, #0x10 -; ldp x19, x21, [sp], #0x10 -; ldr x28, [sp], #0x10 +; ldp x19, x22, [sp], #0x10 +; ldr x24, [sp], #0x10 ; ldp x29, x30, [sp], #0x10 ; ret @@ -130,39 +142,39 @@ block0(v0: i8, v1: i16, v2: i32, v3: i64, v4: f32, v5: f64): ; VCode: ; stp fp, lr, [sp, #-16]! ; mov fp, sp -; stp x23, x26, [sp, #-16]! -; stp x19, x21, [sp, #-16]! +; stp x23, x27, [sp, #-16]! +; stp x20, x21, [sp, #-16]! ; sub sp, sp, #128 ; block0: ; mov x12, sp ; strb w0, [x12] -; mov x21, x0 +; mov x23, x0 ; add x13, sp, #8 ; strh w1, [x13] -; mov x26, x1 +; mov x20, x1 ; add x14, sp, #16 ; str w2, [x14] -; mov x23, x2 +; mov x21, x2 ; add x15, sp, #20 ; str s0, [x15] ; str q0, [sp, #96] ; add x0, sp, #24 ; str x3, [x0] -; mov x19, x3 +; mov x27, x3 ; add x1, sp, #32 ; str d1, [x1] ; str q1, [sp, #112] ; bl 0 ; ; UserStackMap { by_type: [(types::I8, CompoundBitSet {0}), (types::I16, CompoundBitSet {8}), (types::I32, CompoundBitSet {16}), (types::F32, CompoundBitSet {20}), (types::I64, CompoundBitSet {24}), (types::F64, CompoundBitSet {32})], sp_to_sized_stack_slots: None } -; mov x0, x21 -; mov x1, x26 -; mov x2, x23 -; mov x3, x19 +; mov x0, x23 +; mov x1, x20 +; mov x2, x21 +; mov x3, x27 ; ldr q0, [sp, #96] ; ldr q1, [sp, #112] ; add sp, sp, #128 -; ldp x19, x21, [sp], #16 -; ldp x23, x26, [sp], #16 +; ldp x20, x21, [sp], #16 +; ldp x23, x27, [sp], #16 ; ldp fp, lr, [sp], #16 ; ret ; @@ -170,38 +182,38 @@ block0(v0: i8, v1: i16, v2: i32, v3: i64, v4: f32, v5: f64): ; block0: ; offset 0x0 ; stp x29, x30, [sp, #-0x10]! ; mov x29, sp -; stp x23, x26, [sp, #-0x10]! -; stp x19, x21, [sp, #-0x10]! +; stp x23, x27, [sp, #-0x10]! +; stp x20, x21, [sp, #-0x10]! ; sub sp, sp, #0x80 ; block1: ; offset 0x14 ; mov x12, sp ; strb w0, [x12] -; mov x21, x0 +; mov x23, x0 ; add x13, sp, #8 ; strh w1, [x13] -; mov x26, x1 +; mov x20, x1 ; add x14, sp, #0x10 ; str w2, [x14] -; mov x23, x2 +; mov x21, x2 ; add x15, sp, #0x14 ; str s0, [x15] ; stur q0, [sp, #0x60] ; add x0, sp, #0x18 ; str x3, [x0] -; mov x19, x3 +; mov x27, x3 ; add x1, sp, #0x20 ; str d1, [x1] ; stur q1, [sp, #0x70] ; bl #0x5c ; reloc_external Call u0:0 0 -; mov x0, x21 -; mov x1, x26 -; mov x2, x23 -; mov x3, x19 +; mov x0, x23 +; mov x1, x20 +; mov x2, x21 +; mov x3, x27 ; ldur q0, [sp, #0x60] ; ldur q1, [sp, #0x70] ; add sp, sp, #0x80 -; ldp x19, x21, [sp], #0x10 -; ldp x23, x26, [sp], #0x10 +; ldp x20, x21, [sp], #0x10 +; ldp x23, x27, [sp], #0x10 ; ldp x29, x30, [sp], #0x10 ; ret diff --git a/cranelift/filetests/filetests/isa/pulley32/call.clif b/cranelift/filetests/filetests/isa/pulley32/call.clif index d02583907c31..d1f2dfe9a61a 100644 --- a/cranelift/filetests/filetests/isa/pulley32/call.clif +++ b/cranelift/filetests/filetests/isa/pulley32/call.clif @@ -19,7 +19,7 @@ block0: ; x29 = xmov x27 ; block0: ; x0 = xconst8 0 -; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }], defs: [CallRetPair { vreg: Writable { reg: p0i }, preg: p0i }], clobbers: PRegSet { bits: [65534, 65279, 4294967295, 0] }, callee_pop_size: 0 } +; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }], defs: [CallRetPair { vreg: Writable { reg: p0i }, preg: p0i }], clobbers: PRegSet { bits: [1204185006387685820006398, 4294967295] }, callee_pop_size: 0 } ; x0 = xconst8 1 ; x28 = load64_u sp+8 // flags = notrap aligned ; x29 = load64_u sp+0 // flags = notrap aligned @@ -60,7 +60,7 @@ block0: ; x29 = xmov x27 ; block0: ; x0 = xconst8 0 -; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }], defs: [CallRetPair { vreg: Writable { reg: p0i }, preg: p0i }], clobbers: PRegSet { bits: [65534, 65279, 4294967295, 0] }, callee_pop_size: 0 } +; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }], defs: [CallRetPair { vreg: Writable { reg: p0i }, preg: p0i }], clobbers: PRegSet { bits: [1204185006387685820006398, 4294967295] }, callee_pop_size: 0 } ; x0 = xconst8 1 ; x28 = load64_u sp+8 // flags = notrap aligned ; x29 = load64_u sp+0 // flags = notrap aligned @@ -106,7 +106,7 @@ block0: ; x1 = xconst8 1 ; x2 = xconst8 2 ; x3 = xconst8 3 -; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }, CallArgPair { vreg: p1i, preg: p1i }, CallArgPair { vreg: p2i, preg: p2i }, CallArgPair { vreg: p3i, preg: p3i }], defs: [], clobbers: PRegSet { bits: [65535, 65279, 4294967295, 0] }, callee_pop_size: 0 } +; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }, CallArgPair { vreg: p1i, preg: p1i }, CallArgPair { vreg: p2i, preg: p2i }, CallArgPair { vreg: p3i, preg: p3i }], defs: [], clobbers: PRegSet { bits: [1204185006387685820006399, 4294967295] }, callee_pop_size: 0 } ; x28 = load64_u sp+8 // flags = notrap aligned ; x29 = load64_u sp+0 // flags = notrap aligned ; x30 = xconst8 16 @@ -148,7 +148,7 @@ block0: ; store64 sp+0, x29 // flags = notrap aligned ; x29 = xmov x27 ; block0: -; call TestCase(%g), CallInfo { uses: [], defs: [CallRetPair { vreg: Writable { reg: p0i }, preg: p0i }, CallRetPair { vreg: Writable { reg: p1i }, preg: p1i }, CallRetPair { vreg: Writable { reg: p2i }, preg: p2i }, CallRetPair { vreg: Writable { reg: p3i }, preg: p3i }], clobbers: PRegSet { bits: [65520, 65279, 4294967295, 0] }, callee_pop_size: 0 } +; call TestCase(%g), CallInfo { uses: [], defs: [CallRetPair { vreg: Writable { reg: p0i }, preg: p0i }, CallRetPair { vreg: Writable { reg: p1i }, preg: p1i }, CallRetPair { vreg: Writable { reg: p2i }, preg: p2i }, CallRetPair { vreg: Writable { reg: p3i }, preg: p3i }], clobbers: PRegSet { bits: [1204185006387685820006384, 4294967295] }, callee_pop_size: 0 } ; x4 = xadd64 x0, x2 ; x3 = xadd64 x1, x3 ; x0 = xadd64 x4, x3 @@ -214,7 +214,7 @@ block0: ; x12 = xmov x15 ; x13 = xmov x15 ; x14 = xmov x15 -; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }, CallArgPair { vreg: p1i, preg: p1i }, CallArgPair { vreg: p2i, preg: p2i }, CallArgPair { vreg: p3i, preg: p3i }, CallArgPair { vreg: p4i, preg: p4i }, CallArgPair { vreg: p5i, preg: p5i }, CallArgPair { vreg: p6i, preg: p6i }, CallArgPair { vreg: p7i, preg: p7i }, CallArgPair { vreg: p8i, preg: p8i }, CallArgPair { vreg: p9i, preg: p9i }, CallArgPair { vreg: p10i, preg: p10i }, CallArgPair { vreg: p11i, preg: p11i }, CallArgPair { vreg: p12i, preg: p12i }, CallArgPair { vreg: p13i, preg: p13i }, CallArgPair { vreg: p14i, preg: p14i }, CallArgPair { vreg: p15i, preg: p15i }], defs: [], clobbers: PRegSet { bits: [65535, 65279, 4294967295, 0] }, callee_pop_size: 0 } +; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }, CallArgPair { vreg: p1i, preg: p1i }, CallArgPair { vreg: p2i, preg: p2i }, CallArgPair { vreg: p3i, preg: p3i }, CallArgPair { vreg: p4i, preg: p4i }, CallArgPair { vreg: p5i, preg: p5i }, CallArgPair { vreg: p6i, preg: p6i }, CallArgPair { vreg: p7i, preg: p7i }, CallArgPair { vreg: p8i, preg: p8i }, CallArgPair { vreg: p9i, preg: p9i }, CallArgPair { vreg: p10i, preg: p10i }, CallArgPair { vreg: p11i, preg: p11i }, CallArgPair { vreg: p12i, preg: p12i }, CallArgPair { vreg: p13i, preg: p13i }, CallArgPair { vreg: p14i, preg: p14i }, CallArgPair { vreg: p15i, preg: p15i }], defs: [], clobbers: PRegSet { bits: [1204185006387685820006399, 4294967295] }, callee_pop_size: 0 } ; x30 = xconst8 48 ; x27 = xadd32 x27, x30 ; x28 = load64_u sp+8 // flags = notrap aligned @@ -310,7 +310,7 @@ block0: ; store64 sp+48, x18 // flags = notrap aligned ; block0: ; x0 = load_addr OutgoingArg(0) -; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }], defs: [CallRetPair { vreg: Writable { reg: p0i }, preg: p0i }, CallRetPair { vreg: Writable { reg: p1i }, preg: p1i }, CallRetPair { vreg: Writable { reg: p2i }, preg: p2i }, CallRetPair { vreg: Writable { reg: p3i }, preg: p3i }, CallRetPair { vreg: Writable { reg: p4i }, preg: p4i }, CallRetPair { vreg: Writable { reg: p5i }, preg: p5i }, CallRetPair { vreg: Writable { reg: p6i }, preg: p6i }, CallRetPair { vreg: Writable { reg: p7i }, preg: p7i }, CallRetPair { vreg: Writable { reg: p8i }, preg: p8i }, CallRetPair { vreg: Writable { reg: p9i }, preg: p9i }, CallRetPair { vreg: Writable { reg: p10i }, preg: p10i }, CallRetPair { vreg: Writable { reg: p11i }, preg: p11i }, CallRetPair { vreg: Writable { reg: p12i }, preg: p12i }, CallRetPair { vreg: Writable { reg: p13i }, preg: p13i }, CallRetPair { vreg: Writable { reg: p14i }, preg: p14i }, CallRetPair { vreg: Writable { reg: p15i }, preg: p15i }], clobbers: PRegSet { bits: [0, 65279, 4294967295, 0] }, callee_pop_size: 0 } +; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }], defs: [CallRetPair { vreg: Writable { reg: p0i }, preg: p0i }, CallRetPair { vreg: Writable { reg: p1i }, preg: p1i }, CallRetPair { vreg: Writable { reg: p2i }, preg: p2i }, CallRetPair { vreg: Writable { reg: p3i }, preg: p3i }, CallRetPair { vreg: Writable { reg: p4i }, preg: p4i }, CallRetPair { vreg: Writable { reg: p5i }, preg: p5i }, CallRetPair { vreg: Writable { reg: p6i }, preg: p6i }, CallRetPair { vreg: Writable { reg: p7i }, preg: p7i }, CallRetPair { vreg: Writable { reg: p8i }, preg: p8i }, CallRetPair { vreg: Writable { reg: p9i }, preg: p9i }, CallRetPair { vreg: Writable { reg: p10i }, preg: p10i }, CallRetPair { vreg: Writable { reg: p11i }, preg: p11i }, CallRetPair { vreg: Writable { reg: p12i }, preg: p12i }, CallRetPair { vreg: Writable { reg: p13i }, preg: p13i }, CallRetPair { vreg: Writable { reg: p14i }, preg: p14i }, CallRetPair { vreg: Writable { reg: p15i }, preg: p15i }], clobbers: PRegSet { bits: [1204185006387685819940864, 4294967295] }, callee_pop_size: 0 } ; x16 = xmov x13 ; x18 = xmov x11 ; x25 = load64_u OutgoingArg(0) // flags = notrap aligned diff --git a/cranelift/filetests/filetests/isa/pulley64/call.clif b/cranelift/filetests/filetests/isa/pulley64/call.clif index daefab228804..b787b0a58f50 100644 --- a/cranelift/filetests/filetests/isa/pulley64/call.clif +++ b/cranelift/filetests/filetests/isa/pulley64/call.clif @@ -19,7 +19,7 @@ block0: ; x29 = xmov x27 ; block0: ; x0 = xconst8 0 -; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }], defs: [CallRetPair { vreg: Writable { reg: p0i }, preg: p0i }], clobbers: PRegSet { bits: [65534, 65279, 4294967295, 0] }, callee_pop_size: 0 } +; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }], defs: [CallRetPair { vreg: Writable { reg: p0i }, preg: p0i }], clobbers: PRegSet { bits: [1204185006387685820006398, 4294967295] }, callee_pop_size: 0 } ; x0 = xconst8 1 ; x28 = load64_u sp+8 // flags = notrap aligned ; x29 = load64_u sp+0 // flags = notrap aligned @@ -60,7 +60,7 @@ block0: ; x29 = xmov x27 ; block0: ; x0 = xconst8 0 -; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }], defs: [CallRetPair { vreg: Writable { reg: p0i }, preg: p0i }], clobbers: PRegSet { bits: [65534, 65279, 4294967295, 0] }, callee_pop_size: 0 } +; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }], defs: [CallRetPair { vreg: Writable { reg: p0i }, preg: p0i }], clobbers: PRegSet { bits: [1204185006387685820006398, 4294967295] }, callee_pop_size: 0 } ; x0 = xconst8 1 ; x28 = load64_u sp+8 // flags = notrap aligned ; x29 = load64_u sp+0 // flags = notrap aligned @@ -106,7 +106,7 @@ block0: ; x1 = xconst8 1 ; x2 = xconst8 2 ; x3 = xconst8 3 -; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }, CallArgPair { vreg: p1i, preg: p1i }, CallArgPair { vreg: p2i, preg: p2i }, CallArgPair { vreg: p3i, preg: p3i }], defs: [], clobbers: PRegSet { bits: [65535, 65279, 4294967295, 0] }, callee_pop_size: 0 } +; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }, CallArgPair { vreg: p1i, preg: p1i }, CallArgPair { vreg: p2i, preg: p2i }, CallArgPair { vreg: p3i, preg: p3i }], defs: [], clobbers: PRegSet { bits: [1204185006387685820006399, 4294967295] }, callee_pop_size: 0 } ; x28 = load64_u sp+8 // flags = notrap aligned ; x29 = load64_u sp+0 // flags = notrap aligned ; x30 = xconst8 16 @@ -148,7 +148,7 @@ block0: ; store64 sp+0, x29 // flags = notrap aligned ; x29 = xmov x27 ; block0: -; call TestCase(%g), CallInfo { uses: [], defs: [CallRetPair { vreg: Writable { reg: p0i }, preg: p0i }, CallRetPair { vreg: Writable { reg: p1i }, preg: p1i }, CallRetPair { vreg: Writable { reg: p2i }, preg: p2i }, CallRetPair { vreg: Writable { reg: p3i }, preg: p3i }], clobbers: PRegSet { bits: [65520, 65279, 4294967295, 0] }, callee_pop_size: 0 } +; call TestCase(%g), CallInfo { uses: [], defs: [CallRetPair { vreg: Writable { reg: p0i }, preg: p0i }, CallRetPair { vreg: Writable { reg: p1i }, preg: p1i }, CallRetPair { vreg: Writable { reg: p2i }, preg: p2i }, CallRetPair { vreg: Writable { reg: p3i }, preg: p3i }], clobbers: PRegSet { bits: [1204185006387685820006384, 4294967295] }, callee_pop_size: 0 } ; x4 = xadd64 x0, x2 ; x3 = xadd64 x1, x3 ; x0 = xadd64 x4, x3 @@ -214,7 +214,7 @@ block0: ; x12 = xmov x15 ; x13 = xmov x15 ; x14 = xmov x15 -; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }, CallArgPair { vreg: p1i, preg: p1i }, CallArgPair { vreg: p2i, preg: p2i }, CallArgPair { vreg: p3i, preg: p3i }, CallArgPair { vreg: p4i, preg: p4i }, CallArgPair { vreg: p5i, preg: p5i }, CallArgPair { vreg: p6i, preg: p6i }, CallArgPair { vreg: p7i, preg: p7i }, CallArgPair { vreg: p8i, preg: p8i }, CallArgPair { vreg: p9i, preg: p9i }, CallArgPair { vreg: p10i, preg: p10i }, CallArgPair { vreg: p11i, preg: p11i }, CallArgPair { vreg: p12i, preg: p12i }, CallArgPair { vreg: p13i, preg: p13i }, CallArgPair { vreg: p14i, preg: p14i }, CallArgPair { vreg: p15i, preg: p15i }], defs: [], clobbers: PRegSet { bits: [65535, 65279, 4294967295, 0] }, callee_pop_size: 0 } +; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }, CallArgPair { vreg: p1i, preg: p1i }, CallArgPair { vreg: p2i, preg: p2i }, CallArgPair { vreg: p3i, preg: p3i }, CallArgPair { vreg: p4i, preg: p4i }, CallArgPair { vreg: p5i, preg: p5i }, CallArgPair { vreg: p6i, preg: p6i }, CallArgPair { vreg: p7i, preg: p7i }, CallArgPair { vreg: p8i, preg: p8i }, CallArgPair { vreg: p9i, preg: p9i }, CallArgPair { vreg: p10i, preg: p10i }, CallArgPair { vreg: p11i, preg: p11i }, CallArgPair { vreg: p12i, preg: p12i }, CallArgPair { vreg: p13i, preg: p13i }, CallArgPair { vreg: p14i, preg: p14i }, CallArgPair { vreg: p15i, preg: p15i }], defs: [], clobbers: PRegSet { bits: [1204185006387685820006399, 4294967295] }, callee_pop_size: 0 } ; x30 = xconst8 48 ; x27 = xadd32 x27, x30 ; x28 = load64_u sp+8 // flags = notrap aligned @@ -310,7 +310,7 @@ block0: ; store64 sp+48, x18 // flags = notrap aligned ; block0: ; x0 = load_addr OutgoingArg(0) -; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }], defs: [CallRetPair { vreg: Writable { reg: p0i }, preg: p0i }, CallRetPair { vreg: Writable { reg: p1i }, preg: p1i }, CallRetPair { vreg: Writable { reg: p2i }, preg: p2i }, CallRetPair { vreg: Writable { reg: p3i }, preg: p3i }, CallRetPair { vreg: Writable { reg: p4i }, preg: p4i }, CallRetPair { vreg: Writable { reg: p5i }, preg: p5i }, CallRetPair { vreg: Writable { reg: p6i }, preg: p6i }, CallRetPair { vreg: Writable { reg: p7i }, preg: p7i }, CallRetPair { vreg: Writable { reg: p8i }, preg: p8i }, CallRetPair { vreg: Writable { reg: p9i }, preg: p9i }, CallRetPair { vreg: Writable { reg: p10i }, preg: p10i }, CallRetPair { vreg: Writable { reg: p11i }, preg: p11i }, CallRetPair { vreg: Writable { reg: p12i }, preg: p12i }, CallRetPair { vreg: Writable { reg: p13i }, preg: p13i }, CallRetPair { vreg: Writable { reg: p14i }, preg: p14i }, CallRetPair { vreg: Writable { reg: p15i }, preg: p15i }], clobbers: PRegSet { bits: [0, 65279, 4294967295, 0] }, callee_pop_size: 0 } +; call TestCase(%g), CallInfo { uses: [CallArgPair { vreg: p0i, preg: p0i }], defs: [CallRetPair { vreg: Writable { reg: p0i }, preg: p0i }, CallRetPair { vreg: Writable { reg: p1i }, preg: p1i }, CallRetPair { vreg: Writable { reg: p2i }, preg: p2i }, CallRetPair { vreg: Writable { reg: p3i }, preg: p3i }, CallRetPair { vreg: Writable { reg: p4i }, preg: p4i }, CallRetPair { vreg: Writable { reg: p5i }, preg: p5i }, CallRetPair { vreg: Writable { reg: p6i }, preg: p6i }, CallRetPair { vreg: Writable { reg: p7i }, preg: p7i }, CallRetPair { vreg: Writable { reg: p8i }, preg: p8i }, CallRetPair { vreg: Writable { reg: p9i }, preg: p9i }, CallRetPair { vreg: Writable { reg: p10i }, preg: p10i }, CallRetPair { vreg: Writable { reg: p11i }, preg: p11i }, CallRetPair { vreg: Writable { reg: p12i }, preg: p12i }, CallRetPair { vreg: Writable { reg: p13i }, preg: p13i }, CallRetPair { vreg: Writable { reg: p14i }, preg: p14i }, CallRetPair { vreg: Writable { reg: p15i }, preg: p15i }], clobbers: PRegSet { bits: [1204185006387685819940864, 4294967295] }, callee_pop_size: 0 } ; x16 = xmov x13 ; x18 = xmov x11 ; x25 = load64_u OutgoingArg(0) // flags = notrap aligned diff --git a/cranelift/filetests/filetests/isa/riscv64/amodes.clif b/cranelift/filetests/filetests/isa/riscv64/amodes.clif index 678b86f30200..545eaf7cedd0 100644 --- a/cranelift/filetests/filetests/isa/riscv64/amodes.clif +++ b/cranelift/filetests/filetests/isa/riscv64/amodes.clif @@ -387,19 +387,21 @@ block0(v0: i64): ; VCode: ; block0: ; ld a2,0(a0) +; mv a4,a2 ; ld a1,8(a0) ; sd a2,0(a0) ; sd a1,8(a0) -; mv a0,a2 +; mv a0,a4 ; ret ; ; Disassembled: ; block0: ; offset 0x0 ; ld a2, 0(a0) ; trap: heap_oob +; mv a4, a2 ; ld a1, 8(a0) ; trap: heap_oob ; sd a2, 0(a0) ; trap: heap_oob ; sd a1, 8(a0) ; trap: heap_oob -; mv a0, a2 +; mv a0, a4 ; ret function %i128_imm_offset(i64) -> i128 { @@ -412,19 +414,21 @@ block0(v0: i64): ; VCode: ; block0: ; ld a2,16(a0) +; mv a4,a2 ; ld a1,24(a0) ; sd a2,16(a0) ; sd a1,24(a0) -; mv a0,a2 +; mv a0,a4 ; ret ; ; Disassembled: ; block0: ; offset 0x0 ; ld a2, 0x10(a0) ; trap: heap_oob +; mv a4, a2 ; ld a1, 0x18(a0) ; trap: heap_oob ; sd a2, 0x10(a0) ; trap: heap_oob ; sd a1, 0x18(a0) ; trap: heap_oob -; mv a0, a2 +; mv a0, a4 ; ret function %i128_imm_offset_large(i64) -> i128 { @@ -437,19 +441,21 @@ block0(v0: i64): ; VCode: ; block0: ; ld a2,504(a0) +; mv a4,a2 ; ld a1,512(a0) ; sd a2,504(a0) ; sd a1,512(a0) -; mv a0,a2 +; mv a0,a4 ; ret ; ; Disassembled: ; block0: ; offset 0x0 ; ld a2, 0x1f8(a0) ; trap: heap_oob +; mv a4, a2 ; ld a1, 0x200(a0) ; trap: heap_oob ; sd a2, 0x1f8(a0) ; trap: heap_oob ; sd a1, 0x200(a0) ; trap: heap_oob -; mv a0, a2 +; mv a0, a4 ; ret function %i128_imm_offset_negative_large(i64) -> i128 { @@ -462,19 +468,21 @@ block0(v0: i64): ; VCode: ; block0: ; ld a2,-512(a0) +; mv a4,a2 ; ld a1,-504(a0) ; sd a2,-512(a0) ; sd a1,-504(a0) -; mv a0,a2 +; mv a0,a4 ; ret ; ; Disassembled: ; block0: ; offset 0x0 ; ld a2, -0x200(a0) ; trap: heap_oob +; mv a4, a2 ; ld a1, -0x1f8(a0) ; trap: heap_oob ; sd a2, -0x200(a0) ; trap: heap_oob ; sd a1, -0x1f8(a0) ; trap: heap_oob -; mv a0, a2 +; mv a0, a4 ; ret function %i128_add_offset(i64) -> i128 { @@ -488,19 +496,21 @@ block0(v0: i64): ; VCode: ; block0: ; ld a2,32(a0) +; mv a4,a2 ; ld a1,40(a0) ; sd a2,32(a0) ; sd a1,40(a0) -; mv a0,a2 +; mv a0,a4 ; ret ; ; Disassembled: ; block0: ; offset 0x0 ; ld a2, 0x20(a0) ; trap: heap_oob +; mv a4, a2 ; ld a1, 0x28(a0) ; trap: heap_oob ; sd a2, 0x20(a0) ; trap: heap_oob ; sd a1, 0x28(a0) ; trap: heap_oob -; mv a0, a2 +; mv a0, a4 ; ret function %i128_32bit_sextend_simple(i32) -> i128 { @@ -544,10 +554,11 @@ block0(v0: i64, v1: i32): ; sext.w a1,a1 ; add a0,a0,a1 ; ld a5,24(a0) +; mv a2,a5 ; ld a1,32(a0) ; sd a5,24(a0) ; sd a1,32(a0) -; mv a0,a5 +; mv a0,a2 ; ret ; ; Disassembled: @@ -555,10 +566,11 @@ block0(v0: i64, v1: i32): ; sext.w a1, a1 ; add a0, a0, a1 ; ld a5, 0x18(a0) ; trap: heap_oob +; mv a2, a5 ; ld a1, 0x20(a0) ; trap: heap_oob ; sd a5, 0x18(a0) ; trap: heap_oob ; sd a1, 0x20(a0) ; trap: heap_oob -; mv a0, a5 +; mv a0, a2 ; ret function %load_from_get_stack_pointer() -> i64 { diff --git a/cranelift/filetests/filetests/isa/riscv64/arithmetic.clif b/cranelift/filetests/filetests/isa/riscv64/arithmetic.clif index 775137e8fb30..9f20971c8c5a 100644 --- a/cranelift/filetests/filetests/isa/riscv64/arithmetic.clif +++ b/cranelift/filetests/filetests/isa/riscv64/arithmetic.clif @@ -587,19 +587,21 @@ block0(v0: i128, v1: i128): ; VCode: ; block0: ; sub a5,a0,a2 -; sltu a2,a0,a5 +; mv a4,a5 +; sltu a2,a0,a4 +; mv a0,a4 ; sub a3,a1,a3 ; sub a1,a3,a2 -; mv a0,a5 ; ret ; ; Disassembled: ; block0: ; offset 0x0 ; sub a5, a0, a2 -; sltu a2, a0, a5 +; mv a4, a5 +; sltu a2, a0, a4 +; mv a0, a4 ; sub a3, a1, a3 ; sub a1, a3, a2 -; mv a0, a5 ; ret function %add_mul_2(i32, i32, i32) -> i32 { diff --git a/cranelift/filetests/filetests/isa/riscv64/bitrev.clif b/cranelift/filetests/filetests/isa/riscv64/bitrev.clif index 2d03516441cb..83b8c91fab96 100644 --- a/cranelift/filetests/filetests/isa/riscv64/bitrev.clif +++ b/cranelift/filetests/filetests/isa/riscv64/bitrev.clif @@ -361,6 +361,12 @@ block0(v0: i128): } ; VCode: +; addi sp,sp,-16 +; sd ra,8(sp) +; sd fp,0(sp) +; mv fp,sp +; addi sp,sp,-16 +; sd s3,8(sp) ; block0: ; slli a3,a1,8 ; srli a5,a1,8 @@ -398,47 +404,60 @@ block0(v0: i128): ; srli a4,a1,32 ; or a5,a3,a4 ; brev8 a4,a5##tmp=a1 tmp2=a2 step=a3 ty=i64 +; mv s3,a4 ; slli a1,a0,8 ; srli a2,a0,8 -; slli a5,a2,56 -; srli a2,a5,56 +; slli a4,a2,56 +; srli a2,a4,56 ; or a2,a1,a2 -; slli a5,a2,16 +; slli a4,a2,16 ; srli a1,a0,16 ; slli a2,a1,8 -; srli a1,a1,8 -; slli a1,a1,56 +; srli a5,a1,8 +; slli a1,a5,56 ; srli a3,a1,56 -; or a1,a2,a3 -; slli a1,a1,48 +; or a5,a2,a3 +; slli a1,a5,48 ; srli a2,a1,48 -; or a5,a5,a2 -; slli a1,a5,32 +; or a4,a4,a2 +; slli a1,a4,32 ; srli a3,a0,32 -; slli a5,a3,8 +; slli a4,a3,8 ; srli a0,a3,8 ; slli a2,a0,56 -; srli a0,a2,56 -; or a0,a5,a0 +; srli a5,a2,56 +; or a0,a4,a5 ; slli a2,a0,16 -; srli a5,a3,16 -; slli a0,a5,8 -; srli a3,a5,8 -; slli a5,a3,56 -; srli a3,a5,56 +; srli a4,a3,16 +; slli a0,a4,8 +; srli a3,a4,8 +; slli a4,a3,56 +; srli a3,a4,56 ; or a3,a0,a3 -; slli a5,a3,48 -; srli a0,a5,48 +; slli a4,a3,48 +; srli a0,a4,48 ; or a2,a2,a0 -; slli a5,a2,32 -; srli a0,a5,32 -; or a3,a1,a0 -; brev8 a1,a3##tmp=a2 tmp2=a5 step=a0 ty=i64 -; mv a0,a4 +; slli a4,a2,32 +; srli a0,a4,32 +; or a2,a1,a0 +; brev8 a1,a2##tmp=a4 tmp2=a5 step=a0 ty=i64 +; mv a0,s3 +; ld s3,8(sp) +; addi sp,sp,16 +; ld ra,8(sp) +; ld fp,0(sp) +; addi sp,sp,16 ; ret ; ; Disassembled: ; block0: ; offset 0x0 +; addi sp, sp, -0x10 +; sd ra, 8(sp) +; sd s0, 0(sp) +; mv s0, sp +; addi sp, sp, -0x10 +; sd s3, 8(sp) +; block1: ; offset 0x18 ; slli a3, a1, 8 ; srli a5, a1, 8 ; slli a2, a5, 0x38 @@ -493,53 +512,54 @@ block0(v0: i128): ; j -0x28 ; slli a2, a2, 1 ; j -0x30 +; mv s3, a4 ; slli a1, a0, 8 ; srli a2, a0, 8 -; slli a5, a2, 0x38 -; srli a2, a5, 0x38 +; slli a4, a2, 0x38 +; srli a2, a4, 0x38 ; or a2, a1, a2 -; slli a5, a2, 0x10 +; slli a4, a2, 0x10 ; srli a1, a0, 0x10 ; slli a2, a1, 8 -; srli a1, a1, 8 -; slli a1, a1, 0x38 +; srli a5, a1, 8 +; slli a1, a5, 0x38 ; srli a3, a1, 0x38 -; or a1, a2, a3 -; slli a1, a1, 0x30 +; or a5, a2, a3 +; slli a1, a5, 0x30 ; srli a2, a1, 0x30 -; or a5, a5, a2 -; slli a1, a5, 0x20 +; or a4, a4, a2 +; slli a1, a4, 0x20 ; srli a3, a0, 0x20 -; slli a5, a3, 8 +; slli a4, a3, 8 ; srli a0, a3, 8 ; slli a2, a0, 0x38 -; srli a0, a2, 0x38 -; or a0, a5, a0 +; srli a5, a2, 0x38 +; or a0, a4, a5 ; slli a2, a0, 0x10 -; srli a5, a3, 0x10 -; slli a0, a5, 8 -; srli a3, a5, 8 -; slli a5, a3, 0x38 -; srli a3, a5, 0x38 +; srli a4, a3, 0x10 +; slli a0, a4, 8 +; srli a3, a4, 8 +; slli a4, a3, 0x38 +; srli a3, a4, 0x38 ; or a3, a0, a3 -; slli a5, a3, 0x30 -; srli a0, a5, 0x30 +; slli a4, a3, 0x30 +; srli a0, a4, 0x30 ; or a2, a2, a0 -; slli a5, a2, 0x20 -; srli a0, a5, 0x20 -; or a3, a1, a0 +; slli a4, a2, 0x20 +; srli a0, a4, 0x20 +; or a2, a1, a0 ; mv a1, zero ; addi a0, zero, 0x40 -; addi a2, zero, 1 -; slli a2, a2, 0x3f +; addi a4, zero, 1 +; slli a4, a4, 0x3f ; addi a5, zero, 1 ; slli a5, a5, 0x38 ; blez a0, 0x34 -; and t5, a2, a3 +; and t5, a4, a2 ; beq zero, t5, 8 ; or a1, a1, a5 ; addi a0, a0, -1 -; srli a2, a2, 1 +; srli a4, a4, 1 ; addi t5, zero, 8 ; rem t5, a0, t5 ; bnez t5, 0xc @@ -547,6 +567,11 @@ block0(v0: i128): ; j -0x28 ; slli a5, a5, 1 ; j -0x30 -; mv a0, a4 +; mv a0, s3 +; ld s3, 8(sp) +; addi sp, sp, 0x10 +; ld ra, 8(sp) +; ld s0, 0(sp) +; addi sp, sp, 0x10 ; ret diff --git a/cranelift/filetests/filetests/isa/riscv64/bswap.clif b/cranelift/filetests/filetests/isa/riscv64/bswap.clif index 4007284550c5..cbcfe12e57c0 100644 --- a/cranelift/filetests/filetests/isa/riscv64/bswap.clif +++ b/cranelift/filetests/filetests/isa/riscv64/bswap.clif @@ -197,42 +197,43 @@ block0(v0: i128): ; slli a1,a5,32 ; srli a4,a1,32 ; or a5,a3,a4 +; mv t1,a5 ; slli a1,a0,8 ; srli a3,a0,8 -; slli a2,a3,56 -; srli a2,a2,56 +; slli a5,a3,56 +; srli a2,a5,56 ; or a3,a1,a2 -; slli a1,a3,16 -; srli a2,a0,16 -; slli a3,a2,8 -; srli a2,a2,8 -; slli a2,a2,56 -; srli a4,a2,56 -; or a2,a3,a4 -; slli a2,a2,48 -; srli a3,a2,48 -; or a1,a1,a3 -; slli a1,a1,32 +; slli a5,a3,16 +; srli a1,a0,16 +; slli a3,a1,8 +; srli a1,a1,8 +; slli a1,a1,56 +; srli a4,a1,56 +; or a1,a3,a4 +; slli a1,a1,48 +; srli a3,a1,48 +; or a5,a5,a3 +; slli a1,a5,32 ; srli a4,a0,32 -; slli a0,a4,8 +; slli a5,a4,8 ; srli a2,a4,8 ; slli a3,a2,56 -; srli a2,a3,56 -; or a2,a0,a2 +; srli a0,a3,56 +; or a2,a5,a0 ; slli a3,a2,16 -; srli a0,a4,16 -; slli a2,a0,8 -; srli a4,a0,8 -; slli a0,a4,56 -; srli a4,a0,56 +; srli a5,a4,16 +; slli a2,a5,8 +; srli a4,a5,8 +; slli a5,a4,56 +; srli a4,a5,56 ; or a4,a2,a4 -; slli a0,a4,48 -; srli a2,a0,48 +; slli a5,a4,48 +; srli a2,a5,48 ; or a3,a3,a2 -; slli a0,a3,32 -; srli a2,a0,32 +; slli a5,a3,32 +; srli a2,a5,32 ; or a1,a1,a2 -; mv a0,a5 +; mv a0,t1 ; ret ; ; Disassembled: @@ -272,41 +273,42 @@ block0(v0: i128): ; slli a1, a5, 0x20 ; srli a4, a1, 0x20 ; or a5, a3, a4 +; mv t1, a5 ; slli a1, a0, 8 ; srli a3, a0, 8 -; slli a2, a3, 0x38 -; srli a2, a2, 0x38 +; slli a5, a3, 0x38 +; srli a2, a5, 0x38 ; or a3, a1, a2 -; slli a1, a3, 0x10 -; srli a2, a0, 0x10 -; slli a3, a2, 8 -; srli a2, a2, 8 -; slli a2, a2, 0x38 -; srli a4, a2, 0x38 -; or a2, a3, a4 -; slli a2, a2, 0x30 -; srli a3, a2, 0x30 -; or a1, a1, a3 -; slli a1, a1, 0x20 +; slli a5, a3, 0x10 +; srli a1, a0, 0x10 +; slli a3, a1, 8 +; srli a1, a1, 8 +; slli a1, a1, 0x38 +; srli a4, a1, 0x38 +; or a1, a3, a4 +; slli a1, a1, 0x30 +; srli a3, a1, 0x30 +; or a5, a5, a3 +; slli a1, a5, 0x20 ; srli a4, a0, 0x20 -; slli a0, a4, 8 +; slli a5, a4, 8 ; srli a2, a4, 8 ; slli a3, a2, 0x38 -; srli a2, a3, 0x38 -; or a2, a0, a2 +; srli a0, a3, 0x38 +; or a2, a5, a0 ; slli a3, a2, 0x10 -; srli a0, a4, 0x10 -; slli a2, a0, 8 -; srli a4, a0, 8 -; slli a0, a4, 0x38 -; srli a4, a0, 0x38 +; srli a5, a4, 0x10 +; slli a2, a5, 8 +; srli a4, a5, 8 +; slli a5, a4, 0x38 +; srli a4, a5, 0x38 ; or a4, a2, a4 -; slli a0, a4, 0x30 -; srli a2, a0, 0x30 +; slli a5, a4, 0x30 +; srli a2, a5, 0x30 ; or a3, a3, a2 -; slli a0, a3, 0x20 -; srli a2, a0, 0x20 +; slli a5, a3, 0x20 +; srli a2, a5, 0x20 ; or a1, a1, a2 -; mv a0, a5 +; mv a0, t1 ; ret diff --git a/cranelift/filetests/filetests/isa/riscv64/call.clif b/cranelift/filetests/filetests/isa/riscv64/call.clif index 8fcfe0f709aa..534cc5398132 100644 --- a/cranelift/filetests/filetests/isa/riscv64/call.clif +++ b/cranelift/filetests/filetests/isa/riscv64/call.clif @@ -291,7 +291,7 @@ block0: ; addi sp,sp,-32 ; fsd fs0,24(sp) ; fsd fs2,16(sp) -; fsd fs4,8(sp) +; fsd fs3,8(sp) ; block0: ; load_sym a3,%g0+0 ; callind a3 @@ -301,7 +301,7 @@ block0: ; fmv.d fs2,fa0 ; load_sym a3,%g1+0 ; callind a3 -; fmv.d fs4,fa0 +; fmv.d fs3,fa0 ; load_sym a3,%g2+0 ; callind a3 ; load_sym a4,%g3+0 @@ -311,11 +311,11 @@ block0: ; fmv.d fa0,fs2 ; callind a5 ; load_sym a0,%g4+0 -; fmv.d fa0,fs4 +; fmv.d fa0,fs3 ; callind a0 ; fld fs0,24(sp) ; fld fs2,16(sp) -; fld fs4,8(sp) +; fld fs3,8(sp) ; addi sp,sp,32 ; ld ra,8(sp) ; ld fp,0(sp) @@ -331,7 +331,7 @@ block0: ; addi sp, sp, -0x20 ; fsd fs0, 0x18(sp) ; fsd fs2, 0x10(sp) -; fsd fs4, 8(sp) +; fsd fs3, 8(sp) ; block1: ; offset 0x20 ; auipc a3, 0 ; ld a3, 0xc(a3) @@ -353,7 +353,7 @@ block0: ; .byte 0x00, 0x00, 0x00, 0x00 ; reloc_external Abs8 %g1 0 ; .byte 0x00, 0x00, 0x00, 0x00 ; jalr a3 -; fmv.d fs4, fa0 +; fmv.d fs3, fa0 ; auipc a3, 0 ; ld a3, 0xc(a3) ; j 0xc @@ -379,11 +379,11 @@ block0: ; j 0xc ; .byte 0x00, 0x00, 0x00, 0x00 ; reloc_external Abs8 %g4 0 ; .byte 0x00, 0x00, 0x00, 0x00 -; fmv.d fa0, fs4 +; fmv.d fa0, fs3 ; jalr a0 ; fld fs0, 0x18(sp) ; fld fs2, 0x10(sp) -; fld fs4, 8(sp) +; fld fs3, 8(sp) ; addi sp, sp, 0x20 ; ld ra, 8(sp) ; ld s0, 0(sp) @@ -422,9 +422,9 @@ block0(v0: i64): ; sd fp,0(sp) ; mv fp,sp ; block0: +; mv a1,a0 ; li a2,42 ; load_sym a4,%f11+0 -; mv a1,a0 ; mv a0,a2 ; callind a4 ; ld ra,8(sp) @@ -439,13 +439,13 @@ block0(v0: i64): ; sd s0, 0(sp) ; mv s0, sp ; block1: ; offset 0x10 +; mv a1, a0 ; addi a2, zero, 0x2a ; auipc a4, 0 ; ld a4, 0xc(a4) ; j 0xc ; .byte 0x00, 0x00, 0x00, 0x00 ; reloc_external Abs8 %f11 0 ; .byte 0x00, 0x00, 0x00, 0x00 -; mv a1, a0 ; mv a0, a2 ; jalr a4 ; ld ra, 8(sp) @@ -485,9 +485,9 @@ block0(v0: i64): ; sd fp,0(sp) ; mv fp,sp ; block0: +; mv a1,a0 ; li a2,42 ; load_sym a4,%f12+0 -; mv a1,a0 ; mv a0,a2 ; callind a4 ; ld ra,8(sp) @@ -502,13 +502,13 @@ block0(v0: i64): ; sd s0, 0(sp) ; mv s0, sp ; block1: ; offset 0x10 +; mv a1, a0 ; addi a2, zero, 0x2a ; auipc a4, 0 ; ld a4, 0xc(a4) ; j 0xc ; .byte 0x00, 0x00, 0x00, 0x00 ; reloc_external Abs8 %f12 0 ; .byte 0x00, 0x00, 0x00, 0x00 -; mv a1, a0 ; mv a0, a2 ; jalr a4 ; ld ra, 8(sp) @@ -548,9 +548,9 @@ block0(v0: i64): ; sd fp,0(sp) ; mv fp,sp ; block0: +; mv a1,a0 ; li a2,42 ; load_sym a4,%f13+0 -; mv a1,a0 ; mv a0,a2 ; callind a4 ; ld ra,8(sp) @@ -565,13 +565,13 @@ block0(v0: i64): ; sd s0, 0(sp) ; mv s0, sp ; block1: ; offset 0x10 +; mv a1, a0 ; addi a2, zero, 0x2a ; auipc a4, 0 ; ld a4, 0xc(a4) ; j 0xc ; .byte 0x00, 0x00, 0x00, 0x00 ; reloc_external Abs8 %f13 0 ; .byte 0x00, 0x00, 0x00, 0x00 -; mv a1, a0 ; mv a0, a2 ; jalr a4 ; ld ra, 8(sp) @@ -590,8 +590,8 @@ block0(v0: i128, v1: i128, v2: i128, v3: i64, v4: i128): ; sd fp,0(sp) ; mv fp,sp ; block0: -; ld a1,-16(incoming_arg) ; mv a0,a7 +; ld a1,-16(incoming_arg) ; ld ra,8(sp) ; ld fp,0(sp) ; addi sp,sp,16 @@ -604,8 +604,8 @@ block0(v0: i128, v1: i128, v2: i128, v3: i64, v4: i128): ; sd s0, 0(sp) ; mv s0, sp ; block1: ; offset 0x10 -; ld a1, 0x10(sp) ; mv a0, a7 +; ld a1, 0x10(sp) ; ld ra, 8(sp) ; ld s0, 0(sp) ; addi sp, sp, 0x10 @@ -627,11 +627,11 @@ block0(v0: i128, v1: i64): ; addi sp,sp,-32 ; sd s1,24(sp) ; block0: -; sd a1,0(sp) -; load_sym s1,%f14+0 -; mv a5,a1 ; mv a6,a2 ; mv a7,a0 +; sd a1,0(sp) +; mv a5,a1 +; load_sym s1,%f14+0 ; mv a2,a7 ; mv a3,a5 ; mv a4,a7 @@ -652,15 +652,15 @@ block0(v0: i128, v1: i64): ; addi sp, sp, -0x20 ; sd s1, 0x18(sp) ; block1: ; offset 0x18 +; mv a6, a2 +; mv a7, a0 ; sd a1, 0(sp) +; mv a5, a1 ; auipc s1, 0 ; ld s1, 0xc(s1) ; j 0xc ; .byte 0x00, 0x00, 0x00, 0x00 ; reloc_external Abs8 %f14 0 ; .byte 0x00, 0x00, 0x00, 0x00 -; mv a5, a1 -; mv a6, a2 -; mv a7, a0 ; mv a2, a7 ; mv a3, a5 ; mv a4, a7 @@ -683,8 +683,8 @@ block0(v0: i128, v1: i128, v2: i128, v3: i64, v4: i128): ; sd fp,0(sp) ; mv fp,sp ; block0: -; ld a1,-16(incoming_arg) ; mv a0,a7 +; ld a1,-16(incoming_arg) ; ld ra,8(sp) ; ld fp,0(sp) ; addi sp,sp,16 @@ -697,8 +697,8 @@ block0(v0: i128, v1: i128, v2: i128, v3: i64, v4: i128): ; sd s0, 0(sp) ; mv s0, sp ; block1: ; offset 0x10 -; ld a1, 0x10(sp) ; mv a0, a7 +; ld a1, 0x10(sp) ; ld ra, 8(sp) ; ld s0, 0(sp) ; addi sp, sp, 0x10 @@ -720,11 +720,11 @@ block0(v0: i128, v1: i64): ; addi sp,sp,-32 ; sd s1,24(sp) ; block0: -; sd a1,0(sp) -; load_sym s1,%f15+0 -; mv a5,a1 ; mv a6,a2 ; mv a7,a0 +; sd a1,0(sp) +; mv a5,a1 +; load_sym s1,%f15+0 ; mv a2,a7 ; mv a3,a5 ; mv a4,a7 @@ -745,15 +745,15 @@ block0(v0: i128, v1: i64): ; addi sp, sp, -0x20 ; sd s1, 0x18(sp) ; block1: ; offset 0x18 +; mv a6, a2 +; mv a7, a0 ; sd a1, 0(sp) +; mv a5, a1 ; auipc s1, 0 ; ld s1, 0xc(s1) ; j 0xc ; .byte 0x00, 0x00, 0x00, 0x00 ; reloc_external Abs8 %f15 0 ; .byte 0x00, 0x00, 0x00, 0x00 -; mv a5, a1 -; mv a6, a2 -; mv a7, a0 ; mv a2, a7 ; mv a3, a5 ; mv a4, a7 diff --git a/cranelift/filetests/filetests/isa/riscv64/return-call-indirect.clif b/cranelift/filetests/filetests/isa/riscv64/return-call-indirect.clif index d5d1d7b5740f..ca12180fad52 100644 --- a/cranelift/filetests/filetests/isa/riscv64/return-call-indirect.clif +++ b/cranelift/filetests/filetests/isa/riscv64/return-call-indirect.clif @@ -267,12 +267,12 @@ block0: ; sd s10,48(sp) ; sd s11,40(sp) ; block0: -; li a1,10 -; sd a1,16(slot) -; li a2,15 -; sd a2,8(slot) -; li a3,20 -; sd a3,0(slot) +; li a0,10 +; sd a0,16(slot) +; li a1,15 +; sd a1,8(slot) +; li a2,20 +; sd a2,0(slot) ; li a3,25 ; li a4,30 ; li a5,35 @@ -345,12 +345,12 @@ block0: ; sd s10, 0x30(sp) ; sd s11, 0x28(sp) ; block1: ; offset 0x54 -; addi a1, zero, 0xa -; sd a1, 0x10(sp) -; addi a2, zero, 0xf -; sd a2, 8(sp) -; addi a3, zero, 0x14 -; sd a3, 0(sp) +; addi a0, zero, 0xa +; sd a0, 0x10(sp) +; addi a1, zero, 0xf +; sd a1, 8(sp) +; addi a2, zero, 0x14 +; sd a2, 0(sp) ; addi a3, zero, 0x19 ; addi a4, zero, 0x1e ; addi a5, zero, 0x23 diff --git a/cranelift/filetests/filetests/isa/riscv64/return-call.clif b/cranelift/filetests/filetests/isa/riscv64/return-call.clif index b472a6c31c3a..e119025b92a4 100644 --- a/cranelift/filetests/filetests/isa/riscv64/return-call.clif +++ b/cranelift/filetests/filetests/isa/riscv64/return-call.clif @@ -285,10 +285,10 @@ block0: ; sd s10,32(sp) ; sd s11,24(sp) ; block0: -; li a1,10 -; sd a1,8(slot) -; li a2,15 -; sd a2,0(slot) +; li a0,10 +; sd a0,8(slot) +; li a1,15 +; sd a1,0(slot) ; li a2,20 ; li a3,25 ; li a4,30 @@ -360,10 +360,10 @@ block0: ; sd s10, 0x20(sp) ; sd s11, 0x18(sp) ; block1: ; offset 0x54 -; addi a1, zero, 0xa -; sd a1, 8(sp) -; addi a2, zero, 0xf -; sd a2, 0(sp) +; addi a0, zero, 0xa +; sd a0, 8(sp) +; addi a1, zero, 0xf +; sd a1, 0(sp) ; addi a2, zero, 0x14 ; addi a3, zero, 0x19 ; addi a4, zero, 0x1e @@ -561,10 +561,10 @@ block2: ; block0: ; li a1,10 ; sd a1,16(slot) -; li a2,15 -; sd a2,8(slot) -; li a3,20 -; sd a3,0(slot) +; li a1,15 +; sd a1,8(slot) +; li a2,20 +; sd a2,0(slot) ; li a3,25 ; li a4,30 ; li a5,35 @@ -572,11 +572,11 @@ block2: ; li a7,45 ; li a2,50 ; li a1,55 -; li s1,60 -; li s5,65 -; li s4,70 -; li s3,75 -; li s2,80 +; li s5,60 +; li s4,65 +; li s3,70 +; li s2,75 +; li s1,80 ; li t4,85 ; li t3,90 ; li t2,95 @@ -593,11 +593,11 @@ block2: ; li a0,140 ; sd a2,-160(incoming_arg) ; sd a1,-152(incoming_arg) -; sd s1,-144(incoming_arg) -; sd s5,-136(incoming_arg) -; sd s4,-128(incoming_arg) -; sd s3,-120(incoming_arg) -; sd s2,-112(incoming_arg) +; sd s5,-144(incoming_arg) +; sd s4,-136(incoming_arg) +; sd s3,-128(incoming_arg) +; sd s2,-120(incoming_arg) +; sd s1,-112(incoming_arg) ; sd t4,-104(incoming_arg) ; sd t3,-96(incoming_arg) ; sd t2,-88(incoming_arg) @@ -619,11 +619,11 @@ block2: ; ld a0,16(slot) ; sd a2,-144(incoming_arg) ; sd a1,-136(incoming_arg) -; sd s1,-128(incoming_arg) -; sd s5,-120(incoming_arg) -; sd s4,-112(incoming_arg) -; sd s3,-104(incoming_arg) -; sd s2,-96(incoming_arg) +; sd s5,-128(incoming_arg) +; sd s4,-120(incoming_arg) +; sd s3,-112(incoming_arg) +; sd s2,-104(incoming_arg) +; sd s1,-96(incoming_arg) ; sd t4,-88(incoming_arg) ; sd t3,-80(incoming_arg) ; sd t2,-72(incoming_arg) @@ -666,10 +666,10 @@ block2: ; block1: ; offset 0x54 ; addi a1, zero, 0xa ; sd a1, 0x10(sp) -; addi a2, zero, 0xf -; sd a2, 8(sp) -; addi a3, zero, 0x14 -; sd a3, 0(sp) +; addi a1, zero, 0xf +; sd a1, 8(sp) +; addi a2, zero, 0x14 +; sd a2, 0(sp) ; addi a3, zero, 0x19 ; addi a4, zero, 0x1e ; addi a5, zero, 0x23 @@ -677,11 +677,11 @@ block2: ; addi a7, zero, 0x2d ; addi a2, zero, 0x32 ; addi a1, zero, 0x37 -; addi s1, zero, 0x3c -; addi s5, zero, 0x41 -; addi s4, zero, 0x46 -; addi s3, zero, 0x4b -; addi s2, zero, 0x50 +; addi s5, zero, 0x3c +; addi s4, zero, 0x41 +; addi s3, zero, 0x46 +; addi s2, zero, 0x4b +; addi s1, zero, 0x50 ; addi t4, zero, 0x55 ; addi t3, zero, 0x5a ; addi t2, zero, 0x5f @@ -698,11 +698,11 @@ block2: ; addi a0, zero, 0x8c ; sd a2, 0x90(sp) ; sd a1, 0x98(sp) -; sd s1, 0xa0(sp) -; sd s5, 0xa8(sp) -; sd s4, 0xb0(sp) -; sd s3, 0xb8(sp) -; sd s2, 0xc0(sp) +; sd s5, 0xa0(sp) +; sd s4, 0xa8(sp) +; sd s3, 0xb0(sp) +; sd s2, 0xb8(sp) +; sd s1, 0xc0(sp) ; sd t4, 0xc8(sp) ; sd t3, 0xd0(sp) ; sd t2, 0xd8(sp) @@ -742,11 +742,11 @@ block2: ; ld a0, 0x10(sp) ; sd a2, 0xa0(sp) ; sd a1, 0xa8(sp) -; sd s1, 0xb0(sp) -; sd s5, 0xb8(sp) -; sd s4, 0xc0(sp) -; sd s3, 0xc8(sp) -; sd s2, 0xd0(sp) +; sd s5, 0xb0(sp) +; sd s4, 0xb8(sp) +; sd s3, 0xc0(sp) +; sd s2, 0xc8(sp) +; sd s1, 0xd0(sp) ; sd t4, 0xd8(sp) ; sd t3, 0xe0(sp) ; sd t2, 0xe8(sp) diff --git a/cranelift/filetests/filetests/isa/riscv64/stack.clif b/cranelift/filetests/filetests/isa/riscv64/stack.clif index 88df5938e976..2d4bd0eb3069 100644 --- a/cranelift/filetests/filetests/isa/riscv64/stack.clif +++ b/cranelift/filetests/filetests/isa/riscv64/stack.clif @@ -537,47 +537,47 @@ block0(v0: i8): ; addi a0,a0,37 ; ld a1,1256(slot) ; addi a1,a1,39 -; ld a2,1248(slot) -; addi a2,a2,31 +; ld a5,1248(slot) +; addi a2,a5,31 ; ld a3,1240(slot) ; addi a3,a3,33 -; ld a4,1232(slot) -; addi a4,a4,35 +; ld a5,1232(slot) +; addi a4,a5,35 ; ld a5,1224(slot) ; addi a5,a5,37 -; ld t0,1216(slot) -; addi s7,t0,39 -; ld a6,1208(slot) -; addi s8,a6,31 -; ld t4,1200(slot) -; addi s9,t4,33 -; ld s3,1192(slot) -; addi s10,s3,35 -; ld s11,1184(slot) -; addi s11,s11,37 +; ld s11,1216(slot) +; addi s7,s11,39 +; ld t2,1208(slot) +; addi s8,t2,31 +; ld t3,1200(slot) +; addi s9,t3,33 +; ld s2,1192(slot) +; addi s10,s2,35 +; ld s5,1184(slot) +; addi s11,s5,37 ; ld t0,1176(slot) ; addi t0,t0,39 -; ld t1,1168(slot) -; ld t2,1160(slot) -; add t1,t1,t2 -; ld s1,1144(slot) -; ld t3,1152(slot) -; add t2,t3,s1 -; ld a6,1128(slot) -; ld s4,1136(slot) -; add a6,s4,a6 +; ld t1,1160(slot) +; ld t2,1168(slot) +; add t1,t2,t1 +; ld a7,1152(slot) +; ld t4,1144(slot) +; add t2,a7,t4 +; ld s3,1136(slot) +; ld s5,1128(slot) +; add a6,s3,s5 ; ld a7,1112(slot) ; ld t3,1120(slot) ; add a7,t3,a7 ; ld t3,1096(slot) ; ld t4,1104(slot) ; add t3,t4,t3 -; ld s1,1088(slot) -; ld s3,1080(slot) -; add t4,s1,s3 +; ld s2,1080(slot) +; ld t4,1088(slot) +; add t4,t4,s2 ; ld s1,1064(slot) -; ld s2,1072(slot) -; add s1,s2,s1 +; ld s5,1072(slot) +; add s1,s5,s1 ; ld s2,1048(slot) ; ld s3,1056(slot) ; add s2,s3,s2 @@ -743,47 +743,47 @@ block0(v0: i8): ; addi a0, a0, 0x25 ; ld a1, 0x4e8(sp) ; addi a1, a1, 0x27 -; ld a2, 0x4e0(sp) -; addi a2, a2, 0x1f +; ld a5, 0x4e0(sp) +; addi a2, a5, 0x1f ; ld a3, 0x4d8(sp) ; addi a3, a3, 0x21 -; ld a4, 0x4d0(sp) -; addi a4, a4, 0x23 +; ld a5, 0x4d0(sp) +; addi a4, a5, 0x23 ; ld a5, 0x4c8(sp) ; addi a5, a5, 0x25 -; ld t0, 0x4c0(sp) -; addi s7, t0, 0x27 -; ld a6, 0x4b8(sp) -; addi s8, a6, 0x1f -; ld t4, 0x4b0(sp) -; addi s9, t4, 0x21 -; ld s3, 0x4a8(sp) -; addi s10, s3, 0x23 -; ld s11, 0x4a0(sp) -; addi s11, s11, 0x25 +; ld s11, 0x4c0(sp) +; addi s7, s11, 0x27 +; ld t2, 0x4b8(sp) +; addi s8, t2, 0x1f +; ld t3, 0x4b0(sp) +; addi s9, t3, 0x21 +; ld s2, 0x4a8(sp) +; addi s10, s2, 0x23 +; ld s5, 0x4a0(sp) +; addi s11, s5, 0x25 ; ld t0, 0x498(sp) ; addi t0, t0, 0x27 -; ld t1, 0x490(sp) -; ld t2, 0x488(sp) -; add t1, t1, t2 -; ld s1, 0x478(sp) -; ld t3, 0x480(sp) -; add t2, t3, s1 -; ld a6, 0x468(sp) -; ld s4, 0x470(sp) -; add a6, s4, a6 +; ld t1, 0x488(sp) +; ld t2, 0x490(sp) +; add t1, t2, t1 +; ld a7, 0x480(sp) +; ld t4, 0x478(sp) +; add t2, a7, t4 +; ld s3, 0x470(sp) +; ld s5, 0x468(sp) +; add a6, s3, s5 ; ld a7, 0x458(sp) ; ld t3, 0x460(sp) ; add a7, t3, a7 ; ld t3, 0x448(sp) ; ld t4, 0x450(sp) ; add t3, t4, t3 -; ld s1, 0x440(sp) -; ld s3, 0x438(sp) -; add t4, s1, s3 +; ld s2, 0x438(sp) +; ld t4, 0x440(sp) +; add t4, t4, s2 ; ld s1, 0x428(sp) -; ld s2, 0x430(sp) -; add s1, s2, s1 +; ld s5, 0x430(sp) +; add s1, s5, s1 ; ld s2, 0x418(sp) ; ld s3, 0x420(sp) ; add s2, s3, s2 diff --git a/cranelift/filetests/filetests/isa/riscv64/tail-call-conv.clif b/cranelift/filetests/filetests/isa/riscv64/tail-call-conv.clif index 279f8da1af91..b0cada1a7d4d 100644 --- a/cranelift/filetests/filetests/isa/riscv64/tail-call-conv.clif +++ b/cranelift/filetests/filetests/isa/riscv64/tail-call-conv.clif @@ -87,10 +87,10 @@ block0: ; sd s10,176(sp) ; sd s11,168(sp) ; block0: -; li a1,10 -; sd a1,8(slot) -; li a2,15 -; sd a2,0(slot) +; li a0,10 +; sd a0,8(slot) +; li a1,15 +; sd a1,0(slot) ; li a2,20 ; li a3,25 ; li a4,30 @@ -173,10 +173,10 @@ block0: ; sd s10, 0xb0(sp) ; sd s11, 0xa8(sp) ; block1: ; offset 0x40 -; addi a1, zero, 0xa -; sd a1, 0x98(sp) -; addi a2, zero, 0xf -; sd a2, 0x90(sp) +; addi a0, zero, 0xa +; sd a0, 0x98(sp) +; addi a1, zero, 0xf +; sd a1, 0x90(sp) ; addi a2, zero, 0x14 ; addi a3, zero, 0x19 ; addi a4, zero, 0x1e @@ -296,62 +296,64 @@ block0: ; sd s10,48(sp) ; sd s11,40(sp) ; block0: -; li a1,10 -; sd a1,16(slot) +; li a3,10 +; sd a3,24(slot) ; li a1,15 -; sd a1,8(slot) +; sd a1,16(slot) ; li a4,20 -; li a5,25 -; li a2,30 -; li s3,35 -; li s4,40 -; li s5,45 -; li s6,50 -; li s7,55 -; li s8,60 -; li s9,65 -; li s10,70 -; li s11,75 -; li t0,80 -; li t1,85 -; li t2,90 -; li a6,95 -; li a7,100 -; li t3,105 -; li t4,110 -; li s1,115 -; li s2,120 -; li a3,125 -; sd a3,0(slot) +; sd a4,8(slot) +; li a4,25 +; li a5,30 +; li a2,35 +; li s3,40 +; li s4,45 +; li s5,50 +; li s6,55 +; li s7,60 +; li s8,65 +; li s9,70 +; li s10,75 +; li s11,80 +; li t0,85 +; li t1,90 +; li t2,95 +; li a6,100 +; li a7,105 +; li t3,110 +; li t4,115 +; li s1,120 +; li s2,125 ; li a1,130 ; li a3,135 -; sd a4,0(a0) -; sd a5,8(a0) -; sd a2,16(a0) -; sd s3,24(a0) -; sd s4,32(a0) -; sd s5,40(a0) -; sd s6,48(a0) -; sd s7,56(a0) -; sd s8,64(a0) -; sd s9,72(a0) -; sd s10,80(a0) -; sd s11,88(a0) -; sd t0,96(a0) -; sd t1,104(a0) -; sd t2,112(a0) -; sd a6,120(a0) -; sd a7,128(a0) -; sd t3,136(a0) -; sd t4,144(a0) -; sd s1,152(a0) -; sd s2,160(a0) -; ld a4,0(slot) -; sd a4,168(a0) +; sd a3,0(slot) +; ld a3,8(slot) +; sd a3,0(a0) +; sd a4,8(a0) +; sd a5,16(a0) +; sd a2,24(a0) +; sd s3,32(a0) +; sd s4,40(a0) +; sd s5,48(a0) +; sd s6,56(a0) +; sd s7,64(a0) +; sd s8,72(a0) +; sd s9,80(a0) +; sd s10,88(a0) +; sd s11,96(a0) +; sd t0,104(a0) +; sd t1,112(a0) +; sd t2,120(a0) +; sd a6,128(a0) +; sd a7,136(a0) +; sd t3,144(a0) +; sd t4,152(a0) +; sd s1,160(a0) +; sd s2,168(a0) ; sd a1,176(a0) +; ld a3,0(slot) ; sd a3,184(a0) -; ld a0,16(slot) -; ld a1,8(slot) +; ld a0,24(slot) +; ld a1,16(slot) ; ld s1,120(sp) ; ld s2,112(sp) ; ld s3,104(sp) @@ -388,62 +390,64 @@ block0: ; sd s10, 0x30(sp) ; sd s11, 0x28(sp) ; block1: ; offset 0x40 -; addi a1, zero, 0xa -; sd a1, 0x10(sp) +; addi a3, zero, 0xa +; sd a3, 0x18(sp) ; addi a1, zero, 0xf -; sd a1, 8(sp) +; sd a1, 0x10(sp) ; addi a4, zero, 0x14 -; addi a5, zero, 0x19 -; addi a2, zero, 0x1e -; addi s3, zero, 0x23 -; addi s4, zero, 0x28 -; addi s5, zero, 0x2d -; addi s6, zero, 0x32 -; addi s7, zero, 0x37 -; addi s8, zero, 0x3c -; addi s9, zero, 0x41 -; addi s10, zero, 0x46 -; addi s11, zero, 0x4b -; addi t0, zero, 0x50 -; addi t1, zero, 0x55 -; addi t2, zero, 0x5a -; addi a6, zero, 0x5f -; addi a7, zero, 0x64 -; addi t3, zero, 0x69 -; addi t4, zero, 0x6e -; addi s1, zero, 0x73 -; addi s2, zero, 0x78 -; addi a3, zero, 0x7d -; sd a3, 0(sp) +; sd a4, 8(sp) +; addi a4, zero, 0x19 +; addi a5, zero, 0x1e +; addi a2, zero, 0x23 +; addi s3, zero, 0x28 +; addi s4, zero, 0x2d +; addi s5, zero, 0x32 +; addi s6, zero, 0x37 +; addi s7, zero, 0x3c +; addi s8, zero, 0x41 +; addi s9, zero, 0x46 +; addi s10, zero, 0x4b +; addi s11, zero, 0x50 +; addi t0, zero, 0x55 +; addi t1, zero, 0x5a +; addi t2, zero, 0x5f +; addi a6, zero, 0x64 +; addi a7, zero, 0x69 +; addi t3, zero, 0x6e +; addi t4, zero, 0x73 +; addi s1, zero, 0x78 +; addi s2, zero, 0x7d ; addi a1, zero, 0x82 ; addi a3, zero, 0x87 -; sd a4, 0(a0) -; sd a5, 8(a0) -; sd a2, 0x10(a0) -; sd s3, 0x18(a0) -; sd s4, 0x20(a0) -; sd s5, 0x28(a0) -; sd s6, 0x30(a0) -; sd s7, 0x38(a0) -; sd s8, 0x40(a0) -; sd s9, 0x48(a0) -; sd s10, 0x50(a0) -; sd s11, 0x58(a0) -; sd t0, 0x60(a0) -; sd t1, 0x68(a0) -; sd t2, 0x70(a0) -; sd a6, 0x78(a0) -; sd a7, 0x80(a0) -; sd t3, 0x88(a0) -; sd t4, 0x90(a0) -; sd s1, 0x98(a0) -; sd s2, 0xa0(a0) -; ld a4, 0(sp) -; sd a4, 0xa8(a0) +; sd a3, 0(sp) +; ld a3, 8(sp) +; sd a3, 0(a0) +; sd a4, 8(a0) +; sd a5, 0x10(a0) +; sd a2, 0x18(a0) +; sd s3, 0x20(a0) +; sd s4, 0x28(a0) +; sd s5, 0x30(a0) +; sd s6, 0x38(a0) +; sd s7, 0x40(a0) +; sd s8, 0x48(a0) +; sd s9, 0x50(a0) +; sd s10, 0x58(a0) +; sd s11, 0x60(a0) +; sd t0, 0x68(a0) +; sd t1, 0x70(a0) +; sd t2, 0x78(a0) +; sd a6, 0x80(a0) +; sd a7, 0x88(a0) +; sd t3, 0x90(a0) +; sd t4, 0x98(a0) +; sd s1, 0xa0(a0) +; sd s2, 0xa8(a0) ; sd a1, 0xb0(a0) +; ld a3, 0(sp) ; sd a3, 0xb8(a0) -; ld a0, 0x10(sp) -; ld a1, 8(sp) +; ld a0, 0x18(sp) +; ld a1, 0x10(sp) ; ld s1, 0x78(sp) ; ld s2, 0x70(sp) ; ld s3, 0x68(sp) @@ -785,10 +789,10 @@ block0: ; sd s10,384(sp) ; sd s11,376(sp) ; block0: -; li a1,10 -; sd a1,8(slot) -; li a2,15 -; sd a2,0(slot) +; li a0,10 +; sd a0,8(slot) +; li a1,15 +; sd a1,0(slot) ; li a2,20 ; li a3,25 ; li a4,30 @@ -897,10 +901,10 @@ block0: ; sd s10, 0x180(sp) ; sd s11, 0x178(sp) ; block1: ; offset 0x40 -; addi a1, zero, 0xa -; sd a1, 0x168(sp) -; addi a2, zero, 0xf -; sd a2, 0x160(sp) +; addi a0, zero, 0xa +; sd a0, 0x168(sp) +; addi a1, zero, 0xf +; sd a1, 0x160(sp) ; addi a2, zero, 0x14 ; addi a3, zero, 0x19 ; addi a4, zero, 0x1e diff --git a/cranelift/filetests/filetests/isa/riscv64/user_stack_maps.clif b/cranelift/filetests/filetests/isa/riscv64/user_stack_maps.clif index 4b18ae8abd3e..341f7bd4fe0f 100644 --- a/cranelift/filetests/filetests/isa/riscv64/user_stack_maps.clif +++ b/cranelift/filetests/filetests/isa/riscv64/user_stack_maps.clif @@ -41,21 +41,27 @@ block0: ; sd s2,32(sp) ; sd s3,24(sp) ; block0: -; li s3,0 -; li s1,1 -; li s2,2 +; li a0,0 +; mv s3,a0 +; li a0,1 +; li a2,2 ; sw zero,0(slot) -; sw s1,4(slot) -; sw s2,8(slot) +; sw a0,4(slot) +; mv s1,a0 +; sw a2,8(slot) +; mv s2,a2 ; mv a0,s3 ; call userextname0 ; ; UserStackMap { by_type: [(types::I32, CompoundBitSet {0, 4, 8})], sp_to_sized_stack_slots: None } -; sw s1,0(slot) -; sw s2,4(slot) +; mv a0,s1 +; sw a0,0(slot) +; mv a0,s2 +; sw a0,4(slot) ; mv a0,s3 ; call userextname0 ; ; UserStackMap { by_type: [(types::I32, CompoundBitSet {0, 4})], sp_to_sized_stack_slots: None } -; sw s2,0(slot) +; mv a0,s2 +; sw a0,0(slot) ; mv a0,s1 ; call userextname0 ; ; UserStackMap { by_type: [(types::I32, CompoundBitSet {0})], sp_to_sized_stack_slots: None } @@ -81,21 +87,27 @@ block0: ; sd s2, 0x20(sp) ; sd s3, 0x18(sp) ; block1: ; offset 0x20 -; mv s3, zero -; addi s1, zero, 1 -; addi s2, zero, 2 +; mv a0, zero +; mv s3, a0 +; addi a0, zero, 1 +; addi a2, zero, 2 ; sw zero, 0(sp) -; sw s1, 4(sp) -; sw s2, 8(sp) +; sw a0, 4(sp) +; mv s1, a0 +; sw a2, 8(sp) +; mv s2, a2 ; mv a0, s3 ; auipc ra, 0 ; reloc_external RiscvCallPlt u0:0 0 ; jalr ra -; sw s1, 0(sp) -; sw s2, 4(sp) +; mv a0, s1 +; sw a0, 0(sp) +; mv a0, s2 +; sw a0, 4(sp) ; mv a0, s3 ; auipc ra, 0 ; reloc_external RiscvCallPlt u0:0 0 ; jalr ra -; sw s2, 0(sp) +; mv a0, s2 +; sw a0, 0(sp) ; mv a0, s1 ; auipc ra, 0 ; reloc_external RiscvCallPlt u0:0 0 ; jalr ra @@ -139,41 +151,41 @@ block0(v0: i8, v1: i16, v2: i32, v3: i64, v4: f32, v5: f64): ; addi sp,sp,-160 ; sd s1,152(sp) ; sd s2,144(sp) -; sd s3,136(sp) -; sd s4,128(sp) -; sd s9,120(sp) +; sd s6,136(sp) +; sd s8,128(sp) +; sd s10,120(sp) ; fsd fs0,112(sp) ; fsd fs2,104(sp) ; block0: -; mv s2,a4 +; mv s10,a4 ; sb a0,0(slot) -; mv s1,a0 +; mv s8,a0 ; sh a1,8(slot) -; mv s9,a1 +; mv s6,a1 ; sw a2,16(slot) -; mv s4,a2 +; mv s2,a2 ; fsw fa0,20(slot) ; fmv.d fs2,fa0 ; sd a3,24(slot) -; mv s3,a3 +; mv s1,a3 ; fsd fa1,32(slot) ; fmv.d fs0,fa1 ; call userextname0 ; ; UserStackMap { by_type: [(types::I8, CompoundBitSet {0}), (types::I16, CompoundBitSet {8}), (types::I32, CompoundBitSet {16}), (types::F32, CompoundBitSet {20}), (types::I64, CompoundBitSet {24}), (types::F64, CompoundBitSet {32})], sp_to_sized_stack_slots: None } -; mv a2,s4 -; mv a4,s2 +; mv a2,s2 +; mv a4,s10 ; sw a2,0(a4) -; mv a3,s3 +; mv a3,s1 ; sd a3,8(a4) -; mv a0,s1 -; mv a1,s9 +; mv a0,s8 +; mv a1,s6 ; fmv.d fa0,fs2 ; fmv.d fa1,fs0 ; ld s1,152(sp) ; ld s2,144(sp) -; ld s3,136(sp) -; ld s4,128(sp) -; ld s9,120(sp) +; ld s6,136(sp) +; ld s8,128(sp) +; ld s10,120(sp) ; fld fs0,112(sp) ; fld fs2,104(sp) ; addi sp,sp,160 @@ -191,41 +203,41 @@ block0(v0: i8, v1: i16, v2: i32, v3: i64, v4: f32, v5: f64): ; addi sp, sp, -0xa0 ; sd s1, 0x98(sp) ; sd s2, 0x90(sp) -; sd s3, 0x88(sp) -; sd s4, 0x80(sp) -; sd s9, 0x78(sp) +; sd s6, 0x88(sp) +; sd s8, 0x80(sp) +; sd s10, 0x78(sp) ; fsd fs0, 0x70(sp) ; fsd fs2, 0x68(sp) ; block1: ; offset 0x30 -; mv s2, a4 +; mv s10, a4 ; sb a0, 0(sp) -; mv s1, a0 +; mv s8, a0 ; sh a1, 8(sp) -; mv s9, a1 +; mv s6, a1 ; sw a2, 0x10(sp) -; mv s4, a2 +; mv s2, a2 ; fsw fa0, 0x14(sp) ; fmv.d fs2, fa0 ; sd a3, 0x18(sp) -; mv s3, a3 +; mv s1, a3 ; fsd fa1, 0x20(sp) ; fmv.d fs0, fa1 ; auipc ra, 0 ; reloc_external RiscvCallPlt u0:0 0 ; jalr ra -; mv a2, s4 -; mv a4, s2 +; mv a2, s2 +; mv a4, s10 ; sw a2, 0(a4) -; mv a3, s3 +; mv a3, s1 ; sd a3, 8(a4) -; mv a0, s1 -; mv a1, s9 +; mv a0, s8 +; mv a1, s6 ; fmv.d fa0, fs2 ; fmv.d fa1, fs0 ; ld s1, 0x98(sp) ; ld s2, 0x90(sp) -; ld s3, 0x88(sp) -; ld s4, 0x80(sp) -; ld s9, 0x78(sp) +; ld s6, 0x88(sp) +; ld s8, 0x80(sp) +; ld s10, 0x78(sp) ; fld fs0, 0x70(sp) ; fld fs2, 0x68(sp) ; addi sp, sp, 0xa0 diff --git a/cranelift/filetests/filetests/isa/riscv64/zca.clif b/cranelift/filetests/filetests/isa/riscv64/zca.clif index 69b31eb2f9d7..4086bb6353cb 100644 --- a/cranelift/filetests/filetests/isa/riscv64/zca.clif +++ b/cranelift/filetests/filetests/isa/riscv64/zca.clif @@ -449,15 +449,16 @@ block0: ; mv fp,sp ; addi sp,sp,-2048 ; block0: -; load_addr a2,1020(slot) +; load_addr a1,1020(slot) +; mv a5,a1 ; load_addr a1,4(slot) -; load_addr a3,512(slot) -; load_addr a4,256(slot) -; load_addr a5,64(slot) -; sd a3,0(a0) -; sd a4,8(a0) -; sd a5,16(a0) -; mv a0,a2 +; load_addr a2,512(slot) +; load_addr a3,256(slot) +; load_addr a4,64(slot) +; sd a2,0(a0) +; sd a3,8(a0) +; sd a4,16(a0) +; mv a0,a5 ; lui t6,1 ; addi t6,t6,-2048 ; add sp,sp,t6 @@ -474,15 +475,16 @@ block0: ; c.mv s0, sp ; addi sp, sp, -0x800 ; block1: ; offset 0xc -; c.addi4spn a2, sp, 0x3fc +; c.addi4spn a1, sp, 0x3fc +; c.mv a5, a1 ; c.addi4spn a1, sp, 4 -; c.addi4spn a3, sp, 0x200 -; c.addi4spn a4, sp, 0x100 -; c.addi4spn a5, sp, 0x40 -; c.sd a3, 0(a0) -; c.sd a4, 8(a0) -; c.sd a5, 0x10(a0) -; c.mv a0, a2 +; c.addi4spn a2, sp, 0x200 +; c.addi4spn a3, sp, 0x100 +; c.addi4spn a4, sp, 0x40 +; c.sd a2, 0(a0) +; c.sd a3, 8(a0) +; c.sd a4, 0x10(a0) +; c.mv a0, a5 ; c.lui t6, 1 ; addi t6, t6, -0x800 ; c.add sp, t6 @@ -584,28 +586,30 @@ block0: ; VCode: ; block0: -; li a2,0 +; li a1,0 +; mv a5,a1 ; li a1,1 -; li a3,-1 -; li a4,-32 -; li a5,31 -; sd a3,0(a0) -; sd a4,8(a0) -; sd a5,16(a0) -; mv a0,a2 +; li a2,-1 +; li a3,-32 +; li a4,31 +; sd a2,0(a0) +; sd a3,8(a0) +; sd a4,16(a0) +; mv a0,a5 ; ret ; ; Disassembled: ; block0: ; offset 0x0 -; c.li a2, 0 +; c.li a1, 0 +; c.mv a5, a1 ; c.li a1, 1 -; c.li a3, -1 -; c.li a4, -0x20 -; c.li a5, 0x1f -; c.sd a3, 0(a0) -; c.sd a4, 8(a0) -; c.sd a5, 0x10(a0) -; c.mv a0, a2 +; c.li a2, -1 +; c.li a3, -0x20 +; c.li a4, 0x1f +; c.sd a2, 0(a0) +; c.sd a3, 8(a0) +; c.sd a4, 0x10(a0) +; c.mv a0, a5 ; c.jr ra function %c_lui() -> i64, i64, i64 { diff --git a/cranelift/filetests/filetests/isa/riscv64/zcb.clif b/cranelift/filetests/filetests/isa/riscv64/zcb.clif index c5f73c1f725a..19bedd07fa24 100644 --- a/cranelift/filetests/filetests/isa/riscv64/zcb.clif +++ b/cranelift/filetests/filetests/isa/riscv64/zcb.clif @@ -127,15 +127,17 @@ block0(v0: i64): ; VCode: ; block0: ; lbu a3,0(a0) +; mv a4,a3 ; lbu a1,3(a0) -; mv a0,a3 +; mv a0,a4 ; ret ; ; Disassembled: ; block0: ; offset 0x0 ; .byte 0x14, 0x81 ; trap: heap_oob +; c.mv a4, a3 ; .byte 0x6c, 0x81 ; trap: heap_oob -; c.mv a0, a3 +; c.mv a0, a4 ; c.jr ra function %c_lhu(i64) -> i32, i64 { @@ -148,15 +150,17 @@ block0(v0: i64): ; VCode: ; block0: ; lhu a3,0(a0) +; mv a4,a3 ; lhu a1,2(a0) -; mv a0,a3 +; mv a0,a4 ; ret ; ; Disassembled: ; block0: ; offset 0x0 ; .byte 0x14, 0x85 ; trap: heap_oob +; c.mv a4, a3 ; .byte 0x2c, 0x85 ; trap: heap_oob -; c.mv a0, a3 +; c.mv a0, a4 ; c.jr ra function %c_lh(i64) -> i16, i16 { @@ -169,15 +173,17 @@ block0(v0: i64): ; VCode: ; block0: ; lh a3,0(a0) +; mv a4,a3 ; lh a1,2(a0) -; mv a0,a3 +; mv a0,a4 ; ret ; ; Disassembled: ; block0: ; offset 0x0 ; .byte 0x54, 0x85 ; trap: heap_oob +; c.mv a4, a3 ; .byte 0x6c, 0x85 ; trap: heap_oob -; c.mv a0, a3 +; c.mv a0, a4 ; c.jr ra function %c_sb(i64, i8) { diff --git a/cranelift/filetests/filetests/isa/s390x/arithmetic.clif b/cranelift/filetests/filetests/isa/s390x/arithmetic.clif index a72ea47288ed..402408137412 100644 --- a/cranelift/filetests/filetests/isa/s390x/arithmetic.clif +++ b/cranelift/filetests/filetests/isa/s390x/arithmetic.clif @@ -1489,11 +1489,10 @@ block0(v0: i64, v1: i64): ; iilf %r4, 4294967295 ; xgrk %r5, %r4, %r2 ; ngrk %r4, %r5, %r3 -; lgr %r5, %r3 ; cgite %r4, -1 +; lgr %r4, %r3 ; lgr %r3, %r2 -; lgr %r2, %r5 -; dsgr %r2, %r2 +; dsgr %r2, %r4 ; lgr %r2, %r3 ; br %r14 ; @@ -1503,11 +1502,10 @@ block0(v0: i64, v1: i64): ; iilf %r4, 0xffffffff ; xgrk %r5, %r4, %r2 ; ngrk %r4, %r5, %r3 -; lgr %r5, %r3 ; cgite %r4, -1 ; trap: int_ovf +; lgr %r4, %r3 ; lgr %r3, %r2 -; lgr %r2, %r5 -; dsgr %r2, %r2 ; trap: int_divz +; dsgr %r2, %r4 ; trap: int_divz ; lgr %r2, %r3 ; br %r14 @@ -1520,16 +1518,16 @@ block0(v0: i64): ; VCode: ; block0: -; lghi %r4, 2 ; lgr %r3, %r2 +; lghi %r4, 2 ; dsgr %r2, %r4 ; lgr %r2, %r3 ; br %r14 ; ; Disassembled: ; block0: ; offset 0x0 -; lghi %r4, 2 ; lgr %r3, %r2 +; lghi %r4, 2 ; dsgr %r2, %r4 ; trap: int_divz ; lgr %r2, %r3 ; br %r14 @@ -1603,12 +1601,13 @@ block0(v0: i16, v1: i16): ; VCode: ; block0: ; lghr %r5, %r2 +; lgr %r2, %r5 ; lhr %r4, %r3 -; lhi %r2, 32767 -; xrk %r3, %r2, %r5 -; nrk %r2, %r3, %r4 -; cite %r2, -1 -; lgr %r3, %r5 +; lhi %r5, 32767 +; lgr %r3, %r2 +; xr %r5, %r3 +; nr %r5, %r4 +; cite %r5, -1 ; dsgfr %r2, %r4 ; lgr %r2, %r3 ; br %r14 @@ -1616,12 +1615,13 @@ block0(v0: i16, v1: i16): ; Disassembled: ; block0: ; offset 0x0 ; lghr %r5, %r2 +; lgr %r2, %r5 ; lhr %r4, %r3 -; lhi %r2, 0x7fff -; xrk %r3, %r2, %r5 -; nrk %r2, %r3, %r4 -; cite %r2, -1 ; trap: int_ovf -; lgr %r3, %r5 +; lhi %r5, 0x7fff +; lgr %r3, %r2 +; xr %r5, %r3 +; nr %r5, %r4 +; cite %r5, -1 ; trap: int_ovf ; dsgfr %r2, %r4 ; trap: int_divz ; lgr %r2, %r3 ; br %r14 @@ -1658,12 +1658,13 @@ block0(v0: i8, v1: i8): ; VCode: ; block0: ; lgbr %r5, %r2 +; lgr %r2, %r5 ; lbr %r4, %r3 -; lhi %r2, 127 -; xrk %r3, %r2, %r5 -; nrk %r2, %r3, %r4 -; cite %r2, -1 -; lgr %r3, %r5 +; lhi %r5, 127 +; lgr %r3, %r2 +; xr %r5, %r3 +; nr %r5, %r4 +; cite %r5, -1 ; dsgfr %r2, %r4 ; lgr %r2, %r3 ; br %r14 @@ -1671,12 +1672,13 @@ block0(v0: i8, v1: i8): ; Disassembled: ; block0: ; offset 0x0 ; lgbr %r5, %r2 +; lgr %r2, %r5 ; lbr %r4, %r3 -; lhi %r2, 0x7f -; xrk %r3, %r2, %r5 -; nrk %r2, %r3, %r4 -; cite %r2, -1 ; trap: int_ovf -; lgr %r3, %r5 +; lhi %r5, 0x7f +; lgr %r3, %r2 +; xr %r5, %r3 +; nr %r5, %r4 +; cite %r5, -1 ; trap: int_ovf ; dsgfr %r2, %r4 ; trap: int_divz ; lgr %r2, %r3 ; br %r14 @@ -1712,19 +1714,19 @@ block0(v0: i64, v1: i64): ; VCode: ; block0: -; lgr %r5, %r3 +; lgr %r4, %r3 ; lgr %r3, %r2 ; lghi %r2, 0 -; dlgr %r2, %r5 +; dlgr %r2, %r4 ; lgr %r2, %r3 ; br %r14 ; ; Disassembled: ; block0: ; offset 0x0 -; lgr %r5, %r3 +; lgr %r4, %r3 ; lgr %r3, %r2 ; lghi %r2, 0 -; dlgr %r2, %r5 ; trap: int_divz +; dlgr %r2, %r4 ; trap: int_divz ; lgr %r2, %r3 ; br %r14 @@ -1761,19 +1763,19 @@ block0(v0: i32, v1: i32): ; VCode: ; block0: -; lgr %r5, %r3 +; lgr %r4, %r3 ; lgr %r3, %r2 ; lhi %r2, 0 -; dlr %r2, %r5 +; dlr %r2, %r4 ; lgr %r2, %r3 ; br %r14 ; ; Disassembled: ; block0: ; offset 0x0 -; lgr %r5, %r3 +; lgr %r4, %r3 ; lgr %r3, %r2 ; lhi %r2, 0 -; dlr %r2, %r5 ; trap: int_divz +; dlr %r2, %r4 ; trap: int_divz ; lgr %r2, %r3 ; br %r14 @@ -1809,25 +1811,32 @@ block0(v0: i16, v1: i16): } ; VCode: +; stmg %r7, %r15, 56(%r15) ; block0: ; lgr %r4, %r3 ; lhi %r5, 0 +; lgr %r7, %r5 ; llhr %r3, %r2 -; llhr %r4, %r4 -; lgr %r2, %r5 -; dlr %r2, %r4 +; llhr %r5, %r4 +; lgr %r2, %r7 +; dlr %r2, %r5 ; lgr %r2, %r3 +; lmg %r7, %r15, 56(%r15) ; br %r14 ; ; Disassembled: ; block0: ; offset 0x0 +; stmg %r7, %r15, 0x38(%r15) +; block1: ; offset 0x6 ; lgr %r4, %r3 ; lhi %r5, 0 +; lgr %r7, %r5 ; llhr %r3, %r2 -; llhr %r4, %r4 -; lgr %r2, %r5 -; dlr %r2, %r4 ; trap: int_divz +; llhr %r5, %r4 +; lgr %r2, %r7 +; dlr %r2, %r5 ; trap: int_divz ; lgr %r2, %r3 +; lmg %r7, %r15, 0x38(%r15) ; br %r14 function %udiv_i16_imm(i16) -> i16 { @@ -1840,20 +1849,22 @@ block0(v0: i16): ; VCode: ; block0: ; lhi %r4, 0 +; lgr %r5, %r4 ; llhr %r3, %r2 -; lhi %r5, 2 -; lgr %r2, %r4 -; dlr %r2, %r5 +; lhi %r4, 2 +; lgr %r2, %r5 +; dlr %r2, %r4 ; lgr %r2, %r3 ; br %r14 ; ; Disassembled: ; block0: ; offset 0x0 ; lhi %r4, 0 +; lgr %r5, %r4 ; llhr %r3, %r2 -; lhi %r5, 2 -; lgr %r2, %r4 -; dlr %r2, %r5 ; trap: int_divz +; lhi %r4, 2 +; lgr %r2, %r5 +; dlr %r2, %r4 ; trap: int_divz ; lgr %r2, %r3 ; br %r14 @@ -1864,25 +1875,32 @@ block0(v0: i8, v1: i8): } ; VCode: +; stmg %r7, %r15, 56(%r15) ; block0: ; lgr %r4, %r3 ; lhi %r5, 0 +; lgr %r7, %r5 ; llcr %r3, %r2 -; llcr %r4, %r4 -; lgr %r2, %r5 -; dlr %r2, %r4 +; llcr %r5, %r4 +; lgr %r2, %r7 +; dlr %r2, %r5 ; lgr %r2, %r3 +; lmg %r7, %r15, 56(%r15) ; br %r14 ; ; Disassembled: ; block0: ; offset 0x0 +; stmg %r7, %r15, 0x38(%r15) +; block1: ; offset 0x6 ; lgr %r4, %r3 ; lhi %r5, 0 +; lgr %r7, %r5 ; llcr %r3, %r2 -; llcr %r4, %r4 -; lgr %r2, %r5 -; dlr %r2, %r4 ; trap: int_divz +; llcr %r5, %r4 +; lgr %r2, %r7 +; dlr %r2, %r5 ; trap: int_divz ; lgr %r2, %r3 +; lmg %r7, %r15, 0x38(%r15) ; br %r14 function %udiv_i8_imm(i8) -> i8 { @@ -1895,20 +1913,22 @@ block0(v0: i8): ; VCode: ; block0: ; lhi %r4, 0 +; lgr %r5, %r4 ; llcr %r3, %r2 -; lhi %r5, 2 -; lgr %r2, %r4 -; dlr %r2, %r5 +; lhi %r4, 2 +; lgr %r2, %r5 +; dlr %r2, %r4 ; lgr %r2, %r3 ; br %r14 ; ; Disassembled: ; block0: ; offset 0x0 ; lhi %r4, 0 +; lgr %r5, %r4 ; llcr %r3, %r2 -; lhi %r5, 2 -; lgr %r2, %r4 -; dlr %r2, %r5 ; trap: int_divz +; lhi %r4, 2 +; lgr %r2, %r5 +; dlr %r2, %r4 ; trap: int_divz ; lgr %r2, %r3 ; br %r14 @@ -2057,23 +2077,30 @@ block0(v0: i16, v1: i16): } ; VCode: +; stmg %r7, %r15, 56(%r15) ; block0: ; lgr %r4, %r3 ; lhi %r5, 0 +; lgr %r7, %r5 ; llhr %r3, %r2 -; llhr %r4, %r4 -; lgr %r2, %r5 -; dlr %r2, %r4 +; llhr %r5, %r4 +; lgr %r2, %r7 +; dlr %r2, %r5 +; lmg %r7, %r15, 56(%r15) ; br %r14 ; ; Disassembled: ; block0: ; offset 0x0 +; stmg %r7, %r15, 0x38(%r15) +; block1: ; offset 0x6 ; lgr %r4, %r3 ; lhi %r5, 0 +; lgr %r7, %r5 ; llhr %r3, %r2 -; llhr %r4, %r4 -; lgr %r2, %r5 -; dlr %r2, %r4 ; trap: int_divz +; llhr %r5, %r4 +; lgr %r2, %r7 +; dlr %r2, %r5 ; trap: int_divz +; lmg %r7, %r15, 0x38(%r15) ; br %r14 function %urem_i8(i8, i8) -> i8 { @@ -2083,22 +2110,29 @@ block0(v0: i8, v1: i8): } ; VCode: +; stmg %r7, %r15, 56(%r15) ; block0: ; lgr %r4, %r3 ; lhi %r5, 0 +; lgr %r7, %r5 ; llcr %r3, %r2 -; llcr %r4, %r4 -; lgr %r2, %r5 -; dlr %r2, %r4 +; llcr %r5, %r4 +; lgr %r2, %r7 +; dlr %r2, %r5 +; lmg %r7, %r15, 56(%r15) ; br %r14 ; ; Disassembled: ; block0: ; offset 0x0 +; stmg %r7, %r15, 0x38(%r15) +; block1: ; offset 0x6 ; lgr %r4, %r3 ; lhi %r5, 0 +; lgr %r7, %r5 ; llcr %r3, %r2 -; llcr %r4, %r4 -; lgr %r2, %r5 -; dlr %r2, %r4 ; trap: int_divz +; llcr %r5, %r4 +; lgr %r2, %r7 +; dlr %r2, %r5 ; trap: int_divz +; lmg %r7, %r15, 0x38(%r15) ; br %r14 diff --git a/cranelift/filetests/filetests/isa/s390x/call-tail.clif b/cranelift/filetests/filetests/isa/s390x/call-tail.clif index 1ce224b65ce8..e2e93038219b 100644 --- a/cranelift/filetests/filetests/isa/s390x/call-tail.clif +++ b/cranelift/filetests/filetests/isa/s390x/call-tail.clif @@ -245,16 +245,16 @@ block0(v0: i64): ; block0: ; lgr %r10, %r2 ; brasl %r14, %f -; lgr %r13, %r2 -; brasl %r14, %f -; lgr %r9, %r2 -; brasl %r14, %f ; lgr %r12, %r2 ; brasl %r14, %f ; lgr %r8, %r2 ; brasl %r14, %f +; lgr %r9, %r2 +; brasl %r14, %f ; lgr %r11, %r2 ; brasl %r14, %f +; lgr %r13, %r2 +; brasl %r14, %f ; stg %r2, 184(%r15) ; brasl %r14, %f ; stg %r2, 176(%r15) @@ -266,11 +266,11 @@ block0(v0: i64): ; lg %r2, 352(%r15) ; stg %r2, 168(%r15) ; lgr %r2, %r10 -; lgr %r3, %r13 -; lgr %r4, %r9 -; lgr %r5, %r12 -; lgr %r6, %r8 -; lgr %r7, %r11 +; lgr %r3, %r12 +; lgr %r4, %r8 +; lgr %r5, %r9 +; lgr %r6, %r11 +; lgr %r7, %r13 ; brasl %r14, %g ; callee_pop_size 176 ; lg %r2, 168(%r15) ; lmg %r8, %r15, 256(%r15) @@ -283,15 +283,15 @@ block0(v0: i64): ; block1: ; offset 0xa ; lgr %r10, %r2 ; brasl %r14, 0xe ; reloc_external PLTRel32Dbl %f 2 -; lgr %r13, %r2 +; lgr %r12, %r2 ; brasl %r14, 0x18 ; reloc_external PLTRel32Dbl %f 2 -; lgr %r9, %r2 +; lgr %r8, %r2 ; brasl %r14, 0x22 ; reloc_external PLTRel32Dbl %f 2 -; lgr %r12, %r2 +; lgr %r9, %r2 ; brasl %r14, 0x2c ; reloc_external PLTRel32Dbl %f 2 -; lgr %r8, %r2 -; brasl %r14, 0x36 ; reloc_external PLTRel32Dbl %f 2 ; lgr %r11, %r2 +; brasl %r14, 0x36 ; reloc_external PLTRel32Dbl %f 2 +; lgr %r13, %r2 ; brasl %r14, 0x40 ; reloc_external PLTRel32Dbl %f 2 ; stg %r2, 0xb8(%r15) ; brasl %r14, 0x4c ; reloc_external PLTRel32Dbl %f 2 @@ -304,11 +304,11 @@ block0(v0: i64): ; lg %r2, 0x160(%r15) ; stg %r2, 0xa8(%r15) ; lgr %r2, %r10 -; lgr %r3, %r13 -; lgr %r4, %r9 -; lgr %r5, %r12 -; lgr %r6, %r8 -; lgr %r7, %r11 +; lgr %r3, %r12 +; lgr %r4, %r8 +; lgr %r5, %r9 +; lgr %r6, %r11 +; lgr %r7, %r13 ; brasl %r14, 0x98 ; reloc_external PLTRel32Dbl %g 2 ; lg %r2, 0xa8(%r15) ; lmg %r8, %r15, 0x100(%r15) diff --git a/cranelift/filetests/filetests/isa/s390x/multivalue-ret.clif b/cranelift/filetests/filetests/isa/s390x/multivalue-ret.clif index b80531782d16..75937accc011 100644 --- a/cranelift/filetests/filetests/isa/s390x/multivalue-ret.clif +++ b/cranelift/filetests/filetests/isa/s390x/multivalue-ret.clif @@ -40,15 +40,16 @@ block1: ; VCode: ; stmg %r6, %r15, 48(%r15) ; block0: -; lghi %r13, 1 +; lghi %r5, 1 +; lgr %r6, %r5 ; lghi %r3, 2 ; lghi %r4, 3 ; lghi %r5, 4 -; lghi %r14, 5 -; lghi %r6, 6 -; stg %r14, 0(%r2) -; stg %r6, 8(%r2) -; lgr %r2, %r13 +; lghi %r13, 5 +; lghi %r14, 6 +; stg %r13, 0(%r2) +; stg %r14, 8(%r2) +; lgr %r2, %r6 ; lmg %r6, %r15, 48(%r15) ; br %r14 ; @@ -56,15 +57,16 @@ block1: ; block0: ; offset 0x0 ; stmg %r6, %r15, 0x30(%r15) ; block1: ; offset 0x6 -; lghi %r13, 1 +; lghi %r5, 1 +; lgr %r6, %r5 ; lghi %r3, 2 ; lghi %r4, 3 ; lghi %r5, 4 -; lghi %r14, 5 -; lghi %r6, 6 -; stg %r14, 0(%r2) -; stg %r6, 8(%r2) -; lgr %r2, %r13 +; lghi %r13, 5 +; lghi %r14, 6 +; stg %r13, 0(%r2) +; stg %r14, 8(%r2) +; lgr %r2, %r6 ; lmg %r6, %r15, 0x30(%r15) ; br %r14 diff --git a/cranelift/filetests/filetests/isa/s390x/return-call-indirect.clif b/cranelift/filetests/filetests/isa/s390x/return-call-indirect.clif index eb4bf5f5cc6f..2145a60bf4b2 100644 --- a/cranelift/filetests/filetests/isa/s390x/return-call-indirect.clif +++ b/cranelift/filetests/filetests/isa/s390x/return-call-indirect.clif @@ -278,16 +278,16 @@ block0: ; aghi %r15, -600 ; stg %r1, 0(%r15) ; block0: -; lghi %r3, 10 -; stg %r3, 272(%r15) -; lghi %r4, 15 -; stg %r4, 264(%r15) -; lghi %r5, 20 -; stg %r5, 256(%r15) -; lghi %r6, 25 -; stg %r6, 248(%r15) -; lghi %r7, 30 -; stg %r7, 240(%r15) +; lghi %r2, 10 +; stg %r2, 272(%r15) +; lghi %r3, 15 +; stg %r3, 264(%r15) +; lghi %r4, 20 +; stg %r4, 256(%r15) +; lghi %r5, 25 +; stg %r5, 248(%r15) +; lghi %r6, 30 +; stg %r6, 240(%r15) ; lghi %r7, 35 ; stg %r7, 232(%r15) ; lghi %r14, 40 @@ -356,8 +356,8 @@ block0: ; lg %r5, 248(%r15) ; lg %r6, 240(%r15) ; lg %r7, 232(%r15) -; lg %r12, 160(%r15) -; return_call_ind %r12 ; callee_pop_size 320 +; lg %r13, 160(%r15) +; return_call_ind %r13 ; callee_pop_size 320 ; ; Disassembled: ; block0: ; offset 0x0 @@ -366,16 +366,16 @@ block0: ; aghi %r15, -0x258 ; stg %r1, 0(%r15) ; block1: ; offset 0x14 -; lghi %r3, 0xa -; stg %r3, 0x110(%r15) -; lghi %r4, 0xf -; stg %r4, 0x108(%r15) -; lghi %r5, 0x14 -; stg %r5, 0x100(%r15) -; lghi %r6, 0x19 -; stg %r6, 0xf8(%r15) -; lghi %r7, 0x1e -; stg %r7, 0xf0(%r15) +; lghi %r2, 0xa +; stg %r2, 0x110(%r15) +; lghi %r3, 0xf +; stg %r3, 0x108(%r15) +; lghi %r4, 0x14 +; stg %r4, 0x100(%r15) +; lghi %r5, 0x19 +; stg %r5, 0xf8(%r15) +; lghi %r6, 0x1e +; stg %r6, 0xf0(%r15) ; lghi %r7, 0x23 ; stg %r7, 0xe8(%r15) ; lghi %r14, 0x28 @@ -449,8 +449,8 @@ block0: ; lg %r5, 0xf8(%r15) ; lg %r6, 0xf0(%r15) ; lg %r7, 0xe8(%r15) -; lg %r12, 0xa0(%r15) -; lgr %r1, %r12 +; lg %r13, 0xa0(%r15) +; lgr %r1, %r13 ; aghi %r15, 0x118 ; lmg %r8, %r14, 0x180(%r15) ; br %r1 diff --git a/cranelift/filetests/filetests/isa/s390x/return-call.clif b/cranelift/filetests/filetests/isa/s390x/return-call.clif index bd521bc8d71a..d5eb4772921d 100644 --- a/cranelift/filetests/filetests/isa/s390x/return-call.clif +++ b/cranelift/filetests/filetests/isa/s390x/return-call.clif @@ -105,45 +105,45 @@ block0(v0: i64): } ; VCode: -; stmg %r9, %r15, 72(%r15) +; stmg %r11, %r15, 88(%r15) ; lgr %r1, %r15 ; aghi %r15, -160 ; stg %r1, 0(%r15) ; block0: -; lgr %r9, %r2 -; bras %r1, 12 ; data %callee_i64 + 0 ; lg %r7, 0(%r1) +; lgr %r11, %r2 ; lgr %r2, %r3 +; bras %r1, 12 ; data %callee_i64 + 0 ; lg %r7, 0(%r1) ; basr %r14, %r7 -; bras %r1, 12 ; data %callee_i64_multiret + 0 ; lg %r7, 0(%r1) ; lgr %r3, %r2 -; lgr %r2, %r9 +; bras %r1, 12 ; data %callee_i64_multiret + 0 ; lg %r7, 0(%r1) +; lgr %r2, %r11 ; return_call_ind %r7 ; ; Disassembled: ; block0: ; offset 0x0 -; stmg %r9, %r15, 0x48(%r15) +; stmg %r11, %r15, 0x58(%r15) ; lgr %r1, %r15 ; aghi %r15, -0xa0 ; stg %r1, 0(%r15) ; block1: ; offset 0x14 -; lgr %r9, %r2 -; bras %r1, 0x24 +; lgr %r11, %r2 +; lgr %r2, %r3 +; bras %r1, 0x28 ; .byte 0x00, 0x00 ; reloc_external Abs8 %callee_i64 0 ; .byte 0x00, 0x00 ; .byte 0x00, 0x00 ; .byte 0x00, 0x00 ; lg %r7, 0(%r1) -; lgr %r2, %r3 ; basr %r14, %r7 -; bras %r1, 0x3c +; lgr %r3, %r2 +; bras %r1, 0x40 ; .byte 0x00, 0x00 ; reloc_external Abs8 %callee_i64_multiret 0 ; .byte 0x00, 0x00 ; .byte 0x00, 0x00 ; .byte 0x00, 0x00 ; lg %r7, 0(%r1) -; lgr %r3, %r2 -; lgr %r2, %r9 -; lmg %r9, %r15, 0xe8(%r15) +; lgr %r2, %r11 +; lmg %r11, %r15, 0xf8(%r15) ; br %r7 ;;;; Test colocated tail calls ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -350,18 +350,19 @@ block0(v0: i32, v1: i32, v2: i32, v3: i32, v4: i32, v5: i32, v6: i32, v7: i32, v ; aghi %r15, -160 ; stg %r1, 0(%r15) ; block0: -; lgr %r9, %r7 -; lgr %r14, %r6 +; lgr %r14, %r5 +; lgr %r9, %r4 +; lgr %r4, %r6 +; lgr %r3, %r7 ; llgf %r6, 324(%r15) ; llgf %r7, 332(%r15) -; llgf %r2, 340(%r15) -; lg %r3, 344(%r15) -; stg %r3, 176(%r15) -; st %r2, 340(%r15) -; lgr %r3, %r5 -; lgr %r5, %r9 -; lgr %r2, %r4 -; lgr %r4, %r14 +; llgf %r5, 340(%r15) +; lg %r2, 344(%r15) +; stg %r2, 176(%r15) +; st %r5, 340(%r15) +; lgr %r5, %r3 +; lgr %r3, %r14 +; lgr %r2, %r9 ; return_call %one_stack_arg ; callee_pop_size 168 ; ; Disassembled: @@ -371,21 +372,22 @@ block0(v0: i32, v1: i32, v2: i32, v3: i32, v4: i32, v5: i32, v6: i32, v7: i32, v ; aghi %r15, -0xa0 ; stg %r1, 0(%r15) ; block1: ; offset 0x14 -; lgr %r9, %r7 -; lgr %r14, %r6 +; lgr %r14, %r5 +; lgr %r9, %r4 +; lgr %r4, %r6 +; lgr %r3, %r7 ; llgf %r6, 0x144(%r15) ; llgf %r7, 0x14c(%r15) -; llgf %r2, 0x154(%r15) -; lg %r3, 0x158(%r15) -; stg %r3, 0xb0(%r15) -; st %r2, 0x154(%r15) -; lgr %r3, %r5 -; lgr %r5, %r9 -; lgr %r2, %r4 -; lgr %r4, %r14 +; llgf %r5, 0x154(%r15) +; lg %r2, 0x158(%r15) +; stg %r2, 0xb0(%r15) +; st %r5, 0x154(%r15) +; lgr %r5, %r3 +; lgr %r3, %r14 +; lgr %r2, %r9 ; aghi %r15, 0xb0 ; lmg %r9, %r14, 0xf0(%r15) -; jg 0x58 ; reloc_external PLTRel32Dbl %one_stack_arg 2 +; jg 0x5c ; reloc_external PLTRel32Dbl %one_stack_arg 2 function %call_zero_stack_args(i32, i32, i32, i32, i32, i32, i32, i32, i8) -> i8 tail { fn0 = colocated %callee_i8(i8) -> i8 tail @@ -425,47 +427,51 @@ block0(v0: i32, v1: i32, v2: i32, v3: i32, v4: i32, v5: i32, v6: i32): } ; VCode: -; stmg %r8, %r15, 232(%r15) +; stmg %r9, %r15, 240(%r15) ; la %r1, 168(%r15) ; aghi %r15, -176 ; stg %r1, 0(%r15) ; block0: -; lgr %r8, %r7 +; lgr %r14, %r5 +; lgr %r9, %r4 +; lgr %r4, %r6 +; lgr %r6, %r7 ; llgf %r7, 340(%r15) -; lg %r10, 344(%r15) -; stg %r10, 160(%r15) +; lg %r5, 344(%r15) +; stg %r5, 160(%r15) ; st %r2, 324(%r15) ; st %r2, 332(%r15) ; st %r3, 340(%r15) +; lgr %r5, %r4 +; lgr %r4, %r14 ; lgr %r2, %r3 -; lgr %r3, %r4 -; lgr %r4, %r5 -; lgr %r5, %r6 -; lgr %r6, %r8 +; lgr %r3, %r9 ; return_call %call_one_stack_arg ; callee_pop_size 184 ; ; Disassembled: ; block0: ; offset 0x0 -; stmg %r8, %r15, 0xe8(%r15) +; stmg %r9, %r15, 0xf0(%r15) ; la %r1, 0xa8(%r15) ; aghi %r15, -0xb0 ; stg %r1, 0(%r15) ; block1: ; offset 0x14 -; lgr %r8, %r7 +; lgr %r14, %r5 +; lgr %r9, %r4 +; lgr %r4, %r6 +; lgr %r6, %r7 ; llgf %r7, 0x154(%r15) -; lg %r10, 0x158(%r15) -; stg %r10, 0xa0(%r15) +; lg %r5, 0x158(%r15) +; stg %r5, 0xa0(%r15) ; st %r2, 0x144(%r15) ; st %r2, 0x14c(%r15) ; st %r3, 0x154(%r15) +; lgr %r5, %r4 +; lgr %r4, %r14 ; lgr %r2, %r3 -; lgr %r3, %r4 -; lgr %r4, %r5 -; lgr %r5, %r6 -; lgr %r6, %r8 +; lgr %r3, %r9 ; aghi %r15, 0xa0 -; lmg %r8, %r14, 0xf8(%r15) -; jg 0x54 ; reloc_external PLTRel32Dbl %call_one_stack_arg 2 +; lmg %r9, %r14, 0x100(%r15) +; jg 0x5c ; reloc_external PLTRel32Dbl %call_one_stack_arg 2 ;;;; Test passing many arguments on stack ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -536,16 +542,16 @@ block0: ; aghi %r15, -592 ; stg %r1, 0(%r15) ; block0: -; lghi %r3, 10 -; stg %r3, 264(%r15) -; lghi %r4, 15 -; stg %r4, 256(%r15) -; lghi %r5, 20 -; stg %r5, 248(%r15) -; lghi %r6, 25 -; stg %r6, 240(%r15) -; lghi %r7, 30 -; stg %r7, 232(%r15) +; lghi %r2, 10 +; stg %r2, 264(%r15) +; lghi %r3, 15 +; stg %r3, 256(%r15) +; lghi %r4, 20 +; stg %r4, 248(%r15) +; lghi %r5, 25 +; stg %r5, 240(%r15) +; lghi %r6, 30 +; stg %r6, 232(%r15) ; lghi %r7, 35 ; stg %r7, 224(%r15) ; lghi %r14, 40 @@ -622,16 +628,16 @@ block0: ; aghi %r15, -0x250 ; stg %r1, 0(%r15) ; block1: ; offset 0x14 -; lghi %r3, 0xa -; stg %r3, 0x108(%r15) -; lghi %r4, 0xf -; stg %r4, 0x100(%r15) -; lghi %r5, 0x14 -; stg %r5, 0xf8(%r15) -; lghi %r6, 0x19 -; stg %r6, 0xf0(%r15) -; lghi %r7, 0x1e -; stg %r7, 0xe8(%r15) +; lghi %r2, 0xa +; stg %r2, 0x108(%r15) +; lghi %r3, 0xf +; stg %r3, 0x100(%r15) +; lghi %r4, 0x14 +; stg %r4, 0xf8(%r15) +; lghi %r5, 0x19 +; stg %r5, 0xf0(%r15) +; lghi %r6, 0x1e +; stg %r6, 0xe8(%r15) ; lghi %r7, 0x23 ; stg %r7, 0xe0(%r15) ; lghi %r14, 0x28 diff --git a/cranelift/filetests/filetests/isa/s390x/struct-arg.clif b/cranelift/filetests/filetests/isa/s390x/struct-arg.clif index b7b8f20974d1..e34cf9058063 100644 --- a/cranelift/filetests/filetests/isa/s390x/struct-arg.clif +++ b/cranelift/filetests/filetests/isa/s390x/struct-arg.clif @@ -163,41 +163,41 @@ block0(v0: i64, v1: i64, v2: i64): } ; VCode: -; stmg %r8, %r15, 64(%r15) +; stmg %r7, %r15, 56(%r15) ; aghi %r15, -1248 ; block0: -; lgr %r8, %r2 -; lgr %r10, %r4 +; lgr %r7, %r2 +; lgr %r9, %r4 ; la %r2, 160(%r15) ; la %r3, 0(%r3) ; lghi %r4, 1024 ; brasl %r14, %Memcpy -; lgr %r4, %r10 +; lgr %r4, %r9 ; mvc 1184(63,%r15), 0(%r4) ; la %r3, 160(%r15) ; la %r4, 1184(%r15) -; lgr %r2, %r8 +; lgr %r2, %r7 ; brasl %r14, userextname0 -; lmg %r8, %r15, 1312(%r15) +; lmg %r7, %r15, 1304(%r15) ; br %r14 ; ; Disassembled: ; block0: ; offset 0x0 -; stmg %r8, %r15, 0x40(%r15) +; stmg %r7, %r15, 0x38(%r15) ; aghi %r15, -0x4e0 ; block1: ; offset 0xa -; lgr %r8, %r2 -; lgr %r10, %r4 +; lgr %r7, %r2 +; lgr %r9, %r4 ; la %r2, 0xa0(%r15) ; la %r3, 0(%r3) ; lghi %r4, 0x400 ; brasl %r14, 0x1e ; reloc_external PLTRel32Dbl %Memcpy 2 -; lgr %r4, %r10 +; lgr %r4, %r9 ; mvc 0x4a0(0x40, %r15), 0(%r4) ; la %r3, 0xa0(%r15) ; la %r4, 0x4a0(%r15) -; lgr %r2, %r8 +; lgr %r2, %r7 ; brasl %r14, 0x3a ; reloc_external PLTRel32Dbl u0:0 2 -; lmg %r8, %r15, 0x520(%r15) +; lmg %r7, %r15, 0x518(%r15) ; br %r14 diff --git a/cranelift/filetests/filetests/isa/s390x/user_stack_maps.clif b/cranelift/filetests/filetests/isa/s390x/user_stack_maps.clif index 053dde2c7217..9ee6c7c1f8b1 100644 --- a/cranelift/filetests/filetests/isa/s390x/user_stack_maps.clif +++ b/cranelift/filetests/filetests/isa/s390x/user_stack_maps.clif @@ -32,67 +32,73 @@ block0: } ; VCode: -; stmg %r6, %r15, 48(%r15) +; stmg %r7, %r15, 56(%r15) ; aghi %r15, -176 ; block0: -; lhi %r8, 0 -; lhi %r6, 1 -; lhi %r7, 2 +; lhi %r2, 0 +; lgr %r11, %r2 +; lhi %r2, 1 +; lgr %r7, %r2 +; lhi %r2, 2 +; lgr %r9, %r2 ; la %r2, 160(%r15) ; mvhi 0(%r2), 0 ; la %r3, 164(%r15) ; mvhi 0(%r3), 1 ; la %r4, 168(%r15) ; mvhi 0(%r4), 2 -; lgr %r2, %r8 +; lgr %r2, %r11 ; brasl %r14, userextname0 ; ; UserStackMap { by_type: [(types::I32, CompoundBitSet {0, 4, 8})], sp_to_sized_stack_slots: None } ; la %r2, 160(%r15) ; mvhi 0(%r2), 1 ; la %r3, 164(%r15) ; mvhi 0(%r3), 2 -; lgr %r2, %r8 +; lgr %r2, %r11 ; brasl %r14, userextname0 ; ; UserStackMap { by_type: [(types::I32, CompoundBitSet {0, 4})], sp_to_sized_stack_slots: None } ; la %r5, 160(%r15) ; mvhi 0(%r5), 2 -; lgr %r2, %r6 +; lgr %r2, %r7 ; brasl %r14, userextname0 ; ; UserStackMap { by_type: [(types::I32, CompoundBitSet {0})], sp_to_sized_stack_slots: None } -; lgr %r2, %r7 +; lgr %r2, %r9 ; brasl %r14, userextname0 -; lmg %r6, %r15, 224(%r15) +; lmg %r7, %r15, 232(%r15) ; br %r14 ; ; Disassembled: ; block0: ; offset 0x0 -; stmg %r6, %r15, 0x30(%r15) +; stmg %r7, %r15, 0x38(%r15) ; aghi %r15, -0xb0 ; block1: ; offset 0xa -; lhi %r8, 0 -; lhi %r6, 1 -; lhi %r7, 2 +; lhi %r2, 0 +; lgr %r11, %r2 +; lhi %r2, 1 +; lgr %r7, %r2 +; lhi %r2, 2 +; lgr %r9, %r2 ; la %r2, 0xa0(%r15) ; mvhi 0(%r2), 0 ; la %r3, 0xa4(%r15) ; mvhi 0(%r3), 1 ; la %r4, 0xa8(%r15) ; mvhi 0(%r4), 2 -; lgr %r2, %r8 -; brasl %r14, 0x38 ; reloc_external PLTRel32Dbl u0:0 2 +; lgr %r2, %r11 +; brasl %r14, 0x44 ; reloc_external PLTRel32Dbl u0:0 2 ; la %r2, 0xa0(%r15) ; mvhi 0(%r2), 1 ; la %r3, 0xa4(%r15) ; mvhi 0(%r3), 2 -; lgr %r2, %r8 -; brasl %r14, 0x56 ; reloc_external PLTRel32Dbl u0:0 2 +; lgr %r2, %r11 +; brasl %r14, 0x62 ; reloc_external PLTRel32Dbl u0:0 2 ; la %r5, 0xa0(%r15) ; mvhi 0(%r5), 2 -; lgr %r2, %r6 -; brasl %r14, 0x6a ; reloc_external PLTRel32Dbl u0:0 2 ; lgr %r2, %r7 -; brasl %r14, 0x74 ; reloc_external PLTRel32Dbl u0:0 2 -; lmg %r6, %r15, 0xe0(%r15) +; brasl %r14, 0x76 ; reloc_external PLTRel32Dbl u0:0 2 +; lgr %r2, %r9 +; brasl %r14, 0x80 ; reloc_external PLTRel32Dbl u0:0 2 +; lmg %r7, %r15, 0xe8(%r15) ; br %r14 function %different_types(i8, i16, i32, i64, f32, f64) -> i8, i16, i32, i64, f32, f64 { @@ -129,28 +135,28 @@ block0(v0: i8, v1: i16, v2: i32, v3: i64, v4: f32, v5: f64): ; block0: ; la %r9, 160(%r15) ; stc %r2, 0(%r9) -; lgr %r9, %r2 +; lgr %r11, %r2 ; la %r2, 168(%r15) ; sth %r3, 0(%r2) -; lgr %r6, %r3 +; lgr %r9, %r3 ; la %r2, 176(%r15) ; st %r4, 0(%r2) -; lgr %r11, %r4 +; lgr %r7, %r4 ; la %r2, 180(%r15) ; ste %f0, 0(%r2) ; vst %v0, 256(%r15) ; la %r2, 184(%r15) ; stg %r5, 0(%r2) -; lgr %r8, %r5 +; lgr %r6, %r5 ; la %r3, 192(%r15) ; std %f2, 0(%r3) ; vst %v2, 272(%r15) ; brasl %r14, userextname0 ; ; UserStackMap { by_type: [(types::I8, CompoundBitSet {0}), (types::I16, CompoundBitSet {8}), (types::I32, CompoundBitSet {16}), (types::F32, CompoundBitSet {20}), (types::I64, CompoundBitSet {24}), (types::F64, CompoundBitSet {32})], sp_to_sized_stack_slots: None } -; lgr %r2, %r9 -; lgr %r3, %r6 -; lgr %r4, %r11 -; lgr %r5, %r8 +; lgr %r2, %r11 +; lgr %r3, %r9 +; lgr %r4, %r7 +; lgr %r5, %r6 ; vl %v0, 256(%r15) ; vl %v2, 272(%r15) ; ld %f8, 288(%r15) @@ -179,27 +185,27 @@ block0(v0: i8, v1: i16, v2: i32, v3: i64, v4: f32, v5: f64): ; block1: ; offset 0x2a ; la %r9, 0xa0(%r15) ; stc %r2, 0(%r9) -; lgr %r9, %r2 +; lgr %r11, %r2 ; la %r2, 0xa8(%r15) ; sth %r3, 0(%r2) -; lgr %r6, %r3 +; lgr %r9, %r3 ; la %r2, 0xb0(%r15) ; st %r4, 0(%r2) -; lgr %r11, %r4 +; lgr %r7, %r4 ; la %r2, 0xb4(%r15) ; ste %f0, 0(%r2) ; vst %v0, 0x100(%r15) ; la %r2, 0xb8(%r15) ; stg %r5, 0(%r2) -; lgr %r8, %r5 +; lgr %r6, %r5 ; la %r3, 0xc0(%r15) ; std %f2, 0(%r3) ; vst %v2, 0x110(%r15) ; brasl %r14, 0x78 ; reloc_external PLTRel32Dbl u0:0 2 -; lgr %r2, %r9 -; lgr %r3, %r6 -; lgr %r4, %r11 -; lgr %r5, %r8 +; lgr %r2, %r11 +; lgr %r3, %r9 +; lgr %r4, %r7 +; lgr %r5, %r6 ; vl %v0, 0x100(%r15) ; vl %v2, 0x110(%r15) ; ld %f8, 0x120(%r15) diff --git a/cranelift/filetests/filetests/isa/x64/call-conv.clif b/cranelift/filetests/filetests/isa/x64/call-conv.clif index 6b9deb3a5be1..a3b06408892d 100644 --- a/cranelift/filetests/filetests/isa/x64/call-conv.clif +++ b/cranelift/filetests/filetests/isa/x64/call-conv.clif @@ -193,6 +193,11 @@ block0( ; movq %rsp, %rbp ; subq %rsp, $144, %rsp ; block0: +; movq %rcx, %rax +; movq %rdx, %rcx +; movq %rsi, %rdx +; movq %rdi, %rsi +; movq %rax, %rdi ; movq rbp(stack args max - 32), %r10 ; movq rbp(stack args max - 24), %r11 ; movss rbp(stack args max - 16), %xmm11 @@ -211,10 +216,9 @@ block0( ; movl %r11d, 120(%rsp) ; movss %xmm11, 128(%rsp) ; movsd %xmm13, 136(%rsp) -; movq %rcx, %r9 -; movq %rdx, %r8 -; movq %rsi, %rdx -; movq %rdi, %rcx +; movq %rdi, %r9 +; movq %rcx, %r8 +; movq %rsi, %rcx ; call *%rcx ; addq %rsp, $144, %rsp ; movq %rbp, %rsp @@ -227,6 +231,11 @@ block0( ; movq %rsp, %rbp ; subq $0x90, %rsp ; block1: ; offset 0xb +; movq %rcx, %rax +; movq %rdx, %rcx +; movq %rsi, %rdx +; movq %rdi, %rsi +; movq %rax, %rdi ; movq 0x10(%rbp), %r10 ; movq 0x18(%rbp), %r11 ; movss 0x20(%rbp), %xmm11 @@ -245,10 +254,9 @@ block0( ; movl %r11d, 0x78(%rsp) ; movss %xmm11, 0x80(%rsp) ; movsd %xmm13, 0x88(%rsp) -; movq %rcx, %r9 -; movq %rdx, %r8 -; movq %rsi, %rdx -; movq %rdi, %rcx +; movq %rdi, %r9 +; movq %rcx, %r8 +; movq %rsi, %rcx ; callq *%rcx ; addq $0x90, %rsp ; movq %rbp, %rsp @@ -272,11 +280,12 @@ block0(v0: i64, v1:i64, v2:i64, v3:i64, v4:i64): ; movq %rsp, %rbp ; subq %rsp, $48, %rsp ; block0: -; movq %r8, 32(%rsp) +; movq %rdx, %r11 ; movq %rcx, %r9 -; movq %rdx, %r8 ; movq %rsi, %rdx ; movq %rdi, %rcx +; movq %r8, 32(%rsp) +; movq %r11, %r8 ; call *%rcx ; addq %rsp, $48, %rsp ; movq %rbp, %rsp @@ -289,11 +298,12 @@ block0(v0: i64, v1:i64, v2:i64, v3:i64, v4:i64): ; movq %rsp, %rbp ; subq $0x30, %rsp ; block1: ; offset 0x8 -; movq %r8, 0x20(%rsp) +; movq %rdx, %r11 ; movq %rcx, %r9 -; movq %rdx, %r8 ; movq %rsi, %rdx ; movq %rdi, %rcx +; movq %r8, 0x20(%rsp) +; movq %r11, %r8 ; callq *%rcx ; addq $0x30, %rsp ; movq %rbp, %rsp @@ -312,6 +322,10 @@ block0(v0: i32, v1: f32, v2: i64, v3: f64, v4: i32, v5: i32, v6: i32, v7: f32, v ; movq %rsp, %rbp ; subq %rsp, $96, %rsp ; block0: +; movq %rsi, %r9 +; movq %rdi, %rsi +; movdqa %xmm1, %xmm6 +; movdqa %xmm0, %xmm1 ; movl %edx, 32(%rsp) ; movl %ecx, 40(%rsp) ; movl %r8d, 48(%rsp) @@ -319,10 +333,9 @@ block0(v0: i32, v1: f32, v2: i64, v3: f64, v4: i32, v5: i32, v6: i32, v7: f32, v ; movsd %xmm3, 64(%rsp) ; movss %xmm4, 72(%rsp) ; movsd %xmm5, 80(%rsp) -; movq %rdi, %rcx -; movq %rsi, %r8 -; movdqa %xmm1, %xmm3 -; movdqa %xmm0, %xmm1 +; movq %rsi, %rcx +; movq %r9, %r8 +; movdqa %xmm6, %xmm3 ; call *%rcx ; addq %rsp, $96, %rsp ; movq %rbp, %rsp @@ -335,6 +348,10 @@ block0(v0: i32, v1: f32, v2: i64, v3: f64, v4: i32, v5: i32, v6: i32, v7: f32, v ; movq %rsp, %rbp ; subq $0x60, %rsp ; block1: ; offset 0x8 +; movq %rsi, %r9 +; movq %rdi, %rsi +; movdqa %xmm1, %xmm6 +; movdqa %xmm0, %xmm1 ; movl %edx, 0x20(%rsp) ; movl %ecx, 0x28(%rsp) ; movl %r8d, 0x30(%rsp) @@ -342,10 +359,9 @@ block0(v0: i32, v1: f32, v2: i64, v3: f64, v4: i32, v5: i32, v6: i32, v7: f32, v ; movsd %xmm3, 0x40(%rsp) ; movss %xmm4, 0x48(%rsp) ; movsd %xmm5, 0x50(%rsp) -; movq %rdi, %rcx -; movq %rsi, %r8 -; movdqa %xmm1, %xmm3 -; movdqa %xmm0, %xmm1 +; movq %rsi, %rcx +; movq %r9, %r8 +; movdqa %xmm6, %xmm3 ; callq *%rcx ; addq $0x60, %rsp ; movq %rbp, %rsp @@ -399,12 +415,12 @@ block0(v0: i32, v1: i32, v2: i8x16, v3: i64, v4: i8x16): ; movq %rsp, %rbp ; subq %rsp, $64, %rsp ; block0: +; movq %rsi, %rcx ; movq %rdx, %r8 ; lea 32(%rsp), %rdx ; movdqu %xmm0, 0(%rdx) ; lea 48(%rsp), %r9 ; movdqu %xmm1, 0(%r9) -; movq %rsi, %rcx ; call *%rdi ; paddb %xmm0, %xmm0, %xmm0 ; addq %rsp, $64, %rsp @@ -418,12 +434,12 @@ block0(v0: i32, v1: i32, v2: i8x16, v3: i64, v4: i8x16): ; movq %rsp, %rbp ; subq $0x40, %rsp ; block1: ; offset 0x8 +; movq %rsi, %rcx ; movq %rdx, %r8 ; leaq 0x20(%rsp), %rdx ; movdqu %xmm0, (%rdx) ; leaq 0x30(%rsp), %r9 ; movdqu %xmm1, (%r9) -; movq %rsi, %rcx ; callq *%rdi ; paddb %xmm0, %xmm0 ; addq $0x40, %rsp @@ -443,10 +459,10 @@ block0(v0: i32, v1: i8x16): ; movq %rsp, %rbp ; subq %rsp, $64, %rsp ; block0: +; movq %rdi, %r9 ; lea 48(%rsp), %rcx ; movdqu %xmm0, 0(%rcx) ; movq %rcx, 32(%rsp) -; movq %rdi, %r9 ; movq %r9, %rcx ; movq %r9, %rdx ; movq %r9, %r8 @@ -462,10 +478,10 @@ block0(v0: i32, v1: i8x16): ; movq %rsp, %rbp ; subq $0x40, %rsp ; block1: ; offset 0x8 +; movq %rdi, %r9 ; leaq 0x30(%rsp), %rcx ; movdqu %xmm0, (%rcx) ; movq %rcx, 0x20(%rsp) -; movq %rdi, %r9 ; movq %r9, %rcx ; movq %r9, %rdx ; movq %r9, %r8 @@ -487,13 +503,13 @@ block0(v0: i32, v1: i8x16): ; movq %rsp, %rbp ; subq %rsp, $80, %rsp ; block0: +; movq %rdi, %r9 ; lea 48(%rsp), %rcx ; movdqu %xmm0, 0(%rcx) ; movq %rcx, 32(%rsp) ; lea 64(%rsp), %r10 ; movdqu %xmm0, 0(%r10) ; movq %r10, 40(%rsp) -; movq %rdi, %r9 ; movq %r9, %rcx ; movq %r9, %rdx ; movq %r9, %r8 @@ -509,13 +525,13 @@ block0(v0: i32, v1: i8x16): ; movq %rsp, %rbp ; subq $0x50, %rsp ; block1: ; offset 0x8 +; movq %rdi, %r9 ; leaq 0x30(%rsp), %rcx ; movdqu %xmm0, (%rcx) ; movq %rcx, 0x20(%rsp) ; leaq 0x40(%rsp), %r10 ; movdqu %xmm0, (%r10) ; movq %r10, 0x28(%rsp) -; movq %rdi, %r9 ; movq %r9, %rcx ; movq %r9, %rdx ; movq %r9, %r8 @@ -537,15 +553,16 @@ block0(v0: i32, v1: i8x16): ; movq %rsp, %rbp ; subq %rsp, $96, %rsp ; block0: +; movq %rdi, %r10 ; lea 48(%rsp), %rdx ; movdqu %xmm0, 0(%rdx) ; lea 64(%rsp), %r9 ; movdqu %xmm0, 0(%r9) ; movq %r9, 32(%rsp) -; lea 80(%rsp), %rax -; movdqu %xmm0, 0(%rax) -; movq %rax, 40(%rsp) -; movq %rdi, %r9 +; lea 80(%rsp), %rdi +; movdqu %xmm0, 0(%rdi) +; movq %rdi, 40(%rsp) +; movq %r10, %r9 ; movq %r9, %rcx ; movq %r9, %r8 ; call *%r9 @@ -560,15 +577,16 @@ block0(v0: i32, v1: i8x16): ; movq %rsp, %rbp ; subq $0x60, %rsp ; block1: ; offset 0x8 +; movq %rdi, %r10 ; leaq 0x30(%rsp), %rdx ; movdqu %xmm0, (%rdx) ; leaq 0x40(%rsp), %r9 ; movdqu %xmm0, (%r9) ; movq %r9, 0x20(%rsp) -; leaq 0x50(%rsp), %rax -; movdqu %xmm0, (%rax) -; movq %rax, 0x28(%rsp) -; movq %rdi, %r9 +; leaq 0x50(%rsp), %rdi +; movdqu %xmm0, (%rdi) +; movq %rdi, 0x28(%rsp) +; movq %r10, %r9 ; movq %r9, %rcx ; movq %r9, %r8 ; callq *%r9 diff --git a/cranelift/filetests/filetests/isa/x64/fastcall.clif b/cranelift/filetests/filetests/isa/x64/fastcall.clif index b12e5452234e..44b42f9621fe 100644 --- a/cranelift/filetests/filetests/isa/x64/fastcall.clif +++ b/cranelift/filetests/filetests/isa/x64/fastcall.clif @@ -245,8 +245,8 @@ block0(v0: i64): ; cvtsi2sd %xmm3, %rcx, %xmm3 ; movq %rcx, 32(%rsp) ; movq %rcx, 40(%rsp) -; load_ext_name %g+0, %r11 ; movq %rcx, %rdx +; load_ext_name %g+0, %r11 ; movdqa %xmm3, %xmm2 ; call *%r11 ; addq %rsp, $48, %rsp @@ -264,8 +264,8 @@ block0(v0: i64): ; cvtsi2sdq %rcx, %xmm3 ; movq %rcx, 0x20(%rsp) ; movq %rcx, 0x28(%rsp) -; movabsq $0, %r11 ; reloc_external Abs8 %g 0 ; movq %rcx, %rdx +; movabsq $0, %r11 ; reloc_external Abs8 %g 0 ; movdqa %xmm3, %xmm2 ; callq *%r11 ; addq $0x30, %rsp diff --git a/cranelift/filetests/filetests/isa/x64/fma-call.clif b/cranelift/filetests/filetests/isa/x64/fma-call.clif index 5572974f00c1..8b19a8e9455e 100644 --- a/cranelift/filetests/filetests/isa/x64/fma-call.clif +++ b/cranelift/filetests/filetests/isa/x64/fma-call.clif @@ -187,9 +187,9 @@ block0(v0: f64x2, v1: f64x2, v2: f64x2): ; pshufd $238, %xmm2, %xmm2 ; load_ext_name %FmaF64+0, %r9 ; call *%r9 -; movdqa %xmm0, %xmm6 +; movdqa %xmm0, %xmm7 ; movdqu rsp(48 + virtual offset), %xmm0 -; movlhps %xmm0, %xmm6, %xmm0 +; movlhps %xmm0, %xmm7, %xmm0 ; addq %rsp, $64, %rsp ; movq %rbp, %rsp ; popq %rbp @@ -215,9 +215,9 @@ block0(v0: f64x2, v1: f64x2, v2: f64x2): ; pshufd $0xee, %xmm2, %xmm2 ; movabsq $0, %r9 ; reloc_external Abs8 %FmaF64 0 ; callq *%r9 -; movdqa %xmm0, %xmm6 +; movdqa %xmm0, %xmm7 ; movdqu 0x30(%rsp), %xmm0 -; movlhps %xmm6, %xmm0 +; movlhps %xmm7, %xmm0 ; addq $0x40, %rsp ; movq %rbp, %rsp ; popq %rbp diff --git a/cranelift/filetests/filetests/isa/x64/i128.clif b/cranelift/filetests/filetests/isa/x64/i128.clif index 9c1b901673c7..62df9b43a993 100644 --- a/cranelift/filetests/filetests/isa/x64/i128.clif +++ b/cranelift/filetests/filetests/isa/x64/i128.clif @@ -202,13 +202,13 @@ block0(v0: i128, v1: i128): ; movq %rdi, %rdx ; imulq %rdx, %rcx, %rdx ; movq %rax, %rcx +; movq %rdi, %rax ; imulq %rsi, %rcx, %rsi ; addq %rdx, %rsi, %rdx -; movq %rdi, %rax -; movq %rdx, %r8 +; movq %rdx, %r9 ; mulq %rax, %rcx, %rax, %rdx ; movq %rdx, %rcx -; movq %r8, %rdx +; movq %r9, %rdx ; addq %rdx, %rcx, %rdx ; movq %rbp, %rsp ; popq %rbp @@ -223,13 +223,13 @@ block0(v0: i128, v1: i128): ; movq %rdi, %rdx ; imulq %rcx, %rdx ; movq %rax, %rcx +; movq %rdi, %rax ; imulq %rcx, %rsi ; addq %rsi, %rdx -; movq %rdi, %rax -; movq %rdx, %r8 +; movq %rdx, %r9 ; mulq %rcx ; movq %rdx, %rcx -; movq %r8, %rdx +; movq %r9, %rdx ; addq %rcx, %rdx ; movq %rbp, %rsp ; popq %rbp @@ -564,8 +564,8 @@ block0(v0: i64): ; pushq %rbp ; movq %rsp, %rbp ; block0: -; xorq %rdx, %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx, %rdx ; movq %rbp, %rsp ; popq %rbp ; ret @@ -575,8 +575,8 @@ block0(v0: i64): ; pushq %rbp ; movq %rsp, %rbp ; block1: ; offset 0x4 -; xorq %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx ; movq %rbp, %rsp ; popq %rbp ; retq @@ -1251,8 +1251,8 @@ block0(v0: i128): ; movq %rdi, 32(%rdx) ; movq %rsi, 40(%rdx) ; movq %rdi, 48(%rdx) -; movq %rsi, 56(%rdx) ; movq %rdi, %rcx +; movq %rsi, 56(%rdx) ; movq %rsi, %rdx ; movq %rcx, %rax ; movq %rbp, %rsp @@ -1271,8 +1271,8 @@ block0(v0: i128): ; movq %rdi, 0x20(%rdx) ; movq %rsi, 0x28(%rdx) ; movq %rdi, 0x30(%rdx) -; movq %rsi, 0x38(%rdx) ; movq %rdi, %rcx +; movq %rsi, 0x38(%rdx) ; movq %rsi, %rdx ; movq %rcx, %rax ; movq %rbp, %rsp diff --git a/cranelift/filetests/filetests/isa/x64/return-call-indirect.clif b/cranelift/filetests/filetests/isa/x64/return-call-indirect.clif index d8889e147673..22ba0bb94307 100644 --- a/cranelift/filetests/filetests/isa/x64/return-call-indirect.clif +++ b/cranelift/filetests/filetests/isa/x64/return-call-indirect.clif @@ -260,16 +260,16 @@ block0: ; movq %r14, 136(%rsp) ; movq %r15, 144(%rsp) ; block0: -; movl $10, %esi -; movq %rsi, rsp(104 + virtual offset) -; movl $15, %edx -; movq %rdx, rsp(96 + virtual offset) -; movl $20, %ecx -; movq %rcx, rsp(88 + virtual offset) -; movl $25, %r8d -; movq %r8, rsp(80 + virtual offset) -; movl $30, %r9d -; movq %r9, rsp(72 + virtual offset) +; movl $10, %edi +; movq %rdi, rsp(104 + virtual offset) +; movl $15, %esi +; movq %rsi, rsp(96 + virtual offset) +; movl $20, %edx +; movq %rdx, rsp(88 + virtual offset) +; movl $25, %ecx +; movq %rcx, rsp(80 + virtual offset) +; movl $30, %r8d +; movq %r8, rsp(72 + virtual offset) ; movl $35, %r9d ; movq %r9, rsp(64 + virtual offset) ; movl $40, %eax @@ -354,16 +354,16 @@ block0: ; movq %r14, 0x88(%rsp) ; movq %r15, 0x90(%rsp) ; block1: ; offset 0x50 -; movl $0xa, %esi -; movq %rsi, 0x68(%rsp) -; movl $0xf, %edx -; movq %rdx, 0x60(%rsp) -; movl $0x14, %ecx -; movq %rcx, 0x58(%rsp) -; movl $0x19, %r8d -; movq %r8, 0x50(%rsp) -; movl $0x1e, %r9d -; movq %r9, 0x48(%rsp) +; movl $0xa, %edi +; movq %rdi, 0x68(%rsp) +; movl $0xf, %esi +; movq %rsi, 0x60(%rsp) +; movl $0x14, %edx +; movq %rdx, 0x58(%rsp) +; movl $0x19, %ecx +; movq %rcx, 0x50(%rsp) +; movl $0x1e, %r8d +; movq %r8, 0x48(%rsp) ; movl $0x23, %r9d ; movq %r9, 0x40(%rsp) ; movl $0x28, %eax diff --git a/cranelift/filetests/filetests/isa/x64/return-call.clif b/cranelift/filetests/filetests/isa/x64/return-call.clif index e20657ff82e3..f6f4250b3546 100644 --- a/cranelift/filetests/filetests/isa/x64/return-call.clif +++ b/cranelift/filetests/filetests/isa/x64/return-call.clif @@ -233,16 +233,15 @@ block0(v0: i32, v1: i32, v2: i32, v3: i32, v4: i32, v5: i32, v6: i32, v7: i32, v ; pushq %rbp ; movq %rsp, %rbp ; block0: -; movq %r8, %r10 -; movq %r9, %r11 +; movq %rcx, %r10 +; movq %rdx, %rdi +; movq %r8, %rdx +; movq %r9, %rcx ; movq rbp(stack args max - 32), %r8 ; movq rbp(stack args max - 24), %r9 ; movq rbp(stack args max - 16), %rsi ; movl %esi, rbp(stack args max - 16) -; movq %rdx, %rdi -; movq %rcx, %rsi -; movq %r10, %rdx -; movq %r11, %rcx +; movq %r10, %rsi ; return_call_known TestCase(%one_stack_arg) (16) tmp=%r11 %rdi=%rdi %rsi=%rsi %rdx=%rdx %rcx=%rcx %r8=%r8 %r9=%r9 ; ; Disassembled: @@ -250,22 +249,21 @@ block0(v0: i32, v1: i32, v2: i32, v3: i32, v4: i32, v5: i32, v6: i32, v7: i32, v ; pushq %rbp ; movq %rsp, %rbp ; block1: ; offset 0x4 -; movq %r8, %r10 -; movq %r9, %r11 +; movq %rcx, %r10 +; movq %rdx, %rdi +; movq %r8, %rdx +; movq %r9, %rcx ; movq 0x10(%rbp), %r8 ; movq 0x18(%rbp), %r9 ; movq 0x20(%rbp), %rsi ; movl %esi, 0x20(%rbp) -; movq %rdx, %rdi -; movq %rcx, %rsi -; movq %r10, %rdx -; movq %r11, %rcx +; movq %r10, %rsi ; movq %rbp, %rsp ; popq %rbp ; movq (%rsp), %r11 ; movq %r11, 0x10(%rsp) ; addq $0x10, %rsp -; jmp 0x3b ; reloc_external CallPCRel4 %one_stack_arg -4 +; jmp 0x38 ; reloc_external CallPCRel4 %one_stack_arg -4 function %call_zero_stack_args(i32, i32, i32, i32, i32, i32, i32, i32, i8) -> i8 tail { fn0 = colocated %callee_i8(i8) -> i8 tail @@ -313,16 +311,16 @@ block0(v0: i32, v1: i32, v2: i32, v3: i32, v4: i32, v5: i32, v6: i32): ; movq 24(%rsp), %r11 ; movq %r11, 8(%rsp) ; block0: -; movq %r9, %r10 +; movq %rdx, %r10 +; movq %rcx, %rdx +; movq %r8, %rcx +; movq %r9, %r8 ; movq rbp(stack args max - 16), %r9 ; movl %edi, rbp(stack args max - 32) ; movl %edi, rbp(stack args max - 24) ; movl %esi, rbp(stack args max - 16) ; movq %rsi, %rdi -; movq %rdx, %rsi -; movq %rcx, %rdx -; movq %r8, %rcx -; movq %r10, %r8 +; movq %r10, %rsi ; return_call_known TestCase(%call_one_stack_arg) (32) tmp=%r11 %rdi=%rdi %rsi=%rsi %rdx=%rdx %rcx=%rcx %r8=%r8 %r9=%r9 ; ; Disassembled: @@ -336,16 +334,16 @@ block0(v0: i32, v1: i32, v2: i32, v3: i32, v4: i32, v5: i32, v6: i32): ; movq 0x18(%rsp), %r11 ; movq %r11, 8(%rsp) ; block1: ; offset 0x1e -; movq %r9, %r10 +; movq %rdx, %r10 +; movq %rcx, %rdx +; movq %r8, %rcx +; movq %r9, %r8 ; movq 0x20(%rbp), %r9 ; movl %edi, 0x10(%rbp) ; movl %edi, 0x18(%rbp) ; movl %esi, 0x20(%rbp) ; movq %rsi, %rdi -; movq %rdx, %rsi -; movq %rcx, %rdx -; movq %r8, %rcx -; movq %r10, %r8 +; movq %r10, %rsi ; movq %rbp, %rsp ; popq %rbp ; jmp 0x46 ; reloc_external CallPCRel4 %call_one_stack_arg -4 @@ -425,16 +423,16 @@ block0: ; movq %r14, 136(%rsp) ; movq %r15, 144(%rsp) ; block0: -; movl $10, %esi -; movq %rsi, rsp(96 + virtual offset) -; movl $15, %edx -; movq %rdx, rsp(88 + virtual offset) -; movl $20, %ecx -; movq %rcx, rsp(80 + virtual offset) -; movl $25, %r8d -; movq %r8, rsp(72 + virtual offset) -; movl $30, %r9d -; movq %r9, rsp(64 + virtual offset) +; movl $10, %edi +; movq %rdi, rsp(96 + virtual offset) +; movl $15, %esi +; movq %rsi, rsp(88 + virtual offset) +; movl $20, %edx +; movq %rdx, rsp(80 + virtual offset) +; movl $25, %ecx +; movq %rcx, rsp(72 + virtual offset) +; movl $30, %r8d +; movq %r8, rsp(64 + virtual offset) ; movl $35, %r9d ; movq %r9, rsp(56 + virtual offset) ; movl $40, %eax @@ -517,16 +515,16 @@ block0: ; movq %r14, 0x88(%rsp) ; movq %r15, 0x90(%rsp) ; block1: ; offset 0x50 -; movl $0xa, %esi -; movq %rsi, 0x60(%rsp) -; movl $0xf, %edx -; movq %rdx, 0x58(%rsp) -; movl $0x14, %ecx -; movq %rcx, 0x50(%rsp) -; movl $0x19, %r8d -; movq %r8, 0x48(%rsp) -; movl $0x1e, %r9d -; movq %r9, 0x40(%rsp) +; movl $0xa, %edi +; movq %rdi, 0x60(%rsp) +; movl $0xf, %esi +; movq %rsi, 0x58(%rsp) +; movl $0x14, %edx +; movq %rdx, 0x50(%rsp) +; movl $0x19, %ecx +; movq %rcx, 0x48(%rsp) +; movl $0x1e, %r8d +; movq %r8, 0x40(%rsp) ; movl $0x23, %r9d ; movq %r9, 0x38(%rsp) ; movl $0x28, %eax diff --git a/cranelift/filetests/filetests/isa/x64/struct-arg.clif b/cranelift/filetests/filetests/isa/x64/struct-arg.clif index 95b1c4f6bce7..d7d5ba7b2498 100644 --- a/cranelift/filetests/filetests/isa/x64/struct-arg.clif +++ b/cranelift/filetests/filetests/isa/x64/struct-arg.clif @@ -114,16 +114,16 @@ block0(v0: i64, v1: i64): ; pushq %rbp ; movq %rsp, %rbp ; subq %rsp, $80, %rsp -; movq %r14, 64(%rsp) +; movq %r13, 64(%rsp) ; block0: -; movq %rdi, %r14 +; movq %rdi, %r13 ; lea 0(%rsp), %rdi ; movl $64, %edx ; load_ext_name %Memcpy+0, %r10 ; call *%r10 -; movq %r14, %rdi +; movq %r13, %rdi ; call User(userextname0) -; movq 64(%rsp), %r14 +; movq 64(%rsp), %r13 ; addq %rsp, $80, %rsp ; movq %rbp, %rsp ; popq %rbp @@ -134,16 +134,16 @@ block0(v0: i64, v1: i64): ; pushq %rbp ; movq %rsp, %rbp ; subq $0x50, %rsp -; movq %r14, 0x40(%rsp) +; movq %r13, 0x40(%rsp) ; block1: ; offset 0xd -; movq %rdi, %r14 +; movq %rdi, %r13 ; leaq (%rsp), %rdi ; movl $0x40, %edx ; movabsq $0, %r10 ; reloc_external Abs8 %Memcpy 0 ; callq *%r10 -; movq %r14, %rdi +; movq %r13, %rdi ; callq 0x2e ; reloc_external CallPCRel4 u0:0 -4 -; movq 0x40(%rsp), %r14 +; movq 0x40(%rsp), %r13 ; addq $0x50, %rsp ; movq %rbp, %rsp ; popq %rbp @@ -196,11 +196,11 @@ block0(v0: i64, v1: i64, v2: i64): ; pushq %rbp ; movq %rsp, %rbp ; subq %rsp, $208, %rsp -; movq %rbx, 192(%rsp) -; movq %r13, 200(%rsp) +; movq %r12, 192(%rsp) +; movq %r14, 200(%rsp) ; block0: -; movq %rdx, %rbx -; movq %rdi, %r13 +; movq %rdi, %r12 +; movq %rdx, %r14 ; lea 0(%rsp), %rdi ; movl $128, %edx ; load_ext_name %Memcpy+0, %r11 @@ -208,12 +208,12 @@ block0(v0: i64, v1: i64, v2: i64): ; lea 128(%rsp), %rdi ; movl $64, %edx ; load_ext_name %Memcpy+0, %r9 -; movq %rbx, %rsi +; movq %r14, %rsi ; call *%r9 -; movq %r13, %rdi +; movq %r12, %rdi ; call User(userextname0) -; movq 192(%rsp), %rbx -; movq 200(%rsp), %r13 +; movq 192(%rsp), %r12 +; movq 200(%rsp), %r14 ; addq %rsp, $208, %rsp ; movq %rbp, %rsp ; popq %rbp @@ -224,11 +224,11 @@ block0(v0: i64, v1: i64, v2: i64): ; pushq %rbp ; movq %rsp, %rbp ; subq $0xd0, %rsp -; movq %rbx, 0xc0(%rsp) -; movq %r13, 0xc8(%rsp) +; movq %r12, 0xc0(%rsp) +; movq %r14, 0xc8(%rsp) ; block1: ; offset 0x1b -; movq %rdx, %rbx -; movq %rdi, %r13 +; movq %rdi, %r12 +; movq %rdx, %r14 ; leaq (%rsp), %rdi ; movl $0x80, %edx ; movabsq $0, %r11 ; reloc_external Abs8 %Memcpy 0 @@ -236,12 +236,12 @@ block0(v0: i64, v1: i64, v2: i64): ; leaq 0x80(%rsp), %rdi ; movl $0x40, %edx ; movabsq $0, %r9 ; reloc_external Abs8 %Memcpy 0 -; movq %rbx, %rsi +; movq %r14, %rsi ; callq *%r9 -; movq %r13, %rdi +; movq %r12, %rdi ; callq 0x5c ; reloc_external CallPCRel4 u0:0 -4 -; movq 0xc0(%rsp), %rbx -; movq 0xc8(%rsp), %r13 +; movq 0xc0(%rsp), %r12 +; movq 0xc8(%rsp), %r14 ; addq $0xd0, %rsp ; movq %rbp, %rsp ; popq %rbp diff --git a/cranelift/filetests/filetests/isa/x64/struct-ret.clif b/cranelift/filetests/filetests/isa/x64/struct-ret.clif index 2664c459c589..1947901dd0b7 100644 --- a/cranelift/filetests/filetests/isa/x64/struct-ret.clif +++ b/cranelift/filetests/filetests/isa/x64/struct-ret.clif @@ -41,8 +41,8 @@ block0(v0: i64, v1: i64): ; pushq %rbp ; movq %rsp, %rbp ; block0: -; load_ext_name %f2+0, %rcx ; movq %rsi, %rdi +; load_ext_name %f2+0, %rcx ; call *%rcx ; movq %rdx, %rax ; movq %rbp, %rsp @@ -54,8 +54,8 @@ block0(v0: i64, v1: i64): ; pushq %rbp ; movq %rsp, %rbp ; block1: ; offset 0x4 -; movabsq $0, %rcx ; reloc_external Abs8 %f2 0 ; movq %rsi, %rdi +; movabsq $0, %rcx ; reloc_external Abs8 %f2 0 ; callq *%rcx ; movq %rdx, %rax ; movq %rbp, %rsp diff --git a/cranelift/filetests/filetests/isa/x64/tail-call-conv.clif b/cranelift/filetests/filetests/isa/x64/tail-call-conv.clif index c919e5ce872d..56a16e31cda2 100644 --- a/cranelift/filetests/filetests/isa/x64/tail-call-conv.clif +++ b/cranelift/filetests/filetests/isa/x64/tail-call-conv.clif @@ -62,8 +62,8 @@ block0: ; movq %r14, 120(%rsp) ; movq %r15, 128(%rsp) ; block0: -; movl $10, %esi -; movq %rsi, rsp(0 + virtual offset) +; movl $10, %edi +; movq %rdi, rsp(0 + virtual offset) ; movl $15, %esi ; movl $20, %edx ; movl $25, %ecx @@ -111,8 +111,8 @@ block0: ; movq %r14, 0x78(%rsp) ; movq %r15, 0x80(%rsp) ; block1: ; offset 0x27 -; movl $0xa, %esi -; movq %rsi, 0x50(%rsp) +; movl $0xa, %edi +; movq %rdi, 0x50(%rsp) ; movl $0xf, %esi ; movl $0x14, %edx ; movl $0x19, %ecx @@ -193,29 +193,29 @@ block0: ; movq %r14, 136(%rsp) ; movq %r15, 144(%rsp) ; block0: -; movl $10, %ecx -; movq %rcx, rsp(104 + virtual offset) -; movl $15, %edx -; movq %rdx, rsp(96 + virtual offset) -; movl $20, %esi -; movq %rsi, rsp(88 + virtual offset) -; movl $25, %r8d -; movq %r8, rsp(80 + virtual offset) -; movl $30, %eax -; movq %rax, rsp(72 + virtual offset) -; movl $35, %r9d -; movq %r9, rsp(64 + virtual offset) -; movl $40, %r10d -; movq %r10, rsp(56 + virtual offset) -; movl $45, %r11d -; movq %r11, rsp(48 + virtual offset) +; movl $10, %eax +; movq %rax, rsp(104 + virtual offset) +; movl $15, %ecx +; movq %rcx, rsp(96 + virtual offset) +; movl $20, %edx +; movq %rdx, rsp(88 + virtual offset) +; movl $25, %esi +; movq %rsi, rsp(80 + virtual offset) +; movl $30, %esi +; movq %rsi, rsp(72 + virtual offset) +; movl $35, %r8d +; movq %r8, rsp(64 + virtual offset) +; movl $40, %r9d +; movq %r9, rsp(56 + virtual offset) +; movl $45, %r10d +; movq %r10, rsp(48 + virtual offset) ; movl $50, %r11d ; movq %r11, rsp(40 + virtual offset) -; movl $55, %r14d -; movl $60, %r15d -; movl $65, %ebx -; movl $70, %r12d -; movl $75, %r13d +; movl $55, %r13d +; movl $60, %r14d +; movl $65, %r15d +; movl $70, %ebx +; movl $75, %r12d ; movl $80, %eax ; movl $85, %ecx ; movl $90, %edx @@ -233,11 +233,11 @@ block0: ; movq %rsi, rsp(8 + virtual offset) ; movl $135, %esi ; movq %rsi, rsp(0 + virtual offset) -; movq %r14, 0(%rdi) -; movq %r15, 8(%rdi) -; movq %rbx, 16(%rdi) -; movq %r12, 24(%rdi) -; movq %r13, 32(%rdi) +; movq %r13, 0(%rdi) +; movq %r14, 8(%rdi) +; movq %r15, 16(%rdi) +; movq %rbx, 24(%rdi) +; movq %r12, 32(%rdi) ; movq %rax, 40(%rdi) ; movq %rcx, 48(%rdi) ; movq %rdx, 56(%rdi) @@ -285,29 +285,29 @@ block0: ; movq %r14, 0x88(%rsp) ; movq %r15, 0x90(%rsp) ; block1: ; offset 0x2d -; movl $0xa, %ecx -; movq %rcx, 0x68(%rsp) -; movl $0xf, %edx -; movq %rdx, 0x60(%rsp) -; movl $0x14, %esi -; movq %rsi, 0x58(%rsp) -; movl $0x19, %r8d -; movq %r8, 0x50(%rsp) -; movl $0x1e, %eax -; movq %rax, 0x48(%rsp) -; movl $0x23, %r9d -; movq %r9, 0x40(%rsp) -; movl $0x28, %r10d -; movq %r10, 0x38(%rsp) -; movl $0x2d, %r11d -; movq %r11, 0x30(%rsp) +; movl $0xa, %eax +; movq %rax, 0x68(%rsp) +; movl $0xf, %ecx +; movq %rcx, 0x60(%rsp) +; movl $0x14, %edx +; movq %rdx, 0x58(%rsp) +; movl $0x19, %esi +; movq %rsi, 0x50(%rsp) +; movl $0x1e, %esi +; movq %rsi, 0x48(%rsp) +; movl $0x23, %r8d +; movq %r8, 0x40(%rsp) +; movl $0x28, %r9d +; movq %r9, 0x38(%rsp) +; movl $0x2d, %r10d +; movq %r10, 0x30(%rsp) ; movl $0x32, %r11d ; movq %r11, 0x28(%rsp) -; movl $0x37, %r14d -; movl $0x3c, %r15d -; movl $0x41, %ebx -; movl $0x46, %r12d -; movl $0x4b, %r13d +; movl $0x37, %r13d +; movl $0x3c, %r14d +; movl $0x41, %r15d +; movl $0x46, %ebx +; movl $0x4b, %r12d ; movl $0x50, %eax ; movl $0x55, %ecx ; movl $0x5a, %edx @@ -325,11 +325,11 @@ block0: ; movq %rsi, 8(%rsp) ; movl $0x87, %esi ; movq %rsi, (%rsp) -; movq %r14, (%rdi) -; movq %r15, 8(%rdi) -; movq %rbx, 0x10(%rdi) -; movq %r12, 0x18(%rdi) -; movq %r13, 0x20(%rdi) +; movq %r13, (%rdi) +; movq %r14, 8(%rdi) +; movq %r15, 0x10(%rdi) +; movq %rbx, 0x18(%rdi) +; movq %r12, 0x20(%rdi) ; movq %rax, 0x28(%rdi) ; movq %rcx, 0x30(%rdi) ; movq %rdx, 0x38(%rdi) @@ -457,10 +457,10 @@ block0(v0: i64, v1: i64, v2: i64, v3: i64, v4: i64, v5: i64, v6: i64, v7: i64, v ; movq %rcx, rsp(24 + virtual offset) ; movq %r8, rsp(32 + virtual offset) ; movq %r9, rsp(40 + virtual offset) -; movq rbp(stack args max - 176), %r10 -; movq %r10, rsp(48 + virtual offset) -; movq rbp(stack args max - 168), %r11 -; movq %r11, rsp(56 + virtual offset) +; movq rbp(stack args max - 176), %r9 +; movq %r9, rsp(48 + virtual offset) +; movq rbp(stack args max - 168), %r10 +; movq %r10, rsp(56 + virtual offset) ; movq rbp(stack args max - 160), %r11 ; movq %r11, rsp(64 + virtual offset) ; movq rbp(stack args max - 152), %rdx @@ -473,17 +473,17 @@ block0(v0: i64, v1: i64, v2: i64, v3: i64, v4: i64, v5: i64, v6: i64, v7: i64, v ; movq rbp(stack args max - 112), %r9 ; movq rbp(stack args max - 104), %rsi ; movq %rsi, rsp(88 + virtual offset) -; movq rbp(stack args max - 96), %rdi -; movq rbp(stack args max - 88), %rcx -; movq rbp(stack args max - 80), %r8 -; movq rbp(stack args max - 72), %rsi +; movq rbp(stack args max - 96), %r13 +; movq rbp(stack args max - 88), %r15 +; movq rbp(stack args max - 80), %r12 +; movq rbp(stack args max - 72), %r14 ; movq rbp(stack args max - 64), %rbx -; movq rbp(stack args max - 56), %r13 -; movq rbp(stack args max - 48), %r15 -; movq rbp(stack args max - 40), %r12 -; movq rbp(stack args max - 32), %r14 -; movq rbp(stack args max - 24), %rax -; movq %rax, rsp(96 + virtual offset) +; movq rbp(stack args max - 56), %rdi +; movq %rdi, rsp(96 + virtual offset) +; movq rbp(stack args max - 48), %rcx +; movq rbp(stack args max - 40), %r8 +; movq rbp(stack args max - 32), %rdi +; movq rbp(stack args max - 24), %rsi ; movq rbp(stack args max - 16), %rax ; movq %rdx, 0(%rax) ; movq rsp(72 + virtual offset), %rdx @@ -495,16 +495,16 @@ block0(v0: i64, v1: i64, v2: i64, v3: i64, v4: i64, v5: i64, v6: i64, v7: i64, v ; movq %r9, 40(%rax) ; movq rsp(88 + virtual offset), %r10 ; movq %r10, 48(%rax) -; movq %rdi, 56(%rax) -; movq %rcx, 64(%rax) -; movq %r8, 72(%rax) -; movq %rsi, 80(%rax) +; movq %r13, 56(%rax) +; movq %r15, 64(%rax) +; movq %r12, 72(%rax) +; movq %r14, 80(%rax) ; movq %rbx, 88(%rax) -; movq %r13, 96(%rax) -; movq %r15, 104(%rax) -; movq %r12, 112(%rax) -; movq %r14, 120(%rax) -; movq rsp(96 + virtual offset), %rsi +; movq rsp(96 + virtual offset), %rdx +; movq %rdx, 96(%rax) +; movq %rcx, 104(%rax) +; movq %r8, 112(%rax) +; movq %rdi, 120(%rax) ; movq %rsi, 128(%rax) ; movq rsp(0 + virtual offset), %rax ; movq rsp(8 + virtual offset), %rcx @@ -542,10 +542,10 @@ block0(v0: i64, v1: i64, v2: i64, v3: i64, v4: i64, v5: i64, v6: i64, v7: i64, v ; movq %rcx, 0x18(%rsp) ; movq %r8, 0x20(%rsp) ; movq %r9, 0x28(%rsp) -; movq 0x10(%rbp), %r10 -; movq %r10, 0x30(%rsp) -; movq 0x18(%rbp), %r11 -; movq %r11, 0x38(%rsp) +; movq 0x10(%rbp), %r9 +; movq %r9, 0x30(%rsp) +; movq 0x18(%rbp), %r10 +; movq %r10, 0x38(%rsp) ; movq 0x20(%rbp), %r11 ; movq %r11, 0x40(%rsp) ; movq 0x28(%rbp), %rdx @@ -558,17 +558,17 @@ block0(v0: i64, v1: i64, v2: i64, v3: i64, v4: i64, v5: i64, v6: i64, v7: i64, v ; movq 0x50(%rbp), %r9 ; movq 0x58(%rbp), %rsi ; movq %rsi, 0x58(%rsp) -; movq 0x60(%rbp), %rdi -; movq 0x68(%rbp), %rcx -; movq 0x70(%rbp), %r8 -; movq 0x78(%rbp), %rsi +; movq 0x60(%rbp), %r13 +; movq 0x68(%rbp), %r15 +; movq 0x70(%rbp), %r12 +; movq 0x78(%rbp), %r14 ; movq 0x80(%rbp), %rbx -; movq 0x88(%rbp), %r13 -; movq 0x90(%rbp), %r15 -; movq 0x98(%rbp), %r12 -; movq 0xa0(%rbp), %r14 -; movq 0xa8(%rbp), %rax -; movq %rax, 0x60(%rsp) +; movq 0x88(%rbp), %rdi +; movq %rdi, 0x60(%rsp) +; movq 0x90(%rbp), %rcx +; movq 0x98(%rbp), %r8 +; movq 0xa0(%rbp), %rdi +; movq 0xa8(%rbp), %rsi ; movq 0xb0(%rbp), %rax ; movq %rdx, (%rax) ; movq 0x48(%rsp), %rdx @@ -580,16 +580,16 @@ block0(v0: i64, v1: i64, v2: i64, v3: i64, v4: i64, v5: i64, v6: i64, v7: i64, v ; movq %r9, 0x28(%rax) ; movq 0x58(%rsp), %r10 ; movq %r10, 0x30(%rax) -; movq %rdi, 0x38(%rax) -; movq %rcx, 0x40(%rax) -; movq %r8, 0x48(%rax) -; movq %rsi, 0x50(%rax) +; movq %r13, 0x38(%rax) +; movq %r15, 0x40(%rax) +; movq %r12, 0x48(%rax) +; movq %r14, 0x50(%rax) ; movq %rbx, 0x58(%rax) -; movq %r13, 0x60(%rax) -; movq %r15, 0x68(%rax) -; movq %r12, 0x70(%rax) -; movq %r14, 0x78(%rax) -; movq 0x60(%rsp), %rsi +; movq 0x60(%rsp), %rdx +; movq %rdx, 0x60(%rax) +; movq %rcx, 0x68(%rax) +; movq %r8, 0x70(%rax) +; movq %rdi, 0x78(%rax) ; movq %rsi, 0x80(%rax) ; movq (%rsp), %rax ; movq 8(%rsp), %rcx @@ -654,16 +654,16 @@ block0: ; movq %r14, 456(%rsp) ; movq %r15, 464(%rsp) ; block0: -; movl $10, %esi -; movq %rsi, rsp(96 + virtual offset) -; movl $15, %edx -; movq %rdx, rsp(88 + virtual offset) -; movl $20, %ecx -; movq %rcx, rsp(80 + virtual offset) -; movl $25, %r8d -; movq %r8, rsp(72 + virtual offset) -; movl $30, %r9d -; movq %r9, rsp(64 + virtual offset) +; movl $10, %edi +; movq %rdi, rsp(96 + virtual offset) +; movl $15, %esi +; movq %rsi, rsp(88 + virtual offset) +; movl $20, %edx +; movq %rdx, rsp(80 + virtual offset) +; movl $25, %ecx +; movq %rcx, rsp(72 + virtual offset) +; movl $30, %r8d +; movq %r8, rsp(64 + virtual offset) ; movl $35, %r9d ; movq %r9, rsp(56 + virtual offset) ; movl $40, %esi @@ -768,16 +768,16 @@ block0: ; movq %r14, 0x1c8(%rsp) ; movq %r15, 0x1d0(%rsp) ; block1: ; offset 0x33 -; movl $0xa, %esi -; movq %rsi, 0x1a0(%rsp) -; movl $0xf, %edx -; movq %rdx, 0x198(%rsp) -; movl $0x14, %ecx -; movq %rcx, 0x190(%rsp) -; movl $0x19, %r8d -; movq %r8, 0x188(%rsp) -; movl $0x1e, %r9d -; movq %r9, 0x180(%rsp) +; movl $0xa, %edi +; movq %rdi, 0x1a0(%rsp) +; movl $0xf, %esi +; movq %rsi, 0x198(%rsp) +; movl $0x14, %edx +; movq %rdx, 0x190(%rsp) +; movl $0x19, %ecx +; movq %rcx, 0x188(%rsp) +; movl $0x1e, %r8d +; movq %r8, 0x180(%rsp) ; movl $0x23, %r9d ; movq %r9, 0x178(%rsp) ; movl $0x28, %esi diff --git a/cranelift/filetests/filetests/isa/x64/udiv.clif b/cranelift/filetests/filetests/isa/x64/udiv.clif index 56b70ec88983..619cb79916b4 100644 --- a/cranelift/filetests/filetests/isa/x64/udiv.clif +++ b/cranelift/filetests/filetests/isa/x64/udiv.clif @@ -38,8 +38,8 @@ block0(v0: i16, v1: i16): ; pushq %rbp ; movq %rsp, %rbp ; block0: -; xorq %rdx, %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx, %rdx ; div %ax, %dx, %si, %ax, %dx ; trap=int_divz ; movq %rbp, %rsp ; popq %rbp @@ -50,8 +50,8 @@ block0(v0: i16, v1: i16): ; pushq %rbp ; movq %rsp, %rbp ; block1: ; offset 0x4 -; xorq %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx ; divw %si ; trap: int_divz ; movq %rbp, %rsp ; popq %rbp @@ -67,8 +67,8 @@ block0(v0: i32, v1: i32): ; pushq %rbp ; movq %rsp, %rbp ; block0: -; xorq %rdx, %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx, %rdx ; div %eax, %edx, %esi, %eax, %edx ; trap=int_divz ; movq %rbp, %rsp ; popq %rbp @@ -79,8 +79,8 @@ block0(v0: i32, v1: i32): ; pushq %rbp ; movq %rsp, %rbp ; block1: ; offset 0x4 -; xorq %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx ; divl %esi ; trap: int_divz ; movq %rbp, %rsp ; popq %rbp @@ -96,8 +96,8 @@ block0(v0: i64, v1: i64): ; pushq %rbp ; movq %rsp, %rbp ; block0: -; xorq %rdx, %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx, %rdx ; div %rax, %rdx, %rsi, %rax, %rdx ; trap=int_divz ; movq %rbp, %rsp ; popq %rbp @@ -108,8 +108,8 @@ block0(v0: i64, v1: i64): ; pushq %rbp ; movq %rsp, %rbp ; block1: ; offset 0x4 -; xorq %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx ; divq %rsi ; trap: int_divz ; movq %rbp, %rsp ; popq %rbp diff --git a/cranelift/filetests/filetests/isa/x64/udivrem.clif b/cranelift/filetests/filetests/isa/x64/udivrem.clif index eb1e5da9ea32..1468447aa1da 100644 --- a/cranelift/filetests/filetests/isa/x64/udivrem.clif +++ b/cranelift/filetests/filetests/isa/x64/udivrem.clif @@ -16,12 +16,12 @@ block0(v0: i8, v1: i8): ; block0: ; movzbl %dil, %eax ; div %al, %sil, %al ; trap=int_divz -; movq %rax, %rcx +; movq %rax, %r11 ; movzbl %dil, %eax ; div %al, %sil, %al ; trap=int_divz ; movq %rax, %rdx ; shrq $8, %rdx, %rdx -; movq %rcx, %rax +; movq %r11, %rax ; movq %rbp, %rsp ; popq %rbp ; ret @@ -33,12 +33,12 @@ block0(v0: i8, v1: i8): ; block1: ; offset 0x4 ; movzbl %dil, %eax ; divb %sil ; trap: int_divz -; movq %rax, %rcx +; movq %rax, %r11 ; movzbl %dil, %eax ; divb %sil ; trap: int_divz ; movq %rax, %rdx ; shrq $8, %rdx -; movq %rcx, %rax +; movq %r11, %rax ; movq %rbp, %rsp ; popq %rbp ; retq @@ -58,8 +58,8 @@ block0(v0: i16, v1: i16): ; movq %rdi, %rax ; div %ax, %dx, %si, %ax, %dx ; trap=int_divz ; movq %rax, %rcx -; xorq %rdx, %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx, %rdx ; div %ax, %dx, %si, %ax, %dx ; trap=int_divz ; movq %rcx, %rax ; movq %rbp, %rsp @@ -75,8 +75,8 @@ block0(v0: i16, v1: i16): ; movq %rdi, %rax ; divw %si ; trap: int_divz ; movq %rax, %rcx -; xorq %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx ; divw %si ; trap: int_divz ; movq %rcx, %rax ; movq %rbp, %rsp @@ -98,8 +98,8 @@ block0(v0: i32, v1: i32): ; movq %rdi, %rax ; div %eax, %edx, %esi, %eax, %edx ; trap=int_divz ; movq %rax, %rcx -; xorq %rdx, %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx, %rdx ; div %eax, %edx, %esi, %eax, %edx ; trap=int_divz ; movq %rcx, %rax ; movq %rbp, %rsp @@ -115,8 +115,8 @@ block0(v0: i32, v1: i32): ; movq %rdi, %rax ; divl %esi ; trap: int_divz ; movq %rax, %rcx -; xorq %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx ; divl %esi ; trap: int_divz ; movq %rcx, %rax ; movq %rbp, %rsp @@ -138,8 +138,8 @@ block0(v0: i64, v1: i64): ; movq %rdi, %rax ; div %rax, %rdx, %rsi, %rax, %rdx ; trap=int_divz ; movq %rax, %rcx -; xorq %rdx, %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx, %rdx ; div %rax, %rdx, %rsi, %rax, %rdx ; trap=int_divz ; movq %rcx, %rax ; movq %rbp, %rsp @@ -155,8 +155,8 @@ block0(v0: i64, v1: i64): ; movq %rdi, %rax ; divq %rsi ; trap: int_divz ; movq %rax, %rcx -; xorq %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx ; divq %rsi ; trap: int_divz ; movq %rcx, %rax ; movq %rbp, %rsp diff --git a/cranelift/filetests/filetests/isa/x64/urem.clif b/cranelift/filetests/filetests/isa/x64/urem.clif index 50a63d9402a5..e886fcc94f25 100644 --- a/cranelift/filetests/filetests/isa/x64/urem.clif +++ b/cranelift/filetests/filetests/isa/x64/urem.clif @@ -40,8 +40,8 @@ block0(v0: i16, v1: i16): ; pushq %rbp ; movq %rsp, %rbp ; block0: -; xorq %rdx, %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx, %rdx ; div %ax, %dx, %si, %ax, %dx ; trap=int_divz ; movq %rdx, %rax ; movq %rbp, %rsp @@ -53,8 +53,8 @@ block0(v0: i16, v1: i16): ; pushq %rbp ; movq %rsp, %rbp ; block1: ; offset 0x4 -; xorq %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx ; divw %si ; trap: int_divz ; movq %rdx, %rax ; movq %rbp, %rsp @@ -71,8 +71,8 @@ block0(v0: i32, v1: i32): ; pushq %rbp ; movq %rsp, %rbp ; block0: -; xorq %rdx, %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx, %rdx ; div %eax, %edx, %esi, %eax, %edx ; trap=int_divz ; movq %rdx, %rax ; movq %rbp, %rsp @@ -84,8 +84,8 @@ block0(v0: i32, v1: i32): ; pushq %rbp ; movq %rsp, %rbp ; block1: ; offset 0x4 -; xorq %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx ; divl %esi ; trap: int_divz ; movq %rdx, %rax ; movq %rbp, %rsp @@ -102,8 +102,8 @@ block0(v0: i64, v1: i64): ; pushq %rbp ; movq %rsp, %rbp ; block0: -; xorq %rdx, %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx, %rdx ; div %rax, %rdx, %rsi, %rax, %rdx ; trap=int_divz ; movq %rdx, %rax ; movq %rbp, %rsp @@ -115,8 +115,8 @@ block0(v0: i64, v1: i64): ; pushq %rbp ; movq %rsp, %rbp ; block1: ; offset 0x4 -; xorq %rdx, %rdx ; movq %rdi, %rax +; xorq %rdx, %rdx ; divq %rsi ; trap: int_divz ; movq %rdx, %rax ; movq %rbp, %rsp diff --git a/cranelift/filetests/filetests/isa/x64/user_stack_maps.clif b/cranelift/filetests/filetests/isa/x64/user_stack_maps.clif index 3ebdc9d5cc9c..dc258661bdf4 100644 --- a/cranelift/filetests/filetests/isa/x64/user_stack_maps.clif +++ b/cranelift/filetests/filetests/isa/x64/user_stack_maps.clif @@ -36,37 +36,40 @@ block0: ; movq %rsp, %rbp ; subq %rsp, $48, %rsp ; movq %rbx, 16(%rsp) -; movq %r14, 24(%rsp) +; movq %r13, 24(%rsp) ; movq %r15, 32(%rsp) ; block0: -; xorl %ebx, %ebx, %ebx -; movl $1, %r14d -; movl $2, %r15d +; xorl %edi, %edi, %edi +; movq %rdi, %r15 +; movl $1, %edi +; movq %rdi, %rbx +; movl $2, %edi +; movq %rdi, %r13 ; lea rsp(0 + virtual offset), %r11 ; movl $0, 0(%r11) ; lea rsp(4 + virtual offset), %rsi ; movl $1, 0(%rsi) ; lea rsp(8 + virtual offset), %rdi ; movl $2, 0(%rdi) -; movq %rbx, %rdi +; movq %r15, %rdi ; call User(userextname0) ; ; UserStackMap { by_type: [(types::I32, CompoundBitSet {0, 4, 8})], sp_to_sized_stack_slots: None } ; lea rsp(0 + virtual offset), %rcx ; movl $1, 0(%rcx) ; lea rsp(4 + virtual offset), %rdx ; movl $2, 0(%rdx) -; movq %rbx, %rdi +; movq %r15, %rdi ; call User(userextname0) ; ; UserStackMap { by_type: [(types::I32, CompoundBitSet {0, 4})], sp_to_sized_stack_slots: None } ; lea rsp(0 + virtual offset), %r9 ; movl $2, 0(%r9) -; movq %r14, %rdi +; movq %rbx, %rdi ; call User(userextname0) ; ; UserStackMap { by_type: [(types::I32, CompoundBitSet {0})], sp_to_sized_stack_slots: None } -; movq %r15, %rdi +; movq %r13, %rdi ; call User(userextname0) ; movq 16(%rsp), %rbx -; movq 24(%rsp), %r14 +; movq 24(%rsp), %r13 ; movq 32(%rsp), %r15 ; addq %rsp, $48, %rsp ; movq %rbp, %rsp @@ -79,34 +82,37 @@ block0: ; movq %rsp, %rbp ; subq $0x30, %rsp ; movq %rbx, 0x10(%rsp) -; movq %r14, 0x18(%rsp) +; movq %r13, 0x18(%rsp) ; movq %r15, 0x20(%rsp) ; block1: ; offset 0x17 -; xorl %ebx, %ebx -; movl $1, %r14d -; movl $2, %r15d +; xorl %edi, %edi +; movq %rdi, %r15 +; movl $1, %edi +; movq %rdi, %rbx +; movl $2, %edi +; movq %rdi, %r13 ; leaq (%rsp), %r11 ; movl $0, (%r11) ; leaq 4(%rsp), %rsi ; movl $1, (%rsi) ; leaq 8(%rsp), %rdi ; movl $2, (%rdi) -; movq %rbx, %rdi -; callq 0x4e ; reloc_external CallPCRel4 u0:0 -4 +; movq %r15, %rdi +; callq 0x55 ; reloc_external CallPCRel4 u0:0 -4 ; leaq (%rsp), %rcx ; movl $1, (%rcx) ; leaq 4(%rsp), %rdx ; movl $2, (%rdx) -; movq %rbx, %rdi -; callq 0x6b ; reloc_external CallPCRel4 u0:0 -4 +; movq %r15, %rdi +; callq 0x72 ; reloc_external CallPCRel4 u0:0 -4 ; leaq (%rsp), %r9 ; movl $2, (%r9) -; movq %r14, %rdi -; callq 0x7e ; reloc_external CallPCRel4 u0:0 -4 -; movq %r15, %rdi -; callq 0x86 ; reloc_external CallPCRel4 u0:0 -4 +; movq %rbx, %rdi +; callq 0x85 ; reloc_external CallPCRel4 u0:0 -4 +; movq %r13, %rdi +; callq 0x8d ; reloc_external CallPCRel4 u0:0 -4 ; movq 0x10(%rsp), %rbx -; movq 0x18(%rsp), %r14 +; movq 0x18(%rsp), %r13 ; movq 0x20(%rsp), %r15 ; addq $0x30, %rsp ; movq %rbp, %rsp @@ -146,31 +152,31 @@ block0(v0: i8, v1: i16, v2: i32, v3: i64, v4: f32, v5: f64): ; movq %r8, %r13 ; lea rsp(0 + virtual offset), %r8 ; movb %dil, 0(%r8) -; movq %rdi, %r15 +; movq %rdi, %rbx ; lea rsp(8 + virtual offset), %r8 ; movw %si, 0(%r8) -; movq %rsi, %r12 +; movq %rsi, %r14 ; lea rsp(16 + virtual offset), %r9 ; movl %edx, 0(%r9) -; movq %rdx, %rbx +; movq %rdx, %r12 ; lea rsp(20 + virtual offset), %r10 ; movss %xmm0, 0(%r10) ; movdqu %xmm0, rsp(96 + virtual offset) ; lea rsp(24 + virtual offset), %r11 ; movq %rcx, 0(%r11) -; movq %rcx, %r14 +; movq %rcx, %r15 ; lea rsp(32 + virtual offset), %rsi ; movsd %xmm1, 0(%rsi) ; movdqu %xmm1, rsp(112 + virtual offset) ; call User(userextname0) ; ; UserStackMap { by_type: [(types::I8, CompoundBitSet {0}), (types::I16, CompoundBitSet {8}), (types::I32, CompoundBitSet {16}), (types::F32, CompoundBitSet {20}), (types::I64, CompoundBitSet {24}), (types::F64, CompoundBitSet {32})], sp_to_sized_stack_slots: None } -; movq %rbx, %rdx +; movq %r12, %rdx ; movq %r13, %r8 ; movl %edx, 0(%r8) -; movq %r14, %rcx +; movq %r15, %rcx ; movq %rcx, 8(%r8) -; movq %r15, %rax -; movq %r12, %rdx +; movq %rbx, %rax +; movq %r14, %rdx ; movdqu rsp(96 + virtual offset), %xmm0 ; movdqu rsp(112 + virtual offset), %xmm1 ; movq 128(%rsp), %rbx @@ -197,30 +203,30 @@ block0(v0: i8, v1: i16, v2: i32, v3: i64, v4: f32, v5: f64): ; movq %r8, %r13 ; leaq (%rsp), %r8 ; movb %dil, (%r8) -; movq %rdi, %r15 +; movq %rdi, %rbx ; leaq 8(%rsp), %r8 ; movw %si, (%r8) -; movq %rsi, %r12 +; movq %rsi, %r14 ; leaq 0x10(%rsp), %r9 ; movl %edx, (%r9) -; movq %rdx, %rbx +; movq %rdx, %r12 ; leaq 0x14(%rsp), %r10 ; movss %xmm0, (%r10) ; movdqu %xmm0, 0x60(%rsp) ; leaq 0x18(%rsp), %r11 ; movq %rcx, (%r11) -; movq %rcx, %r14 +; movq %rcx, %r15 ; leaq 0x20(%rsp), %rsi ; movsd %xmm1, (%rsi) ; movdqu %xmm1, 0x70(%rsp) ; callq 0x86 ; reloc_external CallPCRel4 u0:0 -4 -; movq %rbx, %rdx +; movq %r12, %rdx ; movq %r13, %r8 ; movl %edx, (%r8) -; movq %r14, %rcx +; movq %r15, %rcx ; movq %rcx, 8(%r8) -; movq %r15, %rax -; movq %r12, %rdx +; movq %rbx, %rax +; movq %r14, %rdx ; movdqu 0x60(%rsp), %xmm0 ; movdqu 0x70(%rsp), %xmm1 ; movq 0x80(%rsp), %rbx diff --git a/cranelift/filetests/filetests/isa/x64/winch.clif b/cranelift/filetests/filetests/isa/x64/winch.clif index 56d042e9cde4..9a9fce756b45 100644 --- a/cranelift/filetests/filetests/isa/x64/winch.clif +++ b/cranelift/filetests/filetests/isa/x64/winch.clif @@ -132,10 +132,10 @@ block0(v0:i64, v1:i64, v2:i64, v3:i64, v4:i64, v5:i64): ; pushq %rbp ; movq %rsp, %rbp ; block0: -; load_ext_name %g+0, %r10 ; movq %rdi, %rax ; movq %r9, %rdi ; movq %rax, %r9 +; load_ext_name %g+0, %r10 ; call *%r10 ; movq %rbp, %rsp ; popq %rbp @@ -146,10 +146,10 @@ block0(v0:i64, v1:i64, v2:i64, v3:i64, v4:i64, v5:i64): ; pushq %rbp ; movq %rsp, %rbp ; block1: ; offset 0x4 -; movabsq $0, %r10 ; reloc_external Abs8 %g 0 ; movq %rdi, %rax ; movq %r9, %rdi ; movq %rax, %r9 +; movabsq $0, %r10 ; reloc_external Abs8 %g 0 ; callq *%r10 ; movq %rbp, %rsp ; popq %rbp @@ -174,10 +174,10 @@ block0(v0:i64, v1:i64, v2:i64, v3:i64, v4:i64, v5:i64): ; movq %r14, 24(%rsp) ; movq %r15, 32(%rsp) ; block0: -; load_ext_name %g+0, %r10 ; movq %rdi, %rax ; movq %r9, %rdi ; movq %rax, %r9 +; load_ext_name %g+0, %r10 ; call *%r10 ; movq 0(%rsp), %rbx ; movq 8(%rsp), %r12 @@ -200,10 +200,10 @@ block0(v0:i64, v1:i64, v2:i64, v3:i64, v4:i64, v5:i64): ; movq %r14, 0x18(%rsp) ; movq %r15, 0x20(%rsp) ; block1: ; offset 0x20 -; movabsq $0, %r10 ; reloc_external Abs8 %g 0 ; movq %rdi, %rax ; movq %r9, %rdi ; movq %rax, %r9 +; movabsq $0, %r10 ; reloc_external Abs8 %g 0 ; callq *%r10 ; movq (%rsp), %rbx ; movq 8(%rsp), %r12 @@ -349,10 +349,10 @@ block0(v0: i32, v1: i64, v2: i32, v3: i64): ; pushq %rbp ; movq %rsp, %rbp ; block0: +; movq %rdi, %rax ; movq %rcx, 12(%r8) ; movl %edx, 8(%r8) ; movq %rsi, 0(%r8) -; movq %rdi, %rax ; movq %rbp, %rsp ; popq %rbp ; ret @@ -362,10 +362,10 @@ block0(v0: i32, v1: i64, v2: i32, v3: i64): ; pushq %rbp ; movq %rsp, %rbp ; block1: ; offset 0x4 +; movq %rdi, %rax ; movq %rcx, 0xc(%r8) ; movl %edx, 8(%r8) ; movq %rsi, (%r8) -; movq %rdi, %rax ; movq %rbp, %rsp ; popq %rbp ; retq diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index 4624fdcfe6a9..312abdbb9d57 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -171,7 +171,7 @@ notes = "We (Bytecode Alliance) are the primary authors of regalloc2 and co-deve [[wildcard-audits.regalloc2]] who = "Trevor Elliott " criteria = "safe-to-deploy" -user-id = 187138 # Trevor Elliott (elliottt) +user-id = 187138 start = "2022-11-29" end = "2025-07-30" notes = """ diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock index d7e34d94470b..e1f81c500991 100644 --- a/supply-chain/imports.lock +++ b/supply-chain/imports.lock @@ -857,13 +857,6 @@ user-id = 3726 user-login = "cfallin" user-name = "Chris Fallin" -[[publisher.regalloc2]] -version = "0.9.4" -when = "2024-08-30" -user-id = 187138 -user-login = "elliottt" -user-name = "Trevor Elliott" - [[publisher.regex]] version = "1.9.1" when = "2023-07-07"