From 6bbe7ef049bc1b9d150a21ccd082c2f65f344682 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 20 Feb 2025 13:12:27 -0500 Subject: kernel/amd64: i8237: Optimize set channel select There is no need for an intermediary register before setting %AL. This commit removes redundant instructions to reduce the amount of cycles used for this operation. Signed-off-by: Ian Moffett --- sys/arch/amd64/isa/i8237.S | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sys/arch/amd64/isa') diff --git a/sys/arch/amd64/isa/i8237.S b/sys/arch/amd64/isa/i8237.S index 00b5bd9..ef6090a 100644 --- a/sys/arch/amd64/isa/i8237.S +++ b/sys/arch/amd64/isa/i8237.S @@ -95,9 +95,8 @@ i8237_set_mode: jg 1f /* Set channel select bits */ - mov %dil, %bl - andb $3, %bl - mov %bl, %al + mov %dil, %al + andb $3, %al /* Set channel mode bits */ mov %sil, %dl -- cgit v1.2.3