Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #1817 > unrolled thread

Alignment exception examples

Started bydruck <news@druck.org.uk>
First post2012-06-23 20:55 +0100
Last post2012-06-27 15:36 +0100
Articles 16 on this page of 36 — 11 participants

Back to article view | Back to comp.sys.acorn.programmer


Contents

  Alignment exception examples druck <news@druck.org.uk> - 2012-06-23 20:55 +0100
    Re: Alignment exception examples chrisbazley@bigfoot.com - 2012-06-23 13:21 -0700
      Re: Alignment exception examples druck <news@druck.org.uk> - 2012-06-24 11:35 +0100
        Re: Alignment exception examples chrisbazley@bigfoot.com - 2012-06-24 04:02 -0700
          Re: Alignment exception examples druck <news@druck.freeuk.com> - 2012-06-24 17:29 +0100
          Re: Alignment exception examples Theo Markettos <theom+news@chiark.greenend.org.uk> - 2012-06-26 00:02 +0100
            Re: Alignment exception examples chrisbazley@bigfoot.com - 2012-06-26 01:15 -0700
              Re: Alignment exception examples Theo Markettos <theom+news@chiark.greenend.org.uk> - 2012-06-26 11:51 +0100
                Re: Alignment exception examples chrisbazley@bigfoot.com - 2012-06-27 05:40 -0700
                  Re: Alignment exception examples druck <news@druck.org.uk> - 2012-06-27 22:43 +0100
              Re: Alignment exception examples Martin Bazley <martin.bazley@blueyonder.co.uk> - 2012-06-26 14:06 +0100
              Re: Alignment exception examples druck <news@druck.org.uk> - 2012-06-26 21:57 +0100
                Re: Alignment exception examples Martin Bazley <martin.bazley@blueyonder.co.uk> - 2012-06-26 23:20 +0100
                  Re: Alignment exception examples druck <news@druck.org.uk> - 2012-06-27 22:51 +0100
                Re: Alignment exception examples chrisbazley@bigfoot.com - 2012-06-26 15:17 -0700
                  Re: Alignment exception examples Theo Markettos <theom+news@chiark.greenend.org.uk> - 2012-06-27 00:23 +0100
                    Re: Alignment exception examples chrisbazley@bigfoot.com - 2012-06-27 05:52 -0700
                      Re: Alignment exception examples druck <news@druck.org.uk> - 2012-06-27 22:46 +0100
                      Re: Alignment exception examples Nick Roberts <tigger@orpheusinternet.co.uk> - 2012-06-28 18:28 +0100
                        Re: Alignment exception examples Theo Markettos <theom+news@chiark.greenend.org.uk> - 2012-06-29 18:38 +0100
                          Re: Alignment exception examples Nick Roberts <tigger@orpheusinternet.co.uk> - 2012-06-29 20:14 +0100
                      Re: Alignment exception examples druck <news@druck.freeuk.com> - 2012-07-04 20:50 +0100
                  Re: Alignment exception examples spampling <spam.pling@btinternet.com> - 2012-06-27 07:58 +0100
                    Re: Alignment exception examples chrisbazley@bigfoot.com - 2012-06-27 05:44 -0700
                      Re: Alignment exception examples spampling <spam.pling@btinternet.com> - 2012-06-27 18:13 +0100
                      Re: Alignment exception examples druck <news@druck.org.uk> - 2012-06-27 22:47 +0100
                  Re: Alignment exception examples druck <news@druck.org.uk> - 2012-06-27 23:04 +0100
                    Re: Alignment exception examples chrisbazley@bigfoot.com - 2012-06-28 15:43 -0700
    Re: Alignment exception examples Thomas Milius <Thomas-Milius@t-online.de> - 2012-06-24 08:24 +0200
      Re: Alignment exception examples druck <news@druck.org.uk> - 2012-06-24 11:37 +0100
        Re: Alignment exception examples Thomas Milius <Thomas-Milius@t-online.de> - 2012-06-24 12:49 +0200
          Re: Alignment exception examples druck <news@druck.freeuk.com> - 2012-06-24 17:01 +0100
            Re: Alignment exception examples Thomas Milius <Thomas-Milius@t-online.de> - 2012-06-24 19:16 +0100
              Re: Alignment exception examples "Ste (news)" <steve@revi11.plus.com> - 2012-07-10 00:14 +0100
    Re: Alignment exception examples Steve Fryatt <news@stevefryatt.org.uk> - 2012-06-24 09:42 +0100
    Re: Alignment exception examples Martin <News03@avisoft.f9.co.uk> - 2012-06-27 15:36 +0100

