Skip to content

No fastcall attribute in POWER platform #35083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions pandas/_libs/src/ujson/lib/ultrajson.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ typedef __int64 JSLONG;
#define EXPORTFUNCTION __declspec(dllexport)

#define FASTCALL_MSVC __fastcall
#define FASTCALL_ATTR

#define INLINE_PREFIX static __inline

#else
Expand All @@ -108,12 +108,6 @@ typedef uint32_t JSUINT32;

#define FASTCALL_MSVC

#if !defined __x86_64__ && !defined __aarch64__
#define FASTCALL_ATTR __attribute__((fastcall))
#else
#define FASTCALL_ATTR
#endif

#define INLINE_PREFIX static inline

typedef uint8_t JSUINT8;
Expand Down
22 changes: 11 additions & 11 deletions pandas/_libs/src/ujson/lib/ultrajsondec.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct DecoderState {
JSONObjectDecoder *dec;
};

JSOBJ FASTCALL_MSVC decode_any(struct DecoderState *ds) FASTCALL_ATTR;
JSOBJ FASTCALL_MSVC decode_any(struct DecoderState *ds);
typedef JSOBJ (*PFN_DECODER)(struct DecoderState *ds);

static JSOBJ SetError(struct DecoderState *ds, int offset,
Expand Down Expand Up @@ -99,7 +99,7 @@ double createDouble(double intNeg, double intValue, double frcValue,
return (intValue + (frcValue * g_pow10[frcDecimalCount])) * intNeg;
}

FASTCALL_ATTR JSOBJ FASTCALL_MSVC decodePreciseFloat(struct DecoderState *ds) {
JSOBJ FASTCALL_MSVC decodePreciseFloat(struct DecoderState *ds) {
char *end;
double value;
errno = 0;
Expand All @@ -114,7 +114,7 @@ FASTCALL_ATTR JSOBJ FASTCALL_MSVC decodePreciseFloat(struct DecoderState *ds) {
return ds->dec->newDouble(ds->prv, value);
}

FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_numeric(struct DecoderState *ds) {
JSOBJ FASTCALL_MSVC decode_numeric(struct DecoderState *ds) {
int intNeg = 1;
int mantSize = 0;
JSUINT64 intValue;
Expand Down Expand Up @@ -340,7 +340,7 @@ FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_numeric(struct DecoderState *ds) {
pow(10.0, expValue * expNeg));
}

FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_true(struct DecoderState *ds) {
JSOBJ FASTCALL_MSVC decode_true(struct DecoderState *ds) {
char *offset = ds->start;
offset++;

Expand All @@ -356,7 +356,7 @@ FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_true(struct DecoderState *ds) {
return SetError(ds, -1, "Unexpected character found when decoding 'true'");
}

FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_false(struct DecoderState *ds) {
JSOBJ FASTCALL_MSVC decode_false(struct DecoderState *ds) {
char *offset = ds->start;
offset++;

Expand All @@ -373,7 +373,7 @@ FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_false(struct DecoderState *ds) {
return SetError(ds, -1, "Unexpected character found when decoding 'false'");
}

FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_null(struct DecoderState *ds) {
JSOBJ FASTCALL_MSVC decode_null(struct DecoderState *ds) {
char *offset = ds->start;
offset++;

Expand All @@ -389,7 +389,7 @@ FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_null(struct DecoderState *ds) {
return SetError(ds, -1, "Unexpected character found when decoding 'null'");
}

FASTCALL_ATTR void FASTCALL_MSVC SkipWhitespace(struct DecoderState *ds) {
void FASTCALL_MSVC SkipWhitespace(struct DecoderState *ds) {
char *offset;

for (offset = ds->start; (ds->end - offset) > 0; offset++) {
Expand Down Expand Up @@ -677,7 +677,7 @@ static const JSUINT8 g_decoderLookup[256] = {
DS_UTFLENERROR,
};

FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_string(struct DecoderState *ds) {
JSOBJ FASTCALL_MSVC decode_string(struct DecoderState *ds) {
JSUTF16 sur[2] = {0};
int iSur = 0;
int index;
Expand Down Expand Up @@ -957,7 +957,7 @@ FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_string(struct DecoderState *ds) {
}
}

FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_array(struct DecoderState *ds) {
JSOBJ FASTCALL_MSVC decode_array(struct DecoderState *ds) {
JSOBJ itemValue;
JSOBJ newObj;
int len;
Expand Down Expand Up @@ -1021,7 +1021,7 @@ FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_array(struct DecoderState *ds) {
}
}

FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_object(struct DecoderState *ds) {
JSOBJ FASTCALL_MSVC decode_object(struct DecoderState *ds) {
JSOBJ itemName;
JSOBJ itemValue;
JSOBJ newObj;
Expand Down Expand Up @@ -1104,7 +1104,7 @@ FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_object(struct DecoderState *ds) {
}
}

FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_any(struct DecoderState *ds) {
JSOBJ FASTCALL_MSVC decode_any(struct DecoderState *ds) {
for (;;) {
switch (*ds->start) {
case '\"':
Expand Down
4 changes: 2 additions & 2 deletions pandas/_libs/src/ujson/lib/ultrajsonenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ void Buffer_Realloc(JSONObjectEncoder *enc, size_t cbNeeded) {
enc->end = enc->start + newSize;
}

FASTCALL_ATTR INLINE_PREFIX void FASTCALL_MSVC
INLINE_PREFIX void FASTCALL_MSVC
Buffer_AppendShortHexUnchecked(char *outputOffset, unsigned short value) {
*(outputOffset++) = g_hexChars[(value & 0xf000) >> 12];
*(outputOffset++) = g_hexChars[(value & 0x0f00) >> 8];
Expand Down Expand Up @@ -722,7 +722,7 @@ int Buffer_EscapeStringValidated(JSOBJ obj, JSONObjectEncoder *enc,

#define Buffer_AppendCharUnchecked(__enc, __chr) *((__enc)->offset++) = __chr;

FASTCALL_ATTR INLINE_PREFIX void FASTCALL_MSVC strreverse(char *begin,
INLINE_PREFIX void FASTCALL_MSVC strreverse(char *begin,
char *end) {
char aux;
while (end > begin) aux = *end, *end-- = *begin, *begin++ = aux;
Expand Down