Lines Matching full:mode

1 //===-- SIModeRegister.cpp - Mode Register --------------------------------===//
9 /// This pass inserts changes to the Mode register settings as required.
11 /// rounding mode setting, but is intended to be generic enough to be easily
23 #define DEBUG_TYPE "si-mode-register"
25 STATISTIC(NumSetregInserted, "Number of setreg of mode register inserted.");
30 // Mask is a bitmask where a '1' indicates the corresponding Mode bit has a
33 unsigned Mode = 0; member
37 Status(unsigned NewMask, unsigned NewMode) : Mask(NewMask), Mode(NewMode) { in Status()
38 Mode &= Mask; in Status()
44 return Status((Mask | S.Mask), ((Mode & ~S.Mask) | (S.Mode & S.Mask))); in merge()
50 return Status(Mask & ~newMask, Mode & ~newMask); in mergeUnknown()
53 // intersect two Status values to produce a mode and mask that is a subset
56 unsigned NewMask = (Mask & S.Mask) & (Mode ^ ~S.Mode); in intersect()
57 unsigned NewMode = (Mode & NewMask); in intersect()
61 // produce the delta required to change the Mode to the required Mode
63 return Status((S.Mask & (Mode ^ S.Mode)) | (~Mask & S.Mask), S.Mode); in delta()
67 return (Mask == S.Mask) && (Mode == S.Mode); in operator ==()
73 return ((Mask & S.Mask) == S.Mask) && ((Mode & S.Mask) == S.Mode); in isCompatible()
81 // The Status that represents the mode register settings required by the
85 // The Status that represents the net changes to the Mode register made by
89 // The Status that represents the mode register settings on exit from this
93 // The Status that represents the intersection of exit Mode register settings
97 // In Phase 1 we record the first instruction that has a mode requirement,
98 // which is used in Phase 3 if we need to insert a mode change.
115 // The default mode register setting currently only caters for the floating
116 // point double precision rounding mode.
117 // We currently assume the default rounding mode is Round to Nearest
118 // NOTE: this should come from a per function rounding mode setting once such
156 "Insert required mode register values", false, false)
166 // Determine the Mode register setting required for this instruction.
167 // Instructions which don't use the Mode register return a null Status.
186 unsigned Mode = MI.getOperand(2).getImm(); in getInstructionMode() local
189 return Status(FP_ROUND_MODE_DP(3), FP_ROUND_MODE_DP(Mode)); in getInstructionMode()
192 unsigned Mode = MI.getOperand(2).getImm(); in getInstructionMode() local
195 return Status(FP_ROUND_MODE_DP(3), FP_ROUND_MODE_DP(Mode)); in getInstructionMode()
198 unsigned Mode = MI.getOperand(6).getImm(); in getInstructionMode() local
201 return Status(FP_ROUND_MODE_DP(3), FP_ROUND_MODE_DP(Mode)); in getInstructionMode()
204 unsigned Mode = MI.getOperand(2).getImm(); in getInstructionMode() local
207 return Status(FP_ROUND_MODE_DP(3), FP_ROUND_MODE_DP(Mode)); in getInstructionMode()
216 // Insert a setreg instruction to update the Mode register.
218 // the value of disjoint parts of the Mode register when we don't know the
226 unsigned Value = (InstrMode.Mode >> Offset) & ((1 << Width) - 1); in insertSetreg()
238 // instruction we get its mode usage. If the instruction uses the Mode register
240 // - update the Change status, which tracks the changes to the Mode register
243 // of the Mode register we merge the modes
246 // mode
273 // We preserve any explicit mode register setreg instruction we encounter, in processBlockPhase1()
290 // not an immediate then we treat the modified bits of the mode register in processBlockPhase1()
295 unsigned Mode = (Val << Offset) & Mask; in processBlockPhase1() local
296 Status Setreg = Status(Mask, Mode); in processBlockPhase1()
305 // This instruction uses the Mode register and its requirements aren't in processBlockPhase1()
306 // compatible with the current mode. in processBlockPhase1()
308 // If the required mode change cannot be included in the current in processBlockPhase1()
350 // In Phase 2 we revisit each block and calculate the common Mode register
366 // Mask bits (which represent the Mode bits with a known value) can only be in processBlockPhase2()
416 // check whether the predecessor mode meets the block's entry requirements. If
417 // not we insert an appropriate setreg instruction to modify the Mode register.
448 // a non-default rounding mode for non-strictfp functions. But it should not in run()
459 // Phase 1 - determine the initial mode required by each block, and add setreg in run()
464 // Phase 2 - determine the exit mode from each block. We add all blocks to the in run()
474 // Phase 3 - add an initial setreg to each block where the required entry mode in run()
475 // is not satisfied by the exit mode of all its predecessors. in run()