Re: Implementation dependent behaviour (WAS: Re: Programming language and IDE design)

glen herrmannsfeldt <gah@ugcs.caltech.edu>
Sun, 24 Nov 2013 21:51:07 +0000 (UTC)

          From comp.compilers

Related articles
Implementation dependent behaviour (WAS: Re: Programming language and martin@gkc.org.uk (Martin Ward) (2013-11-20)
Re: Implementation dependent behaviour (WAS: Re: Programming language Pidgeot18@verizon.net (=?UTF-8?B?Sm9zaHVhIENyYW5tZXIg8J+Qpw==?=) (2013-11-23)
Re: Implementation dependent behaviour (WAS: Re: Programming language gah@ugcs.caltech.edu (glen herrmannsfeldt) (2013-11-24)
Re: Implementation dependent behaviour (WAS: Re: Programming language kaz@kylheku.com (Kaz Kylheku) (2013-12-17)
Re: Implementation dependent behaviour (WAS: Re: Programming language martin@gkc.org.uk (Martin Ward) (2014-01-06)
Re: Implementation dependent behaviour (WAS: Re: Programming language martin@gkc.org.uk (Martin Ward) (2014-01-06)
Re: Implementation dependent behaviour (WAS: Re: Programming language ivan@ootbcomp.com (Ivan Godard) (2014-01-08)
Re: Implementation dependent behaviour (WAS: Re: Programming language kaz@kylheku.com (Kaz Kylheku) (2014-01-08)
Re: Implementation dependent behaviour (WAS: Re: Programming language ivan@ootbcomp.com (Ivan Godard) (2014-01-10)
[3 later articles]
| List of all articles for this month |
From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: Sun, 24 Nov 2013 21:51:07 +0000 (UTC)
Organization: Aioe.org NNTP Server
References: 13-11-025 13-11-028
Keywords: optimize, design
Posted-Date: 27 Nov 2013 11:14:20 EST

Joshua Cranmer ? <Pidgeot18@verizon.net> wrote:


(snip, someone wrote)


>> On the other hand: suppose the language designers pick on a certain
>> behaviour and define *that* as the exact semantics of the programming
>> construct in question. The result:


> Or, you can get extremely inefficient computation on all CPUs. Suppose
> you had a language that required you to trap on arithmetic overflows,
> and that required you to trap at a very specific place in computation.


In some cases, the hardware is designed to satisfy language
requirements.


> This language means you have to prove range analysis on all variables to
> prove that they cannot overflow before you can do any code motion or
> code elimination--effectively negating the most powerful optimizations a
> compiler can do.


I believe that this is at least slightly true for Java. The exception
model restricts some code movements that other compilers might do.


> If you allow a little bit of undefined behavior, if you let compilers
> choose to trap before the value would be observed as overflowed, you
> again allow code elimination and code motion without the range analysis,
> while achieving very nearly the same result.


I suppose you missed the days of imprecise interrupts. The IBM 360/91
does out of order processing, including out of order retire. In the case
of an exception, it has to complete processing of all instructions in
the pipeline, at least those logically before the last retired
instruction.


Even more, there is "multiple imprecise interrupt" when more exceptions
occur while flushing the pipeline. In most cases you don't have the
address of the exception. But in many cases, people would rather
have the speed.


Most imprecise interrupts went away with virtual storage, as you need to
at least do things right in the case of a page fault.


-- glen


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.