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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 183028: X64: Use sahf instruction only on processors that support it. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 3 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
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 593
594 void MacroAssembler::Ret() { 594 void MacroAssembler::Ret() {
595 ret(0); 595 ret(0);
596 } 596 }
597 597
598 598
599 void MacroAssembler::FCmp() { 599 void MacroAssembler::FCmp() {
600 fcompp(); 600 fcompp();
601 push(rax); 601 push(rax);
602 fnstsw_ax(); 602 fnstsw_ax();
603 // TODO(X64): Check that sahf is safe to use, using CPUProbe. 603 if (CpuFeatures::IsSupported(CpuFeatures::SAHF)) {
604 sahf(); 604 sahf();
605 } else {
606 shrl(rax, Immediate(8));
607 and_(rax, Immediate(0xFF));
608 push(rax);
609 popfq();
610 }
605 pop(rax); 611 pop(rax);
606 } 612 }
607 613
608 614
609 void MacroAssembler::CmpObjectType(Register heap_object, 615 void MacroAssembler::CmpObjectType(Register heap_object,
610 InstanceType type, 616 InstanceType type,
611 Register map) { 617 Register map) {
612 movq(map, FieldOperand(heap_object, HeapObject::kMapOffset)); 618 movq(map, FieldOperand(heap_object, HeapObject::kMapOffset));
613 CmpInstanceType(map, type); 619 CmpInstanceType(map, type);
614 } 620 }
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 movq(kScratchRegister, new_space_allocation_top); 1377 movq(kScratchRegister, new_space_allocation_top);
1372 #ifdef DEBUG 1378 #ifdef DEBUG
1373 cmpq(object, Operand(kScratchRegister, 0)); 1379 cmpq(object, Operand(kScratchRegister, 0));
1374 Check(below, "Undo allocation of non allocated memory"); 1380 Check(below, "Undo allocation of non allocated memory");
1375 #endif 1381 #endif
1376 movq(Operand(kScratchRegister, 0), object); 1382 movq(Operand(kScratchRegister, 0), object);
1377 } 1383 }
1378 1384
1379 1385
1380 } } // namespace v8::internal 1386 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698