[llvm-commits] [llvm] r78701 - in /llvm/trunk/lib/Target/ARM: ARMBaseInstrInfo.cpp ARMInstrThumb2.td
Jim Grosbach
grosbach at apple.com
Thu Aug 13 08:13:35 PDT 2009
On Aug 13, 2009, at 1:55 AM, Evan Cheng wrote:
>>
>> ----------------------------------------------------------------------=
>> ==//
>> +// SJLJ Exception handling intrinsics
>> +// eh_sjlj_setjmp() is a three instruction sequence to store the
>> return
>
> 3 instructions?
>
Oops. Fixed.
>> +// address and save #0 in R0 for the non-longjmp case.
>> +// Since by its nature we may be coming from some other function
>> to get
>> +// here, and we're using the stack frame for the containing
>> function to
>> +// save/restore registers, we can't keep anything live in regs
>> across
>> +// the eh_sjlj_setjmp(), else it will almost certainly have been
>> tromped upon
>> +// when we get here from a longjmp(). We force everthing out of
>> registers
>> +// except for our own input by listing the relevant registers in
>> Defs. By
>> +// doing so, we also cause the prologue/epilogue code to actively
>> preserve
>> +// all of the callee-saved resgisters, which is exactly what we
>> want.
>> +let Defs =
>> + [ R0, R1, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, LR,
>> + D0, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12,
>> D13, D14, D15,
>> + D16, D17, D18, D19, D20, D21, D22, D23, D24, D25, D26, D27,
>> D28, D29, D30,
>> + D31 ] in {
>> + def t2Int_eh_sjlj_setjmp : Thumb2XI<(outs), (ins GPR:$src),
>> + AddrModeNone, SizeSpecial,
>> NoItinerary,
>> + "str.w sp, [$src, #+8] @ eh_setjmp
>> begin\n"
>> + "\tadr ip, 0f\n"
>> + "\torr ip, #1\n"
>> + "\tstr.w ip, [$src, #+4]\n"
>> + "\tmovs r0, #0\n"
>> + "\tb 1f\n"
>> + "0:\tmovs r0, #1 @ eh_setjmp end\n"
>> + "1:\n", "",
>> + [(set R0, (ARMeh_sjlj_setjmp GPR:
>> $src))]>;
>
> More questions. What do "0f" "1f" mean? Can we generate multiple
> labels like 0: 1: in the same function? Can there be multiple
> Int_eh_sjlj_setjmp in a function? Does it make sense to add a id
> operand to the instruction so we can print out unique labels?
>
These are assembler numeric labels designed for quick temporary use
like this.
http://developer.apple.com/DOCUMENTATION/DeveloperTools/Reference/Assembler/020-Assembly_Language_Syntax/asm_syntax.html#//apple_ref/doc/uid/TP30000821-TPXREF106
> One more thing. The '\n' after '1:' is not needed.
>
True. I'll remove it.
> Evan
>
>> +}
>> +
>> +
>> +
>> +//
>> =
>> =
>> =
>> ----------------------------------------------------------------------=
>> ==//
>> // Control-Flow Instructions
>> //
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list