View Single Post
Old 08 June 2022, 22:17   #211
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,483
Quote:
Originally Posted by jotd View Post
Anyone can propose further improvements on that one?
Micro optimization..
Code:
        addq.w  #1,d3   ; loop counter is one off
        lsr.l   d3,d0
        moveq   #0,d5
        bset    d3,d5
        subq.l  #1,d5   ; generate 1111s mask
        move.l  d1,d2
        and.l   d5,d2
        asr.l   d3,d1
        moveq   #32,d5
        sub.w   d3,d5   ; shift = 32-shift
        lsl.l   d5,d2   
        or.l    d2,d0
But probably only on 68000

EDIT: I had wasted a register...

Last edited by ross; 08 June 2022 at 22:29.
ross is offline  
 
Page generated in 0.06968 seconds with 10 queries