nppcinl.pas 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. {
  2. Copyright (c) 1998-2007 by Free Pascal development team
  3. Generate PowerPC64 inline 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 nppcinl;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. node,ninl,ncginl,ngppcinl;
  22. type
  23. tppc64inlinenode = class(tgppcinlinenode)
  24. function first_sqrt_real: tnode; override;
  25. procedure second_sqrt_real; override;
  26. end;
  27. implementation
  28. uses
  29. cutils,globals,verbose,
  30. aasmtai,aasmdata,aasmcpu,
  31. symconst,symdef,
  32. defutil,
  33. cgbase,pass_2,
  34. cpubase,ncgutil,
  35. cgutils,cgobj,rgobj;
  36. {*****************************************************************************
  37. tppc64inlinenode
  38. *****************************************************************************}
  39. function tppc64inlinenode.first_sqrt_real : tnode;
  40. begin
  41. expectloc:=LOC_FPUREGISTER;
  42. registersint:=left.registersint;
  43. registersfpu:=max(left.registersfpu,1);
  44. first_sqrt_real := nil;
  45. end;
  46. procedure tppc64inlinenode.second_sqrt_real;
  47. begin
  48. location.loc:=LOC_FPUREGISTER;
  49. load_fpu_location;
  50. case left.location.size of
  51. OS_F32:
  52. current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_FSQRTS,location.register,
  53. left.location.register));
  54. OS_F64:
  55. current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_FSQRT,location.register,
  56. left.location.register));
  57. else
  58. inherited;
  59. end;
  60. end;
  61. begin
  62. cinlinenode:=tppc64inlinenode;
  63. end.