fuzzgen: Add a few more ops#5201
Conversation
jameysharp
left a comment
There was a problem hiding this comment.
Thanks! I have some small requests and a bigger one here.
| // SelectSpectreGuard | ||
| // select_spectre_guard is only implemented on x86_64 and aarch64 | ||
| // when a icmp is preceding it. | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I8, I8, I8], &[I8], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I8, I16, I16], &[I16], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I8, I32, I32], &[I32], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I8, I64, I64], &[I64], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I8, I128, I128], &[I128], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I16, I8, I8], &[I8], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I16, I16, I16], &[I16], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I16, I32, I32], &[I32], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I16, I64, I64], &[I64], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I16, I128, I128], &[I128], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I32, I8, I8], &[I8], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I32, I16, I16], &[I16], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I32, I32, I32], &[I32], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I32, I64, I64], &[I64], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I32, I128, I128], &[I128], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I64, I8, I8], &[I8], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I64, I16, I16], &[I16], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I64, I32, I32], &[I32], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I64, I64, I64], &[I64], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I64, I128, I128], &[I128], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I128, I8, I8], &[I8], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I128, I16, I16], &[I16], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I128, I32, I32], &[I32], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I128, I64, I64], &[I64], insert_opcode), | ||
| #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] | ||
| (Opcode::SelectSpectreGuard, &[I128, I128, I128], &[I128], insert_opcode), |
There was a problem hiding this comment.
I'm a little hesitant to add opcodes to this list where we have to disable all versions of the opcode on all of the architectures that we're actually fuzzing on. I suppose we could add an insert_select_spectre_guard function that generates an icmp first. It's not great in the long run, since I like your idea of eventually generating this table from the meta instruction definitions. But it would get us some more fuzz test coverage quickly, at least.
There was a problem hiding this comment.
Yeah, I don't mind adding that for now.
I didn't open issues for select_spectre_guard since I wasn't sure, but are we planning on implementing that? Or does that opcode only make sense when paired with something else?
There was a problem hiding this comment.
That's a good question! I've opened #5206 for it.
There was a problem hiding this comment.
👍 Thanks!
I've added the special insert_select_spectre_guard, and surprisingly this works for all variations of select_spectre_guard.
I'll wait for a decision to be reached on #5206 before opening the "missing lowerings" issues.
|
🤦♂️ Oh I forgot to push the updated version with the links and the additionally disabled |
675ae77 to
665b8b5
Compare
Adds `bitselect`,`select` and `select_spectre_guard`
665b8b5 to
485f81b
Compare
👋 Hey,
This adds
bitselect,selectandselect_spectre_guardto the fuzzgen list of ops.Fuzzing on x86 & AArch64 for the past couple of hours has not raised any issues.