InstEmitAlu32.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. using ARMeilleure.Decoders;
  2. using ARMeilleure.IntermediateRepresentation;
  3. using ARMeilleure.State;
  4. using ARMeilleure.Translation;
  5. using static ARMeilleure.Instructions.InstEmitAluHelper;
  6. using static ARMeilleure.Instructions.InstEmitHelper;
  7. using static ARMeilleure.IntermediateRepresentation.OperandHelper;
  8. namespace ARMeilleure.Instructions
  9. {
  10. static partial class InstEmit32
  11. {
  12. public static void Add(ArmEmitterContext context)
  13. {
  14. IOpCode32Alu op = (IOpCode32Alu)context.CurrOp;
  15. Operand n = GetAluN(context);
  16. Operand m = GetAluM(context, setCarry: false);
  17. Operand res = context.Add(n, m);
  18. if (op.SetFlags)
  19. {
  20. EmitNZFlagsCheck(context, res);
  21. EmitAddsCCheck(context, n, res);
  22. EmitAddsVCheck(context, n, m, res);
  23. }
  24. EmitAluStore(context, res);
  25. }
  26. public static void Adc(ArmEmitterContext context)
  27. {
  28. IOpCode32Alu op = (IOpCode32Alu)context.CurrOp;
  29. Operand n = GetAluN(context);
  30. Operand m = GetAluM(context, setCarry: false);
  31. Operand res = context.Add(n, m);
  32. Operand carry = GetFlag(PState.CFlag);
  33. res = context.Add(res, carry);
  34. if (op.SetFlags)
  35. {
  36. EmitNZFlagsCheck(context, res);
  37. EmitAdcsCCheck(context, n, res);
  38. EmitAddsVCheck(context, n, m, res);
  39. }
  40. EmitAluStore(context, res);
  41. }
  42. public static void And(ArmEmitterContext context)
  43. {
  44. IOpCode32Alu op = (IOpCode32Alu)context.CurrOp;
  45. Operand n = GetAluN(context);
  46. Operand m = GetAluM(context);
  47. Operand res = context.BitwiseAnd(n, m);
  48. if (op.SetFlags)
  49. {
  50. EmitNZFlagsCheck(context, res);
  51. }
  52. EmitAluStore(context, res);
  53. }
  54. public static void Bfc(ArmEmitterContext context)
  55. {
  56. OpCode32AluBf op = (OpCode32AluBf)context.CurrOp;
  57. Operand d = GetIntA32(context, op.Rd);
  58. Operand res = context.BitwiseAnd(d, Const(~op.DestMask));
  59. SetIntA32(context, op.Rd, res);
  60. }
  61. public static void Bfi(ArmEmitterContext context)
  62. {
  63. OpCode32AluBf op = (OpCode32AluBf)context.CurrOp;
  64. Operand n = GetIntA32(context, op.Rn);
  65. Operand d = GetIntA32(context, op.Rd);
  66. Operand part = context.BitwiseAnd(n, Const(op.SourceMask));
  67. if (op.Lsb != 0)
  68. {
  69. part = context.ShiftLeft(part, Const(op.Lsb));
  70. }
  71. Operand res = context.BitwiseAnd(d, Const(~op.DestMask));
  72. res = context.BitwiseOr(res, context.BitwiseAnd(part, Const(op.DestMask)));
  73. SetIntA32(context, op.Rd, res);
  74. }
  75. public static void Bic(ArmEmitterContext context)
  76. {
  77. IOpCode32Alu op = (IOpCode32Alu)context.CurrOp;
  78. Operand n = GetAluN(context);
  79. Operand m = GetAluM(context);
  80. Operand res = context.BitwiseAnd(n, context.BitwiseNot(m));
  81. if (op.SetFlags)
  82. {
  83. EmitNZFlagsCheck(context, res);
  84. }
  85. EmitAluStore(context, res);
  86. }
  87. public static void Clz(ArmEmitterContext context)
  88. {
  89. Operand m = GetAluM(context, setCarry: false);
  90. Operand res = context.CountLeadingZeros(m);
  91. EmitAluStore(context, res);
  92. }
  93. public static void Cmp(ArmEmitterContext context)
  94. {
  95. IOpCode32Alu op = (IOpCode32Alu)context.CurrOp;
  96. Operand n = GetAluN(context);
  97. Operand m = GetAluM(context, setCarry: false);
  98. Operand res = context.Subtract(n, m);
  99. EmitNZFlagsCheck(context, res);
  100. EmitSubsCCheck(context, n, res);
  101. EmitSubsVCheck(context, n, m, res);
  102. }
  103. public static void Cmn(ArmEmitterContext context)
  104. {
  105. Operand n = GetAluN(context);
  106. Operand m = GetAluM(context, setCarry: false);
  107. Operand res = context.Add(n, m);
  108. EmitNZFlagsCheck(context, res);
  109. EmitAddsCCheck(context, n, res);
  110. EmitAddsVCheck(context, n, m, res);
  111. }
  112. public static void Eor(ArmEmitterContext context)
  113. {
  114. IOpCode32Alu op = (IOpCode32Alu)context.CurrOp;
  115. Operand n = GetAluN(context);
  116. Operand m = GetAluM(context);
  117. Operand res = context.BitwiseExclusiveOr(n, m);
  118. if (op.SetFlags)
  119. {
  120. EmitNZFlagsCheck(context, res);
  121. }
  122. EmitAluStore(context, res);
  123. }
  124. public static void Mov(ArmEmitterContext context)
  125. {
  126. IOpCode32Alu op = (IOpCode32Alu)context.CurrOp;
  127. Operand m = GetAluM(context);
  128. if (op.SetFlags)
  129. {
  130. EmitNZFlagsCheck(context, m);
  131. }
  132. EmitAluStore(context, m);
  133. }
  134. public static void Movt(ArmEmitterContext context)
  135. {
  136. OpCode32AluImm16 op = (OpCode32AluImm16)context.CurrOp;
  137. Operand d = GetIntA32(context, op.Rd);
  138. Operand imm = Const(op.Immediate << 16); // Immeditate value as top halfword.
  139. Operand res = context.BitwiseAnd(d, Const(0x0000ffff));
  140. res = context.BitwiseOr(res, imm);
  141. EmitAluStore(context, res);
  142. }
  143. public static void Mul(ArmEmitterContext context)
  144. {
  145. IOpCode32Alu op = (IOpCode32Alu)context.CurrOp;
  146. Operand n = GetAluN(context);
  147. Operand m = GetAluM(context);
  148. Operand res = context.Multiply(n, m);
  149. if (op.SetFlags)
  150. {
  151. EmitNZFlagsCheck(context, res);
  152. }
  153. EmitAluStore(context, res);
  154. }
  155. public static void Mvn(ArmEmitterContext context)
  156. {
  157. IOpCode32Alu op = (IOpCode32Alu)context.CurrOp;
  158. Operand m = GetAluM(context);
  159. Operand res = context.BitwiseNot(m);
  160. if (op.SetFlags)
  161. {
  162. EmitNZFlagsCheck(context, res);
  163. }
  164. EmitAluStore(context, res);
  165. }
  166. public static void Orr(ArmEmitterContext context)
  167. {
  168. IOpCode32Alu op = (IOpCode32Alu)context.CurrOp;
  169. Operand n = GetAluN(context);
  170. Operand m = GetAluM(context);
  171. Operand res = context.BitwiseOr(n, m);
  172. if (op.SetFlags)
  173. {
  174. EmitNZFlagsCheck(context, res);
  175. }
  176. EmitAluStore(context, res);
  177. }
  178. public static void Pkh(ArmEmitterContext context)
  179. {
  180. OpCode32AluRsImm op = (OpCode32AluRsImm)context.CurrOp;
  181. Operand n = GetAluN(context);
  182. Operand m = GetAluM(context);
  183. Operand res;
  184. bool tbform = op.ShiftType == ShiftType.Asr;
  185. if (tbform)
  186. {
  187. res = context.BitwiseOr(context.BitwiseAnd(n, Const(0xFFFF0000)), context.BitwiseAnd(m, Const(0xFFFF)));
  188. }
  189. else
  190. {
  191. res = context.BitwiseOr(context.BitwiseAnd(m, Const(0xFFFF0000)), context.BitwiseAnd(n, Const(0xFFFF)));
  192. }
  193. EmitAluStore(context, res);
  194. }
  195. public static void Rbit(ArmEmitterContext context)
  196. {
  197. Operand m = GetAluM(context);
  198. Operand res = EmitReverseBits32Op(context, m);
  199. EmitAluStore(context, res);
  200. }
  201. public static void Rev(ArmEmitterContext context)
  202. {
  203. Operand m = GetAluM(context);
  204. Operand res = context.ByteSwap(m);
  205. EmitAluStore(context, res);
  206. }
  207. public static void Rev16(ArmEmitterContext context)
  208. {
  209. Operand m = GetAluM(context);
  210. Operand res = EmitReverseBytes16_32Op(context, m);
  211. EmitAluStore(context, res);
  212. }
  213. public static void Revsh(ArmEmitterContext context)
  214. {
  215. Operand m = GetAluM(context);
  216. Operand res = EmitReverseBytes16_32Op(context, m);
  217. EmitAluStore(context, context.SignExtend16(OperandType.I32, res));
  218. }
  219. public static void Rsc(ArmEmitterContext context)
  220. {
  221. IOpCode32Alu op = (IOpCode32Alu)context.CurrOp;
  222. Operand n = GetAluN(context);
  223. Operand m = GetAluM(context, setCarry: false);
  224. Operand res = context.Subtract(m, n);
  225. Operand borrow = context.BitwiseExclusiveOr(GetFlag(PState.CFlag), Const(1));
  226. res = context.Subtract(res, borrow);
  227. if (op.SetFlags)
  228. {
  229. EmitNZFlagsCheck(context, res);
  230. EmitSbcsCCheck(context, m, n);
  231. EmitSubsVCheck(context, m, n, res);
  232. }
  233. EmitAluStore(context, res);
  234. }
  235. public static void Rsb(ArmEmitterContext context)
  236. {
  237. IOpCode32Alu op = (IOpCode32Alu)context.CurrOp;
  238. Operand n = GetAluN(context);
  239. Operand m = GetAluM(context, setCarry: false);
  240. Operand res = context.Subtract(m, n);
  241. if (op.SetFlags)
  242. {
  243. EmitNZFlagsCheck(context, res);
  244. EmitSubsCCheck(context, m, res);
  245. EmitSubsVCheck(context, m, n, res);
  246. }
  247. EmitAluStore(context, res);
  248. }
  249. public static void Sbc(ArmEmitterContext context)
  250. {
  251. IOpCode32Alu op = (IOpCode32Alu)context.CurrOp;
  252. Operand n = GetAluN(context);
  253. Operand m = GetAluM(context, setCarry: false);
  254. Operand res = context.Subtract(n, m);
  255. Operand borrow = context.BitwiseExclusiveOr(GetFlag(PState.CFlag), Const(1));
  256. res = context.Subtract(res, borrow);
  257. if (op.SetFlags)
  258. {
  259. EmitNZFlagsCheck(context, res);
  260. EmitSbcsCCheck(context, n, m);
  261. EmitSubsVCheck(context, n, m, res);
  262. }
  263. EmitAluStore(context, res);
  264. }
  265. public static void Sbfx(ArmEmitterContext context)
  266. {
  267. OpCode32AluBf op = (OpCode32AluBf)context.CurrOp;
  268. var msb = op.Lsb + op.Msb; // For this instruction, the msb is actually a width.
  269. Operand n = GetIntA32(context, op.Rn);
  270. Operand res = context.ShiftRightSI(context.ShiftLeft(n, Const(31 - msb)), Const(31 - op.Msb));
  271. SetIntA32(context, op.Rd, res);
  272. }
  273. public static void Sdiv(ArmEmitterContext context)
  274. {
  275. EmitDiv(context, false);
  276. }
  277. public static void Ssat(ArmEmitterContext context)
  278. {
  279. OpCode32Sat op = (OpCode32Sat)context.CurrOp;
  280. EmitSat(context, -(1 << op.SatImm), (1 << op.SatImm) - 1);
  281. }
  282. public static void Ssat16(ArmEmitterContext context)
  283. {
  284. OpCode32Sat16 op = (OpCode32Sat16)context.CurrOp;
  285. EmitSat16(context, -(1 << op.SatImm), (1 << op.SatImm) - 1);
  286. }
  287. public static void Sub(ArmEmitterContext context)
  288. {
  289. IOpCode32Alu op = (IOpCode32Alu)context.CurrOp;
  290. Operand n = GetAluN(context);
  291. Operand m = GetAluM(context, setCarry: false);
  292. Operand res = context.Subtract(n, m);
  293. if (op.SetFlags)
  294. {
  295. EmitNZFlagsCheck(context, res);
  296. EmitSubsCCheck(context, n, res);
  297. EmitSubsVCheck(context, n, m, res);
  298. }
  299. EmitAluStore(context, res);
  300. }
  301. public static void Sxtb(ArmEmitterContext context)
  302. {
  303. EmitSignExtend(context, true, 8);
  304. }
  305. public static void Sxtb16(ArmEmitterContext context)
  306. {
  307. EmitExtend16(context, true);
  308. }
  309. public static void Sxth(ArmEmitterContext context)
  310. {
  311. EmitSignExtend(context, true, 16);
  312. }
  313. public static void Teq(ArmEmitterContext context)
  314. {
  315. Operand n = GetAluN(context);
  316. Operand m = GetAluM(context);
  317. Operand res = context.BitwiseExclusiveOr(n, m);
  318. EmitNZFlagsCheck(context, res);
  319. }
  320. public static void Tst(ArmEmitterContext context)
  321. {
  322. Operand n = GetAluN(context);
  323. Operand m = GetAluM(context);
  324. Operand res = context.BitwiseAnd(n, m);
  325. EmitNZFlagsCheck(context, res);
  326. }
  327. public static void Ubfx(ArmEmitterContext context)
  328. {
  329. OpCode32AluBf op = (OpCode32AluBf)context.CurrOp;
  330. var msb = op.Lsb + op.Msb; // For this instruction, the msb is actually a width.
  331. Operand n = GetIntA32(context, op.Rn);
  332. Operand res = context.ShiftRightUI(context.ShiftLeft(n, Const(31 - msb)), Const(31 - op.Msb));
  333. SetIntA32(context, op.Rd, res);
  334. }
  335. public static void Udiv(ArmEmitterContext context)
  336. {
  337. EmitDiv(context, true);
  338. }
  339. public static void Usat(ArmEmitterContext context)
  340. {
  341. OpCode32Sat op = (OpCode32Sat)context.CurrOp;
  342. EmitSat(context, 0, op.SatImm == 32 ? (int)(~0) : (1 << op.SatImm) - 1);
  343. }
  344. public static void Usat16(ArmEmitterContext context)
  345. {
  346. OpCode32Sat16 op = (OpCode32Sat16)context.CurrOp;
  347. EmitSat16(context, 0, (1 << op.SatImm) - 1);
  348. }
  349. public static void Uxtb(ArmEmitterContext context)
  350. {
  351. EmitSignExtend(context, false, 8);
  352. }
  353. public static void Uxtb16(ArmEmitterContext context)
  354. {
  355. EmitExtend16(context, false);
  356. }
  357. public static void Uxth(ArmEmitterContext context)
  358. {
  359. EmitSignExtend(context, false, 16);
  360. }
  361. private static void EmitSignExtend(ArmEmitterContext context, bool signed, int bits)
  362. {
  363. IOpCode32AluUx op = (IOpCode32AluUx)context.CurrOp;
  364. Operand m = GetAluM(context);
  365. Operand res;
  366. if (op.RotateBits == 0)
  367. {
  368. res = m;
  369. }
  370. else
  371. {
  372. Operand rotate = Const(op.RotateBits);
  373. res = context.RotateRight(m, rotate);
  374. }
  375. switch (bits)
  376. {
  377. case 8:
  378. res = (signed) ? context.SignExtend8(OperandType.I32, res) : context.ZeroExtend8(OperandType.I32, res);
  379. break;
  380. case 16:
  381. res = (signed) ? context.SignExtend16(OperandType.I32, res) : context.ZeroExtend16(OperandType.I32, res);
  382. break;
  383. }
  384. if (op.Add)
  385. {
  386. res = context.Add(res, GetAluN(context));
  387. }
  388. EmitAluStore(context, res);
  389. }
  390. private static void EmitExtend16(ArmEmitterContext context, bool signed)
  391. {
  392. IOpCode32AluUx op = (IOpCode32AluUx)context.CurrOp;
  393. Operand m = GetAluM(context);
  394. Operand res;
  395. if (op.RotateBits == 0)
  396. {
  397. res = m;
  398. }
  399. else
  400. {
  401. Operand rotate = Const(op.RotateBits);
  402. res = context.RotateRight(m, rotate);
  403. }
  404. Operand low16, high16;
  405. if (signed)
  406. {
  407. low16 = context.SignExtend8(OperandType.I32, res);
  408. high16 = context.SignExtend8(OperandType.I32, context.ShiftRightUI(res, Const(16)));
  409. }
  410. else
  411. {
  412. low16 = context.ZeroExtend8(OperandType.I32, res);
  413. high16 = context.ZeroExtend8(OperandType.I32, context.ShiftRightUI(res, Const(16)));
  414. }
  415. if (op.Add)
  416. {
  417. Operand n = GetAluN(context);
  418. Operand lowAdd, highAdd;
  419. if (signed)
  420. {
  421. lowAdd = context.SignExtend16(OperandType.I32, n);
  422. highAdd = context.SignExtend16(OperandType.I32, context.ShiftRightUI(n, Const(16)));
  423. }
  424. else
  425. {
  426. lowAdd = context.ZeroExtend16(OperandType.I32, n);
  427. highAdd = context.ZeroExtend16(OperandType.I32, context.ShiftRightUI(n, Const(16)));
  428. }
  429. low16 = context.Add(low16, lowAdd);
  430. high16 = context.Add(high16, highAdd);
  431. }
  432. res = context.BitwiseOr(
  433. context.ZeroExtend16(OperandType.I32, low16),
  434. context.ShiftLeft(context.ZeroExtend16(OperandType.I32, high16), Const(16)));
  435. EmitAluStore(context, res);
  436. }
  437. public static void EmitDiv(ArmEmitterContext context, bool unsigned)
  438. {
  439. Operand n = GetAluN(context);
  440. Operand m = GetAluM(context);
  441. Operand zero = Const(m.Type, 0);
  442. Operand divisorIsZero = context.ICompareEqual(m, zero);
  443. Operand lblBadDiv = Label();
  444. Operand lblEnd = Label();
  445. context.BranchIfTrue(lblBadDiv, divisorIsZero);
  446. if (!unsigned)
  447. {
  448. // ARM64 behaviour: If Rn == INT_MIN && Rm == -1, Rd = INT_MIN (overflow).
  449. // TODO: tests to ensure A32 works the same
  450. Operand intMin = Const(int.MinValue);
  451. Operand minus1 = Const(-1);
  452. Operand nIsIntMin = context.ICompareEqual(n, intMin);
  453. Operand mIsMinus1 = context.ICompareEqual(m, minus1);
  454. Operand lblGoodDiv = Label();
  455. context.BranchIfFalse(lblGoodDiv, context.BitwiseAnd(nIsIntMin, mIsMinus1));
  456. EmitAluStore(context, intMin);
  457. context.Branch(lblEnd);
  458. context.MarkLabel(lblGoodDiv);
  459. }
  460. Operand res = unsigned
  461. ? context.DivideUI(n, m)
  462. : context.Divide(n, m);
  463. EmitAluStore(context, res);
  464. context.Branch(lblEnd);
  465. context.MarkLabel(lblBadDiv);
  466. EmitAluStore(context, zero);
  467. context.MarkLabel(lblEnd);
  468. }
  469. private static void EmitSat(ArmEmitterContext context, int intMin, int intMax)
  470. {
  471. OpCode32Sat op = (OpCode32Sat)context.CurrOp;
  472. Operand n = GetIntA32(context, op.Rn);
  473. int shift = DecodeImmShift(op.ShiftType, op.Imm5);
  474. switch (op.ShiftType)
  475. {
  476. case ShiftType.Lsl:
  477. if (shift == 32)
  478. {
  479. n = Const(0);
  480. }
  481. else
  482. {
  483. n = context.ShiftLeft(n, Const(shift));
  484. }
  485. break;
  486. case ShiftType.Asr:
  487. if (shift == 32)
  488. {
  489. n = context.ShiftRightSI(n, Const(31));
  490. }
  491. else
  492. {
  493. n = context.ShiftRightSI(n, Const(shift));
  494. }
  495. break;
  496. }
  497. Operand lblCheckLtIntMin = Label();
  498. Operand lblNoSat = Label();
  499. Operand lblEnd = Label();
  500. context.BranchIfFalse(lblCheckLtIntMin, context.ICompareGreater(n, Const(intMax)));
  501. SetFlag(context, PState.QFlag, Const(1));
  502. SetIntA32(context, op.Rd, Const(intMax));
  503. context.Branch(lblEnd);
  504. context.MarkLabel(lblCheckLtIntMin);
  505. context.BranchIfFalse(lblNoSat, context.ICompareLess(n, Const(intMin)));
  506. SetFlag(context, PState.QFlag, Const(1));
  507. SetIntA32(context, op.Rd, Const(intMin));
  508. context.Branch(lblEnd);
  509. context.MarkLabel(lblNoSat);
  510. SetIntA32(context, op.Rd, n);
  511. context.MarkLabel(lblEnd);
  512. }
  513. private static void EmitSat16(ArmEmitterContext context, int intMin, int intMax)
  514. {
  515. OpCode32Sat16 op = (OpCode32Sat16)context.CurrOp;
  516. void SetD(int part, Operand value)
  517. {
  518. if (part == 0)
  519. {
  520. SetIntA32(context, op.Rd, context.ZeroExtend16(OperandType.I32, value));
  521. }
  522. else
  523. {
  524. SetIntA32(context, op.Rd, context.BitwiseOr(GetIntA32(context, op.Rd), context.ShiftLeft(value, Const(16))));
  525. }
  526. }
  527. Operand n = GetIntA32(context, op.Rn);
  528. Operand nLow = context.SignExtend16(OperandType.I32, n);
  529. Operand nHigh = context.ShiftRightSI(n, Const(16));
  530. for (int part = 0; part < 2; part++)
  531. {
  532. Operand nPart = part == 0 ? nLow : nHigh;
  533. Operand lblCheckLtIntMin = Label();
  534. Operand lblNoSat = Label();
  535. Operand lblEnd = Label();
  536. context.BranchIfFalse(lblCheckLtIntMin, context.ICompareGreater(nPart, Const(intMax)));
  537. SetFlag(context, PState.QFlag, Const(1));
  538. SetD(part, Const(intMax));
  539. context.Branch(lblEnd);
  540. context.MarkLabel(lblCheckLtIntMin);
  541. context.BranchIfFalse(lblNoSat, context.ICompareLess(nPart, Const(intMin)));
  542. SetFlag(context, PState.QFlag, Const(1));
  543. SetD(part, Const(intMin));
  544. context.Branch(lblEnd);
  545. context.MarkLabel(lblNoSat);
  546. SetD(part, nPart);
  547. context.MarkLabel(lblEnd);
  548. }
  549. }
  550. private static void EmitAluStore(ArmEmitterContext context, Operand value)
  551. {
  552. IOpCode32Alu op = (IOpCode32Alu)context.CurrOp;
  553. EmitGenericAluStoreA32(context, op.Rd, op.SetFlags, value);
  554. }
  555. }
  556. }