narmcal.pas 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. systems;
  35. procedure tarmcallnode.set_result_location(realresdef: tstoreddef);
  36. begin
  37. if (realresdef.typ=floatdef) and
  38. (target_info.abi <> abi_eabihf) and
  39. ((cs_fp_emulation in current_settings.moduleswitches) or
  40. (current_settings.fputype in [fpu_vfpv2,fpu_vfpv3,fpu_vfpv3_d16])) then
  41. begin
  42. { keep the fpu values in integer registers for now, the code
  43. generator will move them to memory or an mmregister when necessary
  44. (avoids double moves in case a function result is assigned to
  45. another function result, or passed as a parameter) }
  46. case retloc.size of
  47. OS_32,
  48. OS_F32:
  49. location_allocate_register(current_asmdata.CurrAsmList,location,s32inttype,false);
  50. OS_64,
  51. OS_F64:
  52. location_allocate_register(current_asmdata.CurrAsmList,location,s64inttype,false);
  53. else
  54. internalerror(2010053008);
  55. end
  56. end
  57. else
  58. inherited;
  59. end;
  60. begin
  61. ccallnode:=tarmcallnode;
  62. end.