View Single Post
Old 08 December 2019, 23:50   #3
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,479
This is faster and the number of processor cycles used are a constant:
Code:
    move.w  #%1010110011010101,d0
    move.w  d0,d1
    add.w   d0,d0
    addx.l  d2,d2
    add.w   d1,d1
    addx.l  d2,d2
    add.w   d0,d0
    addx.l  d2,d2
    add.w   d1,d1
    addx.l  d2,d2
    add.w   d0,d0
    addx.l  d2,d2
    add.w   d1,d1
    addx.l  d2,d2
    add.w   d0,d0
    addx.l  d2,d2
    add.w   d1,d1
    addx.l  d2,d2
    add.w   d0,d0
    addx.l  d2,d2
    add.w   d1,d1
    addx.l  d2,d2
    add.w   d0,d0
    addx.l  d2,d2
    add.w   d1,d1
    addx.l  d2,d2
    add.w   d0,d0
    addx.l  d2,d2
    add.w   d1,d1
    addx.l  d2,d2
    add.w   d0,d0
    addx.l  d2,d2
    add.w   d1,d1
    addx.l  d2,d2
    add.w   d0,d0
    addx.l  d2,d2
    add.w   d1,d1
    addx.l  d2,d2
    add.w   d0,d0
    addx.l  d2,d2
    add.w   d1,d1
    addx.l  d2,d2
    add.w   d0,d0
    addx.l  d2,d2
    add.w   d1,d1
    addx.l  d2,d2
    add.w   d0,d0
    addx.l  d2,d2
    add.w   d1,d1
    addx.l  d2,d2
    add.w   d0,d0
    addx.l  d2,d2
    add.w   d1,d1
    addx.l  d2,d2
    add.w   d0,d0
    addx.l  d2,d2
    add.w   d1,d1
    addx.l  d2,d2
    add.w   d0,d0
    addx.l  d2,d2
    add.w   d1,d1
    addx.l  d2,d2
    add.w   d0,d0
    addx.l  d2,d2
    add.w   d1,d1
    addx.l  d2,d2
    rts
Result in D2.
Yes, is ugly

Probably with a LUT can be made much faster.
ross is offline  
 
Page generated in 0.07657 seconds with 11 queries