1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck -check-prefix CHK %s 2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s 3 4 ; CHK-NOT: InlineAsm 5 6 ; CHECK-LABEL: foo: 7 ; CHECK: bswapq 8 define i64 @foo(i64 %x) nounwind { 9 %asmtmp = tail call i64 asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 %x) nounwind 10 ret i64 %asmtmp 11 } 12 13 ; CHECK-LABEL: bar: 14 ; CHECK: bswapq 15 define i64 @bar(i64 %x) nounwind { 16 %asmtmp = tail call i64 asm "bswapq ${0:q}", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 %x) nounwind 17 ret i64 %asmtmp 18 } 19 20 ; CHECK-LABEL: pen: 21 ; CHECK: bswapl 22 define i32 @pen(i32 %x) nounwind { 23 %asmtmp = tail call i32 asm "bswapl ${0:q}", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %x) nounwind 24 ret i32 %asmtmp 25 } 26 27 ; CHECK-LABEL: s16: 28 ; CHECK: rolw $8, 29 define zeroext i16 @s16(i16 zeroext %x) nounwind { 30 %asmtmp = tail call i16 asm "rorw $$8, ${0:w}", "=r,0,~{dirflag},~{fpsr},~{flags},~{cc}"(i16 %x) nounwind 31 ret i16 %asmtmp 32 } 33 34 ; CHECK-LABEL: t16: 35 ; CHECK: rolw $8, 36 define zeroext i16 @t16(i16 zeroext %x) nounwind { 37 %asmtmp = tail call i16 asm "rorw $$8, ${0:w}", "=r,0,~{cc},~{dirflag},~{fpsr},~{flags}"(i16 %x) nounwind 38 ret i16 %asmtmp 39 } 40 41 ; CHECK-LABEL: u16: 42 ; CHECK: rolw $8, 43 define zeroext i16 @u16(i16 zeroext %x) nounwind { 44 %asmtmp = tail call i16 asm "rolw $$8, ${0:w}", "=r,0,~{dirflag},~{fpsr},~{flags},~{cc}"(i16 %x) nounwind 45 ret i16 %asmtmp 46 } 47 48 ; CHECK-LABEL: v16: 49 ; CHECK: rolw $8, 50 define zeroext i16 @v16(i16 zeroext %x) nounwind { 51 %asmtmp = tail call i16 asm "rolw $$8, ${0:w}", "=r,0,~{cc},~{dirflag},~{fpsr},~{flags}"(i16 %x) nounwind 52 ret i16 %asmtmp 53 } 54 55 ; CHECK-LABEL: s32: 56 ; CHECK: bswapl 57 define i32 @s32(i32 %x) nounwind { 58 %asmtmp = tail call i32 asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %x) nounwind 59 ret i32 %asmtmp 60 } 61 62 ; CHECK-LABEL: t32: 63 ; CHECK: bswapl 64 define i32 @t32(i32 %x) nounwind { 65 %asmtmp = tail call i32 asm "bswap $0", "=r,0,~{dirflag},~{flags},~{fpsr}"(i32 %x) nounwind 66 ret i32 %asmtmp 67 } 68 69 ; CHECK-LABEL: u32: 70 ; CHECK: bswapl 71 define i32 @u32(i32 %x) nounwind { 72 %asmtmp = tail call i32 asm "rorw $$8, ${0:w};rorl $$16, $0;rorw $$8, ${0:w}", "=r,0,~{cc},~{dirflag},~{flags},~{fpsr}"(i32 %x) nounwind 73 ret i32 %asmtmp 74 } 75 76 ; CHECK-LABEL: s64: 77 ; CHECK: bswapq 78 define i64 @s64(i64 %x) nounwind { 79 %asmtmp = tail call i64 asm "bswap ${0:q}", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 %x) nounwind 80 ret i64 %asmtmp 81 } 82 83 ; CHECK-LABEL: t64: 84 ; CHECK: bswapq 85 define i64 @t64(i64 %x) nounwind { 86 %asmtmp = tail call i64 asm "bswap ${0:q}", "=r,0,~{fpsr},~{dirflag},~{flags}"(i64 %x) nounwind 87 ret i64 %asmtmp 88 } 89