Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Unified Diff: src/compiler/instruction.h

Issue 2639353002: [wasm] Fix I32ReinterpretF32 and I64ReinterpretF64 on ia32. (Closed)
Patch Set: update a comment Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler/instruction.h
diff --git a/src/compiler/instruction.h b/src/compiler/instruction.h
index e63ceda14846cf1ecd65c44eb41a7f9247b04b94..1655ea92170545f8b4268922b7e575f9c43ec778 100644
--- a/src/compiler/instruction.h
+++ b/src/compiler/instruction.h
@@ -1069,12 +1069,23 @@ class V8_EXPORT_PRIVATE Constant final {
return bit_cast<float>(static_cast<int32_t>(value_));
}
+ int32_t ToFloat32AsInt() const {
+ DCHECK_EQ(kFloat32, type());
+ return static_cast<int32_t>(value_);
+ }
+
double ToFloat64() const {
if (type() == kInt32) return ToInt32();
DCHECK_EQ(kFloat64, type());
return bit_cast<double>(value_);
}
+ int64_t ToFloat64AsInt() const {
+ if (type() == kInt32) return ToInt32();
+ DCHECK_EQ(kFloat64, type());
+ return value_;
+ }
+
ExternalReference ToExternalReference() const {
DCHECK_EQ(kExternalReference, type());
return bit_cast<ExternalReference>(static_cast<intptr_t>(value_));

Powered by Google App Engine
This is Rietveld 408576698