mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
AArch64 cannot compare shorts directly
This commit is contained in:
parent
8c4a95f083
commit
2c8d214650
1 changed files with 12 additions and 6 deletions
|
@ -4432,13 +4432,19 @@ private elem* elcmp(elem* e, Goal goal)
|
||||||
tym_t tym;
|
tym_t tym;
|
||||||
int sz = tysize(e2.Ety);
|
int sz = tysize(e2.Ety);
|
||||||
|
|
||||||
if (e1.Eoper == OPu16_32 && e2.Vulong <= cast(targ_ulong) SHORTMASK ||
|
/* The AArch64 does not have a compare short instruction, so the comparisons
|
||||||
e1.Eoper == OPs16_32 &&
|
* have to be done with the LDRH, etc., instructions
|
||||||
e2.Vlong == cast(targ_short) e2.Vlong)
|
*/
|
||||||
|
if (config.target_cpu != TARGET_AArch64)
|
||||||
{
|
{
|
||||||
tym = (uns || e1.Eoper == OPu16_32) ? TYushort : TYshort;
|
if (e1.Eoper == OPu16_32 && e2.Vulong <= cast(targ_ulong) SHORTMASK ||
|
||||||
e.E2 = el_una(OP32_16,tym,e2);
|
e1.Eoper == OPs16_32 &&
|
||||||
goto L2;
|
e2.Vlong == cast(targ_short) e2.Vlong)
|
||||||
|
{
|
||||||
|
tym = (uns || e1.Eoper == OPu16_32) ? TYushort : TYshort;
|
||||||
|
e.E2 = el_una(OP32_16,tym,e2);
|
||||||
|
goto L2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Try to convert to byte/word comparison for ((x & c)==d)
|
/* Try to convert to byte/word comparison for ((x & c)==d)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue