Skip to content

Commit d4e191c

Browse files
authored
Merge branch 'main' into component-attestation
2 parents 8e9f052 + b56706f commit d4e191c

File tree

86 files changed

+2854
-1564
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2854
-1564
lines changed

Cargo.lock

Lines changed: 95 additions & 180 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ component-async-tests = { path = "crates/misc/component-async-tests" }
317317

318318
# Bytecode Alliance maintained dependencies:
319319
# ---------------------------
320-
regalloc2 = "0.13.2"
320+
regalloc2 = "0.13.3"
321321

322322
# cap-std family:
323323
target-lexicon = "0.13.0"
@@ -330,25 +330,25 @@ cap-tempfile = "3.4.5"
330330
fs-set-times = "0.20.3"
331331
system-interface = { version = "0.27.3", features = ["cap_std_impls"] }
332332
io-lifetimes = { version = "2.0.3", default-features = false }
333-
io-extras = "0.18.1"
333+
io-extras = "0.18.4"
334334
rustix = "1.0.8"
335335
# wit-bindgen:
336-
wit-bindgen = { version = "0.46.0", default-features = false }
337-
wit-bindgen-rust-macro = { version = "0.46.0", default-features = false }
336+
wit-bindgen = { version = "0.48.0", default-features = false }
337+
wit-bindgen-rust-macro = { version = "0.48.0", default-features = false }
338338

339339
# wasm-tools family:
340-
wasmparser = { version = "0.240.0", default-features = false, features = ['simd'] }
341-
wat = "1.240.0"
342-
wast = "240.0.0"
343-
wasmprinter = "0.240.0"
344-
wasm-encoder = "0.240.0"
345-
wasm-smith = "0.240.0"
346-
wasm-mutate = "0.240.0"
347-
wit-parser = "0.240.0"
348-
wit-component = "0.240.0"
349-
wasm-wave = "0.240.0"
350-
wasm-compose = "0.240.0"
351-
json-from-wast = "0.240.0"
340+
wasmparser = { version = "0.241.0", default-features = false, features = ['simd'] }
341+
wat = "1.241.0"
342+
wast = "241.0.0"
343+
wasmprinter = "0.241.0"
344+
wasm-encoder = "0.241.0"
345+
wasm-smith = "0.241.0"
346+
wasm-mutate = "0.241.0"
347+
wit-parser = "0.241.0"
348+
wit-component = "0.241.0"
349+
wasm-wave = "0.241.0"
350+
wasm-compose = "0.241.0"
351+
json-from-wast = "0.241.0"
352352

353353
# Non-Bytecode Alliance maintained dependencies:
354354
# --------------------------
@@ -359,7 +359,7 @@ object = { version = "0.37.3", default-features = false, features = ['read_core'
359359
gimli = { version = "0.32.3", default-features = false, features = ['read'] }
360360
addr2line = { version = "0.25.1", default-features = false }
361361
anyhow = { version = "1.0.100", default-features = false }
362-
windows-sys = "0.60.2"
362+
windows-sys = "0.61.2"
363363
env_logger = "0.11.5"
364364
log = { version = "0.4.28", default-features = false }
365365
clap = { version = "4.5.48", default-features = false, features = ["std", "derive"] }
@@ -391,7 +391,7 @@ tempfile = "3.23.0"
391391
filecheck = "0.5.0"
392392
libc = { version = "0.2.177", default-features = true }
393393
file-per-thread-logger = "0.2.0"
394-
tokio = { version = "1.47.1", features = [ "rt", "time" ] }
394+
tokio = { version = "1.48.0", features = [ "rt", "time" ] }
395395
hyper = "1.7.0"
396396
http = "1.3.1"
397397
http-body = "1.0.1"

cranelift/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ capstone = { workspace = true, optional = true }
4040
target-lexicon = { workspace = true, features = ["std"] }
4141
env_logger = { workspace = true }
4242
rayon = { version = "1", optional = true }
43-
indicatif = "0.13.0"
4443
thiserror = { workspace = true }
4544
walkdir = { workspace = true }
4645
anyhow = { workspace = true }

cranelift/codegen/src/isa/s390x/lower.isle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3948,6 +3948,15 @@
39483948
(add_logical_mem_zext32_with_flags_paired ty y (sink_uload32 x))
39493949
(trap_if_impl (mask_as_cond 3) tc)))
39503950

3951+
;;;; Rules for `uadd_overflow` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3952+
3953+
(rule 0 (lower (has_type (ty_32_or_64 ty) (uadd_overflow x y)))
3954+
(let ((sum Reg (add_reg ty x y))
3955+
(overflow Reg
3956+
(lower_bool $I8
3957+
(bool (icmpu_reg ty sum x) (intcc_as_cond (IntCC.UnsignedLessThan))))))
3958+
(output_pair sum overflow)))
3959+
39513960
;;;; Rules for `return` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
39523961

