[PATCH 1/6] powerpc sstep: Add maddhd, maddhdu, maddld instruction emulation

Segher Boessenkool segher at kernel.crashing.org
Wed Sep 5 08:12:23 AEST 2018


On Mon, Sep 03, 2018 at 08:49:33PM +0530, Sandipan Das wrote:
> +#ifdef __powerpc64__
> +	case 4:
> +		if (!cpu_has_feature(CPU_FTR_ARCH_300))
> +			return -1;
> +
> +		switch (instr & 0x3f) {
> +		case 48:	/* maddhd */
> +			asm("maddhd %0,%1,%2,%3" : "=r" (op->val) :
> +			    "r" (regs->gpr[ra]), "r" (regs->gpr[rb]),
> +			    "r" (regs->gpr[rc]));
> +			goto compute_done;

If running maddhd does not work, will running it in kernel mode work?

I think you should *actually* emulate it.

(Same for the next patch, "darn", but emulation of that is much more
interesting).


Segher


More information about the Linuxppc-dev mailing list