In PowerPC libem, use the new features of our assembler.
authorGeorge Koehler <xkernigh@netscape.net>
Mon, 23 Jan 2017 22:16:39 +0000 (17:16 -0500)
committerGeorge Koehler <xkernigh@netscape.net>
Mon, 23 Jan 2017 22:16:39 +0000 (17:16 -0500)
commit032bcffef610e94406c192e39d67b5231c2d7ab1
tree5b6a2d9e72e3f721eece1f40bc4e9efd057bec74
parenta41b6f0458604a32d34e94f68644055285a11ab5
In PowerPC libem, use the new features of our assembler.

The new features are the hi16/lo16 and ha16/lo16 syntax for
relocations, and the extended mnemonics like "blr".

Use ha16/lo16 to load some double floats with 2 instructions (lis/lfd)
instead of 3 (lis/ori/lfd).

Use the extended names for branches, comparisons, and bit rotations,
so I can more easily read the code.  The new names often encode the
same machine instructions as the old names, except in a few places
where I changed the instructions.

Stop using andi. when we don't need to set cr0.  In inn.s, I change
andi. to extrwi to extract the same bits.  In los.s and sts.s, I
change "andi. r3, r3, ~3" to "clrrwi r3, r3, 2".  This avoids setting
cr0 and also stops clearing the high 16 bits of r3.

In csa.s, los.s, sts.s, I change some comparisons and right shifts
from signed to unsigned (cmplw, cmplwi, srwi), because the sizes are
unsigned.  In inn.s, the right shift can be signed (sraw) or unsigned
(srw), but I use srw because we don't need the carry bit.

In fef8.s, I save an instruction by using rlwinm instead of addis/andc
to rlwinm to clear a field.  The code no longer kills r7.  In both
fef8.s and fif8.s, I remove the list of killed registers.

Also remove some whitespace from ends of lines.
26 files changed:
mach/powerpc/libem/aar4.s
mach/powerpc/libem/and.s
mach/powerpc/libem/cfi8.s
mach/powerpc/libem/cfu8.s
mach/powerpc/libem/cif8.s
mach/powerpc/libem/cms.s
mach/powerpc/libem/com.s
mach/powerpc/libem/csa.s
mach/powerpc/libem/csb.s
mach/powerpc/libem/cuf8.s
mach/powerpc/libem/fd_00000000.s
mach/powerpc/libem/fd_80000000.s
mach/powerpc/libem/fd_FFFFFFFF.s
mach/powerpc/libem/fef8.s
mach/powerpc/libem/fif8.s
mach/powerpc/libem/inn.s
mach/powerpc/libem/ior.s
mach/powerpc/libem/lar4.s
mach/powerpc/libem/los.s
mach/powerpc/libem/rck.s
mach/powerpc/libem/ret.s
mach/powerpc/libem/sar4.s
mach/powerpc/libem/set.s
mach/powerpc/libem/sts.s
mach/powerpc/libem/xor.s
mach/powerpc/libem/zer.s