2
0

uplink-ia64.pl 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #! /usr/bin/env perl
  2. # Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
  3. #
  4. # Licensed under the OpenSSL license (the "License"). You may not use
  5. # this file except in compliance with the License. You can obtain a copy
  6. # in the file LICENSE in the source distribution or at
  7. # https://www.openssl.org/source/license.html
  8. $output = pop;
  9. open STDOUT,">$output";
  10. $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
  11. push(@INC,"${dir}.");
  12. require "uplink-common.pl";
  13. local $V=8; # max number of args uplink functions may accept...
  14. my $loc0 = "r".(32+$V);
  15. print <<___;
  16. .text
  17. .global OPENSSL_Uplink#
  18. .type OPENSSL_Uplink#,\@function
  19. ___
  20. for ($i=1;$i<=$N;$i++) {
  21. print <<___;
  22. .proc lazy$i#
  23. lazy$i:
  24. .prologue
  25. { .mii; .save ar.pfs,$loc0
  26. alloc loc0=ar.pfs,$V,3,2,0
  27. .save b0,loc1
  28. mov loc1=b0
  29. addl loc2=\@ltoff(OPENSSL_UplinkTable#),gp };;
  30. .body
  31. { .mmi; ld8 out0=[loc2]
  32. mov out1=$i };;
  33. { .mib; add loc2=8*$i,out0
  34. br.call.sptk.many b0=OPENSSL_Uplink# };;
  35. { .mmi; ld8 r31=[loc2];;
  36. ld8 r30=[r31],8 };;
  37. { .mii; ld8 gp=[r31]
  38. mov b6=r30
  39. mov b0=loc1 };;
  40. { .mib; mov ar.pfs=loc0
  41. br.many b6 };;
  42. .endp lazy$i#
  43. ___
  44. }
  45. print <<___;
  46. .data
  47. .global OPENSSL_UplinkTable#
  48. OPENSSL_UplinkTable: data8 $N // amount of following entries
  49. ___
  50. for ($i=1;$i<=$N;$i++) { print " data8 \@fptr(lazy$i#)\n"; }
  51. print <<___;
  52. .size OPENSSL_UplinkTable,.-OPENSSL_UplinkTable#
  53. ___
  54. close STDOUT;