Skip to content

add v64i2 MUL operation - #22

Open
ffmpbgrnn wants to merge 2 commits into
zjuacompiler:masterfrom
ffmpbgrnn:master
Open

add v64i2 MUL operation#22
ffmpbgrnn wants to merge 2 commits into
zjuacompiler:masterfrom
ffmpbgrnn:master

Conversation

@ffmpbgrnn

Copy link
Copy Markdown

这是简单的测试代码:

@.str = private unnamed_addr constant [4 x i8] c"%u\0A\00", align 1

; Function Attrs: nounwind uwtable
define i32 @main() #0 {
entry:
  %a = add i32 0, 1
  %b = add i32 10, 20
  %c = add i32 %a, %b
  %d = zext i32 %c to i128
  %e = zext i32 %b to i128
  %x = bitcast i128 %d to <64 x i2>
  %y = bitcast i128 %e to <64 x i2>
  %z = mul <64 x i2> %x, %y
  %ans = bitcast <64 x i2> %z to <4 x i32>
  %ans_1 = extractelement <4 x i32> %ans, i32 0
  %ans_2 = extractelement <4 x i32> %ans, i32 1
  %ans_3 = extractelement <4 x i32> %ans, i32 2
  %ans_4 = extractelement <4 x i32> %ans, i32 3

  %call_1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i32 0, i32 0), i32 %ans_1)
  %call_2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i32 0, i32 0), i32 %ans_2)
  %call_3 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i32 0, i32 0), i32 %ans_3)
  %call_4 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i32 0, i32 0), i32 %ans_4)
  ret i32 0
}

declare i32 @printf(i8*, ...) #1

@chouqin

chouqin commented Jun 11, 2014

Copy link
Copy Markdown
Contributor

看看啊。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants