[wasm][interpreter] Print float in hex representation

The interpreter is used for testing (including fuzzing) only, and in
these cases it's often important to see the exact value of a float. Both
decimal and scientific notation does not show the full value though, and
decimal representation can also be really long for large values, making
it hard to compare values.
This CL switches this debug output to hexadecimal float values, which
always shows the float value in full precision and is also much shorter
than decimal notation in many cases.

R=ahaas@chromium.org

Bug: chromium:1112099
Change-Id: Ia84824227fcd2f1e763ab89280a202ed44930a71
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2346646
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69323}
This commit is contained in:
Clemens Backes 2020-08-10 16:17:26 +02:00 committed by Commit Bot
parent 3bd6d14160
commit 64dfb0b4ad

View File

@ -3720,10 +3720,10 @@ class WasmInterpreterInternals {
PrintF("i64:%" PRId64 "", val.to<int64_t>());
break;
case ValueType::kF32:
PrintF("f32:%f", val.to<float>());
PrintF("f32:%a", val.to<float>());
break;
case ValueType::kF64:
PrintF("f64:%lf", val.to<double>());
PrintF("f64:%la", val.to<double>());
break;
case ValueType::kS128: {
// This defaults to tracing all S128 values as i32x4 values for now,