@@ -36,15 +36,17 @@ Z80MCAsmInfoELF::Z80MCAsmInfoELF(const Triple &T) {
36
36
CodePointerSize = CalleeSaveStackSlotSize = Is16Bit ? 2 : 3 ;
37
37
MaxInstLength = 6 ;
38
38
39
+ CommentString = " ;" ;
40
+ Code16Directive = " .assume\t adl = 0" ;
41
+ Code24Directive = " .assume\t adl = 1" ;
42
+ Code32Directive = Code64Directive = nullptr ;
43
+ UseIntegratedAssembler = false ;
44
+ AssemblerDialect = !Is16Bit;
45
+
39
46
if (!Z80GasStyle) {
40
47
DollarIsPC = true ;
41
48
SeparatorString = nullptr ;
42
- CommentString = " ;" ;
43
49
PrivateGlobalPrefix = PrivateLabelPrefix = " " ;
44
- Code16Directive = " assume\t adl = 0" ;
45
- Code24Directive = " assume\t adl = 1" ;
46
- Code32Directive = Code64Directive = nullptr ;
47
- AssemblerDialect = !Is16Bit;
48
50
SupportsQuotedNames = false ;
49
51
ZeroDirective = AscizDirective = nullptr ;
50
52
BlockSeparator = " dup " ;
@@ -79,10 +81,6 @@ Z80MCAsmInfoELF::Z80MCAsmInfoELF(const Triple &T) {
79
81
DwarfFileDirective = " \t file\t " ;
80
82
DwarfLocDirective = " \t loc\t " ;
81
83
DwarfCFIDirectivePrefix = " \t cfi_" ;
82
- } else {
83
- CommentString = " ;" ;
84
- Code16Directive = Code24Directive = Code32Directive = Code64Directive = nullptr ;
85
- UseIntegratedAssembler = false ;
86
84
}
87
85
}
88
86
@@ -99,16 +97,22 @@ bool Z80MCAsmInfoELF::shouldOmitSectionDirective(StringRef SectionName) const {
99
97
}
100
98
101
99
const char *Z80MCAsmInfoELF::getBlockDirective (int64_t Size ) const {
100
+ if (Z80GasStyle) {
101
+ return MCAsmInfoELF::getBlockDirective (Size );
102
+ }
102
103
switch (Size ) {
103
104
default : return nullptr ;
104
- case 1 : return Z80GasStyle ? " \t .byte " : " \t db\t " ;
105
- case 2 : return Z80GasStyle ? " \t .short " : " \t dw\t " ;
106
- case 3 : return Z80GasStyle ? " \t .long " : " \t dl\t " ;
107
- case 4 : return Z80GasStyle ? " \t .quad " : " \t dd\t " ;
105
+ case 1 : return " \t db\t " ;
106
+ case 2 : return " \t dw\t " ;
107
+ case 3 : return " \t dl\t " ;
108
+ case 4 : return " \t dd\t " ;
108
109
}
109
110
}
110
111
111
112
const char *Z80MCAsmInfoELF::getUnaryOperator (unsigned Opc) const {
113
+ if (Z80GasStyle) {
114
+ return MCAsmInfoELF::getUnaryOperator (Opc);
115
+ }
112
116
switch (Opc) {
113
117
default : llvm_unreachable (" unknown opcode" );
114
118
case MCUnaryExpr::LNot: return " ~" ;
@@ -119,6 +123,9 @@ const char *Z80MCAsmInfoELF::getUnaryOperator(unsigned Opc) const {
119
123
}
120
124
121
125
const char *Z80MCAsmInfoELF::getBinaryOperator (unsigned Opc) const {
126
+ if (Z80GasStyle) {
127
+ return MCAsmInfoELF::getBinaryOperator (Opc);
128
+ }
122
129
switch (Opc) {
123
130
default : llvm_unreachable (" unknown opcode" );
124
131
case MCBinaryExpr::Add: return " +" ;
0 commit comments