deep

a Cross Development Platform for Java

User Tools

Site Tools


dev:crosscompiler:backend_arm:code_generator

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
dev:crosscompiler:backend_arm:code_generator [2019/11/15 16:35] – [Stackframe] ursgrafdev:crosscompiler:backend_arm:code_generator [2019/11/17 18:18] – [Method Call] ursgraf
Line 16: Line 16:
 \\ \\
 ===== Exception Stackframe ===== ===== Exception Stackframe =====
-In case of an exception the registers LR, CTR, CR, XER, SRR0 and SRR1 must be additionally saved. Then follow all GPRs. In factit would be sufficient to store all the volatile GPR's and the nonvolatile GPR'which are used within this method. But //stmw// and //lmw// can be applied very efficiently but allow for storing a whole row only.\\  +In case of an exception all volatile GPRs together with LR must be saved. Further, the nonvolatile GPRs which are used in this method must be saved as well. \\  
-FPR's need no saving, as they are normally not allowed to be used in exceptions (FP bit in MSR = 0). Here again, if ''US.ENABLE_FLOATS()'' is called in this method, the FPR's must be saved as well.+EXTR's need no saving, as they are not allowed to be used in exceptions. If an exception method calls a method where EXTR are used (e.g. in an interrupt handler or in a decrementer subclassyou have to use ''US.ENABLE_FLOATS()'' to store the them.
  
-[{{ .:exceptionstackframe.png?250&direct | //Stack frame for exception method//}}]+[{{ :dev:crosscompiler:backend_arm:exceptionstackframearm.png?350&direct | //Stack frame for exception method//}}]
  
-Optimization: The PPC architecture has lots of FPR's. One could use half of them in normal methods and the other half in exception methods. For such a case all normal methods which could be called from within exception methods must be translated a second time with the second set. The compiler would have to find out how to handle each method.+Optimization: The ARM architecture has lots of EXTR's. One could use half of them in normal methods and the other half in exception methods. For such a case all normal methods which could be called from within exception methods must be translated a second time with the second set. The compiler would have to find out how to handle each method.
  
 ===== Method Call ===== ===== Method Call =====
  
 ==== Parameter Passing ==== ==== Parameter Passing ====
-All parameters must be copied in the appropriate registers, see [[.:register_allocation|Register Allocation]]. During this it might be necessary that two or more registers must be swapped in a cycle. For this purpose two arrays //destGPR// and //destFPR// are determined. They show which source register goes into which destination register, if the register holds a parameter. If a cycle is found it will be solved through the aid of R0 or FR0, respectively.+All parameters must be copied in the appropriate registers, see [[.:register_allocation|Register Allocation]]. During this it might be necessary that two or more registers must be swapped in a cycle. For this purpose two arrays //destGPR// and //destFPR// are determined. They show which source register goes into which destination register, if the register holds a parameter.
  
 ==== Return Value ==== ==== Return Value ====
dev/crosscompiler/backend_arm/code_generator.txt · Last modified: 2022/12/20 11:34 by ursgraf