]> asedeno.scripts.mit.edu Git - linux.git/commit
powerpc/lib/sstep: Fix fixed-point arithmetic instructions that set CA32
authorSandipan Das <sandipan@linux.vnet.ibm.com>
Fri, 29 Sep 2017 05:44:09 +0000 (11:14 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 4 Oct 2017 00:28:03 +0000 (11:28 +1100)
commitdc39c1d68f256990d4bb0033a219e8ca15ba4d7f
tree9459c42df2f2d8a8df64a4d588ee859c40ce576a
parent924c8feb041c3ef22d46ac2e7468161aad85e979
powerpc/lib/sstep: Fix fixed-point arithmetic instructions that set CA32

There are existing fixed-point arithmetic instructions that always set the
CA bit of XER to reflect the carry out of bit 0 in 64-bit mode and out of
bit 32 in 32-bit mode. In ISA v3.0, these instructions also always set the
CA32 bit of XER to reflect the carry out of bit 32.

This fixes the emulated behaviour of such instructions when running on a
system that is compliant with POWER ISA v3.0. The following instructions
are affected:
  * Add Immediate Carrying (addic)
  * Add Immediate Carrying and Record (addic.)
  * Subtract From Immediate Carrying (subfic)
  * Add Carrying (addc[.])
  * Subtract From Carrying (subfc[.])
  * Add Extended (adde[.])
  * Subtract From Extended (subfe[.])
  * Add to Minus One Extended (addme[.])
  * Subtract From Minus One Extended (subfme[.])
  * Add to Zero Extended (addze[.])
  * Subtract From Zero Extended (subfze[.])

Fixes: 0016a4cf5582 ("powerpc: Emulate most Book I instructions in emulate_step()")
Signed-off-by: Sandipan Das <sandipan@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/lib/sstep.c