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

2015-09-23 Thread H.J. Lu
On Tue, Sep 22, 2015 at 11:13 AM, Richard Henderson wrote: > > HJ, I think Hal is right. Providing the data via arguments is vastly superior > to providing it via builtins. I had actually been thinking the same thing > myself. > > It should be easy to check that the function

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

2015-09-22 Thread H. Peter Anvin
On 09/22/15 04:52, David Chisnall wrote: > 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. > >

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

2015-09-22 Thread H. Peter Anvin
On 09/22/15 04:44, David Chisnall wrote: > 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

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

2015-09-22 Thread H. Peter Anvin
On 09/22/15 01:41, David Chisnall wrote: > 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

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

2015-09-22 Thread Richard Henderson
via cfe-dev" <cfe-...@lists.llvm.org> >>>> To: "GCC Development" <gcc@gcc.gnu.org>, cfe-...@lists.llvm.org >>>> Sent: Monday, September 21, 2015 11:27:18 AM >>>> Subject: Re: [cfe-dev] RFC: Support x86 interrupt and exception >>>&g

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

2015-09-22 Thread Hal Finkel
- Original Message - > From: "H.J. Lu" <hjl.to...@gmail.com> > To: "Hal Finkel" <hfin...@anl.gov> > Cc: "GCC Development" <gcc@gcc.gnu.org>, cfe-...@lists.llvm.org > Sent: Monday, September 21, 2015 7:17:20 PM > Subject:

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

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

2015-09-22 Thread H.J. Lu
>, cfe-...@lists.llvm.org >> Sent: Monday, September 21, 2015 7:17:20 PM >> Subject: Re: [cfe-dev] RFC: Support x86 interrupt and exception handlers >> >> On Mon, Sep 21, 2015 at 4:03 PM, Hal Finkel <hfin...@anl.gov> wrote: >> > - Original Message - >

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

2015-09-22 Thread H.J. Lu
On Tue, Sep 22, 2015 at 1:41 AM, David Chisnall wrote: > 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

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

2015-09-22 Thread H.J. Lu
On Tue, Sep 22, 2015 at 4:44 AM, David Chisnall wrote: > 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

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

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*.

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

2015-09-21 Thread H.J. Lu
ay, September 21, 2015 11:27:18 AM >> Subject: Re: [cfe-dev] RFC: Support x86 interrupt and exception handlers >> >> On Thu, Sep 17, 2015 at 12:26 PM, H.J. Lu <hjl.to...@gmail.com> >> wrote: >> > On Tue, Sep 15, 2015 at 1:11 PM, H.J. Lu <hjl

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

2015-09-21 Thread Hal Finkel
- Original Message - > From: "H.J. Lu" <hjl.to...@gmail.com> > To: "Hal Finkel" <hfin...@anl.gov> > Cc: "GCC Development" <gcc@gcc.gnu.org>, cfe-...@lists.llvm.org > Sent: Monday, September 21, 2015 5:57:36 PM > Subject:

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

2015-09-21 Thread H.J. Lu
>, cfe-...@lists.llvm.org >> Sent: Monday, September 21, 2015 5:57:36 PM >> Subject: Re: [cfe-dev] RFC: Support x86 interrupt and exception handlers >> >> On Mon, Sep 21, 2015 at 3:40 PM, Hal Finkel <hfin...@anl.gov> wrote: >> > - Original Message -

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

2015-09-21 Thread Hal Finkel
- Original Message - > From: "H.J. Lu via cfe-dev" <cfe-...@lists.llvm.org> > To: "GCC Development" <gcc@gcc.gnu.org>, cfe-...@lists.llvm.org > Sent: Monday, September 21, 2015 11:27:18 AM > Subject: Re: [cfe-dev] RFC: Support x86 interrupt and

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

2015-09-21 Thread H.J. Lu
On Mon, Sep 21, 2015 at 2:23 PM, John Criswell wrote: > On 9/21/15 4:45 PM, H.J. Lu wrote: >> >> On Mon, Sep 21, 2015 at 11:52 AM, John Criswell >> wrote: >>> >>> On 9/21/15 12:27 PM, H.J. Lu via cfe-dev wrote: On Thu, Sep 17, 2015 at 12:26 PM,

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

2015-09-21 Thread H.J. Lu
On Mon, Sep 21, 2015 at 11:52 AM, John Criswell wrote: > On 9/21/15 12:27 PM, H.J. Lu via cfe-dev wrote: >> >> On Thu, Sep 17, 2015 at 12:26 PM, H.J. Lu wrote: >>> >>> On Tue, Sep 15, 2015 at 1:11 PM, H.J. Lu wrote: > > To

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

2015-09-21 Thread John Criswell
On 9/21/15 12:27 PM, H.J. Lu via cfe-dev wrote: On Thu, Sep 17, 2015 at 12:26 PM, H.J. Lu wrote: On Tue, Sep 15, 2015 at 1:11 PM, H.J. Lu wrote: To implement interrupt and exception handlers for x86 processors, a compiler should support: 1. void *

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

2015-09-21 Thread John Criswell
On 9/21/15 4:45 PM, H.J. Lu wrote: On Mon, Sep 21, 2015 at 11:52 AM, John Criswell wrote: On 9/21/15 12:27 PM, H.J. Lu via cfe-dev wrote: On Thu, Sep 17, 2015 at 12:26 PM, H.J. Lu wrote: On Tue, Sep 15, 2015 at 1:11 PM, H.J. Lu