Subject: Re: ARM710 bug in UMULL
To: None <kim@pvv.ntnu.no>
From: Richard Earnshaw <rearnsha@arm.com>
List: port-arm32
Date: 11/01/2001 11:45:47
> Do you know a reference to this information? More information?

The ARM ARM covers everything about which architectures support which 
instructions.  The ARM710a is a ARM architecture v3 device.  Umull was 
added in the v3M extension.

> Are there ARM7M chips pin-compatible with ARM710a perhaps?

I'm not aware of any; that doesn't mean that they don't exist, but I think 
it is unlikely now -- I don't even think an ARM710T chip (v4) (if such a 
beast exists as a standard part) would be pin compatible.  Even if they 
do, there is a strong chance that RISC OS won't recognize the device.

> Strangely, according to my Acorn ARM assembler manual, UMULL is supported.
> I will have to write a macro to emulate it then. I hope GNU as is flexible
> enough to support that. If not... I don`t know.

I've never tried this sort of thing.  Unfortunately, older ARM chips were 
rather lax at faulting unused parts of the instruction space, so I don't 
think the chip will even take the undefined instruction fault if it tries 
to execute a umull.  If it did, then emulation could easily be handled by 
inserting an undefined instruction handler.

However, that does bring up an idea, which might be made to work

The ARM ARM defines 

	0b cccc 011x xxxx xxxx xxxx xxxx xxx1 xxxx

to be undefined (and the ARM7 data sheet I have says that these 
instructions will fault).  You could make the macro in your assembler 
recode the umul/smul/umla/smla instructions to use this space (to fully 
encode the long multiply instructions needs 19 bits -- 4x4bits for 
registers, 1 for set-cond and 2 for instruction type -- you have 24 to 
play with here) and then install an undefined instruction handler to 
interpret this.  This might be easier than trying to synthesize the umul 
inline, which might start to get tricky when you have to preserve all the 
state that is normally preserved.

R.