1 // Works on all IA-64 platforms: Linux, HP-UX, Win64i...
2 // On Win64i compile with ias.exe.
5 .global OPENSSL_cpuid_setup#
6 .proc OPENSSL_cpuid_setup#
8 { .mib; br.ret.sptk.many b0 };;
9 .endp OPENSSL_cpuid_setup#
11 .global OPENSSL_rdtsc#
15 br.ret.sptk.many b0 };;
18 .global OPENSSL_atomic_add#
19 .proc OPENSSL_atomic_add#
30 cmpxchg4.acq r2=[r32],r8,ar.ccv
32 { .mib; cmp.ne p6,p0=r2,r3
34 (p6) br.dpnt .Lspin };;
37 br.ret.sptk.many b0 };;
38 .endp OPENSSL_atomic_add#
40 // Returns a structure comprising pointer to the top of stack of
41 // the caller and pointer beyond backing storage for the current
42 // register frame. The latter is required, because it might be
43 // insufficient to wipe backing storage for the current frame
44 // (as this procedure does), one might have to go further, toward
45 // higher addresses to reach for whole "retroactively" saved
47 .global OPENSSL_wipe_cpu#
48 .proc OPENSSL_wipe_cpu#
55 { .mib; alloc r2=ar.pfs,0,96,0,96
57 brp.loop.imp .L_wipe_top,.L_wipe_end-16
63 { .mii; add r9=96*8-8,r9
66 // One can sweep double as fast, but then we can't quarantee
67 // that backing storage is wiped...
69 { .mfi; st8 [r9]=r0,-8
74 br.ctop.sptk .L_wipe_top };;
122 { .mfi; add r9=96*8+8,r9
128 .endp OPENSSL_wipe_cpu#
130 .global OPENSSL_cleanse#
131 .proc OPENSSL_cleanse#
133 { .mib; cmp.eq p6,p0=0,r33 // len==0
134 #if defined(_HPUX_SOURCE) && !defined(_LP64)
137 (p6) br.ret.spnt b0 };;
139 cmp.leu p6,p0=15,r33 // len>=15
140 (p6) br.cond.dptk .Lot };;
143 { .mib; st1 [r32]=r0,1
144 cmp.ltu p6,p7=1,r33 } // len>1
145 { .mbb; add r33=-1,r33 // len--
146 (p6) br.cond.dptk .Little
147 (p7) br.ret.sptk.many b0 };;
150 { .mib; cmp.eq p6,p0=0,r2
151 (p6) br.cond.dptk .Laligned };;
152 { .mmi; st1 [r32]=r0,1;;
154 { .mib; add r33=-1,r33
158 { .mmi; st8 [r32]=r0,8
159 and r2=-8,r33 // len&~7
160 add r33=-8,r33 };; // len-=8
161 { .mib; cmp.ltu p6,p0=8,r2 // ((len+8)&~7)>8
162 (p6) br.cond.dptk .Laligned };;
164 { .mbb; cmp.eq p6,p7=r0,r33
165 (p7) br.cond.dpnt .Little
166 (p6) br.ret.sptk.many b0 };;
167 .endp OPENSSL_cleanse#