From afe7a997005a3412ceb76a2442d55bf464537980 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 21 Sep 2016 16:46:16 -0600 Subject: [PATCH] Increase optimization, fix clobbers in vesad --- Makefile | 8 ++++---- drivers/vesad/src/primitive.rs | 12 ++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 1327d0b..09fff8a 100644 --- a/Makefile +++ b/Makefile @@ -12,9 +12,9 @@ KCARGOFLAGS=--target $(KTARGET).json -- -C soft-float TARGET=$(ARCH)-unknown-redox BUILD=build/userspace RUSTC=./rustc.sh -RUSTCFLAGS=--target $(TARGET).json -C soft-float --cfg redox +RUSTCFLAGS=--target $(TARGET).json -C opt-level=2 -C soft-float --cfg redox CARGO=RUSTC="$(RUSTC)" cargo -CARGOFLAGS=--target $(TARGET).json -- -C soft-float --cfg redox +CARGOFLAGS=--target $(TARGET).json -- -C opt-level=2 -C soft-float --cfg redox # Default targets .PHONY: all clean qemu bochs FORCE @@ -43,7 +43,7 @@ ifeq ($(ARCH),arm) QEMUFLAGS+=-cpu arm1176 -machine integratorcp QEMUFLAGS+=-nographic -build/%.list: build/% +%.list: % $(ARCH)-none-eabi-objdump -C -D $< > $@ $(KBUILD)/harddrive.bin: $(KBUILD)/kernel @@ -68,7 +68,7 @@ else LD=$(ARCH)-elf-ld endif -build/%.list: build/% +%.list: % objdump -C -M intel -D $< > $@ $(KBUILD)/harddrive.bin: $(KBUILD)/kernel bootloader/$(ARCH)/** diff --git a/drivers/vesad/src/primitive.rs b/drivers/vesad/src/primitive.rs index 8427745..16c2536 100644 --- a/drivers/vesad/src/primitive.rs +++ b/drivers/vesad/src/primitive.rs @@ -1,5 +1,4 @@ #[cfg(target_arch = "x86_64")] -#[allow(unused_assignments)] #[inline(always)] #[cold] pub unsafe fn fast_copy(dst: *mut u8, src: *const u8, len: usize) { @@ -7,12 +6,11 @@ pub unsafe fn fast_copy(dst: *mut u8, src: *const u8, len: usize) { rep movsb" : : "{rdi}"(dst as usize), "{rsi}"(src as usize), "{rcx}"(len) - : "cc", "memory" + : "cc", "memory", "rdi", "rsi", "rcx" : "intel", "volatile"); } #[cfg(target_arch = "x86_64")] -#[allow(unused_assignments)] #[inline(always)] #[cold] pub unsafe fn fast_copy64(dst: *mut u64, src: *const u64, len: usize) { @@ -20,12 +18,11 @@ pub unsafe fn fast_copy64(dst: *mut u64, src: *const u64, len: usize) { rep movsq" : : "{rdi}"(dst as usize), "{rsi}"(src as usize), "{rcx}"(len) - : "cc", "memory" + : "cc", "memory", "rdi", "rsi", "rcx" : "intel", "volatile"); } #[cfg(target_arch = "x86_64")] -#[allow(unused_assignments)] #[inline(always)] #[cold] pub unsafe fn fast_set32(dst: *mut u32, src: u32, len: usize) { @@ -33,12 +30,11 @@ pub unsafe fn fast_set32(dst: *mut u32, src: u32, len: usize) { rep stosd" : : "{rdi}"(dst as usize), "{eax}"(src), "{rcx}"(len) - : "cc", "memory" + : "cc", "memory", "rdi", "rcx" : "intel", "volatile"); } #[cfg(target_arch = "x86_64")] -#[allow(unused_assignments)] #[inline(always)] #[cold] pub unsafe fn fast_set64(dst: *mut u64, src: u64, len: usize) { @@ -46,6 +42,6 @@ pub unsafe fn fast_set64(dst: *mut u64, src: u64, len: usize) { rep stosq" : : "{rdi}"(dst as usize), "{rax}"(src), "{rcx}"(len) - : "cc", "memory" + : "cc", "memory", "rdi", "rcx" : "intel", "volatile"); }