Skip to content

Ghidra is a software reverse engineering (SRE) framework

1.4 KB
Raw Blame
<decompilertest>
<binaryimage arch="x86:LE:64:default:gcc">
<!--
  One function compiled from C with SSE (clang -O1): a loaded vector used twice, scaled lane by lane and slid one lane up with PSLLDQ:
    void scaleandslide(float *out, const float *in, float s) {
      __m128 v = _mm_loadu_ps(in);
      __m128 w = _mm_mul_ps(v, _mm_set1_ps(s));
      asm("pslldq $4, %0" : "+x"(v));
      _mm_storeu_ps(out, w);
      _mm_storeu_ps(out + 4, v);
    }
-->
<bytechunk space="ram" offset="0x100000" readonly="true">
554889e50f100e0fc6c0000f59c1660f73f9040f11070f114f105dc3
</bytechunk>
<symbol space="ram" offset="0x100000" name="scaleandslide"/>
</binaryimage>
<script>
  <com>parse line extern void scaleandslide(float4 *out, float4 *in, float4 s);</com>
  <com>lo fu scaleandslide</com>
  <com>decompile</com>
  <com>print C</com>
</script>
<stringmatch name="LaneLeft #1" min="1" max="1">out\[1\] = s \* fVar2;</stringmatch>
<stringmatch name="LaneLeft #2" min="1" max="1">out\[4\] = 0.0;</stringmatch>
<stringmatch name="LaneLeft #3" min="1" max="1">out\[5\] = fVar1;</stringmatch>
<stringmatch name="LaneLeft #4" min="1" max="1">out\[7\] = fVar3;</stringmatch>
<stringmatch name="LaneLeft #5" min="0" max="0">&lt;&lt; 0x20</stringmatch>
<stringmatch name="LaneLeft #6" min="0" max="0">_0_4_</stringmatch>
<stringmatch name="LaneLeft #7" min="0" max="0">axVar</stringmatch>
</decompilertest>