I've pushed a set of changes to the uniarch git repositories. This includes
various fixes for constant shift operations on large integers, which appear
to have been bugs since the early days of mspgcc3. Someday I'll get around
to back-porting these to mspgcc4.
Also an implementation of __delay_cycles, which won't be backported.
I've refined/clarified the semantics of function attributes, and have
appended the notes for that specific commit. Note the addition of the
"hosted" attribute which eliminates the need to manually insert a "RETI"
instruction when using a naked/task interrupt. (Without this, if you had a
stack frame in the routine your RETI would be in the wrong place.)
If there's some capability you want that can't be reasonably expressed with
these attributes, let me know what it is.
saveprologue has progressed from "disabled until it can be checked" to
"wontfix". If you need this sort of functionality, please create a new item
on the bug tracker, and we can discuss how to resolve it.
Peter
0d370a4 Update for release
a72612b SF 3257021, 3257192: function attribute rework
3abb531 Run everything through indent again
091b3d0 SF 3250899: error right shift 32-bit values
64c6735 SF 3250605: error left shift 64-bit values
5a0a5da SF 3250633: error right logical shift 64-bit values
53cbbd9 Reformatting in shift code
96ecb5a Remove uncalled statics, inline uniquely called statics
d1dcc05 Remove length calculations in shift operations
bb404e2 Clear out more bogus instruction length infrastructure
4e598c6 Partial SF 3244669: remove hard-coded lengths from msp430_name_code
5fef21d Remove patterns which use @Rn+ naturally.
c1fbc59 Reduce visibility of utility functions.
c42f445 Correct instruction lengths for set expressions in builtins.
3d2dd01 Consistent placement of unspec_volatile on set patterns.
a059b93 Eliminate build warnings from use of HOST_WIDE_INT in printf formats
6b16b08 Update version for next release
commit a72612b4d83ba10bbdccc4b91f31d37704a7a1d1
Author: Peter A. Bigot <pabi...@users.sourceforge.net>
Date: Tue Mar 29 10:49:11 2011 -0500
SF 3257021, 3257192: function attribute rework
Further clarification/orthogonalization of function attributes related
to
frame prologue and epilogue. Fix SF 3257192: obey noreturn in epilogue.
Fix SF 3257021: allow naked/task on interrupts. Update to match
semantics
defined below.
Attributes related to frame content
-----------------------------------
The following function attributes in msp430 affect code in function
prologues or epilogues:
naked, task, interrupt([vector])
signal, wakeup
critical, reentrant
hosted
saveprologue has been disabled and currently has no effect (3229408).
My
current intent is to eliminate it. If a case can be made that the
functionality is necessary, a new interface will be defined.
hosted is new to uniarch.
Primitive frame code generation features
----------------------------------------
The following flags affect code generated in the function prologue and
epilogue.
prologue_push_sr : Push SR onto the stack first thing (immediately after
return address).
prologue_eint : __eint() in prologue
prologue_dint : __dint() in prologue
preserve_registers : Save callee-modified registers for caller
allocate_frame : Adjust stack pointer for local variables.
(Automatically
cleared if no local variables are required.)
epilogue_eint : __eint() in epilogue
epilogue_dint : __dint() in epilogue
epilogue_exit_lpm : LPM4_bits cleared in word at top of stack
use_reti : In epilogue, generate RETI instead of RET or RETA.
inhibit_return : In epilogue, do not generate a return instruction
Note: The position of eint/dint relative to other operations may be
different in the specification below than previous behavior. The order
here
is intended to prevent the prologue/epilogue code from being interrupted
unless interrupts were enabled outside the function.
Prologue sequence
~~~~~~~~~~~~~~~~~
push SR if prologue_push_sr
dint if prologue_dint
push caller registers if preserve_registers
adjust stack pointer if allocate_frame
initialize frame pointer if used
eint if prologue_eint
Epilogue sequence
~~~~~~~~~~~~~~~~~
dint if epilogue_dint
adjust stack pointer if allocate_frame
restore caller registers if preserve_registers
clear LPM4_bits in top of stack if epilogue_exit_lpm
eint if epilogue_eint
generate return instruction unless inhibit_return
Validation/filtering
--------------------
Only the first of interrupt, critical, reentrant is retained.
signal and wakeup are discarded unless interrupt.
Only the first of task, naked, saveprologue is retained.
reentrant and critical are discarded if naked.
Effective of Attributes
-----------------------
preserve_registers and allocate_frame default to TRUE. All other flags
default to FALSE.
prologue_push_sr is set if critical present
use_reti is set if interrupt present
prologue_eint is set if signal present
prologue_dint is set if critical or reentrant present
epilogue_eint is set if reentrant present
epilogue_exit_lpm is set if wakeup present
preserve_registers is cleared if naked or task present
allocate_frame is cleared if naked present. (An error is generated if
the
final frame size is not zero.)
inhibit_return is set if naked or task present, or the function has the
(GCC standard) noreturn attribute
inhibit_return is set and preserve_registers is cleared if function is
main() [TODO 3207026]
inhibit_return is cleared if hosted is present
(epilogue_dint is never currently set, but its position is defined and
it is
implemented for completeness.)
Example Attribute Interactions
------------------------------
When 3207026 is implemented, main() will implicitly be treated the same
as
task(). Addition of the hosted attribute will allow it to return.
An interrupt routine that serves as a task switcher and implements its
own
register save/restore protocol might be given attributes task and
hosted,
which allow it to handle register pushes but still generate the RETI.
Obligatory grumble: why does "reentrant" disable interrupts on entry and
enable them on exit, thus making itself not reentrant?
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users