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

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

Issue 44153002: Introduce andps for IA32/X64 (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: 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
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 3865 matching lines...) Expand 10 before | Expand all | Expand 10 after
3876 3876
3877 ASSERT(instr->value()->Equals(instr->result())); 3877 ASSERT(instr->value()->Equals(instr->result()));
3878 Representation r = instr->hydrogen()->value()->representation(); 3878 Representation r = instr->hydrogen()->value()->representation();
3879 3879
3880 CpuFeatureScope scope(masm(), SSE2); 3880 CpuFeatureScope scope(masm(), SSE2);
3881 if (r.IsDouble()) { 3881 if (r.IsDouble()) {
3882 XMMRegister scratch = double_scratch0(); 3882 XMMRegister scratch = double_scratch0();
3883 XMMRegister input_reg = ToDoubleRegister(instr->value()); 3883 XMMRegister input_reg = ToDoubleRegister(instr->value());
3884 __ xorps(scratch, scratch); 3884 __ xorps(scratch, scratch);
3885 __ subsd(scratch, input_reg); 3885 __ subsd(scratch, input_reg);
3886 __ pand(input_reg, scratch); 3886 __ andps(input_reg, scratch);
Benedikt Meurer 2013/10/28 11:23:18 Why andps and not andpd?
Weiliang 2013/10/28 12:41:10 For bit-wise operation, I think there is no much d
3887 } else if (r.IsSmiOrInteger32()) { 3887 } else if (r.IsSmiOrInteger32()) {
3888 EmitIntegerMathAbs(instr); 3888 EmitIntegerMathAbs(instr);
3889 } else { // Tagged case. 3889 } else { // Tagged case.
3890 DeferredMathAbsTaggedHeapNumber* deferred = 3890 DeferredMathAbsTaggedHeapNumber* deferred =
3891 new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr, x87_stack_); 3891 new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr, x87_stack_);
3892 Register input_reg = ToRegister(instr->value()); 3892 Register input_reg = ToRegister(instr->value());
3893 // Smi check. 3893 // Smi check.
3894 __ JumpIfNotSmi(input_reg, deferred->entry()); 3894 __ JumpIfNotSmi(input_reg, deferred->entry());
3895 EmitIntegerMathAbs(instr); 3895 EmitIntegerMathAbs(instr);
3896 __ bind(deferred->exit()); 3896 __ bind(deferred->exit());
(...skipping 2481 matching lines...) Expand 10 before | Expand all | Expand 10 after
6378 FixedArray::kHeaderSize - kPointerSize)); 6378 FixedArray::kHeaderSize - kPointerSize));
6379 __ bind(&done); 6379 __ bind(&done);
6380 } 6380 }
6381 6381
6382 6382
6383 #undef __ 6383 #undef __
6384 6384
6385 } } // namespace v8::internal 6385 } } // namespace v8::internal
6386 6386
6387 #endif // V8_TARGET_ARCH_IA32 6387 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/disasm-ia32.cc ('k') | src/x64/assembler-x64.h » ('j') | src/x64/lithium-codegen-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698