From: Dan Gohman Date: Thu, 5 Nov 2015 20:44:29 +0000 (+0000) Subject: [WebAssembly] Rename Immediate instructions to Const. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=154081af536e603f457d1951ad31705a3642768d;p=oota-llvm.git [WebAssembly] Rename Immediate instructions to Const. This more closely reflects the naming convention in the spec. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252204 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp b/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp index 59c1ff381a0..5a6f4354b22 100644 --- a/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp +++ b/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp @@ -281,16 +281,16 @@ void WebAssemblyAsmPrinter::EmitInstruction(const MachineInstr *MI) { case WebAssembly::ARGUMENT_F64: OS << "get_local " << argToString(MI->getOperand(1)); break; - case WebAssembly::Immediate_I32: + case WebAssembly::Const_I32: OS << "i32.const " << MI->getOperand(1).getImm(); break; - case WebAssembly::Immediate_I64: + case WebAssembly::Const_I64: OS << "i64.const " << MI->getOperand(1).getImm(); break; - case WebAssembly::Immediate_F32: + case WebAssembly::Const_F32: OS << "f32.const " << toString(MI->getOperand(1).getFPImm()->getValueAPF()); break; - case WebAssembly::Immediate_F64: + case WebAssembly::Const_F64: OS << "f64.const " << toString(MI->getOperand(1).getFPImm()->getValueAPF()); break; default: { diff --git a/lib/Target/WebAssembly/WebAssemblyInstrInfo.td b/lib/Target/WebAssembly/WebAssemblyInstrInfo.td index 32f7923edbe..71adcbfbe54 100644 --- a/lib/Target/WebAssembly/WebAssemblyInstrInfo.td +++ b/lib/Target/WebAssembly/WebAssemblyInstrInfo.td @@ -93,18 +93,18 @@ defm : ARGUMENT; defm : ARGUMENT; -def Immediate_I32 : I<(outs I32:$res), (ins i32imm:$imm), - [(set I32:$res, imm:$imm)], - "i32.const $res, $imm">; -def Immediate_I64 : I<(outs I64:$res), (ins i64imm:$imm), - [(set I64:$res, imm:$imm)], - "i64.const $res, $imm">; -def Immediate_F32 : I<(outs F32:$res), (ins f32imm:$imm), - [(set F32:$res, fpimm:$imm)], - "f32.const $res, $imm">; -def Immediate_F64 : I<(outs F64:$res), (ins f64imm:$imm), - [(set F64:$res, fpimm:$imm)], - "f64.const $res, $imm">; +def Const_I32 : I<(outs I32:$res), (ins i32imm:$imm), + [(set I32:$res, imm:$imm)], + "i32.const $res, $imm">; +def Const_I64 : I<(outs I64:$res), (ins i64imm:$imm), + [(set I64:$res, imm:$imm)], + "i64.const $res, $imm">; +def Const_F32 : I<(outs F32:$res), (ins f32imm:$imm), + [(set F32:$res, fpimm:$imm)], + "f32.const $res, $imm">; +def Const_F64 : I<(outs F64:$res), (ins f64imm:$imm), + [(set F64:$res, fpimm:$imm)], + "f64.const $res, $imm">; // Special types of immediates. FIXME: Hard-coded as 32-bit for now. def GLOBAL : I<(outs I32:$dst), (ins global:$addr),