From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 13 16:16:23 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 00D5516A400; Mon, 13 Mar 2006 16:16:23 +0000 (UTC) (envelope-from root@scienceclue.ath.cx) Received: from scienceclue.ath.cx (mic92-1-87-90-12-116.dsl.club-internet.fr [87.90.12.116]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E37C43D46; Mon, 13 Mar 2006 16:16:20 +0000 (GMT) (envelope-from root@scienceclue.ath.cx) Received: from scienceclue.ath.cx (localhost [127.0.0.1]) by scienceclue.ath.cx (8.13.4/8.13.4) with ESMTP id k2DGHk0r057133; Mon, 13 Mar 2006 17:17:46 +0100 (CET) (envelope-from root@scienceclue.ath.cx) Received: (from root@localhost) by scienceclue.ath.cx (8.13.4/8.13.4/Submit) id k2DGHe7n057132; Mon, 13 Mar 2006 17:17:40 +0100 (CET) (envelope-from root) Date: Mon, 13 Mar 2006 17:17:40 +0100 From: Mathieu Prevot To: freebsd-hackers@freebsd.org Message-ID: <20060313161740.GA56875@scienceclue.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD-AMD64 6.1-PRERELEASE X-URL: http://scienceclue.ath.cx Cc: freebsd-amd64@freebsd.org Subject: Creating real bool type for simulation in physics X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Mathieu Prevot List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Mar 2006 16:16:23 -0000 Hello, I use freebsd/amd64 (RELENG_6) for simulation in physics. I am working on the Ising model: an assembly of spins (micromagnets) which interact and which are in one of two states (up or down). Until now I use char to define the state of each spin (-1 or 1), however, I remarked that most time is spent on memory I/O. Most of bits are unused. I think that if I can use just one bit per spin, I can have something much faster. I need advices on how to use it. I guess I can't define a new type with a 1/8 byte height (or one bit), yes ? What variable (int, char...) do you recommend to use for a sempron 64 bits. I think I'll need to define new operators (opaque operators, built with bit operators) to switch my spins or use directly the following: & | ^ ~ ... May I gain speed using MMX registers or something like this ? How can I do this ? Here is my basic and multithreaded program: http://scienceclue.ath.cx/download/ising_lps_0.2.tar.bz2 Thanks Mathieu P.