llvm-6502/lib/Target/Mips
Reed Kotler 2c3a4641a7 This patch is needed to make c++ exceptions work for mips16.
Mips16 is really a processor decoding mode (ala thumb 1) and in the same
program, mips16 and mips32 functions can exist and can call each other.

If a jal type instruction encounters an address with the lower bit set, then
the processor switches to mips16 mode (if it is not already in it). If the
lower bit is not set, then it switches to mips32 mode.

The linker knows which functions are mips16 and which are mips32.
When relocation is performed on code labels, this lower order bit is
set if the code label is a mips16 code label.

In general this works just fine, however when creating exception handling
tables and dwarf, there are cases where you don't want this lower order
bit added in.

This has been traditionally distinguished in gas assembly source by using a
different syntax for the label.

lab1:      ; this will cause the lower order bit to be added
lab2=.     ; this will not cause the lower order bit to be added

In some cases, it does not matter because in dwarf and debug tables
the difference of two labels is used and in that case the lower order
bits subtract each other out.

To fix this, I have added to mcstreamer the notion of a debuglabel.
The default is for label and debug label to be the same. So calling
EmitLabel and EmitDebugLabel produce the same result.

For various reasons, there is only one set of labels that needs to be
modified for the mips exceptions to work. These are the "$eh_func_beginXXX" 
labels.

Mips overrides the debug label suffix from ":" to "=." .

This initial patch fixes exceptions. More changes most likely
will be needed to DwarfCFException to make all of this work
for actual debugging. These changes will be to emit debug labels in some
places where a simple label is emitted now.

