[LLVMdev] adding support for -ffixed-<reg>
陳韋任 (Wei-Ren Chen)
chenwj at iis.sinica.edu.tw
Tue Oct 2 08:14:39 PDT 2012
> From the GCC manual (http://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/
> Treat the register named reg as a fixed register; generated code should
> never refer to it (except perhaps as a stack pointer, frame pointer or in
> some other fixed role).
> reg must be the name of a register. The register names accepted are
> machine-specific and are defined in the REGISTER_NAMES macro in the machine
> description macro file.
> Useful when writing kernel code or other low-level code (e.g. a VM) where you
> want to reserve a particular register for your own use.
Ya, I saw people writing VM often ask for this functionality on ML.
But I have a question, what the difference between this and global
register ? To me, they both seems to reserve particular register
from being used by the compiler. If they're the same, I remember Chris
objected to add global register feature in LLVM.
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
More information about the llvm-dev