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

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

Issue 63423004: Introduce %_IsMinusZero. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: extended test case Created 7 years, 1 month 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
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2652 matching lines...) Expand 10 before | Expand all | Expand 10 after
2663 __ fstp_d(MemOperand(esp, 0)); 2663 __ fstp_d(MemOperand(esp, 0));
2664 } 2664 }
2665 2665
2666 __ add(esp, Immediate(kDoubleSize)); 2666 __ add(esp, Immediate(kDoubleSize));
2667 int offset = sizeof(kHoleNanUpper32); 2667 int offset = sizeof(kHoleNanUpper32);
2668 __ cmp(MemOperand(esp, -offset), Immediate(kHoleNanUpper32)); 2668 __ cmp(MemOperand(esp, -offset), Immediate(kHoleNanUpper32));
2669 EmitBranch(instr, equal); 2669 EmitBranch(instr, equal);
2670 } 2670 }
2671 2671
2672 2672
2673 void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) {
2674 Representation rep = instr->hydrogen()->value()->representation();
2675 ASSERT(!rep.IsInteger32());
2676 Label if_false;
2677 Register scratch = ToRegister(instr->temp());
2678
2679 if (rep.IsDouble()) {
2680 CpuFeatureScope use_sse2(masm(), SSE2);
2681 XMMRegister value = ToDoubleRegister(instr->value());
2682 XMMRegister xmm_scratch = double_scratch0();
2683 __ xorps(xmm_scratch, xmm_scratch);
2684 __ ucomisd(xmm_scratch, value);
2685 __ j(not_equal, &if_false);
2686 __ movmskpd(scratch, value);
2687 __ test(scratch, Immediate(1));
2688 EmitBranch(instr, not_zero);
2689 } else {
2690 Register value = ToRegister(instr->value());
2691 Handle<Map> map = masm()->isolate()->factory()->heap_number_map();
2692 __ CheckMap(eax, map, &if_false, DO_SMI_CHECK);
2693 __ cmp(FieldOperand(value, HeapNumber::kExponentOffset),
2694 Immediate(0x80000000));
2695 __ j(not_equal, &if_false);
2696 __ cmp(FieldOperand(value, HeapNumber::kMantissaOffset),
2697 Immediate(0x00000000));
2698 EmitBranch(instr, equal);
2699 }
2700
2701 __ bind(&if_false);
2702 EmitFalseBranch(instr, no_condition);
2703 }
2704
2705
2673 Condition LCodeGen::EmitIsObject(Register input, 2706 Condition LCodeGen::EmitIsObject(Register input,
2674 Register temp1, 2707 Register temp1,
2675 Label* is_not_object, 2708 Label* is_not_object,
2676 Label* is_object) { 2709 Label* is_object) {
2677 __ JumpIfSmi(input, is_not_object); 2710 __ JumpIfSmi(input, is_not_object);
2678 2711
2679 __ cmp(input, isolate()->factory()->null_value()); 2712 __ cmp(input, isolate()->factory()->null_value());
2680 __ j(equal, is_object); 2713 __ j(equal, is_object);
2681 2714
2682 __ mov(temp1, FieldOperand(input, HeapObject::kMapOffset)); 2715 __ mov(temp1, FieldOperand(input, HeapObject::kMapOffset));
(...skipping 3753 matching lines...) Expand 10 before | Expand all | Expand 10 after
6436 FixedArray::kHeaderSize - kPointerSize)); 6469 FixedArray::kHeaderSize - kPointerSize));
6437 __ bind(&done); 6470 __ bind(&done);
6438 } 6471 }
6439 6472
6440 6473
6441 #undef __ 6474 #undef __
6442 6475
6443 } } // namespace v8::internal 6476 } } // namespace v8::internal
6444 6477
6445 #endif // V8_TARGET_ARCH_IA32 6478 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698