2
0

uplink-ia64.pl 1.4 KB

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