forked from OSchip/llvm-project
				
			Refactor isThumb1Only() && isMClass() into a predicate called isV6M()
This must be enforced for all v6M cores, not just the cortex-m0, irregardless of the user-specified alignment. Patch by Charlie Turner. llvm-svn: 219300
This commit is contained in:
		
							parent
							
								
									51dc3f4701
								
							
						
					
					
						commit
						bab5ace6aa
					
				| 
						 | 
					@ -310,15 +310,14 @@ void ARMSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
 | 
				
			||||||
      (hasV7Ops() && (isTargetLinux() || isTargetNaCl() ||
 | 
					      (hasV7Ops() && (isTargetLinux() || isTargetNaCl() ||
 | 
				
			||||||
                      isTargetNetBSD())) ||
 | 
					                      isTargetNetBSD())) ||
 | 
				
			||||||
      (hasV6Ops() && (isTargetMachO() || isTargetNetBSD()));
 | 
					      (hasV6Ops() && (isTargetMachO() || isTargetNetBSD()));
 | 
				
			||||||
    // The one exception is cortex-m0, which despite being v6, does not
 | 
					 | 
				
			||||||
    // support unaligned accesses. Rather than make the above boolean
 | 
					 | 
				
			||||||
    // expression even more obtuse, just override the value here.
 | 
					 | 
				
			||||||
    if (isThumb1Only() && isMClass())
 | 
					 | 
				
			||||||
      AllowsUnalignedMem = false;
 | 
					 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    AllowsUnalignedMem = !(Align == StrictAlign);
 | 
					    AllowsUnalignedMem = !(Align == StrictAlign);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // No v6M core supports unaligned memory access (v6M ARM ARM A3.2)
 | 
				
			||||||
 | 
					  if (isV6M())
 | 
				
			||||||
 | 
					    AllowsUnalignedMem = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  switch (IT) {
 | 
					  switch (IT) {
 | 
				
			||||||
  case DefaultIT:
 | 
					  case DefaultIT:
 | 
				
			||||||
    RestrictIT = hasV8Ops() ? true : false;
 | 
					    RestrictIT = hasV8Ops() ? true : false;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -405,6 +405,10 @@ public:
 | 
				
			||||||
  bool isRClass() const { return ARMProcClass == RClass; }
 | 
					  bool isRClass() const { return ARMProcClass == RClass; }
 | 
				
			||||||
  bool isAClass() const { return ARMProcClass == AClass; }
 | 
					  bool isAClass() const { return ARMProcClass == AClass; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  bool isV6M() const {
 | 
				
			||||||
 | 
					    return isThumb1Only() && isMClass();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  bool isR9Reserved() const { return IsR9Reserved; }
 | 
					  bool isR9Reserved() const { return IsR9Reserved; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  bool useMovt(const MachineFunction &MF) const;
 | 
					  bool useMovt(const MachineFunction &MF) const;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue