multiply_and_divide.py (6459:f7f0d361d6fc) | multiply_and_divide.py (6463:fe6165923529) |
---|---|
1# Copyright (c) 2007 The Hewlett-Packard Development Company 2# All rights reserved. 3# 4# Redistribution and use of this software in source and binary forms, 5# with or without modification, are permitted provided that the 6# following conditions are met: 7# 8# The software must be used only for Non-Commercial Use which means any --- 47 unchanged lines hidden (view full) --- 56microcode = ''' 57 58# 59# Byte version of one operand unsigned multiply. 60# 61 62def macroop MUL_B_R 63{ | 1# Copyright (c) 2007 The Hewlett-Packard Development Company 2# All rights reserved. 3# 4# Redistribution and use of this software in source and binary forms, 5# with or without modification, are permitted provided that the 6# following conditions are met: 7# 8# The software must be used only for Non-Commercial Use which means any --- 47 unchanged lines hidden (view full) --- 56microcode = ''' 57 58# 59# Byte version of one operand unsigned multiply. 60# 61 62def macroop MUL_B_R 63{ |
64 mul1u rax, reg | 64 mul1u rax, reg, flags=(OF,CF) |
65 mulel rax | 65 mulel rax |
66 muleh ah, flags=(OF,CF) | 66 muleh ah |
67}; 68 69def macroop MUL_B_M 70{ 71 ld t1, seg, sib, disp | 67}; 68 69def macroop MUL_B_M 70{ 71 ld t1, seg, sib, disp |
72 mul1u rax, t1 | 72 mul1u rax, t1, flags=(OF,CF) |
73 mulel rax | 73 mulel rax |
74 muleh ah, flags=(OF,CF) | 74 muleh ah |
75}; 76 77def macroop MUL_B_P 78{ 79 rdip t7 80 ld t1, seg, riprel, disp | 75}; 76 77def macroop MUL_B_P 78{ 79 rdip t7 80 ld t1, seg, riprel, disp |
81 mul1u rax, t1 | 81 mul1u rax, t1, flags=(OF,CF) |
82 mulel rax | 82 mulel rax |
83 muleh ah, flags=(OF,CF) | 83 muleh ah |
84}; 85 86# 87# One operand unsigned multiply. 88# 89 90def macroop MUL_R 91{ | 84}; 85 86# 87# One operand unsigned multiply. 88# 89 90def macroop MUL_R 91{ |
92 mul1u rax, reg | 92 mul1u rax, reg, flags=(OF,CF) |
93 mulel rax | 93 mulel rax |
94 muleh rdx, flags=(OF,CF) | 94 muleh rdx |
95}; 96 97def macroop MUL_M 98{ 99 ld t1, seg, sib, disp | 95}; 96 97def macroop MUL_M 98{ 99 ld t1, seg, sib, disp |
100 mul1u rax, t1 | 100 mul1u rax, t1, flags=(OF,CF) |
101 mulel rax | 101 mulel rax |
102 muleh rdx, flags=(OF,CF) | 102 muleh rdx |
103}; 104 105def macroop MUL_P 106{ 107 rdip t7 108 ld t1, seg, riprel, disp | 103}; 104 105def macroop MUL_P 106{ 107 rdip t7 108 ld t1, seg, riprel, disp |
109 mul1u rax, t1 | 109 mul1u rax, t1, flags=(OF,CF) |
110 mulel rax | 110 mulel rax |
111 muleh rdx, flags=(OF,CF) | 111 muleh rdx |
112}; 113 114# 115# Byte version of one operand signed multiply. 116# 117 118def macroop IMUL_B_R 119{ | 112}; 113 114# 115# Byte version of one operand signed multiply. 116# 117 118def macroop IMUL_B_R 119{ |
120 mul1s rax, reg | 120 mul1s rax, reg, flags=(OF,CF) |
121 mulel rax | 121 mulel rax |
122 muleh ah, flags=(OF,CF) | 122 muleh ah |
123}; 124 125def macroop IMUL_B_M 126{ 127 ld t1, seg, sib, disp | 123}; 124 125def macroop IMUL_B_M 126{ 127 ld t1, seg, sib, disp |
128 mul1s rax, t1 | 128 mul1s rax, t1, flags=(OF,CF) |
129 mulel rax | 129 mulel rax |
130 muleh ah, flags=(OF,CF) | 130 muleh ah |
131}; 132 133def macroop IMUL_B_P 134{ 135 rdip t7 136 ld t1, seg, riprel, disp | 131}; 132 133def macroop IMUL_B_P 134{ 135 rdip t7 136 ld t1, seg, riprel, disp |
137 mul1s rax, t1 | 137 mul1s rax, t1, flags=(OF,CF) |
138 mulel rax | 138 mulel rax |
139 muleh ah, flags=(OF,CF) | 139 muleh ah |
140}; 141 142# 143# One operand signed multiply. 144# 145 146def macroop IMUL_R 147{ | 140}; 141 142# 143# One operand signed multiply. 144# 145 146def macroop IMUL_R 147{ |
148 mul1s rax, reg | 148 mul1s rax, reg, flags=(OF,CF) |
149 mulel rax | 149 mulel rax |
150 muleh rdx, flags=(OF,CF) | 150 muleh rdx |
151}; 152 153def macroop IMUL_M 154{ 155 ld t1, seg, sib, disp | 151}; 152 153def macroop IMUL_M 154{ 155 ld t1, seg, sib, disp |
156 mul1s rax, t1 | 156 mul1s rax, t1, flags=(OF,CF) |
157 mulel rax | 157 mulel rax |
158 muleh rdx, flags=(OF,CF) | 158 muleh rdx |
159}; 160 161def macroop IMUL_P 162{ 163 rdip t7 164 ld t1, seg, riprel, disp | 159}; 160 161def macroop IMUL_P 162{ 163 rdip t7 164 ld t1, seg, riprel, disp |
165 mul1s rax, t1 | 165 mul1s rax, t1, flags=(OF,CF) |
166 mulel rax | 166 mulel rax |
167 muleh rdx, flags=(OF,CF) | 167 muleh rdx |
168}; 169 170def macroop IMUL_R_R 171{ | 168}; 169 170def macroop IMUL_R_R 171{ |
172 mul1s reg, regm | 172 mul1s reg, regm, flags=(OF,CF) |
173 mulel reg | 173 mulel reg |
174 muleh t0, flags=(CF,OF) | 174 muleh t0 |
175}; 176 177def macroop IMUL_R_M 178{ 179 ld t1, seg, sib, disp | 175}; 176 177def macroop IMUL_R_M 178{ 179 ld t1, seg, sib, disp |
180 mul1s reg, t1 | 180 mul1s reg, t1, flags=(CF,OF) |
181 mulel reg | 181 mulel reg |
182 muleh t0, flags=(CF,OF) | 182 muleh t0 |
183}; 184 185def macroop IMUL_R_P 186{ 187 rdip t7 188 ld t1, seg, riprel, disp | 183}; 184 185def macroop IMUL_R_P 186{ 187 rdip t7 188 ld t1, seg, riprel, disp |
189 mul1s reg, t1 | 189 mul1s reg, t1, flags=(CF,OF) |
190 mulel reg | 190 mulel reg |
191 muleh t0, flags=(CF,OF) | 191 muleh t0 |
192}; 193 194# 195# Three operand signed multiply. 196# 197 198def macroop IMUL_R_R_I 199{ 200 limm t1, imm | 192}; 193 194# 195# Three operand signed multiply. 196# 197 198def macroop IMUL_R_R_I 199{ 200 limm t1, imm |
201 mul1s regm, t1 | 201 mul1s regm, t1, flags=(OF,CF) |
202 mulel reg | 202 mulel reg |
203 muleh t0, flags=(OF,CF) | 203 muleh t0 |
204}; 205 206def macroop IMUL_R_M_I 207{ 208 limm t1, imm 209 ld t2, seg, sib, disp | 204}; 205 206def macroop IMUL_R_M_I 207{ 208 limm t1, imm 209 ld t2, seg, sib, disp |
210 mul1s t2, t1 | 210 mul1s t2, t1, flags=(OF,CF) |
211 mulel reg | 211 mulel reg |
212 muleh t0, flags=(OF,CF) | 212 muleh t0 |
213}; 214 215def macroop IMUL_R_P_I 216{ 217 rdip t7 218 limm t1, imm 219 ld t2, seg, riprel | 213}; 214 215def macroop IMUL_R_P_I 216{ 217 rdip t7 218 limm t1, imm 219 ld t2, seg, riprel |
220 mul1s t2, t1 | 220 mul1s t2, t1, flags=(OF,CF) |
221 mulel reg | 221 mulel reg |
222 muleh t0, flags=(OF,CF) | 222 muleh t0 |
223}; 224 225# 226# One byte version of unsigned division 227# 228 229def macroop DIV_B_R 230{ --- 597 unchanged lines hidden --- | 223}; 224 225# 226# One byte version of unsigned division 227# 228 229def macroop DIV_B_R 230{ --- 597 unchanged lines hidden --- |