llvm.org GIT mirror llvm / 55a57a7
WebAssembly: fix more syntax br_if shouldn't start with a dot. div and rem went from prefix u/s to suffix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250972 91177308-0d34-0410-b5e6-96231b3b80d8 JF Bastien 5 years ago
5 changed file(s) with 14 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
106106 std::string Name(&N[0], &N[NameEnd]);
107107 if (!HasType)
108108 return Name;
109 for (const char *typelessOpcode : { "return", "call" })
109 for (const char *typelessOpcode : { "return", "call", "br_if" })
110110 if (Name == typelessOpcode)
111111 return Name;
112112 return std::string(&N[NameEnd + 1], &N[Len]) + '.' + Name;
1414 defm ADD : BinaryInt;
1515 defm SUB : BinaryInt;
1616 defm MUL : BinaryInt;
17 defm SDIV : BinaryInt;
18 defm UDIV : BinaryInt;
19 defm SREM : BinaryInt;
20 defm UREM : BinaryInt>;
17 defm DIV_S : BinaryInt>;
18 defm DIV_U : BinaryInt;
19 defm REM_S : BinaryInt;
20 defm REM_U : BinaryInt;
2121 defm AND : BinaryInt;
2222 defm IOR : BinaryInt;
2323 defm XOR : BinaryInt;
6868 ; CHECK-NEXT: set_local 2, pop{{$}}
6969 ; CHECK-NEXT: get_local 0{{$}}
7070 ; CHECK-NEXT: set_local 3, pop{{$}}
71 ; CHECK-NEXT: sdiv (get_local 3), (get_local 2){{$}}
71 ; CHECK-NEXT: div_s (get_local 3), (get_local 2){{$}}
7272 ; CHECK-NEXT: set_local 4, pop{{$}}
7373 ; CHECK-NEXT: return (get_local 4){{$}}
7474 define i32 @sdiv32(i32 %x, i32 %y) {
8585 ; CHECK-NEXT: set_local 2, pop{{$}}
8686 ; CHECK-NEXT: get_local 0{{$}}
8787 ; CHECK-NEXT: set_local 3, pop{{$}}
88 ; CHECK-NEXT: udiv (get_local 3), (get_local 2){{$}}
88 ; CHECK-NEXT: div_u (get_local 3), (get_local 2){{$}}
8989 ; CHECK-NEXT: set_local 4, pop{{$}}
9090 ; CHECK-NEXT: return (get_local 4){{$}}
9191 define i32 @udiv32(i32 %x, i32 %y) {
102102 ; CHECK-NEXT: set_local 2, pop{{$}}
103103 ; CHECK-NEXT: get_local 0{{$}}
104104 ; CHECK-NEXT: set_local 3, pop{{$}}
105 ; CHECK-NEXT: srem (get_local 3), (get_local 2){{$}}
105 ; CHECK-NEXT: rem_s (get_local 3), (get_local 2){{$}}
106106 ; CHECK-NEXT: set_local 4, pop{{$}}
107107 ; CHECK-NEXT: return (get_local 4){{$}}
108108 define i32 @srem32(i32 %x, i32 %y) {
119119 ; CHECK-NEXT: set_local 2, pop{{$}}
120120 ; CHECK-NEXT: get_local 0{{$}}
121121 ; CHECK-NEXT: set_local 3, pop{{$}}
122 ; CHECK-NEXT: urem (get_local 3), (get_local 2){{$}}
122 ; CHECK-NEXT: rem_u (get_local 3), (get_local 2){{$}}
123123 ; CHECK-NEXT: set_local 4, pop{{$}}
124124 ; CHECK-NEXT: return (get_local 4){{$}}
125125 define i32 @urem32(i32 %x, i32 %y) {
6868 ; CHECK-NEXT: set_local 2, pop{{$}}
6969 ; CHECK-NEXT: get_local 0{{$}}
7070 ; CHECK-NEXT: set_local 3, pop{{$}}
71 ; CHECK-NEXT: sdiv (get_local 3), (get_local 2){{$}}
71 ; CHECK-NEXT: div_s (get_local 3), (get_local 2){{$}}
7272 ; CHECK-NEXT: set_local 4, pop{{$}}
7373 ; CHECK-NEXT: return (get_local 4){{$}}
7474 define i64 @sdiv64(i64 %x, i64 %y) {
8585 ; CHECK-NEXT: set_local 2, pop{{$}}
8686 ; CHECK-NEXT: get_local 0{{$}}
8787 ; CHECK-NEXT: set_local 3, pop{{$}}
88 ; CHECK-NEXT: udiv (get_local 3), (get_local 2){{$}}
88 ; CHECK-NEXT: div_u (get_local 3), (get_local 2){{$}}
8989 ; CHECK-NEXT: set_local 4, pop{{$}}
9090 ; CHECK-NEXT: return (get_local 4){{$}}
9191 define i64 @udiv64(i64 %x, i64 %y) {
102102 ; CHECK-NEXT: set_local 2, pop{{$}}
103103 ; CHECK-NEXT: get_local 0{{$}}
104104 ; CHECK-NEXT: set_local 3, pop{{$}}
105 ; CHECK-NEXT: srem (get_local 3), (get_local 2){{$}}
105 ; CHECK-NEXT: rem_s (get_local 3), (get_local 2){{$}}
106106 ; CHECK-NEXT: set_local 4, pop{{$}}
107107 ; CHECK-NEXT: return (get_local 4){{$}}
108108 define i64 @srem64(i64 %x, i64 %y) {
119119 ; CHECK-NEXT: set_local 2, pop{{$}}
120120 ; CHECK-NEXT: get_local 0{{$}}
121121 ; CHECK-NEXT: set_local 3, pop{{$}}
122 ; CHECK-NEXT: urem (get_local 3), (get_local 2){{$}}
122 ; CHECK-NEXT: rem_u (get_local 3), (get_local 2){{$}}
123123 ; CHECK-NEXT: set_local 4, pop{{$}}
124124 ; CHECK-NEXT: return (get_local 4){{$}}
125125 define i64 @urem64(i64 %x, i64 %y) {
99 ; CHECK-LABEL: test0:
1010 ; CHECK: get_local 0{{$}}
1111 ; CHECK: set_local [[REG:.*]], pop
12 ; CHECK: sdiv (get_local [[REG]]), {{.*}}
12 ; CHECK: div_s (get_local [[REG]]), {{.*}}
1313 ; CHECK: set_local [[REG]], pop
1414 ; CHECK: return (get_local [[REG]])
1515 define i32 @test0(i32 %p) {