@@ -2209,6 +2209,7 @@ void disassemble(uint c) @trusted
22092209 p3 = (Rm == 0 && (opcode2 & 8 )) ? " #0.0" : fregString(rbuf[4 .. 8 ]," sd h" [ftype],Rm);
22102210 }
22112211 }
2212+ else
22122213
22132214 // Floating-point immediate http://www.scs.stanford.edu/~zyedidia/arm64/encodingindex.html#floatimm
22142215 if (field(ins,31 ,24 ) == 0x1E && field(ins,21 ,21 ) == 1 && field(ins,12 ,10 ) == 4 )
@@ -2226,7 +2227,33 @@ void disassemble(uint c) @trusted
22262227 }
22272228 else
22282229
2229- // Floating-point conditional compare
2230+ // Floating-point conditional compare https://www.scs.stanford.edu/~zyedidia/arm64/encodingindex.html#floatccmp
2231+ if (field(ins, 30 , 30 ) == 0 && field(ins, 28 , 24 ) == 0x1E && field(ins,21 ,21 ) == 1 && field(ins, 11 , 10 ) == 1 )
2232+ {
2233+ url = " floatccmp" ;
2234+
2235+ uint M = field(ins,31 ,31 );
2236+ uint S = field(ins,29 ,29 );
2237+ uint ftype = field(ins,23 ,22 );
2238+ uint Rm = field(ins,20 ,16 );
2239+ uint cond = field(ins,15 ,12 );
2240+ uint Rn = field(ins, 9 , 5 );
2241+ uint op = field(ins, 4 , 4 );
2242+ uint nzcv = field(ins, 3 , 0 );
2243+
2244+ if (M == 0 && S == 0 )
2245+ {
2246+ // fccmp d5,d5,#0,vs
2247+ url = op ? " fccmpe_float" : " fccmp_float" ;
2248+ p1 = op ? " fccmpe" : " fccmp" ;
2249+ p2 = fregString(rbuf[0 .. 4 ]," sd h" [ftype],Rn);
2250+ p3 = fregString(rbuf[0 .. 4 ]," sd h" [ftype],Rm);
2251+ uint n = snprintf(buf.ptr, cast (uint )buf.length," #0x%x" , nzcv);
2252+ p4 = buf[0 .. n];
2253+ p5 = condstring[cond];
2254+ }
2255+ }
2256+ else
22302257
22312258 // Floating-point data-processing (2 source) https://www.scs.stanford.edu/~zyedidia/arm64/encodingindex.html#floatdp2
22322259 if (field(ins, 30 , 30 ) == 0 && field(ins, 28 , 24 ) == 0x1E && field(ins,21 ,21 ) == 1 && field(ins, 11 , 10 ) == 2 )
@@ -3216,8 +3243,10 @@ unittest
32163243unittest
32173244{
32183245 int line64 = __LINE__ ;
3219- string [96 ] cases64 = // 64 bit code gen
3246+ string [98 ] cases64 = // 64 bit code gen
32203247 [
3248+ " 1E 65 64 A0 fccmp d5,d5,#0x0,vs" ,
3249+ " 1E 65 64 B0 fccmpe d5,d5,#0x0,vs" ,
32213250 " 79 C0 47 AB ldrsh w11,[x29,#0x22]" ,
32223251 " F8 1F 03 A8 stur x8,[x29,#-0x10]" ,
32233252 " B8 00 04 62 str w2,[x3],#0" ,
0 commit comments