All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915: Use mul_u32_u32() more
Date: Wed, 10 Apr 2019 21:24:53 +0300	[thread overview]
Message-ID: <20190410182453.GQ3888@intel.com> (raw)
In-Reply-To: <155473824405.26510.7099067821495523123@skylake-alporthouse-com>

On Mon, Apr 08, 2019 at 04:44:04PM +0100, Chris Wilson wrote:
> Quoting Ville Syrjala (2019-04-08 16:27:01)
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > We have a lot of '(u64)foo * bar' everywhere. Replace with
> > mul_u32_u32() to avoid gcc failing to use a regular 32x32->64
> > multiply for this.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> As a purely mechanical translation,
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> > diff --git a/drivers/gpu/drm/i915/intel_dpll_mgr.c b/drivers/gpu/drm/i915/intel_dpll_mgr.c
> > index e01c057ce50b..29edc369920b 100644
> > --- a/drivers/gpu/drm/i915/intel_dpll_mgr.c
> > +++ b/drivers/gpu/drm/i915/intel_dpll_mgr.c
> > @@ -2741,11 +2741,11 @@ static bool icl_calc_mg_pll_state(struct intel_crtc_state *crtc_state)
> >         }
> >  
> >         if (use_ssc) {
> > -               tmp = (u64)dco_khz * 47 * 32;
> > +               tmp = mul_u32_u32(dco_khz, 47 * 32);
> >                 do_div(tmp, refclk_khz * m1div * 10000);
> >                 ssc_stepsize = tmp;
> >  
> > -               tmp = (u64)dco_khz * 1000;
> > +               tmp = mul_u32_u32(dco_khz, 1000);
> 
> These caught my eye, wondering if the code was better reduced if the
> constant was first or itself cast to (u64).

Looks like gcc (8.2) handles these two as is actually. Or at least
the generated asm is identical both ways.

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-04-10 18:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08 15:27 [PATCH 1/2] drm/i915: Use mul_u32_u32() more Ville Syrjala
2019-04-08 15:27 ` [PATCH 2/2] drm/i915: Simplify some icl pll calculations Ville Syrjala
2019-04-08 15:49   ` Chris Wilson
2019-04-08 16:06     ` Ville Syrjälä
2019-04-08 16:14       ` Chris Wilson
2019-04-08 17:05       ` Chris Wilson
2019-04-10 17:59         ` Ville Syrjälä
2019-04-10 18:13           ` Chris Wilson
2019-04-10 18:51             ` Ville Syrjälä
2019-04-08 15:40 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/2] drm/i915: Use mul_u32_u32() more Patchwork
2019-04-08 15:44 ` [PATCH 1/2] " Chris Wilson
2019-04-10 18:24   ` Ville Syrjälä [this message]
2019-04-08 16:28 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] " Patchwork
2019-04-30 14:10 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/2] drm/i915: Use mul_u32_u32() more (rev2) Patchwork
2019-04-30 14:25 ` ✓ Fi.CI.BAT: success " Patchwork
2019-05-01  4:53 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-05-02  7:43 ` Patchwork
2019-05-02  8:47 ` ✓ Fi.CI.IGT: success " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190410182453.GQ3888@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.