From 307945877e7b800bd12b5932c4c64eae61888235 Mon Sep 17 00:00:00 2001 From: Afonso Bordado Date: Tue, 20 Dec 2022 00:39:33 +0000 Subject: [PATCH] fuzzgen: Add `srem`/`urem` (#5476) --- cranelift/fuzzgen/src/function_generator.rs | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/cranelift/fuzzgen/src/function_generator.rs b/cranelift/fuzzgen/src/function_generator.rs index cb8019bae4..ebdd89a5c2 100644 --- a/cranelift/fuzzgen/src/function_generator.rs +++ b/cranelift/fuzzgen/src/function_generator.rs @@ -304,6 +304,28 @@ const OPCODE_SIGNATURES: &'static [( // aarch64: https://github.com/bytecodealliance/wasmtime/issues/4864 #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] (Opcode::Sdiv, &[I128, I128], &[I128], insert_opcode), + // Urem + (Opcode::Urem, &[I8, I8], &[I8], insert_opcode), + (Opcode::Urem, &[I16, I16], &[I16], insert_opcode), + (Opcode::Urem, &[I32, I32], &[I32], insert_opcode), + (Opcode::Urem, &[I64, I64], &[I64], insert_opcode), + // urem.i128 not implemented in some backends: + // x64: https://github.com/bytecodealliance/wasmtime/issues/5474 + // aarch64: https://github.com/bytecodealliance/wasmtime/issues/5472 + #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] + (Opcode::Urem, &[I128, I128], &[I128], insert_opcode), + // Srem + // Issues on x64: https://github.com/bytecodealliance/wasmtime/issues/5470 + #[cfg(not(target_arch = "x86_64"))] + (Opcode::Srem, &[I8, I8], &[I8], insert_opcode), + (Opcode::Srem, &[I16, I16], &[I16], insert_opcode), + (Opcode::Srem, &[I32, I32], &[I32], insert_opcode), + (Opcode::Srem, &[I64, I64], &[I64], insert_opcode), + // srem.i128 not implemented in some backends: + // x64: https://github.com/bytecodealliance/wasmtime/issues/5474 + // aarch64: https://github.com/bytecodealliance/wasmtime/issues/5472 + #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] + (Opcode::Srem, &[I128, I128], &[I128], insert_opcode), // Ineg (Opcode::Ineg, &[I8, I8], &[I8], insert_opcode), (Opcode::Ineg, &[I16, I16], &[I16], insert_opcode),