This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Eric Christopher <>

Eric Christopher wrote:

Anyhow, this fixes up all of the failures that were noticed (and I was able to test on
x86_64-darwin as well).

Probably obvious, but OK?

2006-11-04 Eric Christopher <>

       * Use nocona instead of 486
       for arch.

/* { dg-do compile } */
/* { dg-options "-march=nocona" } */
/* { dg-final { scan-assembler "bswap" } } */

This will pick "bswap" word from __builtin_bswap. You should probably use scan-assembler-not "builtin_bswap".

int foo (int a)
 int b;

b = __builtin_bswap (a);

There is no __builtin_bswap() builtin function,  only
__builtin_bswap32() and __builtin_bswap64(). The test "passes" only
due to above problem.

+(define_insn "bswapsi2"
+  [(set (match_operand:SI 0 "register_operand" "=r")
+	(bswap:SI (match_operand:SI 1 "register_operand" "0")))
+   (clobber (reg:CC FLAGS_REG))]
+  "bswap\t%1"


+ [(set_attr "prefix_0f" "1")])

Does this patern need to be disabled on 64 bits? IMO it can still be
used with 32bit argument.

BTW: I wonder, why there is no bswaphi2 pattern. Intel recommends xchg
instruction to swap bytes in HImode argument. The relevant pattern
could be defined like:

(define_insn "bswaphi2"
 [(set (match_operand:HI 0 "register_operand" "=G")
	(bswap:HI (match_operand:HI 1 "register_operand" "0")))]
 "xchg\t%b0, %h0")

I'm sure that linux's __be16 and __le16 data could find some use for
this pattern.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]