narmcal.pas 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. {
  2. Copyright (c) 2002 by Florian Klaempfl
  3. Implements the ARM specific part of call nodes
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. unit narmcal;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. symdef,node,ncal,ncgcal;
  22. type
  23. tarmcallnode = class(tcgcallnode)
  24. procedure set_result_location(realresdef: tstoreddef);override;
  25. end;
  26. implementation
  27. uses
  28. verbose,globtype,globals,aasmdata,
  29. symconst,
  30. cgbase,
  31. cpubase,cpuinfo,
  32. ncgutil,
  33. paramgr;
  34. procedure tarmcallnode.set_result_location(realresdef: tstoreddef);
  35. begin
  36. if (realresdef.typ=floatdef) and
  37. ((cs_fp_emulation in current_settings.moduleswitches) or
  38. (current_settings.fputype in [fpu_vfpv2,fpu_vfpv3])) then
  39. begin
  40. { keep the fpu values in integer registers for now, the code
  41. generator will move them to memory or an mmregister when necessary
  42. (avoids double moves in case a function result is assigned to
  43. another function result, or passed as a parameter) }
  44. case retloc.size of
  45. OS_32,
  46. OS_F32:
  47. location_allocate_register(current_asmdata.CurrAsmList,location,s32inttype,false);
  48. OS_64,
  49. OS_F64:
  50. location_allocate_register(current_asmdata.CurrAsmList,location,s64inttype,false);
  51. else
  52. internalerror(2010053008);
  53. end
  54. end
  55. else
  56. inherited;
  57. end;
  58. begin
  59. ccallnode:=tarmcallnode;
  60. end.