prod_lo <- prod[XLEN:(XLEN*2)-1]
if n = 0 then
RT <- (RT) + prod_lo
+ RS <- (RS) - prod_lo
else
- res <- (RT) + prod_lo
+ res1 <- (RT) + prod_lo
+ res2 <- (RS) - prod_lo
round <- [0]*XLEN
round[XLEN -n] <- 1
- res <- res + round
- signbit <- res[0]
+ res1 <- res1 + round
+ res2 <- res2 + round
+ signbit1 <- res1[0]
+ signbit2 <- res2[0]
m <- MASK(n, (XLEN-1))
- res <- ROTL64(res, XLEN-n) & m
- smask <- ([signbit]*XLEN) & ¬m
- RT <- (res | smask)
-
-Special Registers Altered:
-
- None
-
-# [DRAFT] Integer Butterfly Multiply Subtract From FFT/DCT
-
-A-Form
-
-* msubrs RT,RA,SH,RB
-
-Pseudo-code:
-
- n <- SH
- prod <- MULS(RB, RA)
- prod_lo <- prod[XLEN:(XLEN*2)-1]
- if n = 0 then
- RT <- (RT) - prod_lo
- else
- res <- (RT) - prod_lo
- round <- [0]*XLEN
- round[XLEN -n] <- 1
- res <- res + round
- signbit <- res[0]
- m <- MASK(n, (XLEN-1))
- res <- ROTL64(res, XLEN-n) & m
- smask <- ([signbit]*XLEN) & ¬m
- RT <- (res | smask)
+ res1 <- ROTL64(res1, XLEN-n) & m
+ res2 <- ROTL64(res2, XLEN-n) & m
+ smask1 <- ([signbit1]*XLEN) & ¬m
+ smask2 <- ([signbit2]*XLEN) & ¬m
+ RT <- (res1 | smask1)
+ RS <- (res2 | smask2)
Special Registers Altered:
-----01011-,ALU,OP_FISHMV,FRS,CONST_UI,NONE,FRS,NONE,NONE,0,0,ZERO,0,NONE,0,0,0,0,0,0,NONE,0,0,fishmv,DX,,1,unofficial until submitted and approved/renumbered by the opf isa wg
------01000,ALU,OP_MADDSUBRS,RA,CONST_SH,RB,RT,NONE,NONE,0,0,ZERO,0,NONE,0,0,0,0,1,0,NONE,0,0,maddsubrs,A,,1,unofficial until submitted and approved/renumbered by the opf isa wg
------01001,ALU,OP_MADDRS,RA,CONST_SH,RB,RT,NONE,NONE,0,0,ZERO,0,NONE,0,0,0,0,1,0,NONE,0,0,maddrs,A,,1,unofficial until submitted and approved/renumbered by the opf isa wg
-------01010,ALU,OP_MSUBRS,RA,CONST_SH,RB,RT,NONE,NONE,0,0,ZERO,0,NONE,0,0,0,0,1,0,NONE,0,0,msubrs,A,,1,unofficial until submitted and approved/renumbered by the opf isa wg
"maddhd", "maddhdu", "maddld", # INT multiply-and-add
"maddsubrs", # Integer DCT Butterfly Add Sub and Round Shift
"maddrs", # Integer DCT Butterfly Add and Accumulate and Round Shift
- "msubrs", # Integer DCT Butterfly Subtract From and Round Shift
"mcrf", "mcrxr", "mcrxrx", "mfcr/mfocrf", # CR mvs
"mfmsr", "mfspr",
"minmax", # AV bitmanip
OP_SHADD = 103
OP_MADDSUBRS = 104
OP_MADDRS = 105
- OP_MSUBRS = 106
class In1Sel(Enum):
def case_0_maddrs(self):
isa = SVP64Asm(["maddsubrs 1,10,0,11",
- "maddrs 1,10,0,12",
- "msubrs 2,10,0,12"])
+ "maddrs 1,10,0,12"])
lst = list(isa)
initial_regs = [0] * 32
initial_regs[11] = 0x00002d41
initial_regs[12] = 0x00000d00
- e = ExpectedState(pc=12)
+ e = ExpectedState(pc=8)
e.intregs[1] = 0x3658c869
e.intregs[2] = 0xffffffffcd583ef9
e.intregs[10] = 0x0000e6b8
def case_1_maddrs(self):
isa = SVP64Asm(["maddsubrs 1,10,0,11",
- "maddrs 1,10,14,12",
- "msubrs 2,10,14,12"])
+ "maddrs 1,10,14,12"])
lst = list(isa)
initial_regs = [0] * 32
initial_regs[11] = 0x00002d41
initial_regs[12] = 0x00000d00
- e = ExpectedState(pc=12)
+ e = ExpectedState(pc=8)
e.intregs[1] = 0x0000d963
e.intregs[2] = 0xffffffffffff3561
e.intregs[10] = 0x0000e6b8