cgflags.pas 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl
  4. Member of the Free Pascal development team
  5. This unit implements the code generation for things regarding
  6. flags, this unit applies of course only for cpus support flags
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. ****************************************************************************
  19. }
  20. unit cgflags;
  21. interface
  22. uses
  23. cgobj;
  24. implementation
  25. uses
  26. cgobj,nmem;
  27. procedure flags_assignment_flags(p : passignmentnode);
  28. begin
  29. if loc=LOC_CREGISTER then
  30. emit_flag2reg(p^.right^.location.resflags,p^.left^.location.register)
  31. else
  32. begin
  33. ai:=new(paicpu,op_ref(A_Setcc,S_B,newreference(p^.left^.location.reference)));
  34. ai^.SetCondition(flag_2_cond[p^.right^.location.resflags]);
  35. exprasmlist^.concat(ai);
  36. end;
  37. del_reference(p^.left^.location.reference);
  38. end;
  39. begin
  40. p2_assignment_flags:=@flags_assignment_flags;
  41. end.
  42. {
  43. $Log$
  44. Revision 1.1 2000-07-13 06:30:07 michael
  45. + Initial import
  46. Revision 1.1 2000/03/01 15:36:13 florian
  47. * some new stuff for the new cg
  48. }