Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-m.b-one.net (mx-m.one.com [91.198.169.60])
	by mail9.b-one.net (Postfix) with ESMTP id AD414400124
	for <info@awaresystems.be>; Wed,  7 Oct 2009 23:15:28 +0200 (CEST)
X-Virus-Scanned: by one.com
X-Spam-Score: 0
X-Spam-Level: 
X-Spam-Status: No, score=0 tagged_above=0 required=6 tests=[none]
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144])
	by mx-m.b-one.net (Postfix) with ESMTP id 0209F18A0E16
	for <info@awaresystems.be>; Wed,  7 Oct 2009 23:15:27 +0200 (CEST)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id E5ABA1D1F44DB;
	Wed,  7 Oct 2009 16:14:54 -0500 (EST)
Received: from toronto2.smartgames.ca (toronto2.smartgames.ca [204.15.192.18])
	by lists.maptools.org (Postfix) with ESMTP id F19D31D1F44D0
	for <tiff@lists.maptools.org>; Wed,  7 Oct 2009 16:08:42 -0500 (EST)
Received: from [10.143.176.101] (unknown [10.143.176.101])
	by toronto2.smartgames.ca (Postfix) with ESMTP id 5800C16C5A;
	Wed,  7 Oct 2009 17:09:04 -0400 (EDT)
In-Reply-To: <79109839.20091007224719@mail.ru>
References: <007c01ca4783$dfa4fc60$9eeef520$@com>
	<alpine.GSO.2.01.0910071454200.15399@freddy.simplesystems.org>
	<79109839.20091007224719@mail.ru>
Mime-Version: 1.0 (Apple Message framework v753.1)
X-Priority: 3 (Normal)
Message-Id: <FAFBDF07-5A74-465D-9982-B663D48F9AE0@telegraphics.com.au>
From: Toby Thain <toby@telegraphics.com.au>
Date: Wed, 7 Oct 2009 17:10:13 -0400
To: Igor Skochinsky <skochinsky@mail.ru>
X-Mailer: Apple Mail (2.753.1)
Cc: tiff@lists.maptools.org
Subject: Re: [Tiff] Wrong Native Bit Order on Intel x86_64
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org


On 7-Oct-09, at 4:47 PM, Igor Skochinsky wrote:

> Hello Bob,
>
> Wednesday, October 7, 2009, 9:59:45 PM, you wrote:
>
> BF> On Wed, 7 Oct 2009, Eskandar Ensafi wrote:
>>>
>>> I noticed that when I tried to compile tiff-4.0.0-beta4, the  
>>> native bit order on 64-bit x86_64 systems was
>>> determined to be FILLORDER_MSB2LSB (not correct as far as I know)  
>>> whereas on 32-bit x86 systems, it is
>>> correctly determined to be FILLORDER_LSB2MSB.  I checked my  
>>> current tiff-3.8.2 installation (the standard
>>> package provided in Red Hat Enterprise Linux 5.4), and the same  
>>> discrepancy existed in tiff-3.8.
>
> BF> This is very interesting.  It seems like there should be some
> BF> efficient way to determine this at run-time rather than via the
> BF> configure script.  I am not sure how to test for native fill order
> BF> though.
>
> My guess would be:
>
> if ( (1<<1) == 2 )
>   // LSB2MSB
> else
>   // MSB2LSB

This cannot work, of course.

As Eskandar suspected, native bit numbering is not visible to C. You  
could expose it using platform specific assembler, but it's probably  
pointless effort.

--Toby

>
> -- 
> WBR,
>  Igor                            mailto:skochinsky@mail.ru
>
> _______________________________________________
> Tiff mailing list: Tiff@lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/tiff
> http://www.remotesensing.org/libtiff/

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
