File: i128-addsub.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (39 lines) | stat: -rw-r--r-- 1,570 bytes parent folder | download | duplicates (14)
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
33
34
35
36
37
38
39
; RUN: llc < %s

define void @test_add(i64 %AL, i64 %AH, i64 %BL, i64 %BH, ptr %RL, ptr %RH) {
entry:
	%tmp1 = zext i64 %AL to i128		; <i128> [#uses=1]
	%tmp23 = zext i64 %AH to i128		; <i128> [#uses=1]
	%tmp4 = shl i128 %tmp23, 64		; <i128> [#uses=1]
	%tmp5 = or i128 %tmp4, %tmp1		; <i128> [#uses=1]
	%tmp67 = zext i64 %BL to i128		; <i128> [#uses=1]
	%tmp89 = zext i64 %BH to i128		; <i128> [#uses=1]
	%tmp11 = shl i128 %tmp89, 64		; <i128> [#uses=1]
	%tmp12 = or i128 %tmp11, %tmp67		; <i128> [#uses=1]
	%tmp15 = add i128 %tmp12, %tmp5		; <i128> [#uses=2]
	%tmp1617 = trunc i128 %tmp15 to i64		; <i64> [#uses=1]
	store i64 %tmp1617, ptr %RL
	%tmp21 = lshr i128 %tmp15, 64		; <i128> [#uses=1]
	%tmp2122 = trunc i128 %tmp21 to i64		; <i64> [#uses=1]
	store i64 %tmp2122, ptr %RH
	ret void
}

define void @test_sub(i64 %AL, i64 %AH, i64 %BL, i64 %BH, ptr %RL, ptr %RH) {
entry:
	%tmp1 = zext i64 %AL to i128		; <i128> [#uses=1]
	%tmp23 = zext i64 %AH to i128		; <i128> [#uses=1]
	%tmp4 = shl i128 %tmp23, 64		; <i128> [#uses=1]
	%tmp5 = or i128 %tmp4, %tmp1		; <i128> [#uses=1]
	%tmp67 = zext i64 %BL to i128		; <i128> [#uses=1]
	%tmp89 = zext i64 %BH to i128		; <i128> [#uses=1]
	%tmp11 = shl i128 %tmp89, 64		; <i128> [#uses=1]
	%tmp12 = or i128 %tmp11, %tmp67		; <i128> [#uses=1]
	%tmp15 = sub i128 %tmp5, %tmp12		; <i128> [#uses=2]
	%tmp1617 = trunc i128 %tmp15 to i64		; <i64> [#uses=1]
	store i64 %tmp1617, ptr %RL
	%tmp21 = lshr i128 %tmp15, 64		; <i128> [#uses=1]
	%tmp2122 = trunc i128 %tmp21 to i64		; <i64> [#uses=1]
	store i64 %tmp2122, ptr %RH
	ret void
}