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

Side by Side Diff: src/compiler/ppc/code-generator-ppc.cc

Issue 2754263004: PPC: [Atomics] Make Atomics.exchange a builtin using TF (Closed)
Patch Set: rebased Created 3 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/compilation-info.h" 7 #include "src/compilation-info.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 Register value = i.InputRegister(index); \ 785 Register value = i.InputRegister(index); \
786 __ lwsync(); \ 786 __ lwsync(); \
787 if (mode == kMode_MRI) { \ 787 if (mode == kMode_MRI) { \
788 __ asm_instr(value, operand); \ 788 __ asm_instr(value, operand); \
789 } else { \ 789 } else { \
790 __ asm_instrx(value, operand); \ 790 __ asm_instrx(value, operand); \
791 } \ 791 } \
792 __ sync(); \ 792 __ sync(); \
793 DCHECK_EQ(LeaveRC, i.OutputRCBit()); \ 793 DCHECK_EQ(LeaveRC, i.OutputRCBit()); \
794 } while (0) 794 } while (0)
795 #define ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(load_instr, store_instr) \
796 do { \
797 Label exchange; \
798 __ bind(&exchange); \
799 __ load_instr(i.OutputRegister(0), \
800 MemOperand(i.InputRegister(0), i.InputRegister(1))); \
801 __ store_instr(i.InputRegister(2), \
802 MemOperand(i.InputRegister(0), i.InputRegister(1))); \
803 __ bne(&exchange, cr0); \
804 } while (0)
795 805
796 void CodeGenerator::AssembleDeconstructFrame() { 806 void CodeGenerator::AssembleDeconstructFrame() {
797 __ LeaveFrame(StackFrame::MANUAL); 807 __ LeaveFrame(StackFrame::MANUAL);
798 } 808 }
799 809
800 void CodeGenerator::AssemblePrepareTailCall() { 810 void CodeGenerator::AssemblePrepareTailCall() {
801 if (frame_access_state()->has_frame()) { 811 if (frame_access_state()->has_frame()) {
802 __ RestoreFrameStateForTailCall(); 812 __ RestoreFrameStateForTailCall();
803 } 813 }
804 frame_access_state()->SetFrameAccessToSP(); 814 frame_access_state()->SetFrameAccessToSP();
(...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1972 case kAtomicStoreWord8: 1982 case kAtomicStoreWord8:
1973 ASSEMBLE_ATOMIC_STORE_INTEGER(stb, stbx); 1983 ASSEMBLE_ATOMIC_STORE_INTEGER(stb, stbx);
1974 break; 1984 break;
1975 case kAtomicStoreWord16: 1985 case kAtomicStoreWord16:
1976 ASSEMBLE_ATOMIC_STORE_INTEGER(sth, sthx); 1986 ASSEMBLE_ATOMIC_STORE_INTEGER(sth, sthx);
1977 break; 1987 break;
1978 case kAtomicStoreWord32: 1988 case kAtomicStoreWord32:
1979 ASSEMBLE_ATOMIC_STORE_INTEGER(stw, stwx); 1989 ASSEMBLE_ATOMIC_STORE_INTEGER(stw, stwx);
1980 break; 1990 break;
1981 case kAtomicExchangeInt8: 1991 case kAtomicExchangeInt8:
1992 ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(lbarx, stbcx);
1993 __ extsb(i.OutputRegister(0), i.OutputRegister(0));
1994 break;
1982 case kAtomicExchangeUint8: 1995 case kAtomicExchangeUint8:
1996 ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(lbarx, stbcx);
1997 break;
1983 case kAtomicExchangeInt16: 1998 case kAtomicExchangeInt16:
1999 ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(lharx, sthcx);
2000 __ extsh(i.OutputRegister(0), i.OutputRegister(0));
2001 break;
1984 case kAtomicExchangeUint16: 2002 case kAtomicExchangeUint16:
2003 ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(lharx, sthcx);
2004 break;
1985 case kAtomicExchangeWord32: 2005 case kAtomicExchangeWord32:
2006 ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(lwarx, stwcx);
2007 break;
1986 case kAtomicCompareExchangeInt8: 2008 case kAtomicCompareExchangeInt8:
1987 case kAtomicCompareExchangeUint8: 2009 case kAtomicCompareExchangeUint8:
1988 case kAtomicCompareExchangeInt16: 2010 case kAtomicCompareExchangeInt16:
1989 case kAtomicCompareExchangeUint16: 2011 case kAtomicCompareExchangeUint16:
1990 case kAtomicCompareExchangeWord32: 2012 case kAtomicCompareExchangeWord32:
1991 UNREACHABLE(); 2013 UNREACHABLE();
1992 break; 2014 break;
1993 default: 2015 default:
1994 UNREACHABLE(); 2016 UNREACHABLE();
1995 break; 2017 break;
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
2596 padding_size -= v8::internal::Assembler::kInstrSize; 2618 padding_size -= v8::internal::Assembler::kInstrSize;
2597 } 2619 }
2598 } 2620 }
2599 } 2621 }
2600 2622
2601 #undef __ 2623 #undef __
2602 2624
2603 } // namespace compiler 2625 } // namespace compiler
2604 } // namespace internal 2626 } // namespace internal
2605 } // namespace v8 2627 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-sharedarraybuffer-gen.cc ('k') | src/compiler/ppc/instruction-selector-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698