aoptcpu.pas 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. {
  2. Copyright (c) 1998-2002 by Jonas Maebe, member of the Free Pascal
  3. Development Team
  4. This unit implements the Risc-V32 optimizer object
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. Unit aoptcpu;
  19. Interface
  20. {$i fpcdefs.inc}
  21. uses
  22. cpubase,
  23. aoptobj, aoptcpub, aopt, aoptcpurv,
  24. aasmtai,aasmdata, aasmcpu;
  25. Type
  26. TCpuAsmOptimizer = class(TRVCpuAsmOptimizer)
  27. { uses the same constructor as TAopObj }
  28. function PeepHoleOptPass1Cpu(var p: tai): boolean; override;
  29. function PostPeepHoleOptsCpu(var p: tai): boolean; override;
  30. End;
  31. Implementation
  32. uses
  33. cutils, verbose, cgbase, cgcpu, cgobj;
  34. function TCpuAsmOptimizer.PeepHoleOptPass1Cpu(var p: tai): boolean;
  35. var
  36. next1, next2: tai;
  37. l1, l2, shlcount: longint;
  38. begin
  39. result := inherited PeepHoleOptPass1Cpu(p);
  40. if result then
  41. exit;
  42. case p.typ of
  43. ait_instruction:
  44. begin
  45. {case taicpu(p).opcode of
  46. end;}
  47. end;
  48. else
  49. ;
  50. end;
  51. end;
  52. function TCpuAsmOptimizer.PostPeepHoleOptsCpu(var p: tai): boolean;
  53. var
  54. next1: tai;
  55. begin
  56. result := inherited PostPeepHoleOptsCpu(p);
  57. if result then
  58. exit;
  59. case p.typ of
  60. ait_instruction:
  61. begin
  62. end;
  63. else
  64. ;
  65. end;
  66. end;
  67. begin
  68. casmoptimizer:=TCpuAsmOptimizer;
  69. End.