Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pulley: Get align.wast passing #9789

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cranelift/codegen/src/isa/pulley_shared/lower.isle
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,16 @@
(rule (lower (has_type ty (iconst (u64_from_imm64 n))))
(imm ty n))

;;;; Rules for `f32const`;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(rule (lower (f32const (u32_from_ieee32 x)))
(pulley_fconst32 x))

;;;; Rules for `f64const`;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(rule (lower (f64const (u64_from_ieee64 x)))
(pulley_fconst64 x))

;;;; Rules for `iadd` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(rule (lower (has_type $I8 (iadd a b)))
Expand Down
18 changes: 0 additions & 18 deletions crates/wast-util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@ impl WastTest {
"misc_testsuite/br-table-fuzzbug.wast",
"misc_testsuite/call_indirect.wast",
"misc_testsuite/component-model/fused.wast",
"misc_testsuite/component-model/simple.wast",
"misc_testsuite/component-model/strings.wast",
"misc_testsuite/div-rem.wast",
"misc_testsuite/embenchen_fannkuch.wast",
Expand All @@ -416,16 +415,13 @@ impl WastTest {
"misc_testsuite/gc/i31ref-of-global-initializers.wast",
"misc_testsuite/gc/i31ref-tables.wast",
"misc_testsuite/gc/ref-test.wast",
"misc_testsuite/gc/struct-instructions.wast",
"misc_testsuite/int-to-float-splat.wast",
"misc_testsuite/issue1809.wast",
"misc_testsuite/issue4840.wast",
"misc_testsuite/issue4890.wast",
"misc_testsuite/issue6562.wast",
"misc_testsuite/issue694.wast",
"misc_testsuite/many_table_gets_lead_to_gc.wast",
"misc_testsuite/memory-combos.wast",
"misc_testsuite/memory64/codegen.wast",
"misc_testsuite/memory64/simd.wast",
"misc_testsuite/memory64/threads.wast",
"misc_testsuite/misc_traps.wast",
Expand Down Expand Up @@ -458,22 +454,17 @@ impl WastTest {
"misc_testsuite/winch/_simd_load.wast",
"misc_testsuite/winch/_simd_multivalue.wast",
"misc_testsuite/winch/_simd_store.wast",
"misc_testsuite/winch/br_table.wast",
"misc_testsuite/winch/float-comparison.wast",
"misc_testsuite/winch/global.wast",
"misc_testsuite/winch/select.wast",
"misc_testsuite/winch/table_fill.wast",
"misc_testsuite/winch/table_get.wast",
"misc_testsuite/winch/table_set.wast",
"spec_testsuite/align.wast",
"spec_testsuite/block.wast",
"spec_testsuite/br.wast",
"spec_testsuite/br_if.wast",
"spec_testsuite/br_table.wast",
"spec_testsuite/bulk.wast",
"spec_testsuite/call.wast",
"spec_testsuite/call_indirect.wast",
"spec_testsuite/const.wast",
"spec_testsuite/conversions.wast",
"spec_testsuite/elem.wast",
"spec_testsuite/endianness.wast",
Expand All @@ -486,9 +477,7 @@ impl WastTest {
"spec_testsuite/fac.wast",
"spec_testsuite/float_exprs.wast",
"spec_testsuite/float_literals.wast",
"spec_testsuite/float_memory.wast",
"spec_testsuite/float_misc.wast",
"spec_testsuite/func.wast",
"spec_testsuite/func_ptrs.wast",
"spec_testsuite/global.wast",
"spec_testsuite/i32.wast",
Expand All @@ -506,19 +495,13 @@ impl WastTest {
"spec_testsuite/loop.wast",
"spec_testsuite/memory.wast",
"spec_testsuite/memory_grow.wast",
"spec_testsuite/memory_redundancy.wast",
"spec_testsuite/nop.wast",
"spec_testsuite/proposals/annotations/simd_lane.wast",
"spec_testsuite/proposals/extended-const/elem.wast",
"spec_testsuite/proposals/extended-const/global.wast",
"spec_testsuite/proposals/multi-memory/align.wast",
"spec_testsuite/proposals/multi-memory/align0.wast",
"spec_testsuite/proposals/multi-memory/float_exprs0.wast",
"spec_testsuite/proposals/multi-memory/float_exprs1.wast",
"spec_testsuite/proposals/multi-memory/float_memory0.wast",
"spec_testsuite/proposals/multi-memory/imports.wast",
"spec_testsuite/proposals/multi-memory/imports0.wast",
"spec_testsuite/proposals/multi-memory/imports3.wast",
"spec_testsuite/proposals/multi-memory/linking0.wast",
"spec_testsuite/proposals/multi-memory/linking3.wast",
"spec_testsuite/proposals/multi-memory/load.wast",
Expand All @@ -538,7 +521,6 @@ impl WastTest {
"spec_testsuite/proposals/threads/memory.wast",
"spec_testsuite/ref_func.wast",
"spec_testsuite/ref_is_null.wast",
"spec_testsuite/return.wast",
"spec_testsuite/select.wast",
"spec_testsuite/simd_address.wast",
"spec_testsuite/simd_align.wast",
Expand Down
10 changes: 10 additions & 0 deletions pulley/src/interp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,16 @@ impl OpVisitor for Interpreter<'_> {
self.state[operands.dst].set_u64(a | b);
ControlFlow::Continue(())
}

fn fconst32(&mut self, dst: FReg, bits: u32) -> ControlFlow<Done> {
self.state[dst].set_f32(f32::from_bits(bits));
ControlFlow::Continue(())
}

fn fconst64(&mut self, dst: FReg, bits: u64) -> ControlFlow<Done> {
self.state[dst].set_f64(f64::from_bits(bits));
ControlFlow::Continue(())
}
}

impl ExtendedOpVisitor for Interpreter<'_> {
Expand Down
5 changes: 5 additions & 0 deletions pulley/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,11 @@ macro_rules! for_each_op {
xor32 = XOr32 { operands: BinaryOperands<XReg> };
/// `dst = src1 | src2`
xor64 = XOr64 { operands: BinaryOperands<XReg> };

/// `low32(dst) = bits`
fconst32 = FConst32 { dst: FReg, bits: u32 };
/// `dst = bits`
fconst64 = FConst64 { dst: FReg, bits: u64 };
}
};
}
Expand Down
Loading