Bug 385207 - PPC64, generate_store_FPRF() generates too many Iops
Summary: PPC64, generate_store_FPRF() generates too many Iops
Status: CLOSED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (show other bugs)
Version: 3.14 SVN
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-29 18:00 UTC by Carl Love
Modified: 2017-10-05 17:26 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
replace body of generate_store_FPRF with C helper function. (26.15 KB, patch)
2017-09-29 18:01 UTC, Carl Love
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carl Love 2017-09-29 18:00:00 UTC
A number of the power 9 instructions call generate_store_FPRF() to calculate
the floating point condition code value.  The function generates a lot of Iops.
If there are about 6 or instructions in the basic block that use this function, it exhausts the temporary memory.
Comment 1 Carl Love 2017-09-29 18:01:42 UTC
Created attachment 108093 [details]
replace body of generate_store_FPRF with C helper  function.

replace the generate_store_FPRF function body with a C Helper function.
Comment 2 Julian Seward 2017-10-03 10:04:22 UTC
+#define V128_FRACTION_MASK 0x0000FFFFFFFFFFFFULL  /* upper 64-bit fractional mask */
+
+ULong generate_C_FPCC_helper( ULong size, ULong src_hi, ULong src ) {
+   UInt NaN, inf, zero, norm, dnorm, pos;
+   UInt bit0, bit1, bit2, bit3;

* nit: { on its own line, in the house style

* Please rename 'size' here to 'irType', because that's what it really is



+   if ( size == Ity_I16 ) {
+      frac_part = I16_FRACTION_MASK & src;
+      exp_mask = I16_EXP_MASK;
...
+     exp_mask = V128_EXP_MASK;
+     exp_part = exp_mask & src_hi;
+     sign_bit = src_hi >> 63;
+   }

Add

  else {
    vassert(0);
  }

so as to cause the system to fail if any other value is passed for irType.


OK to land with the above points fixed.
Comment 3 Carl Love 2017-10-03 17:27:13 UTC
patch committed:  commit acdeb75d2a58f4f3910ddaf9b2bc2ec74378fa3a