[ DartFuzz ] Disable floating point operations when comparing different architectures

Comparing floating point results from different architectures can lead
to false divergences due to floating point errors or slightly different
implementations of specific operations (e.g., Float32x4.clamp behaves
differently around 0.0 for ARM and x64).

Should fix false divergences related to https://github.com/dart-lang/sdk/issues/40426

Change-Id: Ife0ab07d20e87add4e754e328bb8f7389920021d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134573
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This commit is contained in:
Ben Konyi 2020-02-06 02:00:49 +00:00 committed by commit-bot@chromium.org
parent 3598d4340d
commit aadcb4418b

View file

@ -373,9 +373,9 @@ class DartFuzzTest {
// Testcase generation flags.
// Only use FP when modes have same precision (to avoid false
// Only use FP when modes have the same architecture (to avoid false
// divergences between 32-bit and 64-bit versions).
fp = samePrecision(mode1, mode2);
fp = sameArchitecture(mode1, mode2);
// Occasionally test FFI (if capable).
ffi = ffiCapable(mode1, mode2) && (rand.nextInt(5) == 0);
// Resort to flat types for the more expensive modes.
@ -404,8 +404,11 @@ class DartFuzzTest {
skippedSeeds = {};
}
bool samePrecision(String mode1, String mode2) =>
mode1.contains('64') == mode2.contains('64');
bool sameArchitecture(String mode1, String mode2) =>
((mode1.contains('arm32') && mode2.contains('arm32')) ||
(mode1.contains('arm64') && mode2.contains('arm64')) ||
(mode1.contains('x64') && mode2.contains('x64')) ||
(mode1.contains('ia32') && mode2.contains('ia32')));
bool ffiCapable(String mode1, String mode2) =>
(mode1.startsWith('jit') || mode1.startsWith('kbc')) &&