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

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 14109010: ARM: Enable VFP default NaN mode (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4413 matching lines...) Expand 10 before | Expand all | Expand 10 after
4424 ? Operand((constant_key << element_size_shift) + 4424 ? Operand((constant_key << element_size_shift) +
4425 FixedDoubleArray::kHeaderSize - kHeapObjectTag) 4425 FixedDoubleArray::kHeaderSize - kHeapObjectTag)
4426 : Operand(key, LSL, shift_size); 4426 : Operand(key, LSL, shift_size);
4427 __ add(scratch, elements, operand); 4427 __ add(scratch, elements, operand);
4428 if (!key_is_constant) { 4428 if (!key_is_constant) {
4429 __ add(scratch, scratch, 4429 __ add(scratch, scratch,
4430 Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag)); 4430 Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag));
4431 } 4431 }
4432 4432
4433 if (instr->NeedsCanonicalization()) { 4433 if (instr->NeedsCanonicalization()) {
4434 // Check for NaN. All NaNs must be canonicalized. 4434 // Force a canonical NaN.
4435 __ VFPCompareAndSetFlags(value, value); 4435 if (masm()->emit_debug_code()) {
4436 Label after_canonicalization; 4436 __ vmrs(ip);
4437 4437 __ tst(ip, Operand(kVFPDefaultNaNModeControlBit));
4438 // Only load canonical NaN if the comparison above set the overflow. 4438 __ Assert(ne, "Default NaN mode not set");
4439 __ b(vc, &after_canonicalization); 4439 }
4440 __ Vmov(value, 4440 __ VFPCanonicalizeNaN(value);
4441 FixedDoubleArray::canonical_not_the_hole_nan_as_double());
4442
4443 __ bind(&after_canonicalization);
4444 } 4441 }
4445
4446 __ vstr(value, scratch, instr->additional_index() << element_size_shift); 4442 __ vstr(value, scratch, instr->additional_index() << element_size_shift);
4447 } 4443 }
4448 4444
4449 4445
4450 void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { 4446 void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) {
4451 Register value = ToRegister(instr->value()); 4447 Register value = ToRegister(instr->value());
4452 Register elements = ToRegister(instr->elements()); 4448 Register elements = ToRegister(instr->elements());
4453 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) 4449 Register key = instr->key()->IsRegister() ? ToRegister(instr->key())
4454 : no_reg; 4450 : no_reg;
4455 Register scratch = scratch0(); 4451 Register scratch = scratch0();
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
4857 HLoadKeyed* load = HLoadKeyed::cast(change_input); 4853 HLoadKeyed* load = HLoadKeyed::cast(change_input);
4858 convert_hole = load->UsesMustHandleHole(); 4854 convert_hole = load->UsesMustHandleHole();
4859 } 4855 }
4860 4856
4861 Label no_special_nan_handling; 4857 Label no_special_nan_handling;
4862 Label done; 4858 Label done;
4863 if (convert_hole) { 4859 if (convert_hole) {
4864 DwVfpRegister input_reg = ToDoubleRegister(instr->value()); 4860 DwVfpRegister input_reg = ToDoubleRegister(instr->value());
4865 __ VFPCompareAndSetFlags(input_reg, input_reg); 4861 __ VFPCompareAndSetFlags(input_reg, input_reg);
4866 __ b(vc, &no_special_nan_handling); 4862 __ b(vc, &no_special_nan_handling);
4867 __ vmov(reg, scratch0(), input_reg); 4863 __ vmov(scratch, input_reg.high());
4868 __ cmp(scratch0(), Operand(kHoleNanUpper32)); 4864 __ cmp(scratch, Operand(kHoleNanUpper32));
4869 Label canonicalize; 4865 // If not the hole NaN, force the NaN to be canonical.
4870 __ b(ne, &canonicalize); 4866 __ VFPCanonicalizeNaN(input_reg, ne);
4867 __ b(ne, &no_special_nan_handling);
4871 __ Move(reg, factory()->the_hole_value()); 4868 __ Move(reg, factory()->the_hole_value());
4872 __ b(&done); 4869 __ b(&done);
4873 __ bind(&canonicalize);
4874 __ Vmov(input_reg,
4875 FixedDoubleArray::canonical_not_the_hole_nan_as_double(),
4876 no_reg);
4877 } 4870 }
4878 4871
4879 __ bind(&no_special_nan_handling); 4872 __ bind(&no_special_nan_handling);
4880 DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr); 4873 DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr);
4881 if (FLAG_inline_new) { 4874 if (FLAG_inline_new) {
4882 __ LoadRoot(scratch, Heap::kHeapNumberMapRootIndex); 4875 __ LoadRoot(scratch, Heap::kHeapNumberMapRootIndex);
4883 // We want the untagged address first for performance 4876 // We want the untagged address first for performance
4884 __ AllocateHeapNumber(reg, temp1, temp2, scratch, deferred->entry(), 4877 __ AllocateHeapNumber(reg, temp1, temp2, scratch, deferred->entry(),
4885 DONT_TAG_RESULT); 4878 DONT_TAG_RESULT);
4886 } else { 4879 } else {
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
6003 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 5996 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
6004 __ ldr(result, FieldMemOperand(scratch, 5997 __ ldr(result, FieldMemOperand(scratch,
6005 FixedArray::kHeaderSize - kPointerSize)); 5998 FixedArray::kHeaderSize - kPointerSize));
6006 __ bind(&done); 5999 __ bind(&done);
6007 } 6000 }
6008 6001
6009 6002
6010 #undef __ 6003 #undef __
6011 6004
6012 } } // namespace v8::internal 6005 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.h ('k') | src/arm/macro-assembler-arm.h » ('j') | src/arm/simulator-arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698