From d85b49755cb1214f32b99620b2eb4621918fffc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1roly=20Balogh?= Date: Mon, 23 Feb 2015 03:37:51 +0000 Subject: [PATCH] m68k: some ideas for a future second_abs_long implementation. no functional changes. git-svn-id: trunk@29806 - --- compiler/m68k/n68kinl.pas | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/compiler/m68k/n68kinl.pas b/compiler/m68k/n68kinl.pas index 44f0aa829a..e8ebbaee0b 100644 --- a/compiler/m68k/n68kinl.pas +++ b/compiler/m68k/n68kinl.pas @@ -184,6 +184,29 @@ implementation end; end; + { ideas for second_abs_long (KB) } + + { This is probably faster on 68000 than the generic implementation, + because shifting is slow on the original 68000, maybe also on the 68020? + Also needs to be tested on 040/060. This can also work on a CF. + input - d0, output - d2 + move.l d0,d2 + btst #31,d2 + sne d1 + extb.l d1 (or ext.w + ext.l on 68000) + eor.l d1,d2 + sub.l d1,d2 + } + + { Solution using bitfield extraction, we don't support the necessary asm + construct for this yet, probably this is the fastest on 020, slower on + 040/060 than the one above, doesn't work on '000 or CF. + input - d0, output - d2 + move.l d0,d2 + bfexts d0[0:1],d1 + eor.l d1,d2 + sub.l d1,d2 + } begin cinlinenode:=t68kinlinenode; end.