Perhaps we should pass sets smaller than 16bytes in registers, like all other structures are...
Pascal patches the backend (stor-layout.c) to get this. More precisely `stor-layout.c' contains the following (at line 1813):
if (rounded_size > (int) alignment) TYPE_MODE (type) = BLKmode; else TYPE_MODE (type) = mode_for_size (alignment, MODE_INT, 1);
Pascal makes alignment equal to size of long. By default alignment is BITS_PER_WORD. I do not know what other front ends are doing, but safe way is to expect any integer mode.
I see, this can be problem for passing 128bit sets in register, but I guess if we classify it using x86_64_INTEGER_CLASS it will just work (get casted via PARALLEL)
Honza
The following snippet appearently works for Pascal and should be relatively safe for other front ends:
else if (TREE_CODE (type) == SET_TYPE) { if (bytes <= 4) { classes[0] = X86_64_INTEGERSI_CLASS; return 1; } else if (bytes <= 8) { classes[0] = X86_64_INTEGER_CLASS; return 1; } else if (bytes <= 12) { classes[0] = X86_64_INTEGER_CLASS; classes[1] = X86_64_INTEGERSI_CLASS; return 2; } else { classes[0] = X86_64_INTEGER_CLASS; classes[1] = X86_64_INTEGER_CLASS; return 2; }