diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td @@ -15,7 +15,7 @@ multiclass ATOMIC_I pattern_r, string asmstr_r, string asmstr_s, bits<32> atomic_op, - string is64 = "false"> { + bit is64 = false> { defm "" : I, Requires<[HasAtomics]>; @@ -38,13 +38,13 @@ (ins P2Align:$p2align, offset32_op:$off, I32:$addr, I32:$count), (outs), (ins P2Align:$p2align, offset32_op:$off), [], "memory.atomic.notify \t$dst, ${off}(${addr})${p2align}, $count", - "memory.atomic.notify \t${off}${p2align}", 0x00, "false">; + "memory.atomic.notify \t${off}${p2align}", 0x00, false>; defm MEMORY_ATOMIC_NOTIFY_A64 : ATOMIC_I<(outs I32:$dst), (ins P2Align:$p2align, offset64_op:$off, I64:$addr, I32:$count), (outs), (ins P2Align:$p2align, offset64_op:$off), [], "memory.atomic.notify \t$dst, ${off}(${addr})${p2align}, $count", - "memory.atomic.notify \t${off}${p2align}", 0x00, "true">; + "memory.atomic.notify \t${off}${p2align}", 0x00, true>; let mayLoad = 1 in { defm MEMORY_ATOMIC_WAIT32_A32 : ATOMIC_I<(outs I32:$dst), @@ -52,28 +52,28 @@ I64:$timeout), (outs), (ins P2Align:$p2align, offset32_op:$off), [], "memory.atomic.wait32 \t$dst, ${off}(${addr})${p2align}, $exp, $timeout", - "memory.atomic.wait32 \t${off}${p2align}", 0x01, "false">; + "memory.atomic.wait32 \t${off}${p2align}", 0x01, false>; defm MEMORY_ATOMIC_WAIT32_A64 : ATOMIC_I<(outs I32:$dst), (ins P2Align:$p2align, offset64_op:$off, I64:$addr, I32:$exp, I64:$timeout), (outs), (ins P2Align:$p2align, offset64_op:$off), [], "memory.atomic.wait32 \t$dst, ${off}(${addr})${p2align}, $exp, $timeout", - "memory.atomic.wait32 \t${off}${p2align}", 0x01, "true">; + "memory.atomic.wait32 \t${off}${p2align}", 0x01, true>; defm MEMORY_ATOMIC_WAIT64_A32 : ATOMIC_I<(outs I32:$dst), (ins P2Align:$p2align, offset32_op:$off, I32:$addr, I64:$exp, I64:$timeout), (outs), (ins P2Align:$p2align, offset32_op:$off), [], "memory.atomic.wait64 \t$dst, ${off}(${addr})${p2align}, $exp, $timeout", - "memory.atomic.wait64 \t${off}${p2align}", 0x02, "false">; + "memory.atomic.wait64 \t${off}${p2align}", 0x02, false>; defm MEMORY_ATOMIC_WAIT64_A64 : ATOMIC_I<(outs I32:$dst), (ins P2Align:$p2align, offset64_op:$off, I64:$addr, I64:$exp, I64:$timeout), (outs), (ins P2Align:$p2align, offset64_op:$off), [], "memory.atomic.wait64 \t$dst, ${off}(${addr})${p2align}, $exp, $timeout", - "memory.atomic.wait64 \t${off}${p2align}", 0x02, "true">; + "memory.atomic.wait64 \t${off}${p2align}", 0x02, true>; } // mayLoad = 1 } // hasSideEffects = 1 @@ -469,13 +469,13 @@ (ins P2Align:$p2align, offset32_op:$off, I32:$addr, rc:$val), (outs), (ins P2Align:$p2align, offset32_op:$off), [], !strconcat(name, "\t$dst, ${off}(${addr})${p2align}, $val"), - !strconcat(name, "\t${off}${p2align}"), atomic_op, "false">; + !strconcat(name, "\t${off}${p2align}"), atomic_op, false>; defm "_A64" : ATOMIC_I<(outs rc:$dst), (ins P2Align:$p2align, offset64_op:$off, I64:$addr, rc:$val), (outs), (ins P2Align:$p2align, offset64_op:$off), [], !strconcat(name, "\t$dst, ${off}(${addr})${p2align}, $val"), - !strconcat(name, "\t${off}${p2align}"), atomic_op, "true">; + !strconcat(name, "\t${off}${p2align}"), atomic_op, true>; } defm ATOMIC_RMW_ADD_I32 : WebAssemblyBinRMW; @@ -767,14 +767,14 @@ rc:$new_), (outs), (ins P2Align:$p2align, offset32_op:$off), [], !strconcat(name, "\t$dst, ${off}(${addr})${p2align}, $exp, $new_"), - !strconcat(name, "\t${off}${p2align}"), atomic_op, "false">; + !strconcat(name, "\t${off}${p2align}"), atomic_op, false>; defm "_A64" : ATOMIC_I<(outs rc:$dst), (ins P2Align:$p2align, offset64_op:$off, I64:$addr, rc:$exp, rc:$new_), (outs), (ins P2Align:$p2align, offset64_op:$off), [], !strconcat(name, "\t$dst, ${off}(${addr})${p2align}, $exp, $new_"), - !strconcat(name, "\t${off}${p2align}"), atomic_op, "true">; + !strconcat(name, "\t${off}${p2align}"), atomic_op, true>; } defm ATOMIC_RMW_CMPXCHG_I32 : diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrFormats.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrFormats.td --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrFormats.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrFormats.td @@ -14,12 +14,12 @@ // WebAssembly Instruction Format. // We instantiate 2 of these for every actual instruction (register based // and stack based), see below. -class WebAssemblyInst inst, string asmstr, bit stack, string is64> +class WebAssemblyInst inst, string asmstr, bit stack, bit is64> : StackRel, RegisterRel, Wasm64Rel, Instruction { bits<32> Inst = inst; // Instruction encoding. bit StackBased = stack; string BaseName = NAME; - string IsWasm64 = is64; + bit IsWasm64 = is64; string Wasm32Name = !subst("_A64", "_A32", NAME); let Namespace = "WebAssembly"; let Pattern = []; @@ -31,7 +31,7 @@ // Normal instructions. Default instantiation of a WebAssemblyInst. class NI pattern, bit stack, - string asmstr = "", bits<32> inst = -1, string is64 = "false"> + string asmstr = "", bits<32> inst = -1, bit is64 = false> : WebAssemblyInst { dag OutOperandList = oops; dag InOperandList = iops; @@ -54,7 +54,7 @@ // there is always an equivalent pair of instructions. multiclass I pattern_r, string asmstr_r = "", string asmstr_s = "", - bits<32> inst = -1, string is64 = "false"> { + bits<32> inst = -1, bit is64 = false> { let isCodeGenOnly = 1 in def "" : NI; let BaseName = NAME in diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td @@ -251,8 +251,8 @@ let FilterClass = "Wasm64Rel"; let RowFields = ["Wasm32Name"]; let ColFields = ["IsWasm64"]; - let KeyCol = ["false"]; - let ValueCols = [["true"]]; + let KeyCol = ["0"]; + let ValueCols = [["1"]]; } //===----------------------------------------------------------------------===// diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrMemory.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrMemory.td --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrMemory.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrMemory.td @@ -47,13 +47,13 @@ (ins P2Align:$p2align, offset32_op:$off, I32:$addr), (outs), (ins P2Align:$p2align, offset32_op:$off), [], !strconcat(Name, "\t$dst, ${off}(${addr})${p2align}"), - !strconcat(Name, "\t${off}${p2align}"), Opcode, "false">, + !strconcat(Name, "\t${off}${p2align}"), Opcode, false>, Requires; defm "_A64": I<(outs rc:$dst), (ins P2Align:$p2align, offset64_op:$off, I64:$addr), (outs), (ins P2Align:$p2align, offset64_op:$off), [], !strconcat(Name, "\t$dst, ${off}(${addr})${p2align}"), - !strconcat(Name, "\t${off}${p2align}"), Opcode, "true">, + !strconcat(Name, "\t${off}${p2align}"), Opcode, true>, Requires; } } @@ -244,7 +244,7 @@ (outs), (ins P2Align:$p2align, offset32_op:$off), [], !strconcat(Name, "\t${off}(${addr})${p2align}, $val"), - !strconcat(Name, "\t${off}${p2align}"), Opcode, "false">, + !strconcat(Name, "\t${off}${p2align}"), Opcode, false>, Requires; let mayStore = 1, UseNamedOperandTable = 1 in defm "_A64" : I<(outs), @@ -252,7 +252,7 @@ (outs), (ins P2Align:$p2align, offset64_op:$off), [], !strconcat(Name, "\t${off}(${addr})${p2align}, $val"), - !strconcat(Name, "\t${off}${p2align}"), Opcode, "true">, + !strconcat(Name, "\t${off}${p2align}"), Opcode, true>, Requires; }