Skip to content

Ghidra is a software reverse engineering (SRE) framework

1.5 KB
Raw Blame
<decompilertest>
<binaryimage arch="x86:LE:64:default:gcc">
<!--
#include <xmmintrin.h>
/* a vector loaded whole, its first lane stored alone (so the vector is known to have four-byte lanes), its top lane
   replaced by zero through two shuffles against a zero register, the result stored whole: the decompiler folds the
   shuffles into a zero extension of the low three lanes, which the lane split must follow forward from the loaded vector */
void zeroload(float *out, float *first, const float *in) {
  __m128 v = _mm_loadu_ps(in);
  _mm_store_ss(first, v);
  __m128 t = _mm_shuffle_ps(v, _mm_setzero_ps(), 0x0a);
  v = _mm_shuffle_ps(v, t, 0x84);
  _mm_storeu_ps(out, v);
}
-->
<bytechunk space="ram" offset="0x100000" readonly="true">
554889e50f1002f30f11060f57c90fc6c8200fc6c1240f11075dc3
</bytechunk>
<symbol space="ram" offset="0x100000" name="zeroload"/>
</binaryimage>
<script>
  <com>parse line extern void zeroload(float4 *out, float4 *first, float4 *in);</com>
  <com>lo fu zeroload</com>
  <com>decompile</com>
  <com>print C</com>
</script>
<stringmatch name="ZeroLoad #1" min="1" max="1">\*first = fVar1;</stringmatch>
<stringmatch name="ZeroLoad #2" min="1" max="1">\*out = fVar1;</stringmatch>
<stringmatch name="ZeroLoad #3" min="1" max="1">out\[1\] = fVar2;</stringmatch>
<stringmatch name="ZeroLoad #4" min="1" max="1">out\[2\] = fVar3;</stringmatch>
<stringmatch name="ZeroLoad #5" min="1" max="1">out\[3\] = 0.0;</stringmatch>
<stringmatch name="ZeroLoad #6" min="0" max="0">axVar</stringmatch>
</decompilertest>