Re: [cfe-dev] RFC: Support x86 interrupt and exception handlers

2015-09-22 Thread David Chisnall
On 22 Sep 2015, at 12:47, H.J. Lu wrote: > > since __builtin_exception_error () is the same as > __builtin_return_address (0) and __builtin_interrupt_data () is > address of __builtin_exception_error () + size of register. Except that they’re *not*. __builtin_return_address(0) is guaranteed to

Re: [cfe-dev] RFC: Support x86 interrupt and exception handlers

2015-09-22 Thread David Chisnall
On 22 Sep 2015, at 12:39, H.J. Lu via cfe-dev wrote: > > The center piece of my proposal is not to change how parameters > are passed in compiler. As for user experience, the feedbacks on > my proposal from our users are very positive. Implementing the intrinsics for getting the current interru

Re: [cfe-dev] RFC: Support x86 interrupt and exception handlers

2015-09-22 Thread David Chisnall
On 21 Sep 2015, at 21:45, H.J. Lu via cfe-dev wrote: > > The main purpose of x86 interrupt attribute is to allow programmers > to write x86 interrupt/exception handlers in C WITHOUT assembly > stubs to avoid extra branch from assembly stubs to C functions. I > want to keep the number of new intr