Page 2 of 2 — ← Prev page 1 [2]


#1855

FromNick Roberts <tigger@orpheusinternet.co.uk>
Date2012-06-29 20:14 +0100
Message-ID<9fdc90a752.tigger@bc63.orpheusinternet.co.uk>
In reply to#1851
In message <IBo*jO3+t@news.chiark.greenend.org.uk>
       Theo Markettos <theom+news@chiark.greenend.org.uk> wrote:

> Nick Roberts <tigger@orpheusinternet.co.uk> wrote:
> > So no, most stuff written in C isn't FP intensive (unless the person
> > writing the C doesn't understand the purpose of strong typing).
> 
> It depends on the domain... a web server or a database won't use much
> FP, a CAD package or a video codec will.  For things naturally suited
> to FP it gets quite tedious to try to write them using solely
> integers (especially if fixed point isn't sufficient).

That was the point I was trying to make. Stating that "most stuff
written in C is FP intensive" as the earlier poster did is simply not
true - it isn't C that makes it FP-intensive, it's the problem domain.

-- 
Nick Roberts           tigger @ orpheusinternet.co.uk           

Hanlon's Razor: Never attribute to malice that which
can be adequately explained by stupidity.

[toc] | [prev] | [next] | [standalone]


#1878

Fromdruck <news@druck.freeuk.com>
Date2012-07-04 20:50 +0100
Message-ID<224e27aa52.druck@druck.freeuk.net>
In reply to#1840
On 27 Jun 2012 chrisbazley@bigfoot.com wrote:

> On Wednesday, June 27, 2012 12:23:49 AM UTC+1, Theo Markettos wrote:
>> chrisbazley@bigfoot.com wrote:
>>> It seems that you want to run ported applications as fast as possible on
>>> the latest hardware, and to hell with backward compatibility.  You don't
>>> even seem particularly bothered about executing incompatible code on an
>>> operating system that provides minimal safeguards against insidious
>>> side-effects.
>> 
>> I'm not sure where 'ported' came from.

> It came from druck, who wrote "But given that RISC OS has had very
> poor FP since hardware FP was canned, its only going to be ported
> programs that are FP heavy, which means its even easier to
> recomopile."

Given the poor FP on RISC OS, developers go out of their way not to 
use it, using fixed point if at all possible. On other platforms with 
highly accelerated FP, there isn't the stigma, so it's used for many 
things such as 3D graphic APIs, codecs, and lots of other things - all 
of which have been ported to RISC OS at one time or another and found 
to be hideously slow.

---druck

-- 
The ARM Club Free Software - http://www.armclub.org.uk/free/
32 bit Conversions Page    - http://www.armclub.org.uk/32bit/

[toc] | [prev] | [next] | [standalone]


#1837

Fromspampling <spam.pling@btinternet.com>
Date2012-06-27 07:58 +0100
Message-ID<52a645caf8spam.pling@btinternet.com>
In reply to#1835
In article <1bced15b-6ff8-4bcd-8f19-93bbd3e58f06@googlegroups.com>,
   <chrisbazley@bigfoot.com> wrote:
> I don't think there are enough RISC OS users left to alienate the
> returnees who buy Acorn machines on eBay.

I think the more likely scenario is that the returnees buy a beagleboard
(or successor) and load RO5.18+ to use the OS on modern hardware.

This machine is an RPC, and when I can move the mail functions to a bit of
modern hardware it won't get much (if any) use anymore. It was bought when
the RPC first came out and it owes me nothing.
I might experiment with IDE to SSD conversion but little else.

As Theo says the proposal was to include VFP emulation so that the
functionality was there for slow old machines.

Bear in mind that using a beagleboard based unit versus an older machine
probably saves the cost of the beagleboard in electricity during a 12 month
period.

-- 

Steve Pampling

[toc] | [prev] | [next] | [standalone]


#1839

Fromchrisbazley@bigfoot.com
Date2012-06-27 05:44 -0700
Message-ID<2118ba57-b1ca-4a22-ae0c-0c7ea693db7a@googlegroups.com>
In reply to#1837
On Wednesday, June 27, 2012 7:58:20 AM UTC+1, spampling wrote:
> In article <1bced15b-6ff8-4bcd-8f19-93bbd3e58f06@googlegroups.com>,
>    <chrisbazley@bigfoot.com> wrote:
> > I don't think there are enough RISC OS users left to alienate the
> > returnees who buy Acorn machines on eBay.
> 
> I think the more likely scenario is that the returnees buy a beagleboard
> (or successor) and load RO5.18+ to use the OS on modern hardware.

Would they do that if they knew that none of the software that they nostalgically remembered would work?

> As Theo says the proposal was to include VFP emulation so that the
> functionality was there for slow old machines.

But as I pointed out, many of the "slow old machines" have an FPA that will be sitting idle.

Chris Bazley

[toc] | [prev] | [next] | [standalone]


#1842

Fromspampling <spam.pling@btinternet.com>
Date2012-06-27 18:13 +0100
Message-ID<52a67e261bspam.pling@btinternet.com>
In reply to#1839
In article <2118ba57-b1ca-4a22-ae0c-0c7ea693db7a@googlegroups.com>,
   <chrisbazley@bigfoot.com> wrote:
> On Wednesday, June 27, 2012 7:58:20 AM UTC+1, spampling wrote:
> > In article <1bced15b-6ff8-4bcd-8f19-93bbd3e58f06@googlegroups.com>,
> >    <chrisbazley@bigfoot.com> wrote:
> > > I don't think there are enough RISC OS users left to alienate the
> > > returnees who buy Acorn machines on eBay.
> > 
> > I think the more likely scenario is that the returnees buy a
> > beagleboard (or successor) and load RO5.18+ to use the OS on modern
> > hardware.

> Would they do that if they knew that none of the software that they
> nostalgically remembered would work?

Well a scan of the ROOL forums suggests that they are doing. Maybe
nostalgia ain't what it used to be.

> > As Theo says the proposal was to include VFP emulation so that the
> > functionality was there for slow old machines.

> But as I pointed out, many of the "slow old machines" have an FPA that
> will be sitting idle.

I thought that was covered in the emulation or detect aspect.

> Chris Bazley

-- 

Steve Pampling

[toc] | [prev] | [next] | [standalone]


#1845

Fromdruck <news@druck.org.uk>
Date2012-06-27 22:47 +0100
Message-ID<jsfv24$gq8$3@dont-email.me>
In reply to#1839
On 27/06/2012 13:44, chrisbazley@bigfoot.com wrote:
> But as I pointed out, many of the "slow old machines" have an FPA that will be sitting idle.

A hardware FPA that is slower than FPE on a StrongARM, never mind 
anything more recent!

---druck

[toc] | [prev] | [next] | [standalone]


#1847

Fromdruck <news@druck.org.uk>
Date2012-06-27 23:04 +0100
Message-ID<jsg016$oat$1@dont-email.me>
In reply to#1835
On 26/06/2012 23:17, chrisbazley@bigfoot.com wrote:
> On Tuesday, June 26, 2012 9:57:41 PM UTC+1, druck wrote:
>> On 26/06/2012 09:15, chrisbazley@bigfoot.com wrote:
>>> I think you forgot something: ARM3+FPA, ARM7500FE and emulated
>>> machines would boot slower with less free memory and run
>>> recompiled apps an order of magnitude slower.
>>
>> Do we care about FP performance on extremely old and slow
>> hardware?
>
> Well, my sister might because she uses an A5000.

We if she was worried about performance, she would surely have something
quicker, a Strong ARM Risc PC, A9, Iyonix, etc...

>> All my 32bit conversions broke compatibility with the ARM2/3 due to
>> the use of MRS/MSR instructions. I've not had one complaint in the
>> last 6 years. So I think the RISC OS world can stand a modicum of
>> progress and drop support for things produced 3 decades ago.
>
> I think it all comes down to what you think RISC OS is for.

I'm getting the feeling you think RISC OS isn't for the past, but for 
the ancient past!

> It seems that you want to run ported applications as fast as possible
> on the latest hardware, and to hell with backward compatibility. You
> don't even seem particularly bothered about executing incompatible
> code on an operating system that provides minimal safeguards against
> insidious side-effects.

No, what I want to see on RISC OS is ongoing software development 
inspired and made possible by the enhanced capabilities of new ARM 
hardware that is becoming available.

You wont get that if you insist all software maintains compatibility 
with ARM2 and and a thrice obsolete FP instruction set.

> I don't see the point of that, because you are competing with
> next-generation operating systems on exactly the same hardware, which
> I would expect to run the same applications faster and more stable
> with better control over threads and processes.

If you hadn't noticed they've already won and taken almost all of the 
developers with them, and not allowing the use of any new ARM toys aint 
going to bring them back.

> I am concerned about the effect of further fragmentation on what
> remains of the RISC OS 'scene', which is why I have never (and
> probably will never) compile software for an ISA that isn't
> compatible with ARM2. I don't think there are enough RISC OS users
> left to alienate the returnees who buy Acorn machines on eBay.

People buying old machines on ebay, only want to run sotfware from that 
era - its called a dead platform, and by not supporting anything new, 
you are making it deader.

---druck

[toc] | [prev] | [next] | [standalone]


#1848

Fromchrisbazley@bigfoot.com
Date2012-06-28 15:43 -0700
Message-ID<1893a818-f2b3-4a8f-8a39-426088123bc0@googlegroups.com>
In reply to#1847
On Wednesday, 27 June 2012 23:04:30 UTC+1, druck  wrote:
> On 26/06/2012 23:17, chrisbazley@bigfoot.com wrote:
> > I am concerned about the effect of further fragmentation on what
> > remains of the RISC OS 'scene', which is why I have never (and
> > probably will never) compile software for an ISA that isn't
> > compatible with ARM2. I don't think there are enough RISC OS users
> > left to alienate the returnees who buy Acorn machines on eBay.
> 
> People buying old machines on ebay, only want to run sotfware from that 
> era - its called a dead platform, and by not supporting anything new, 
> you are making it deader.

Would you describe Acorn MOS as "a dead platform", given that two new games were recently released by Retro Software? I don't see anyone lobbying for all that 8-bit software to be recompiled for BeagleBoard, although it is in principle possible (as demonstrated by John Kortink and Michael Foot).

Steve Revill recently wrote "RISC OS is dead as a commercial market for software developers." I would say that both of Acorn's successful operating systems are now undead. In other words, they "...are deceased and yet behave as if alive."

I am not going to repine over that if it lets me enjoy what little free time I have before I'm middle-aged, instead of trying to fix yet another half-arsed text area implementation on top of doing a day job that is not so much 9-to-5 as 10-to-0. I mention text areas because the single thing I can imagine doing to increase the sum of human happiness amongst RISC OS users would be to bring NetSurf's embarrassingly awful text area implementation up to a condition that I might even consider inflicting on human being. 

I think the fact that nobody has already done so speaks volumes. Sometimes platforms have to die to let people live.

Chris Bazley

[toc] | [prev] | [next] | [standalone]


#1820

FromThomas Milius <Thomas-Milius@t-online.de>
Date2012-06-24 08:24 +0200
Message-ID<d12cb7a452.Thomas@thomas-milius.t-online.de>
In reply to#1817
In message <js5701$ium$1@dont-email.me>
          druck <news@druck.org.uk> wrote:

> Hi,
> 
> I want to extend ARMalyser's static code analysis engine to report 
> potential alignment exceptions in ARMv7 code. Can anyone point me at 
> code known to produce alignment exceptions on the Beagle board, so I can 
> see if ARMalyser does actually spot them in real code. If possible I'd 
> like examples of both data alignment and branches with bit 0 set.
> 

A perfidious example for alignment exceptions I found together with Detlef
Tielsch inside Photodesk during our last German RISC OS user meeting. It
caused Photodesk to crash in case of clipping a certain area.

I think Photodesk used Wimp_GetWindowInfo to obtain a certain information.
Unfortunately Wimp_GetWindowInfo uses the two least significant Bits inside
the pointer passed to it for additional information because the pointer must
be word aligned and the Bits are unused.

The problem was the following. The assembler code of Photodesk set Bit 0
and called Wimp_GetWindowInfo. However it reused R1 afterwards without a
change to examine the returned window header information. As Bit 0 wasn't
evaluated at older ARMs this worked fine until ARM v7 architecture. A simple
masking of the two lower Bits cured the problem.

I think there are a couple of RISC OS SWIs making usage of the trick with
the two lower unused Bits. So perhaps you can check whether such an SWI
call is made perhaps with one of the two Bits set and check afterwards wether
the content of the register is preserved by the SWI and whether it is reused
afterwards for addressing without setting it with a new value. A more simple
solution would be to flag all such potential SWI calls and leave it to the
programmer to check the calls manually.

Best Regards

Thomas Milius

[toc] | [prev] | [next] | [standalone]


#1823

Fromdruck <news@druck.org.uk>
Date2012-06-24 11:37 +0100
Message-ID<js6qko$71i$2@dont-email.me>
In reply to#1820
On 24/06/2012 07:24, Thomas Milius wrote:
> A perfidious example for alignment exceptions I found together with Detlef
> Tielsch inside Photodesk during our last German RISC OS user meeting. It
> caused Photodesk to crash in case of clipping a certain area.

Thanks, but can you point out which of the hundred odd executable files 
contains the problem.

---druck

[toc] | [prev] | [next] | [standalone]


#1824

FromThomas Milius <Thomas-Milius@t-online.de>
Date2012-06-24 12:49 +0200
Message-ID<d073cfa452.Thomas@thomas-milius.t-online.de>
In reply to#1823
In message <js6qko$71i$2@dont-email.me>
          druck <news@druck.org.uk> wrote:

> On 24/06/2012 07:24, Thomas Milius wrote:
> > A perfidious example for alignment exceptions I found together with
> > Detlef Tielsch inside Photodesk during our last German RISC OS user
> > meeting. It caused Photodesk to crash in case of clipping a certain area.
> 
> Thanks, but can you point out which of the hundred odd executable files 
> contains the problem.
> 

Detlef had the source not myself. I only located and corrected the bug
temporarily. And of course it is repaired since a while in a proper way. So I
don't see a chance to help you with code to check from my side. Sorry.
Perhaps Detlef is renembering the piece of code.

Best Regards

Thomas Milius

[toc] | [prev] | [next] | [standalone]


#1826

Fromdruck <news@druck.freeuk.com>
Date2012-06-24 17:01 +0100
Message-ID<45faeba452.druck@druck.freeuk.net>
In reply to#1824
On 24 Jun 2012 Thomas Milius <Thomas-Milius@t-online.de> wrote:
> In message <js6qko$71i$2@dont-email.me>
>           druck <news@druck.org.uk> wrote:
>> On 24/06/2012 07:24, Thomas Milius wrote:
>>> A perfidious example for alignment exceptions I found together with
>>> Detlef Tielsch inside Photodesk during our last German RISC OS user
>>> meeting. It caused Photodesk to crash in case of clipping a certain area.
>> 
>> Thanks, but can you point out which of the hundred odd executable files
>> contains the problem.

> Detlef had the source not myself. I only located and corrected the bug
> temporarily. And of course it is repaired since a while in a proper way. So I
> don't see a chance to help you with code to check from my side. Sorry.
> Perhaps Detlef is renembering the piece of code.

I also have all the source from doing the 32bit port, it's just 
working out which one of the files it is in - there are lots!

---druck

-- 
The ARM Club Free Software - http://www.armclub.org.uk/free/
32 bit Conversions Page    - http://www.armclub.org.uk/32bit/

[toc] | [prev] | [next] | [standalone]


#1828

FromThomas Milius <Thomas-Milius@t-online.de>
Date2012-06-24 19:16 +0100
Message-ID<8a69f8a452.Thomas@thomas-milius.t-online.de>
In reply to#1826
In message <45faeba452.druck@druck.freeuk.net>
          druck <news@druck.freeuk.com> wrote:

> On 24 Jun 2012 Thomas Milius <Thomas-Milius@t-online.de> wrote:

> > Detlef had the source not myself. I only located and corrected the bug
> > temporarily. And of course it is repaired since a while in a proper way.
> > So I don't see a chance to help you with code to check from my side.
> > Sorry. Perhaps Detlef is renembering the piece of code.
> 
> I also have all the source from doing the 32bit port, it's just 
> working out which one of the files it is in - there are lots!
> 

Taken from Detlefs Mail correspondence

-Temporary fix of the copy bug with ARM v7 architecture (crash) in
 module Photodesk
        ORR     R1,R1,#1
        SWI     Wimp_GetWindowInfo
        EOR     R1,R1,#1                  ; clear bit 0 !!!!
        ADD     R2,R1,#&2C                      ; ="," (44)
        LDMIA   R2!,{R3-R6}
        ADD     R2,R1,#4
        STMIA   R2!,{R3-R6}
        LDR     R1,[R11,#8]
        SWI     Wimp_UpdateWindow
 also one statement reported as not 32 bit corrected by changing
        from:
       
        LDMIA   R12,{R1-R3,R6,R7,R11,R12,R14,PC}~ ;~~ not 32bit safe
                                                   (uses PSR)
        to simply:
        LDMIA   R12,{R1-R3,R6,R7,R11,R12,R14,PC}
 Module Photodesk assembled and linked from the (amended) Armalyser output.
 Clearly this should be included in the original sources after testing
 21/Aug/2011
 
 Hope this helps. The EOR R1, R1, #1 was the temporary correction. Without
 it the program will crash.
 
 Best Regards
 
 Thomas Milius
 

[toc] | [prev] | [next] | [standalone]


#1900

From"Ste (news)" <steve@revi11.plus.com>
Date2012-07-10 00:14 +0100
Message-ID<52accd2bd9steve@revi11.plus.com>
In reply to#1828
In article <8a69f8a452.Thomas@thomas-milius.t-online.de>,
   Thomas Milius <Thomas-Milius@t-online.de> wrote:
>         EOR     R1,R1,#1                  ; clear bit 0 !!!!

BIC anyone?

Steve

-- 
Steve Revill @ Home
Note: All opinions expressed herein are my own.

[toc] | [prev] | [next] | [standalone]


#1821

FromSteve Fryatt <news@stevefryatt.org.uk>
Date2012-06-24 09:42 +0100
Message-ID<mpro.m645im016d7eo01ka.news@stevefryatt.org.uk>
In reply to#1817
On 23 Jun, druck wrote in message
    <js5701$ium$1@dont-email.me>:

> I want to extend ARMalyser's static code analysis engine to report
> potential alignment exceptions in ARMv7 code. Can anyone point me at code
> known to produce alignment exceptions on the Beagle board, so I can see if
> ARMalyser does actually spot them in real code. If possible I'd like
> examples of both data alignment and branches with bit 0 set.
> 
> Free software which I can download would be my first preference, but if
> anyone has some of their own code (such as old versions of software prior
> to being fixed), please reply before sending the code so my mail box
> doesn't get full.

Versions of IcnClipBrd prior to 0.16 had LDRs from unaligned addresses. I've
stuck 0.15 back up on my website at

  http://www.stevefryatt.org.uk/software/clipboard/icnclipbrd015.zip

if you want to download a copy.  As Chris points out, though, both issues
are cases of trying to do LDRB Rx,[Ry,Rz] with an LDR Rx,[Ry,Rz] so you
would be trying to spot that Ry+Rz can result in unaligned addresses being
fed to an LDR.

For anyone else who actually wants to /use/ the software, please stick to
version 0.16 from

  http://www.stevefryatt.org.uk/software/clipboard/

-- 
Steve Fryatt - Leeds, England

http://www.stevefryatt.org.uk/

[toc] | [prev] | [next] | [standalone]


#1841

FromMartin <News03@avisoft.f9.co.uk>
Date2012-06-27 15:36 +0100
Message-ID<52a66fb4ecNews03@avisoft.f9.co.uk>
In reply to#1817
Did you get my mail to news@ about a possible exception example?

Or do you lose mails to this reply address?!

-- 
Martin Avison 
Note that unfortunately this email address will become invalid
without notice if (when) any spam is received. 

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.sys.acorn.programmer


csiph-web