39533962
(rule (lower (return args))

cranelift/codegen/src/opts/icmp.isle

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,3 +350,29 @@
350350
(if-let true (i64_lt x 0))
351351
(iconst_u ty 0))
352352

353+
;; (x < y) & (x ≠ -1) = (x < y)
354+
(rule
355+
(simplify (band ty (ne ty x (iconst_s _ -1)) (ugt ty y x)))
356+
(ult ty x y))
357+
(rule
358+
(simplify (band ty (ne ty x (iconst_s _ -1)) (ult ty x z)))
359+
(ult ty x z))
360+
(rule
361+
(simplify (band ty (ne ty (iconst_s _ -1) x) (ugt ty y x)))
362+
(ult ty x y))
363+
(rule
364+
(simplify (band ty (ne ty (iconst_s _ -1) x) (ult ty x z)))
365+
(ult ty x z))
366+
(rule
367+
(simplify (band ty (ugt ty x y) (ne ty y (iconst_s _ -1))))
368+
(ult ty y x))
369+
(rule
370+
(simplify (band ty (ugt ty x y) (ne ty (iconst_s _ -1) y)))
371+
(ult ty y x))
372+
(rule
373+
(simplify (band ty (ult ty x y) (ne ty x (iconst_s _ -1))))
374+
(ult ty x y))
375+
(rule
376+
(simplify (band ty (ult ty x y) (ne ty (iconst_s _ -1) x)))
377+
(ult ty x y))
378+

cranelift/filetests/filetests/egraph/icmp.clif

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,3 +405,19 @@ block0(v0: i32):
405405
; return v9 ; v9 = 0
406406
; }
407407

408+
;; (x <u y) & (x != -1) => (x <_u y)
409+
function %test_ult_ne_minus_one(i32, i32) -> i8 fast {
410+
block0(v0: i32, v1: i32):
411+
v2 = icmp ult v0, v1
412+
v3 = iconst.i32 -1
413+
v4 = icmp ne v0, v3
414+
v5 = band v2, v4
415+
return v5
416+
}
417+
418+
; function %test_ult_ne_minus_one(i32, i32) -> i8 fast {
419+
; block0(v0: i32, v1: i32):
420+
; v6 = icmp ult v0, v1
421+
; return v6
422+
; }
423+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
test compile precise-output
2+
target s390x
3+
4+
function %f2(i32, i32) -> i32, i8 {
5+
block0(v0: i32, v1: i32):
6+
v2, v3 = uadd_overflow v0, v1
7+
return v2, v3
8+
}
9+
10+
; VCode:
11+
; block0:
12+
; ark %r5, %r2, %r3
13+
; clr %r5, %r2
14+
; lhi %r3, 0
15+
; lochil %r3, 1
16+
; lgr %r2, %r5
17+
; br %r14
18+
;
19+
; Disassembled:
20+
; block0: ; offset 0x0
21+
; ark %r5, %r2, %r3
22+
; clr %r5, %r2
23+
; lhi %r3, 0
24+
; lochil %r3, 1
25+
; lgr %r2, %r5
26+
; br %r14
27+
28+
function %f4(i64, i64) -> i64, i8 {
29+
block0(v0: i64, v1: i64):
30+
v2, v3 = uadd_overflow v0, v1
31+
return v2, v3
32+
}
33+
34+
; VCode:
35+
; block0:
36+
; agrk %r5, %r2, %r3
37+
; clgr %r5, %r2
38+
; lhi %r3, 0
39+
; lochil %r3, 1
40+
; lgr %r2, %r5
41+
; br %r14
42+
;
43+
; Disassembled:
44+
; block0: ; offset 0x0
45+
; agrk %r5, %r2, %r3
46+
; clgr %r5, %r2
47+
; lhi %r3, 0
48+
; lochil %r3, 1
49+
; lgr %r2, %r5
50+
; br %r14
51+

cranelift/filetests/filetests/runtests/icmp.clif

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,14 @@ block0(v0: i32):
159159

160160
; run: %test_ult_sgt_neg_const_x(42) == 0
161161

162+
;; (x <u y) & (x != -1) => (x <_u y)
163+
function %test_ult_ne_minus_one(i32, i32) -> i8 {
164+
block0(v0: i32, v1: i32):
165+
v2 = icmp ult v0, v1
166+
v3 = iconst.i32 -1
167+
v4 = icmp ne v0, v3
168+
v5 = band v2, v4
169+
return v5
170+
}
171+
; run: %test_ult_ne_minus_one(3, 5) == 1
172+
; run: %test_ult_ne_minus_one(-1, 1) == 0

cranelift/filetests/filetests/runtests/uadd_overflow.clif

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
test interpret
22
test run
33
set enable_llvm_abi_extensions=true
4-
target aarch64
54
set enable_multi_ret_implicit_sret
65
target x86_64
6+
target aarch64
77
target riscv64
8+
target s390x
89
target pulley32
910
target pulley32be
1011
target pulley64

0 commit comments

Comments
 (0)