Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2014-08

Code generator issue for Cortex-M0 chips in trunk

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Ring

There seems to be a bug in the codegenerator for armv6m thumb code.

tst r0,#-2147483648

is not valid armv6m assembler code, documentation says that tst only can use registers:

TST Rn, Rm

where:
Rn Is the register holding the first operand. Rm The register to test against.

Cortex-M0+ Devices Generic User Guide

Restrictions

In these instructions, Rn and Rm must only specify R0-R7.

Cortex-M0+ Devices Generic User Guide
Could somebody please fix?

Thank you,

Michael

/Users/ring/devel/fpc-arm/compiler/ppcrossarm -Cparmv6m @rtl.cfg -Ur -Tembedded -Parm -XParm-none-eabi- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm -FE. -FU/Users/ring/devel/fpc-arm/rtl/units/arm-embedded -darm -dRELEASE -O- -gw2 -Us -Sg system.pp
/Users/ring/devel/fpc-arm/rtl/units/arm-embedded/system.s: Assembler messages:
/Users/ring/devel/fpc-arm/rtl/units/arm-embedded/system.s:342: Error: unshifted register required -- `tst r0,#-2147483648'

Reply by email

Sven Barth
to Michael Ring
"Michael Ring" wrote 6 lines
There seems to be a bug in the codegenerator for armv6m thumb code. tst r0,#-2147483648 is not valid armv6m assembler code, documentation says that tst only can

use registers:

Show quoted text 5 lines
TST Rn, Rm where: Rn Is the register holding the first operand. Rm The register to test

against.

Show quoted text 7 lines
Restrictions In these instructions, Rn and Rm must only specify R0-R7. Could somebody please fix?

Maybe best report as a bug so that it isn't forgotten.

Regards,
Sven

Reply by email

Michael Ring
to Sven Barth

Will do so ....

Michael

Sven Barth wrote 34 lines
Am 08.08.2014 10:29 schrieb "Michael Ring" < >: > > There seems to be a bug in the codegenerator for armv6m thumb code. > > tst r0,#-2147483648 > > is not valid armv6m assembler code, documentation says that tst only can use registers: > > TST Rn, Rm > > where: > Rn Is the register holding the first operand. Rm The register to test against. > > Restrictions > > In these instructions, Rn and Rm must only specify R0-R7. > > > Could somebody please fix? Maybe best report as a bug so that it isn't forgotten. Regards, Sven _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Michael Ring
to Nico Erfurth

The patch worked, generated assembler looks ok, will test on device this evening

Nico Erfurth wrote 20 lines
On 08.08.14 10:28, Michael Ring wrote: > There seems to be a bug in the codegenerator for armv6m thumb code. > > tst r0,#-2147483648 > > is not valid armv6m assembler code, documentation says that tst only can > use registers: > > TST Rn, Rm Please try the attached patch, it should solve the problem, I'll commit it after testing. Nico _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email