File: 2007-04-30-InlineAsmEarlyClobber.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (32 lines) | stat: -rw-r--r-- 1,238 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
; RUN: llc -verify-machineinstrs < %s | FileCheck %s
; RUN: llc -verify-machineinstrs < %s -regalloc=fast -optimize-regalloc=0 | FileCheck %s
; The first argument of subfc must not be the same as any other register.

; CHECK: APP
; CHECK: subc [[REG:[0-9]+]],
; CHECK-NOT: [[REG]]
; CHECK: NO_APP
; PR1357

;target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
target triple = "powerpc-unknown-linux-gnu"

;long long test(int A, int B, int C) {
;  unsigned X, Y;
;  __asm__ ("subf%I3c %1,%4,%3\n\tsubfze %0,%2"
;                 : "=r" (X), "=&r" (Y)
;                 : "r" (A), "rI" (B), "r" (C));
;  return ((long long)Y << 32) | X;
;}

define i64 @test(i32 %A, i32 %B, i32 %C) nounwind {
entry:
	%Y = alloca i32, align 4		; <i32*> [#uses=2]
	%tmp4 = call i32 asm "subf${3:I}c $1,$4,$3\0A\09subfze $0,$2", "=r,=*&r,r,rI,r"( i32* elementtype( i32) %Y, i32 %A, i32 %B, i32 %C )		; <i32> [#uses=1]
	%tmp5 = load i32, i32* %Y		; <i32> [#uses=1]
	%tmp56 = zext i32 %tmp5 to i64		; <i64> [#uses=1]
	%tmp7 = shl i64 %tmp56, 32		; <i64> [#uses=1]
	%tmp89 = zext i32 %tmp4 to i64		; <i64> [#uses=1]
	%tmp10 = or i64 %tmp7, %tmp89		; <i64> [#uses=1]
	ret i64 %tmp10
}