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

Side by Side Diff: src/IceTargetLoweringARM32.h

Issue 1409863006: Subzero. ARM32. Refactors atomic intrinsics lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 10 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 //===- subzero/src/IceTargetLoweringARM32.h - ARM32 lowering ----*- C++ -*-===// 1 //===- subzero/src/IceTargetLoweringARM32.h - ARM32 lowering ----*- C++ -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 }; 239 };
240 240
241 CondWhenTrue lowerFcmpCond(const InstFcmp *Instr); 241 CondWhenTrue lowerFcmpCond(const InstFcmp *Instr);
242 void lowerFcmp(const InstFcmp *Instr) override; 242 void lowerFcmp(const InstFcmp *Instr) override;
243 CondWhenTrue lowerInt8AndInt16IcmpCond(InstIcmp::ICond Condition, 243 CondWhenTrue lowerInt8AndInt16IcmpCond(InstIcmp::ICond Condition,
244 Operand *Src0, Operand *Src1); 244 Operand *Src0, Operand *Src1);
245 CondWhenTrue lowerInt32IcmpCond(InstIcmp::ICond Condition, Operand *Src0, 245 CondWhenTrue lowerInt32IcmpCond(InstIcmp::ICond Condition, Operand *Src0,
246 Operand *Src1); 246 Operand *Src1);
247 CondWhenTrue lowerInt64IcmpCond(InstIcmp::ICond Condition, Operand *Src0, 247 CondWhenTrue lowerInt64IcmpCond(InstIcmp::ICond Condition, Operand *Src0,
248 Operand *Src1); 248 Operand *Src1);
249 CondWhenTrue lowerIcmpCond(InstIcmp::ICond Condition, Operand *Src0,
250 Operand *Src1);
249 CondWhenTrue lowerIcmpCond(const InstIcmp *Instr); 251 CondWhenTrue lowerIcmpCond(const InstIcmp *Instr);
250 void lowerIcmp(const InstIcmp *Instr) override; 252 void lowerIcmp(const InstIcmp *Instr) override;
253 /// Emits the basic sequence for lower-linked/store-exclusive loops:
254 ///
255 /// retry:
256 /// ldrex tmp, [Addr]
257 /// StoreValue = Operation(tmp)
258 /// strexCond success, StoreValue, [Addr]
259 /// cmpCond success, #0
260 /// bne retry
261 ///
262 /// Operation needs to return which value to strex in Addr, it must not change
263 /// the flags if Cond is not AL, and must not emit any instructions that could
264 /// end up writting to memory. Operation also needs to handle fake-defing for
Jim Stichnoth 2016/02/17 03:50:17 writing
John 2016/02/17 13:01:39 Done.
265 /// i64 handling.
266 void
267 lowerLoadLinkedStoreExclusive(Type Ty, Operand *Addr,
268 std::function<Variable *(Variable *)> Operation,
269 CondARM32::Cond Cond = CondARM32::AL);
270 void lowerInt64AtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr,
271 Operand *Val);
251 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr, 272 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr,
252 Operand *Val); 273 Operand *Val);
253 void lowerIntrinsicCall(const InstIntrinsicCall *Instr) override; 274 void lowerIntrinsicCall(const InstIntrinsicCall *Instr) override;
254 void lowerInsertElement(const InstInsertElement *Instr) override; 275 void lowerInsertElement(const InstInsertElement *Instr) override;
255 void lowerLoad(const InstLoad *Instr) override; 276 void lowerLoad(const InstLoad *Instr) override;
256 void lowerPhi(const InstPhi *Instr) override; 277 void lowerPhi(const InstPhi *Instr) override;
257 void lowerRet(const InstRet *Instr) override; 278 void lowerRet(const InstRet *Instr) override;
258 void lowerSelect(const InstSelect *Instr) override; 279 void lowerSelect(const InstSelect *Instr) override;
259 void lowerStore(const InstStore *Instr) override; 280 void lowerStore(const InstStore *Instr) override;
260 void lowerSwitch(const InstSwitch *Instr) override; 281 void lowerSwitch(const InstSwitch *Instr) override;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 Context.insert<InstARM32Eor>(Dest, Src0, Src1, Pred); 374 Context.insert<InstARM32Eor>(Dest, Src0, Src1, Pred);
354 } 375 }
355 /// _ldr, for all your memory to Variable data moves. It handles all types 376 /// _ldr, for all your memory to Variable data moves. It handles all types
356 /// (integer, floating point, and vectors.) Addr needs to be valid for Dest's 377 /// (integer, floating point, and vectors.) Addr needs to be valid for Dest's
357 /// type (e.g., no immediates for vector loads, and no index registers for fp 378 /// type (e.g., no immediates for vector loads, and no index registers for fp
358 /// loads.) 379 /// loads.)
359 void _ldr(Variable *Dest, OperandARM32Mem *Addr, 380 void _ldr(Variable *Dest, OperandARM32Mem *Addr,
360 CondARM32::Cond Pred = CondARM32::AL) { 381 CondARM32::Cond Pred = CondARM32::AL) {
361 Context.insert<InstARM32Ldr>(Dest, Addr, Pred); 382 Context.insert<InstARM32Ldr>(Dest, Addr, Pred);
362 } 383 }
363 void _ldrex(Variable *Dest, OperandARM32Mem *Addr, 384 InstARM32Ldrex *_ldrex(Variable *Dest, OperandARM32Mem *Addr,
364 CondARM32::Cond Pred = CondARM32::AL) { 385 CondARM32::Cond Pred = CondARM32::AL) {
365 Context.insert<InstARM32Ldrex>(Dest, Addr, Pred); 386 auto *Ldrex = Context.insert<InstARM32Ldrex>(Dest, Addr, Pred);
366 if (auto *Dest64 = llvm::dyn_cast<Variable64On32>(Dest)) { 387 if (auto *Dest64 = llvm::dyn_cast<Variable64On32>(Dest)) {
367 Context.insert<InstFakeDef>(Dest64->getLo(), Dest); 388 Context.insert<InstFakeDef>(Dest64->getLo(), Dest);
368 Context.insert<InstFakeDef>(Dest64->getHi(), Dest); 389 Context.insert<InstFakeDef>(Dest64->getHi(), Dest);
369 } 390 }
391 return Ldrex;
370 } 392 }
371 void _lsl(Variable *Dest, Variable *Src0, Operand *Src1, 393 void _lsl(Variable *Dest, Variable *Src0, Operand *Src1,
372 CondARM32::Cond Pred = CondARM32::AL) { 394 CondARM32::Cond Pred = CondARM32::AL) {
373 Context.insert<InstARM32Lsl>(Dest, Src0, Src1, Pred); 395 Context.insert<InstARM32Lsl>(Dest, Src0, Src1, Pred);
374 } 396 }
375 void _lsls(Variable *Dest, Variable *Src0, Operand *Src1, 397 void _lsls(Variable *Dest, Variable *Src0, Operand *Src1,
376 CondARM32::Cond Pred = CondARM32::AL) { 398 CondARM32::Cond Pred = CondARM32::AL) {
377 constexpr bool SetFlags = true; 399 constexpr bool SetFlags = true;
378 Context.insert<InstARM32Lsl>(Dest, Src0, Src1, Pred, SetFlags); 400 Context.insert<InstARM32Lsl>(Dest, Src0, Src1, Pred, SetFlags);
379 } 401 }
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 private: 1307 private:
1286 ~TargetHeaderARM32() = default; 1308 ~TargetHeaderARM32() = default;
1287 1309
1288 TargetARM32Features CPUFeatures; 1310 TargetARM32Features CPUFeatures;
1289 }; 1311 };
1290 1312
1291 } // end of namespace ARM32 1313 } // end of namespace ARM32
1292 } // end of namespace Ice 1314 } // end of namespace Ice
1293 1315
1294 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H 1316 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698