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

Unified Diff: src/typing-asm.cc

Issue 1756693003: Allow negation of doubles in asm typer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | test/cctest/test-asm-validator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/typing-asm.cc
diff --git a/src/typing-asm.cc b/src/typing-asm.cc
index eb896db3320376a471dba6bcebaea209ac267e17..ed5b02ef0f9aa8edb43531cd91e59bb7ee2ed150 100644
--- a/src/typing-asm.cc
+++ b/src/typing-asm.cc
@@ -1258,6 +1258,14 @@ void AsmTyper::VisitBinaryOperation(BinaryOperation* expr) {
}
IntersectResult(expr, cache_.kAsmDouble);
return;
+ } else if (expr->op() == Token::MUL && left_type->Is(cache_.kAsmDouble) &&
+ expr->right()->IsLiteral() &&
+ !expr->right()->AsLiteral()->raw_value()->ContainsDot() &&
+ expr->right()->AsLiteral()->raw_value()->AsNumber() == -1.0) {
+ // For unary -, expressed as x * -1
+ expr->right()->set_bounds(Bounds(cache_.kAsmDouble));
+ IntersectResult(expr, cache_.kAsmDouble);
+ return;
} else if (type->Is(cache_.kAsmFloat) && expr->op() != Token::MOD) {
if (left_intish != 0 || right_intish != 0) {
FAIL(expr, "float operation before required fround");
« no previous file with comments | « no previous file | test/cctest/test-asm-validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698