Some historical discussion on this from gcc can be found at:
http://gcc.gnu.org/ml/gcc-patches/2008-08/msg00623.html
http://gcc.gnu.org/ml/gcc-patches/2008-11/msg01273.html 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170279 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-16 04:00:45 +00:00
..
AsmParser Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
Disassembler Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
InstPrinter [CMake] Remove dependencies to intrinsics_gen I introduced in r169724. 2012-12-11 05:53:54 +00:00
MCTargetDesc This patch is needed to make c++ exceptions work for mips16. 2012-12-16 04:00:45 +00:00
TargetInfo remove Emacs-tag form .cpp files in Mips Backend, and fix some typo. 2012-02-17 08:55:11 +00:00
CMakeLists.txt Remove TargetELFWriterInfo. 2012-10-28 21:34:43 +00:00
LLVMBuild.txt Add disassembler to MIPS. 2012-04-17 18:03:21 +00:00
Makefile MIPS DSP: add code necessary for pseudo instruction lowering. 2012-09-27 01:59:07 +00:00
Mips16FrameLowering.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
Mips16FrameLowering.h Properly save and restore RA and Mips16 callee save registers S0,S1 2012-09-21 01:08:16 +00:00
Mips16InstrFormats.td Add basic ability to setup call frame, and make procedure calls. 2012-07-23 23:45:54 +00:00
Mips16InstrInfo.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
Mips16InstrInfo.h Sort includes for all of the .h files under the 'lib' tree. These were 2012-12-04 07:12:27 +00:00
Mips16InstrInfo.td Switch LLVM_USE_RVALUE_REFERENCES to LLVM_HAS_RVALUE_REFERENCES. 2012-11-30 11:45:22 +00:00
Mips16RegisterInfo.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
Mips16RegisterInfo.h Implement ADJCALLSTACKUP and ADJCALLSTACKDOWN 2012-10-31 05:21:10 +00:00
Mips64InstrInfo.td [mips] Delete nodes and instructions for dynamic alloca that are no longer in 2012-12-07 03:10:18 +00:00
Mips.h Add long branch expansion pass for MIPS. 2012-06-14 01:19:35 +00:00
Mips.td [mips] Delete unused sub-target features. 2012-12-07 03:04:05 +00:00
MipsAnalyzeImmediate.cpp Fix integer undefined behavior due to signed left shift overflow in LLVM. 2012-08-24 23:29:28 +00:00
MipsAnalyzeImmediate.h Fix undefined behavior in the Mips backend. 2012-03-09 06:36:45 +00:00
MipsAsmPrinter.cpp [mips] Set HWEncoding field of registers. Use delete function 2012-12-10 20:04:40 +00:00
MipsAsmPrinter.h Sort includes for all of the .h files under the 'lib' tree. These were 2012-12-04 07:12:27 +00:00
MipsCallingConv.td Use the methods and classes that were added to simplify LowerCall and 2012-10-27 00:29:43 +00:00
MipsCodeEmitter.cpp [mips] Set HWEncoding field of registers. Use delete function 2012-12-10 20:04:40 +00:00
MipsCondMov.td [mips] Delete all floating point instruction classes that are no longer used. 2012-12-13 02:05:02 +00:00
MipsDelaySlotFiller.cpp Use the new MIBundleBuilder class in the Mips target. 2012-12-07 04:23:40 +00:00
MipsDSPInstrFormats.td MIPS DSP: other miscellaneous instructions. 2012-09-28 20:50:31 +00:00
MipsDSPInstrInfo.td [mips] Move class IsCommutable into MipsInstrInfo.td. 2012-12-13 00:32:01 +00:00
MipsFrameLowering.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
MipsFrameLowering.h [mips] Add function MipsFrameLowering::estimateStackSize. 2012-11-02 21:10:22 +00:00
MipsInstrFormats.td [mips] Delete all floating point instruction classes that are no longer used. 2012-12-13 02:05:02 +00:00
MipsInstrFPU.td [mips] Delete all floating point instruction classes that are no longer used. 2012-12-13 02:05:02 +00:00
MipsInstrInfo.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
MipsInstrInfo.h Make function loadImmediate a member of MipsSEInstrInfo and change it to return 2012-08-23 00:21:05 +00:00
MipsInstrInfo.td [mips] Move class IsCommutable into MipsInstrInfo.td. 2012-12-13 00:32:01 +00:00
MipsISelDAGToDAG.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
MipsISelLowering.cpp This code implements most of mips16 hardfloat as it is done by gcc. 2012-12-15 00:20:05 +00:00
MipsISelLowering.h This code implements most of mips16 hardfloat as it is done by gcc. 2012-12-15 00:20:05 +00:00
MipsJITInfo.cpp Classic JIT is still being supported by MIPS, along with MCJIT. 2012-12-03 23:11:12 +00:00
MipsJITInfo.h Classic JIT is still being supported by MIPS, along with MCJIT. 2012-12-03 23:11:12 +00:00
MipsLongBranch.cpp Use the new MIBundleBuilder class in the Mips target. 2012-12-07 04:23:40 +00:00
MipsMachineFunction.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
MipsMachineFunction.h Sort includes for all of the .h files under the 'lib' tree. These were 2012-12-04 07:12:27 +00:00
MipsMCInstLower.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
MipsMCInstLower.h MIPS DSP: add code necessary for pseudo instruction lowering. 2012-09-27 01:59:07 +00:00
MipsRegisterInfo.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
MipsRegisterInfo.h Add a member of type Mips16InstrInfo/MipsSEInstrInfo to class 2012-08-22 23:58:53 +00:00
MipsRegisterInfo.td [mips] Set HWEncoding field of registers. Use delete function 2012-12-10 20:04:40 +00:00
MipsRelocations.h remove blanks, and some code format 2012-02-28 07:46:26 +00:00
MipsSchedule.td remove blanks, and some code format 2012-02-28 07:46:26 +00:00
MipsSEFrameLowering.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
MipsSEFrameLowering.h Add definitions of two subclasses of MipsFrameLowering, Mips16FrameLowering and 2012-07-31 22:50:19 +00:00
MipsSEInstrInfo.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
MipsSEInstrInfo.h Make function loadImmediate a member of MipsSEInstrInfo and change it to return 2012-08-23 00:21:05 +00:00
MipsSelectionDAGInfo.cpp remove Emacs-tag form .cpp files in Mips Backend, and fix some typo. 2012-02-17 08:55:11 +00:00
MipsSelectionDAGInfo.h Reverse unnecessary changes made in r129606 and r129608. There is no change in functionality. 2011-04-15 21:51:11 +00:00
MipsSERegisterInfo.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
MipsSERegisterInfo.h [mips] Stop reserving register AT and use register scavenger when a scratch 2012-11-03 00:05:43 +00:00
MipsSubtarget.cpp [mips] Delete unused sub-target features. 2012-12-07 03:04:05 +00:00
MipsSubtarget.h [mips] Delete unused sub-target features. 2012-12-07 03:04:05 +00:00
MipsTargetMachine.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
MipsTargetMachine.h [mips] Fix a memory leak bug report by NAKAMURA Takumi. 2012-12-12 20:09:58 +00:00
MipsTargetObjectFile.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
MipsTargetObjectFile.h Reverse unnecessary changes made in r129606 and r129608. There is no change in functionality. 2011-04-15 21:51:11 +00:00