From ba8ddae0aaa51f5a4e33d07f395e5558ca18d857 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Tue, 8 Feb 2011 19:11:36 +0000 Subject: [PATCH] i586 compatability macros (CMOVcc substitutes) for NET branch git-svn-id: svn://kolibrios.org@1857 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/applications/macros.inc | 18 ++++++++ kernel/branches/net/macros.inc | 47 ++++++++++++++++++++- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/kernel/branches/net/applications/macros.inc b/kernel/branches/net/applications/macros.inc index 99b09676fe..435f2ddfb2 100644 --- a/kernel/branches/net/applications/macros.inc +++ b/kernel/branches/net/applications/macros.inc @@ -541,6 +541,24 @@ local .jumpaddr .jumpaddr: } +macro cmovg reg1, reg2 { + +local .jumpaddr + + jle .jumpaddr + mov reg1, reg2 + .jumpaddr: +} + +macro cmovl reg1, reg2 { + +local .jumpaddr + + jge .jumpaddr + mov reg1, reg2 + .jumpaddr: +} + end if ; constants diff --git a/kernel/branches/net/macros.inc b/kernel/branches/net/macros.inc index e99a17ec97..08c82fee3e 100644 --- a/kernel/branches/net/macros.inc +++ b/kernel/branches/net/macros.inc @@ -101,6 +101,49 @@ end if macro Mov op1,op2,op3 ; op1 = op2 = op3 { - mov op2,op3 - mov op1,op2 + mov op2,op3 + mov op1,op2 } + + +if __CPU_type eq p5 ; CMOVcc isnt supported on the P5 + +cmove fix cmovz +macro cmovz reg1, reg2 { + +local .jumpaddr + + jnz .jumpaddr + mov reg1, reg2 + .jumpaddr: +} + +cmovne fix cmovnz +macro cmovnz reg1, reg2 { + +local .jumpaddr + + jz .jumpaddr + mov reg1, reg2 + .jumpaddr: +} + +macro cmovg reg1, reg2 { + +local .jumpaddr + + jle .jumpaddr + mov reg1, reg2 + .jumpaddr: +} + +macro cmovl reg1, reg2 { + +local .jumpaddr + + jge .jumpaddr + mov reg1, reg2 + .jumpaddr: +} + +end if