create schedule for calculating COS coefficient in DCT
[openpower-isa.git] / openpower / isa / bcd.mdwn
1 <!-- Instructions here described in PowerISA Version 3.0 B Book 1 -->
2
3 <!-- Section 3.3.15 Binary Coded Decimal (BCD) Assist Instructions. Page 111 -->
4
5 <!-- The Binary Coded Decimal Assist instructions operate on Binary Coded Decimal -->
6 <!-- operands (cbcdtd and addg6s) and Decimal Floating-Point operands (cdtbcd) -->
7 <!-- See Chapter 5. for additional information. -->
8
9
10 # Convert Declets To Binary Coded Decimal
11
12 X-Form
13
14 * cdtbcd RA, RS
15
16 Pseudo-code:
17
18 do i = 0 to 1
19 n <- i * 32
20 RA[n+0:n+7] <- 0
21 RA[n+8:n+19 ] <- DPD_TO_BCD ( (RS)[n+12:n+21] )
22 RA[n+20:n+31] <- DPD_TO_BCD ( (RS)[n+22:n+31] )
23
24 Special Registers Altered:
25
26 None
27
28 # Add and Generate Sixes
29
30 XO-Form
31
32 * addg6s RT,RA,RB
33
34 Pseudo-code:
35
36 do i = 0 to 15
37 dci <- carry_out(RA[4*i:63] + RB[4*i:63])
38 c <- ([dc[0]]*4 || [dc[1]]*4 || [dc[2]]*4 || [dc[3]]*4 ||
39 [dc[4]]*4 || [dc[5]]*4 || [dc[6]]*4 || [dc[7]]*4 ||
40 [dc[8]]*4 || [dc[9]]*4 || [dc[10]]*4 || [dc[11]]*4 ||
41 [dc[12]]*4 || [dc[13]]*4 || [dc[14]]*4 || [dc[15]]*4)
42 RT <- (¬c) & 0x6666_6666_6666_6666
43
44 Special Registers Altered:
45
46 None
47
48 # Convert Binary Coded Decimal To Declets
49
50 X-Form
51
52 * cbcdtd RA, RS
53
54 Pseudo-code:
55
56 do i = 0 to 1
57 n <- i * 32
58 RA[n+0:n+11] <- 0
59 RA[n+12:n+21] <- BCD_TO_DPD ( (RS)[n+8:n+19] )
60 RA[n+22:n+31] <- BCD_TO_DPD ( (RS)[n+20:n+31] )
61
62 Special Registers Altered:
63
64 None
65
66 <!-- Checked March 2021 -->