From f8df3953f4289bc7912a1fce3030d0a359eda426 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Fri, 8 Apr 2016 11:33:41 -0500 Subject: [PATCH] radeon_hd: Fix build. Port missed macros in AtomBIOS parser --- .../accelerants/radeon_hd/atombios/atom.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/add-ons/accelerants/radeon_hd/atombios/atom.cpp b/src/add-ons/accelerants/radeon_hd/atombios/atom.cpp index bc4a62e0bf..ee4e2cc456 100644 --- a/src/add-ons/accelerants/radeon_hd/atombios/atom.cpp +++ b/src/add-ons/accelerants/radeon_hd/atombios/atom.cpp @@ -632,9 +632,11 @@ atom_op_div32(atom_exec_context *ctx, int *ptr, int arg) if (src != 0) { val64 = dst; val64 |= ((uint64)ctx->ctx->divmul[1]) << 32; - do_div(val64, src); - ctx->ctx->divmul[0] = lower_32_bits(val64); - ctx->ctx->divmul[1] = upper_32_bits(val64); + val64 /= (uint64)src; + // Lower 32 + ctx->ctx->divmul[0] = (uint32)val64; + // Upper 32 + ctx->ctx->divmul[1] = (uint32)(((val64) >> 16) >> 16); } else { ctx->ctx->divmul[0] = 0; ctx->ctx->divmul[1] = 0; @@ -764,8 +766,10 @@ atom_op_mul32(atom_exec_context *ctx, int *ptr, int arg) dst = atom_get_dst(ctx, arg, attr, ptr, NULL, 1); src = atom_get_src(ctx, attr, ptr); val64 = (uint64)dst * (uint64)src; - ctx->ctx->divmul[0] = lower_32_bits(val64); - ctx->ctx->divmul[1] = upper_32_bits(val64); + // Lower 32 + ctx->ctx->divmul[0] = (uint32)val64; + // Upper 32 + ctx->ctx->divmul[1] = (uint32)(((val64) >> 16) >> 16); #ifdef ATOM_TRACE TRACE("%s: 0x%" B_PRIX32 " * 0x%" B_PRIX32 " is" " 0x%" B_PRIX32 " + 0x%" B_PRIX32 "\n", __func__, dst, src,