Hi Doug, Hi Tim, Hi All,
so yesterday I finally switched on the Raspberry Pi Doug gave me as an xmas present, built the Spur ARM Cog VM and ... we definitely have a working VM. I was able to update a Spur image from mid February all the way to tip and run tests. 3751 run, 3628 passes, 24 expected failures, 89 failures, 10 errors, 0 unexpected passes
Fun! So I want to revisit the literal load question.
Doug got me a Pi 1 B. cat /proc/cpuinfo reveals
processor : 0
model name : ARMv6-compatible processor rev 7 (v6l)
Features : swp half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7
Hardware : BCM2708
Revision : 000e
Serial : 00000000fe7b08eb
4.4 Load immediate values using MOV and MVN
The MOV and MVN instructions can write a range of immediate values to a register.
In ARM state:
MOV can load any 8-bit immediate value, giving a range of 0x0-0xFF (0-255).
It can also rotate these values by any even number.
These values are also available as immediate operands in many data processing operations, without being loaded in a separate instruction.
MVN can load the bitwise complements of these values. The numerical values are -(n+1), where n is the value available in MOV.
In ARMv6T2 and later, MOV can load any 16-bit number, giving a range of 0x0-0xFFFF (0-65535).
The following table shows the range of 8-bit values that can be loaded in a single ARM MOV or MVN instruction (for data processing operations). The value to load must be a multiple of the value shown in the Step column.
So it looks to me that the right approach is to add an ARMv6 subclass to CogARMInstruction that uses the 16-bit literal load instructions and use that as our standard 32-bit ARM code generator. But I'm ignorant as to the processor versions used in the Raspberry Pi. Are all RPis ARMv6? What exactly is ARMv6T2? I'm guessing that T2 refers to Thunmb2, is that correct? And on the specific question can anyone think of a good reason /not/ to use the 16-bit literal load approach?