Skip to content

Commit bfa2c42

Browse files
author
Krzysztof Parzyszek
committed
[VE] Change displacement type in MEM..i from i32 to i64
In selection patterns, addresses (like tblockaddr) are passed as the displacement (the i in MEM..i) to instructions taking MEM operands. Since addresses are 64-bit, having this part of the MEM..i operand as i32 causes a type inference error. The instructions actually only encode 32 bits of the displacement, but there is no way to manually extract these bits (either the high or the low half) in selection patterns. This didn't happen before, because of a bug in type inference when dealing with iPTR.
1 parent 6c3990a commit bfa2c42

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Target/VE/VEInstrInfo.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,22 +325,22 @@ def VEMEMziiAsmOperand : AsmOperandClass {
325325
// ASX format uses single assembly instruction format.
326326
def MEMrri : Operand<iPTR> {
327327
let PrintMethod = "printMemASXOperand";
328-
let MIOperandInfo = (ops ptr_rc, ptr_rc, i32imm);
328+
let MIOperandInfo = (ops ptr_rc, ptr_rc, i64imm);
329329
let ParserMatchClass = VEMEMrriAsmOperand;
330330
}
331331
def MEMrii : Operand<iPTR> {
332332
let PrintMethod = "printMemASXOperand";
333-
let MIOperandInfo = (ops ptr_rc, i32imm, i32imm);
333+
let MIOperandInfo = (ops ptr_rc, i32imm, i64imm);
334334
let ParserMatchClass = VEMEMriiAsmOperand;
335335
}
336336
def MEMzri : Operand<iPTR> {
337337
let PrintMethod = "printMemASXOperand";
338-
let MIOperandInfo = (ops i32imm /* = 0 */, ptr_rc, i32imm);
338+
let MIOperandInfo = (ops i32imm /* = 0 */, ptr_rc, i64imm);
339339
let ParserMatchClass = VEMEMzriAsmOperand;
340340
}
341341
def MEMzii : Operand<iPTR> {
342342
let PrintMethod = "printMemASXOperand";
343-
let MIOperandInfo = (ops i32imm /* = 0 */, i32imm, i32imm);
343+
let MIOperandInfo = (ops i32imm /* = 0 */, i32imm, i64imm);
344344
let ParserMatchClass = VEMEMziiAsmOperand;
345345
}
346346

0 commit comments

Comments
 (0)