blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
721
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
57
| license_type
stringclasses 2
values | repo_name
stringlengths 5
91
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 321
values | visit_date
timestamp[ns]date 2016-08-12 09:31:09
2023-09-06 10:45:07
| revision_date
timestamp[ns]date 2010-09-28 14:01:40
2023-09-06 06:22:19
| committer_date
timestamp[ns]date 2010-09-28 14:01:40
2023-09-06 06:22:19
| github_id
int64 426
681M
| star_events_count
int64 101
243k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 23
values | gha_event_created_at
timestamp[ns]date 2012-06-28 18:51:49
2023-09-14 21:59:16
⌀ | gha_created_at
timestamp[ns]date 2008-02-11 22:55:26
2023-08-10 11:14:58
⌀ | gha_language
stringclasses 147
values | src_encoding
stringclasses 26
values | language
stringclasses 2
values | is_vendor
bool 2
classes | is_generated
bool 2
classes | length_bytes
int64 6
10.2M
| extension
stringclasses 115
values | filename
stringlengths 3
113
| content
stringlengths 6
10.2M
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b51a8183842fa8ff80689e384ea1e6d3f2f53caf
|
2b4867ce106d3068b67f2244019247df9cf6f341
|
/tests/runner-tests/cpp/include/subdir/a.h
|
a72897526d5596a9cc284d3cbff0e98f167756a3
|
[
"BSD-3-Clause"
] |
permissive
|
jyn514/saltwater
|
d22b29ac40a4e3deb6128d904759d9183f081ab4
|
097c72d30e325de57fbed8a506431754a0560374
|
refs/heads/master
| 2023-05-09T05:44:43.147928
| 2021-06-03T02:53:32
| 2021-06-03T02:53:32
| 190,940,981
| 131
| 25
|
BSD-3-Clause
| 2021-04-07T22:58:39
| 2019-06-08T22:26:45
|
Rust
|
UTF-8
|
C
| false
| false
| 26
|
h
|
a.h
|
#include "b.h"
int a = 1;
|
dd0d74b83e2f383fcca2d6339740a0ecaf86e1f5
|
bdc27c22522a99b5bff2ec4cfa95fadcba65747d
|
/source/adios2/toolkit/sst/cp/cp_reader.c
|
ed58f0da42029024d2df6a84bd4c9a69ea44f8a9
|
[
"Apache-2.0"
] |
permissive
|
ornladios/ADIOS2
|
a34e257b28adb26e6563b800502266ebb0c9088c
|
c8b7b66ed21b03bfb773bd972d5aeaaf10231e67
|
refs/heads/master
| 2023-08-31T18:11:22.186415
| 2023-08-29T20:45:03
| 2023-08-29T20:45:03
| 75,750,830
| 243
| 140
|
Apache-2.0
| 2023-09-14T11:15:00
| 2016-12-06T16:39:55
|
C++
|
UTF-8
|
C
| false
| false
| 86,663
|
c
|
cp_reader.c
|
#include <assert.h>
#include <ctype.h>
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
#include "adios2/common/ADIOSConfig.h"
#include <atl.h>
#include <evpath.h>
#include <pthread.h>
#include "sst.h"
#include "cp_internal.h"
#include <adios2-perfstubs-interface.h>
#define gettid() pthread_self()
#ifdef MUTEX_DEBUG
#define STREAM_MUTEX_LOCK(Stream) \
{ \
fprintf(stderr, "(PID %lx, TID %lx) CP_READER Trying lock line %d\n", (long)getpid(), \
(long)gettid(), __LINE__); \
pthread_mutex_lock(&Stream->DataLock); \
Stream->Locked++; \
fprintf(stderr, "(PID %lx, TID %lx) CP_READER Got lock\n", (long)getpid(), \
(long)gettid()); \
}
#define STREAM_MUTEX_UNLOCK(Stream) \
{ \
fprintf(stderr, "(PID %lx, TID %lx) CP_READER UNlocking line %d\n", (long)getpid(), \
(long)gettid(), __LINE__); \
Stream->Locked--; \
pthread_mutex_unlock(&Stream->DataLock); \
}
#define STREAM_CONDITION_WAIT(Stream) \
{ \
fprintf(stderr, "(PID %lx, TID %lx) CP_READER Dropping Condition Lock line %d\n", \
(long)getpid(), (long)gettid(), __LINE__); \
Stream->Locked = 0; \
pthread_cond_wait(&Stream->DataCondition, &Stream->DataLock); \
fprintf(stderr, "(PID %lx, TID %lx) CP_READER Acquired Condition Lock line %d\n", \
(long)getpid(), (long)gettid(), __LINE__); \
Stream->Locked = 1; \
}
#define STREAM_CONDITION_SIGNAL(Stream) \
{ \
assert(Stream->Locked == 1); \
fprintf(stderr, "(PID %lx, TID %lx) CP_READER Signalling Condition line %d\n", \
(long)getpid(), (long)gettid(), __LINE__); \
pthread_cond_signal(&Stream->DataCondition); \
}
#define STREAM_ASSERT_LOCKED(Stream) \
{ \
assert(Stream->Locked == 1); \
}
#else
#define STREAM_MUTEX_LOCK(Stream) \
{ \
pthread_mutex_lock(&Stream->DataLock); \
}
#define STREAM_MUTEX_UNLOCK(Stream) \
{ \
pthread_mutex_unlock(&Stream->DataLock); \
}
#define STREAM_CONDITION_WAIT(Stream) \
{ \
pthread_cond_wait(&Stream->DataCondition, &Stream->DataLock); \
}
#define STREAM_CONDITION_SIGNAL(Stream) \
{ \
pthread_cond_signal(&Stream->DataCondition); \
}
#define STREAM_ASSERT_LOCKED(Stream)
#endif
static char *readContactInfoFile(const char *Name, SstStream Stream, int Timeout)
{
size_t len = strlen(Name) + strlen(SST_POSTFIX) + 1;
char *FileName = malloc(len);
int Badfile = 0;
int ZeroCount = 0;
FILE *WriterInfo;
int64_t TimeoutRemainingMsec = Timeout * 1000;
int64_t WaitWarningRemainingMsec = 5 * 1000;
long SleepInterval = 100000;
snprintf(FileName, len, "%s" SST_POSTFIX, Name);
CP_verbose(Stream, PerRankVerbose,
"Looking for writer contact in file %s, with timeout %d secs\n", FileName, Timeout);
redo:
WriterInfo = fopen(FileName, "r");
while (!WriterInfo)
{
// CMusleep(Stream->CPInfo->cm, SleepInterval);
usleep(SleepInterval);
TimeoutRemainingMsec -= (SleepInterval / 1000);
WaitWarningRemainingMsec -= (SleepInterval / 1000);
if (WaitWarningRemainingMsec == 0)
{
fprintf(stderr,
"ADIOS2 SST Engine waiting for contact information "
"file %s to be created\n",
Name);
}
if (TimeoutRemainingMsec <= 0)
{
free(FileName);
return NULL;
}
WriterInfo = fopen(FileName, "r");
}
struct stat Buf;
fstat(fileno(WriterInfo), &Buf);
int Size = Buf.st_size;
if (Size == 0)
{
// Try again, it might look zero momentarily, but shouldn't stay that
// way.
ZeroCount++;
if (ZeroCount < 5)
{
// We'll give it several attempts (and some time) to go non-zero
usleep(SleepInterval);
goto redo;
}
}
if (Size < strlen(SSTMAGICV0))
{
Badfile++;
}
else
{
char Tmp[strlen(SSTMAGICV0)];
if (fread(Tmp, strlen(SSTMAGICV0), 1, WriterInfo) != 1)
{
fprintf(stderr, "Filesystem read failed in SST Open, failing operation\n");
fclose(WriterInfo);
Badfile++;
}
Size -= strlen(SSTMAGICV0);
if (strncmp(Tmp, SSTMAGICV0, strlen(SSTMAGICV0)) != 0)
{
Badfile++;
}
}
if (Badfile)
{
fprintf(stderr, "!!! File %s is not an ADIOS2 SST Engine Contact file\n", FileName);
free(FileName);
fclose(WriterInfo);
return NULL;
}
free(FileName);
char *Buffer = calloc(1, Size + 1);
if (fread(Buffer, Size, 1, WriterInfo) != 1)
{
fprintf(stderr, "Filesystem read failed in SST Open, failing operation\n");
free(Buffer);
fclose(WriterInfo);
return NULL;
}
fclose(WriterInfo);
return Buffer;
}
static char *readContactInfoScreen(const char *Name, SstStream Stream)
{
char Input[10240];
char *Skip = Input;
fprintf(stdout,
"Please enter the contact information associated with SST "
"input stream \"%s\":\n",
Name);
if (fgets(Input, sizeof(Input), stdin) == NULL)
{
fprintf(stdout, "Read from stdin failed, exiting\n");
exit(1);
}
while (isspace(*Skip))
Skip++;
return strdup(Skip);
}
static char *readContactInfo(const char *Name, SstStream Stream, int Timeout)
{
switch (Stream->RegistrationMethod)
{
case SstRegisterFile:
return readContactInfoFile(Name, Stream, Timeout);
case SstRegisterScreen:
return readContactInfoScreen(Name, Stream);
case SstRegisterCloud:
/* not yet */
return NULL;
}
return NULL;
}
// ReaderConnCloseHandler is called by the network handler thread in
// response to the failure of a network connection to the writer.
extern void ReaderConnCloseHandler(CManager cm, CMConnection ClosedConn, void *client_data)
{
PERFSTUBS_TIMER_START_FUNC(timer);
SstStream Stream = (SstStream)client_data;
int FailedPeerRank = -1;
STREAM_MUTEX_LOCK(Stream);
CP_verbose(Stream, PerRankVerbose, "Reader-side close handler invoked\n");
if ((Stream->Status == Destroyed) || (!Stream->ConnectionsToWriter))
{
STREAM_MUTEX_UNLOCK(Stream);
return;
}
for (int i = 0; i < Stream->WriterCohortSize; i++)
{
if (Stream->ConnectionsToWriter[i].CMconn == ClosedConn)
{
FailedPeerRank = i;
}
}
if (Stream->Status == Established)
{
if ((Stream->WriterConfigParams->CPCommPattern == SstCPCommMin) && (Stream->Rank != 0))
{
CP_verbose(Stream, PerRankVerbose,
"Reader-side Rank received a "
"connection-close event during normal "
"operations, but might be part of shutdown "
"Don't change stream status.\n");
/* if this happens and *is* a failure, we'll get the status from
* rank 0 later */
}
else
{
/*
* tag our reader instance as failed, IFF this came from someone we
* should have gotten a CLOSE from. I.E. a reverse peer
*/
CP_verbose(Stream, PerRankVerbose,
"Reader-side Rank received a "
"connection-close event during normal "
"operations, peer likely failed\n");
if (FailedPeerRank == Stream->FailureContactRank)
{
Stream->Status = PeerFailed;
STREAM_CONDITION_SIGNAL(Stream);
}
}
CP_verbose(Stream, PerRankVerbose,
"The close was for connection to writer peer %d, notifying DP\n",
FailedPeerRank);
STREAM_MUTEX_UNLOCK(Stream);
/* notify DP of failure. This should terminate any waits currently
* pending in the DP for that rank */
Stream->DP_Interface->notifyConnFailure(&Svcs, Stream->DP_Stream, FailedPeerRank);
}
else if (Stream->Status == PeerClosed)
{
/* ignore this. We expect a close after the connection is marked closed
*/
CP_verbose(Stream, PerRankVerbose,
"Reader-side Rank received a "
"connection-close event after close, "
"not unexpected\n");
STREAM_MUTEX_UNLOCK(Stream);
// Don't notify DP, because this is part of normal shutdown and we don't
// want to kill pending reads
}
else if (Stream->Status == PeerFailed)
{
CP_verbose(Stream, PerRankVerbose,
"Reader-side Rank received a "
"connection-close event after PeerFailed, already notified DP \n");
// Don't notify DP, because we already have */
STREAM_MUTEX_UNLOCK(Stream);
}
else
{
CP_verbose(Stream, CriticalVerbose, "Got an unexpected connection close event\n");
CP_verbose(Stream, PerStepVerbose,
"Reader-side Rank received a "
"connection-close event in unexpected "
"status %s\n",
SSTStreamStatusStr[Stream->Status]);
STREAM_MUTEX_UNLOCK(Stream);
}
PERFSTUBS_TIMER_STOP_FUNC(timer);
}
// SstCurrentStep is only called by the main program thread and
// needs no locking as it only accesses data set by the main thread
extern long SstCurrentStep(SstStream Stream) { return Stream->ReaderTimestep; }
static void releasePriorTimesteps(SstStream Stream, long Latest);
static void sendOneToEachWriterRank(SstStream s, CMFormat f, void *Msg, void **WS_StreamPtr);
static void **ParticipateInReaderInitDataExchange(SstStream Stream, void *dpInfo,
void **ret_data_block)
{
struct _CP_DP_PairInfo combined_init;
struct _CP_ReaderInitInfo cpInfo;
struct _CP_DP_PairInfo **pointers;
cpInfo.ContactInfo = CP_GetContactString(Stream, NULL);
cpInfo.ReaderID = Stream;
combined_init.CP_Info = (void **)&cpInfo;
combined_init.DP_Info = dpInfo;
pointers = (struct _CP_DP_PairInfo **)CP_consolidateDataToRankZero(
Stream, &combined_init, Stream->CPInfo->PerRankReaderInfoFormat, ret_data_block);
free(cpInfo.ContactInfo);
return (void **)pointers;
}
static int HasAllPeers(SstStream Stream)
{
int i, StillWaiting = 0;
if (!Stream->ConnectionsToWriter)
{
CP_verbose(Stream, PerRankVerbose,
"(PID %lx, TID %lx) Waiting for first Peer notification\n", (long)gettid(),
(long)getpid());
return 0;
}
i = 0;
while (Stream->Peers[i] != -1)
{
int peer = Stream->Peers[i];
if (Stream->ConnectionsToWriter[peer].CMconn == NULL)
StillWaiting++;
i++;
}
if (StillWaiting == 0)
{
CP_verbose(Stream, PerRankVerbose, "Rank %d has all forward peer connections\n",
Stream->Rank);
return 1;
}
else
{
CP_verbose(Stream, PerRankVerbose, "Rank %d waiting for %d forward peer connections\n",
Stream->Rank, StillWaiting);
return 0;
}
}
attr_list ContactWriter(SstStream Stream, char *Filename, SstParams Params, SMPI_Comm comm,
CMConnection *conn_p, void **WriterFileID_p)
{
int DataSize = 0;
attr_list RetVal = NULL;
if (Stream->Rank == 0)
{
char *Writer0Contact = readContactInfo(Filename, Stream, Params->OpenTimeoutSecs);
char *CMContactString = NULL;
CMConnection conn = NULL;
attr_list WriterRank0Contact;
if (Writer0Contact)
{
CMContactString = malloc(strlen(Writer0Contact)); /* at least long enough */
sscanf(Writer0Contact, "%p:%s", WriterFileID_p, CMContactString);
// printf("Writer contact info is fileID %p, contact info
// %s\n",
// WriterFileID, CMContactString);
free(Writer0Contact);
if (globalNetinfoCallback)
{
(globalNetinfoCallback)(1, CP_GetContactString(Stream, NULL), IPDiagString);
(globalNetinfoCallback)(2, CMContactString, NULL);
}
WriterRank0Contact = attr_list_from_string(CMContactString);
conn = CMget_conn(Stream->CPInfo->SharedCM->cm, WriterRank0Contact);
free_attr_list(WriterRank0Contact);
}
if (conn)
{
DataSize = strlen(CMContactString) + 1;
*conn_p = conn;
}
else
{
DataSize = 0;
*conn_p = NULL;
}
SMPI_Bcast(&DataSize, 1, SMPI_INT, 0, Stream->mpiComm);
if (DataSize != 0)
{
SMPI_Bcast(CMContactString, DataSize, SMPI_CHAR, 0, Stream->mpiComm);
RetVal = attr_list_from_string(CMContactString);
}
if (CMContactString)
free(CMContactString);
}
else
{
SMPI_Bcast(&DataSize, 1, SMPI_INT, 0, Stream->mpiComm);
if (DataSize != 0)
{
char *Buffer = malloc(DataSize);
SMPI_Bcast(Buffer, DataSize, SMPI_CHAR, 0, Stream->mpiComm);
RetVal = attr_list_from_string(Buffer);
free(Buffer);
}
}
return RetVal;
}
// SstReaderOpen is an SST reader entry point, called only by the
// main program thread It must be called by all ranks, and as it
// creates the only shared data structure, no locking is necessary
// prior to the CMCondition_wait() that is triggered in response to
// reader regsitration.
SstStream SstReaderOpen(const char *Name, SstParams Params, SMPI_Comm comm)
{
SstStream Stream;
void *dpInfo;
struct _CP_DP_PairInfo **pointers;
void *data_block;
void *free_block;
writer_data_t ReturnData;
struct _ReaderActivateMsg Msg;
struct timeval Start, Stop, Diff;
char *Filename = strdup(Name);
CMConnection rank0_to_rank0_conn = NULL;
void *WriterFileID;
char NeededDataPlane[32] = {0}; // Don't name a data plane longer than 31 chars
Stream = CP_newStream();
Stream->Role = ReaderRole;
Stream->mpiComm = comm;
SMPI_Comm_rank(Stream->mpiComm, &Stream->Rank);
SMPI_Comm_size(Stream->mpiComm, &Stream->CohortSize);
CP_validateParams(Stream, Params, 0 /* reader */);
Stream->ConfigParams = Params;
Stream->CPInfo = CP_getCPInfo(Stream->ConfigParams->ControlModule);
Stream->FinalTimestep = INT_MAX; /* set this on close */
Stream->LastDPNotifiedTimestep = -1;
gettimeofday(&Start, NULL);
attr_list WriterContactAttributes =
ContactWriter(Stream, Filename, Params, comm, &rank0_to_rank0_conn, &WriterFileID);
if (WriterContactAttributes == NULL)
{
SstStreamDestroy(Stream);
free(Stream);
free(Filename);
return NULL;
}
if (Stream->Rank == 0)
{
struct _DPQueryMsg DPQuery;
memset(&DPQuery, 0, sizeof(DPQuery));
DPQuery.WriterFile = WriterFileID;
DPQuery.WriterResponseCondition =
CMCondition_get(Stream->CPInfo->SharedCM->cm, rank0_to_rank0_conn);
CMCondition_set_client_data(Stream->CPInfo->SharedCM->cm, DPQuery.WriterResponseCondition,
&NeededDataPlane[0]);
if (CMwrite(rank0_to_rank0_conn, Stream->CPInfo->SharedCM->DPQueryFormat, &DPQuery) != 1)
{
CP_verbose(Stream, CriticalVerbose,
"DPQuery message failed to send to writer in SstReaderOpen\n");
}
/* wait for "go" from writer */
CP_verbose(Stream, PerRankVerbose,
"Waiting for writer DPResponse message in SstReadOpen(\"%s\")\n", Filename,
DPQuery.WriterResponseCondition);
int result =
CMCondition_wait(Stream->CPInfo->SharedCM->cm, DPQuery.WriterResponseCondition);
if (result == 0)
{
fprintf(stderr, "The writer exited before contact could be made, "
"SST Open failed.\n");
return NULL;
}
CP_verbose(Stream, PerRankVerbose,
"finished wait writer DPresponse message in read_open, "
"WRITER is using \"%s\" DataPlane\n",
&NeededDataPlane[0]);
// NeededDP should now contain the name of the dataplane the writer is
// using
SMPI_Bcast(&NeededDataPlane[0], sizeof(NeededDataPlane), SMPI_CHAR, 0, Stream->mpiComm);
}
else
{
SMPI_Bcast(&NeededDataPlane[0], sizeof(NeededDataPlane), SMPI_CHAR, 0, Stream->mpiComm);
}
{
char *RequestedDP = Stream->ConfigParams->DataTransport;
Stream->ConfigParams->DataTransport = strdup(&NeededDataPlane[0]);
Stream->DP_Interface = SelectDP(&Svcs, Stream, Stream->ConfigParams, Stream->Rank);
if (Stream->DP_Interface)
if (strcmp(Stream->DP_Interface->DPName, &NeededDataPlane[0]) != 0)
{
fprintf(stderr,
"The writer is using the %s DataPlane for SST data "
"transport, but the reader has failed to load this "
"transport. Communication cannot occur. See the SST "
"DataTransport engine parameter to force a match.",
NeededDataPlane);
return NULL;
}
if (RequestedDP)
free(RequestedDP);
}
FinalizeCPInfo(Stream->CPInfo, Stream->DP_Interface);
Stream->DP_Stream = Stream->DP_Interface->initReader(
&Svcs, Stream, &dpInfo, Stream->ConfigParams, WriterContactAttributes, &Stream->Stats);
free_attr_list(WriterContactAttributes);
pointers =
(struct _CP_DP_PairInfo **)ParticipateInReaderInitDataExchange(Stream, dpInfo, &data_block);
if (Stream->Rank == 0)
{
struct _CombinedWriterInfo WriterData;
struct _ReaderRegisterMsg ReaderRegister;
memset(&ReaderRegister, 0, sizeof(ReaderRegister));
memset(&WriterData, 0, sizeof(WriterData));
WriterData.WriterCohortSize = -1;
ReaderRegister.WriterFile = WriterFileID;
ReaderRegister.WriterResponseCondition =
CMCondition_get(Stream->CPInfo->SharedCM->cm, rank0_to_rank0_conn);
ReaderRegister.ReaderCohortSize = Stream->CohortSize;
switch (Stream->ConfigParams->SpeculativePreloadMode)
{
case SpecPreloadOff:
case SpecPreloadOn:
ReaderRegister.SpecPreload =
(SpeculativePreloadMode)Stream->ConfigParams->SpeculativePreloadMode;
break;
case SpecPreloadAuto:
ReaderRegister.SpecPreload = SpecPreloadOff;
if (Stream->CohortSize <= Stream->ConfigParams->SpecAutoNodeThreshold)
{
ReaderRegister.SpecPreload = SpecPreloadOn;
}
break;
}
ReaderRegister.CP_ReaderInfo = malloc(ReaderRegister.ReaderCohortSize * sizeof(void *));
ReaderRegister.DP_ReaderInfo = malloc(ReaderRegister.ReaderCohortSize * sizeof(void *));
for (int i = 0; i < ReaderRegister.ReaderCohortSize; i++)
{
ReaderRegister.CP_ReaderInfo[i] = (CP_ReaderInitInfo)pointers[i]->CP_Info;
ReaderRegister.DP_ReaderInfo[i] = pointers[i]->DP_Info;
}
free(pointers);
/* the response value is set in the handler */
volatile struct _WriterResponseMsg *response = NULL;
CMCondition_set_client_data(Stream->CPInfo->SharedCM->cm,
ReaderRegister.WriterResponseCondition, &response);
if (CMwrite(rank0_to_rank0_conn, Stream->CPInfo->SharedCM->ReaderRegisterFormat,
&ReaderRegister) != 1)
{
CP_verbose(Stream, CriticalVerbose,
"Message failed to send to writer in SstReaderOpen\n");
}
free(ReaderRegister.CP_ReaderInfo);
free(ReaderRegister.DP_ReaderInfo);
/* wait for "go" from writer */
CP_verbose(Stream, PerRankVerbose,
"Waiting for writer response message in SstReadOpen(\"%s\")\n", Filename,
ReaderRegister.WriterResponseCondition);
int result =
CMCondition_wait(Stream->CPInfo->SharedCM->cm, ReaderRegister.WriterResponseCondition);
if (result == 0)
{
fprintf(stderr, "The writer exited before the SST Reader Open "
"could be completed.\n");
return NULL;
}
CP_verbose(Stream, PerRankVerbose, "finished wait writer response message in read_open\n");
if (response)
{
WriterData.WriterCohortSize = response->WriterCohortSize;
WriterData.WriterConfigParams = response->WriterConfigParams;
WriterData.StartingStepNumber = response->NextStepNumber;
WriterData.CP_WriterInfo = response->CP_WriterInfo;
WriterData.DP_WriterInfo = response->DP_WriterInfo;
}
ReturnData = CP_distributeDataFromRankZero(
Stream, &WriterData, Stream->CPInfo->CombinedWriterInfoFormat, &free_block);
}
else
{
ReturnData = CP_distributeDataFromRankZero(
Stream, NULL, Stream->CPInfo->CombinedWriterInfoFormat, &free_block);
}
free(data_block);
if (ReturnData->WriterCohortSize == -1)
{
/* Rank 0 found no writer at that contact point, fail the stream */
free(free_block);
return NULL;
}
if (Stream->Rank == 0)
{
CP_verbose(Stream, SummaryVerbose, "Opening Reader Stream.\nWriter stream params are:\n");
CP_dumpParams(Stream, ReturnData->WriterConfigParams, 0 /* writer side */);
CP_verbose(Stream, SummaryVerbose, "Reader stream params are:\n");
CP_dumpParams(Stream, Stream->ConfigParams, 1 /* reader side */);
}
// printf("I am reader rank %d, my info on writers is:\n", Stream->Rank);
// FMdump_data(FMFormat_of_original(Stream->CPInfo->combined_writer_Format),
// ReturnData, 1024000);
// printf("\n");
Stream->WriterCohortSize = ReturnData->WriterCohortSize;
Stream->WriterConfigParams = ReturnData->WriterConfigParams;
if ((Stream->WriterConfigParams->MarshalMethod == SstMarshalFFS) && (Stream->Rank == 0))
{
CP_verbose(Stream, SummaryVerbose, "Writer is doing FFS-based marshalling\n");
}
if ((Stream->WriterConfigParams->MarshalMethod == SstMarshalBP) && (Stream->Rank == 0))
{
CP_verbose(Stream, SummaryVerbose, "Writer is doing BP-based marshalling\n");
}
if ((Stream->WriterConfigParams->CPCommPattern == SstCPCommMin) && (Stream->Rank == 0))
{
CP_verbose(Stream, SummaryVerbose,
"Writer is using Minimum Connection Communication pattern (min)\n");
}
if ((Stream->WriterConfigParams->CPCommPattern == SstCPCommPeer) && (Stream->Rank == 0))
{
CP_verbose(Stream, SummaryVerbose,
"Writer is using Peer-based Communication pattern (peer)\n");
}
STREAM_MUTEX_LOCK(Stream);
Stream->ReaderTimestep = ReturnData->StartingStepNumber - 1;
if (Stream->WriterConfigParams->CPCommPattern == SstCPCommPeer)
{
/*
* Wait for connections and messages from writer side peers
*/
getPeerArrays(Stream->CohortSize, Stream->Rank, Stream->WriterCohortSize, &Stream->Peers,
NULL);
while (!HasAllPeers(Stream))
{
/* wait until we get the timestep metadata or something else changes
*/
STREAM_CONDITION_WAIT(Stream);
}
}
else
{
if (!Stream->ConnectionsToWriter)
{
Stream->ConnectionsToWriter =
calloc(sizeof(CP_PeerConnection), ReturnData->WriterCohortSize);
}
}
for (int i = 0; i < ReturnData->WriterCohortSize; i++)
{
attr_list attrs = attr_list_from_string(ReturnData->CP_WriterInfo[i]->ContactInfo);
Stream->ConnectionsToWriter[i].ContactList = attrs;
Stream->ConnectionsToWriter[i].RemoteStreamID = ReturnData->CP_WriterInfo[i]->WriterID;
}
// Deref the original connection to writer rank 0 (might still be open as a
// peer)
if (Stream->WriterConfigParams->CPCommPattern == SstCPCommPeer)
{
if (rank0_to_rank0_conn)
{
CMConnection_dereference(rank0_to_rank0_conn);
}
}
else
{
/* only rely on the rank 0 to rank 0 that we already have (if we're rank
* 0) */
if (rank0_to_rank0_conn)
{
CMConnection conn = rank0_to_rank0_conn;
Stream->ConnectionsToWriter[0].CMconn = conn;
CMconn_register_close_handler(conn, ReaderConnCloseHandler, (void *)Stream);
}
}
Stream->Status = Established;
gettimeofday(&Stop, NULL);
timersub(&Stop, &Start, &Diff);
Stream->OpenTimeSecs = (double)Diff.tv_usec / 1e6 + Diff.tv_sec;
gettimeofday(&Stream->ValidStartTime, NULL);
Stream->Filename = Filename;
Stream->ParamsBlock = free_block;
STREAM_MUTEX_UNLOCK(Stream);
AddToLastCallFreeList(Stream);
Stream->DP_Interface->provideWriterDataToReader(
&Svcs, Stream->DP_Stream, ReturnData->WriterCohortSize, Stream->ConnectionsToWriter,
ReturnData->DP_WriterInfo);
CP_verbose(Stream, PerRankVerbose, "Sending Reader Activate messages to writer\n");
memset(&Msg, 0, sizeof(Msg));
sendOneToEachWriterRank(Stream, Stream->CPInfo->SharedCM->ReaderActivateFormat, &Msg,
&Msg.WSR_Stream);
CP_verbose(Stream, PerStepVerbose,
"Finish opening Stream \"%s\", starting with Step number %d\n", Filename,
ReturnData->StartingStepNumber);
return Stream;
}
// SstReaderGetParams is an SST entry point only called by the main
// program thread. It can only be called after initialization and
// only accesses data installed durinig initialization, it needs no
// locking.
extern void SstReaderGetParams(SstStream Stream, SstMarshalMethod *WriterMarshalMethod,
int *WriterIsRowMajor)
{
*WriterMarshalMethod = (SstMarshalMethod)Stream->WriterConfigParams->MarshalMethod;
*WriterIsRowMajor = Stream->WriterConfigParams->IsRowMajor;
}
/*
* CP_PeerSetupHandler is called by the network handler thread in
* response to incoming PeerSetup messages to setup the reader-side
* Peer list
*/
extern void CP_PeerSetupHandler(CManager cm, CMConnection conn, void *Msg_v, void *client_data,
attr_list attrs)
{
PERFSTUBS_TIMER_START_FUNC(timer);
SstStream Stream;
struct _PeerSetupMsg *Msg = (struct _PeerSetupMsg *)Msg_v;
Stream = (SstStream)Msg->RS_Stream;
STREAM_MUTEX_LOCK(Stream);
CP_verbose(Stream, TraceVerbose, "Received peer setup from rank %d, conn %p\n", Msg->WriterRank,
conn);
if (!Stream->ConnectionsToWriter)
{
CP_verbose(Stream, TraceVerbose, "Allocating connections to writer\n");
Stream->ConnectionsToWriter = calloc(sizeof(CP_PeerConnection), Msg->WriterCohortSize);
}
CP_verbose(Stream, TraceVerbose, "Received peer setup from rank %d, conn %p\n", Msg->WriterRank,
conn);
if (Msg->WriterRank != -1)
{
Stream->ConnectionsToWriter[Msg->WriterRank].CMconn = conn;
CMConnection_add_reference(conn);
Stream->FailureContactRank = Msg->WriterRank;
}
CMconn_register_close_handler(conn, ReaderConnCloseHandler, (void *)Stream);
STREAM_CONDITION_SIGNAL(Stream);
STREAM_MUTEX_UNLOCK(Stream);
PERFSTUBS_TIMER_STOP_FUNC(timer);
}
void queueTimestepMetadataMsgAndNotify(SstStream Stream, struct _TimestepMetadataMsg *tsm,
CMConnection conn)
{
STREAM_ASSERT_LOCKED(Stream);
if (tsm->Timestep < Stream->DiscardPriorTimestep)
{
struct _ReleaseTimestepMsg Msg;
memset(&Msg, 0, sizeof(Msg));
Msg.Timestep = tsm->Timestep;
/*
* send each writer rank a release for this timestep (actually goes to
* WSR Streams)
*/
if (tsm->Metadata != NULL)
{
CP_verbose(Stream, PerStepVerbose,
"Sending ReleaseTimestep message for PRIOR DISCARD "
"timestep %d, one to each writer\n",
tsm->Timestep);
sendOneToEachWriterRank(Stream, Stream->CPInfo->SharedCM->ReleaseTimestepFormat, &Msg,
&Msg.WSR_Stream);
}
else
{
CP_verbose(Stream, PerStepVerbose,
"Received discard notice for timestep %d, "
"ignoring in PRIOR DISCARD\n",
tsm->Timestep);
}
}
struct _TimestepMetadataList *New = malloc(sizeof(struct _RegisterQueue));
New->MetadataMsg = tsm;
New->Next = NULL;
if (Stream->Timesteps)
{
struct _TimestepMetadataList *Last = Stream->Timesteps;
while (Last->Next)
{
Last = Last->Next;
}
Last->Next = New;
}
else
{
Stream->Timesteps = New;
}
Stream->Stats.TimestepMetadataReceived++;
if (tsm->Metadata)
{
Stream->Stats.MetadataBytesReceived +=
(tsm->Metadata->DataSize + tsm->AttributeData->DataSize);
}
CP_verbose(Stream, PerRankVerbose,
"Received a Timestep metadata message for timestep %d, "
"signaling condition\n",
tsm->Timestep);
STREAM_CONDITION_SIGNAL(Stream);
if ((Stream->Rank == 0) && (Stream->WriterConfigParams->CPCommPattern == SstCPCommMin) &&
(Stream->ConfigParams->AlwaysProvideLatestTimestep))
{
/*
* IFF we are in CommMin mode, AND we are to always provide
* the newest timestep, then when a new timestep arrives then
* we want to release timesteps that are older than it, NOT
* INCLUDING ANY TIMESTEP IN CURRENT USE.
*/
CP_verbose(Stream, TraceVerbose,
"Got a new timestep in AlwaysProvideLatestTimestep mode, "
"discard older than %d\n",
tsm->Timestep);
releasePriorTimesteps(Stream, tsm->Timestep);
}
}
struct _SstMetaMetaBlockInternal
{
size_t TimestepAdded;
char *BlockData;
size_t BlockSize;
char *ID;
size_t IDSize;
};
void AddFormatsToMetaMetaInfo(SstStream Stream, struct _TimestepMetadataMsg *Msg)
{
FFSFormatList Formats = Msg->Formats;
STREAM_ASSERT_LOCKED(Stream);
while (Formats)
{
Stream->InternalMetaMetaInfo =
realloc(Stream->InternalMetaMetaInfo, (sizeof(struct _SstMetaMetaBlockInternal) *
(Stream->InternalMetaMetaCount + 1)));
struct _SstMetaMetaBlockInternal *NewInfo =
&Stream->InternalMetaMetaInfo[Stream->InternalMetaMetaCount];
Stream->InternalMetaMetaCount++;
NewInfo->TimestepAdded = Msg->Timestep;
NewInfo->ID = malloc(Formats->FormatIDRepLen);
NewInfo->IDSize = Formats->FormatIDRepLen;
NewInfo->BlockData = malloc(Formats->FormatServerRepLen);
NewInfo->BlockSize = Formats->FormatServerRepLen;
memcpy(NewInfo->ID, Formats->FormatIDRep, Formats->FormatIDRepLen);
memcpy(NewInfo->BlockData, Formats->FormatServerRep, Formats->FormatServerRepLen);
Formats = Formats->Next;
}
}
void AddAttributesToAttrDataList(SstStream Stream, struct _TimestepMetadataMsg *Msg)
{
if (Stream->AttrsRetrieved)
{
int i = 0;
while (Stream->InternalAttrDataInfo && Stream->InternalAttrDataInfo[i].BlockData)
{
free(Stream->InternalAttrDataInfo[i].BlockData);
i++;
}
free(Stream->InternalAttrDataInfo);
Stream->InternalAttrDataInfo = NULL;
Stream->InternalAttrDataCount = 0;
Stream->AttrsRetrieved = 0;
}
if (Msg->AttributeData->DataSize == 0)
return;
Stream->InternalAttrDataInfo =
realloc(Stream->InternalAttrDataInfo,
(sizeof(struct _SstBlock) * (Stream->InternalAttrDataCount + 2)));
struct _SstBlock *NewInfo = &Stream->InternalAttrDataInfo[Stream->InternalAttrDataCount];
Stream->InternalAttrDataCount++;
NewInfo->BlockData = malloc(Msg->AttributeData->DataSize);
NewInfo->BlockSize = Msg->AttributeData->DataSize;
memcpy(NewInfo->BlockData, Msg->AttributeData->block, Msg->AttributeData->DataSize);
memset(&Stream->InternalAttrDataInfo[Stream->InternalAttrDataCount], 0,
sizeof(struct _SstData));
}
// CP_TimestepMetadataHandler is called by the network handler thread
// to handle incoming TimestepMetadata messages
void CP_TimestepMetadataHandler(CManager cm, CMConnection conn, void *Msg_v, void *client_data,
attr_list attrs)
{
PERFSTUBS_TIMER_START_FUNC(timer);
SstStream Stream;
struct _TimestepMetadataMsg *Msg = (struct _TimestepMetadataMsg *)Msg_v;
Stream = (SstStream)Msg->RS_Stream;
STREAM_MUTEX_LOCK(Stream);
if ((Stream->Rank != 0) || (Stream->WriterConfigParams->CPCommPattern == SstCPCommPeer))
{
/* All ranks are getting this */
if (Msg->Metadata == NULL)
{
CP_verbose(Stream, PerRankVerbose,
"Received a message that timestep %d has been discarded\n", Msg->Timestep);
/*
* before discarding, install any precious metadata from this
* message
*/
if (Stream->WriterConfigParams->MarshalMethod == SstMarshalFFS)
{
FFSMarshalInstallPreciousMetadata(Stream, Msg);
}
else if (Stream->WriterConfigParams->MarshalMethod == SstMarshalBP5)
{
AddFormatsToMetaMetaInfo(Stream, Msg);
AddAttributesToAttrDataList(Stream, Msg);
}
STREAM_MUTEX_UNLOCK(Stream);
return;
}
else
{
CP_verbose(Stream, PerStepVerbose,
"Received an incoming metadata message for timestep %d\n", Msg->Timestep);
}
/* arrange for this message data to stay around */
CMtake_buffer(cm, Msg);
queueTimestepMetadataMsgAndNotify(Stream, Msg, conn);
}
else
{
/* I must be rank 0 and only I got this, I'll need to distribute it to
* everyone */
/* arrange for this message data to stay around */
CMtake_buffer(cm, Msg);
queueTimestepMetadataMsgAndNotify(Stream, Msg, conn);
}
STREAM_MUTEX_UNLOCK(Stream);
PERFSTUBS_TIMER_STOP_FUNC(timer);
}
// CP_WriterResponseHandler is called by the network handler thread to
// handle WriterResponse messages. One of these will be sent to rank0
// reader from rank0 writer in response to the ReaderRegister message.
// It will find rank0 writer in CMCondition_wait(). It's only action
// is to associate the incoming response message to the CMcondition
// we're waiting on,m so no locking is necessary.
void CP_WriterResponseHandler(CManager cm, CMConnection conn, void *Msg_v, void *client_data,
attr_list attrs)
{
PERFSTUBS_REGISTER_THREAD();
PERFSTUBS_TIMER_START_FUNC(timer);
struct _WriterResponseMsg *Msg = (struct _WriterResponseMsg *)Msg_v;
struct _WriterResponseMsg **response_ptr;
// fprintf(stderr, "Received a writer_response message for condition
// %d\n",
// Msg->WriterResponseCondition);
// fprintf(stderr, "The responding writer has cohort of size %d :\n",
// Msg->writer_CohortSize);
// for (int i = 0; i < Msg->writer_CohortSize; i++) {
// fprintf(stderr, " rank %d CP contact info: %s, %p\n", i,
// Msg->CP_WriterInfo[i]->ContactInfo,
// Msg->CP_WriterInfo[i]->WriterID);
// }
/* arrange for this message data to stay around */
CMtake_buffer(cm, Msg);
/* attach the message to the CMCondition so it an be retrieved by the main
* thread */
response_ptr = CMCondition_get_client_data(cm, Msg->WriterResponseCondition);
*response_ptr = Msg;
/* wake the main thread */
CMCondition_signal(cm, Msg->WriterResponseCondition);
PERFSTUBS_TIMER_STOP_FUNC(timer);
}
// CP_DPQueryResponseHandler is called by the network handler thread to
// handle DPQueryResponse messages. One of these will be sent to rank0
// reader from rank0 writer in response to the DPQuery message.
// It will find rank0 writer in CMCondition_wait(). It's only action
// is to associate the incoming response message to the CMcondition
// we're waiting on,m so no locking is necessary.
void CP_DPQueryResponseHandler(CManager cm, CMConnection conn, void *Msg_v, void *client_data,
attr_list attrs)
{
PERFSTUBS_REGISTER_THREAD();
PERFSTUBS_TIMER_START_FUNC(timer);
struct _DPQueryResponseMsg *Msg = (struct _DPQueryResponseMsg *)Msg_v;
char *NeededDP_ptr;
// fprintf(stderr, "Received a writer_response message for condition
// %d\n",
// Msg->WriterResponseCondition);
// fprintf(stderr, "The responding writer has cohort of size %d :\n",
// Msg->writer_CohortSize);
// for (int i = 0; i < Msg->writer_CohortSize; i++) {
// fprintf(stderr, " rank %d CP contact info: %s, %p\n", i,
// Msg->CP_WriterInfo[i]->ContactInfo,
// Msg->CP_WriterInfo[i]->WriterID);
// }
/* attach the message to the CMCondition so it an be retrieved by the main
* thread */
NeededDP_ptr = CMCondition_get_client_data(cm, Msg->WriterResponseCondition);
strcpy(NeededDP_ptr, Msg->OperativeDP);
/* wake the main thread */
CMCondition_signal(cm, Msg->WriterResponseCondition);
PERFSTUBS_TIMER_STOP_FUNC(timer);
}
// CP_WriterCloseHandler is called by the network handler thread to
// handle WriterResponse messages. One of these will be sent to rank0
// reader from rank0 writer in response to the ReaderRegister message.
// It will find rank0 writer in CMCondition_wait(). It's only action
// is to associate the incoming response message to the CMcondition
// we're waiting on, so no locking is necessary.
extern void CP_WriterCloseHandler(CManager cm, CMConnection conn, void *Msg_v, void *client_data,
attr_list attrs)
{
PERFSTUBS_TIMER_START_FUNC(timer);
WriterCloseMsg Msg = (WriterCloseMsg)Msg_v;
SstStream Stream = (SstStream)Msg->RS_Stream;
STREAM_MUTEX_LOCK(Stream);
CP_verbose(Stream, PerStepVerbose,
"Received a writer close message. "
"Timestep %d was the final timestep.\n",
Msg->FinalTimestep);
Stream->FinalTimestep = Msg->FinalTimestep;
Stream->Status = PeerClosed;
/* wake anyone that might be waiting */
STREAM_CONDITION_SIGNAL(Stream);
STREAM_MUTEX_UNLOCK(Stream);
PERFSTUBS_TIMER_STOP_FUNC(timer);
}
// CP_CommPatternLockedHandler is called by the network handler thread
// to handle CommPatternLocked messages. It can only be called
// post-registration and won't be called after Close. Lock to protect
// against race conditions in determining comm lock scenario.
extern void CP_CommPatternLockedHandler(CManager cm, CMConnection conn, void *Msg_v,
void *client_data, attr_list attrs)
{
CommPatternLockedMsg Msg = (CommPatternLockedMsg)Msg_v;
SstStream Stream = (SstStream)Msg->RS_Stream;
STREAM_MUTEX_LOCK(Stream);
CP_verbose(Stream, PerStepVerbose,
"Received a CommPatternLocked message, beginning with Timestep %d.\n",
Msg->Timestep);
Stream->CommPatternLocked = 1;
Stream->CommPatternLockedTimestep = Msg->Timestep;
STREAM_MUTEX_UNLOCK(Stream);
}
static long MaxQueuedMetadata(SstStream Stream)
{
struct _TimestepMetadataList *Next;
long MaxTimestep = -1;
STREAM_ASSERT_LOCKED(Stream);
Next = Stream->Timesteps;
if (Next == NULL)
{
CP_verbose(Stream, TraceVerbose, "MaxQueued Timestep returning -1\n");
return -1;
}
while (Next)
{
if (Next->MetadataMsg->Timestep >= MaxTimestep)
{
MaxTimestep = Next->MetadataMsg->Timestep;
}
Next = Next->Next;
}
CP_verbose(Stream, TraceVerbose, "MaxQueued Timestep returning %ld\n", MaxTimestep);
return MaxTimestep;
}
static long NextQueuedMetadata(SstStream Stream)
{
struct _TimestepMetadataList *Next;
long MinTimestep = LONG_MAX;
STREAM_ASSERT_LOCKED(Stream);
Next = Stream->Timesteps;
if (Next == NULL)
{
CP_verbose(Stream, TraceVerbose, "NextQueued Timestep returning -1\n");
return -1;
}
while (Next)
{
if (Next->MetadataMsg->Timestep <= MinTimestep)
{
MinTimestep = Next->MetadataMsg->Timestep;
}
Next = Next->Next;
}
CP_verbose(Stream, TraceVerbose, "NextQueued Timestep returning %ld\n", MinTimestep);
return MinTimestep;
}
// A delayed task to wake the stream after a specific time period
static void triggerDataCondition(CManager cm, void *vStream)
{
SstStream Stream = (SstStream)vStream;
STREAM_MUTEX_LOCK(Stream);
/* wake the sleeping main thread for timeout */
STREAM_CONDITION_SIGNAL(Stream);
STREAM_MUTEX_UNLOCK(Stream);
}
static void waitForMetadataWithTimeout(SstStream Stream, float timeout_secs)
{
struct _TimestepMetadataList *Next;
struct timeval start, now, end;
int timeout_int_sec = floor(timeout_secs);
int timeout_int_usec = ((timeout_secs - floorf(timeout_secs)) * 1000000);
CMTaskHandle TimeoutTask = NULL;
STREAM_ASSERT_LOCKED(Stream);
gettimeofday(&start, NULL);
Next = Stream->Timesteps;
CP_verbose(Stream, PerRankVerbose,
"Wait for metadata with timeout %g secs starting at time %ld.%06ld \n", timeout_secs,
start.tv_sec, start.tv_usec);
if (Next)
{
CP_verbose(Stream, PerRankVerbose, "Returning from wait with timeout, NO TIMEOUT\n");
}
end.tv_sec = start.tv_sec + timeout_int_sec;
end.tv_usec = start.tv_usec + timeout_int_usec;
if (end.tv_usec > 1000000)
{
end.tv_sec++;
end.tv_usec -= 1000000;
}
if (end.tv_sec < start.tv_sec)
{
// rollover
end.tv_sec = INT_MAX;
}
// special case
if (timeout_secs == 0.0)
{
CP_verbose(Stream, PerRankVerbose,
"Returning from wait With no data after zero timeout poll\n");
return;
}
TimeoutTask = CMadd_delayed_task(Stream->CPInfo->SharedCM->cm, timeout_int_sec,
timeout_int_usec, triggerDataCondition, Stream);
while (1)
{
Next = Stream->Timesteps;
if (Next)
{
CMremove_task(TimeoutTask);
CP_verbose(Stream, PerRankVerbose, "Returning from wait with timeout, NO TIMEOUT\n");
return;
}
if (Stream->Status != Established)
{
CP_verbose(Stream, PerRankVerbose,
"Returning from wait with timeout, STREAM NO "
"LONGER ESTABLISHED\n");
return;
}
gettimeofday(&now, NULL);
CP_verbose(Stream, TraceVerbose, "timercmp, now is %ld.%06ld end is %ld.%06ld \n",
now.tv_sec, now.tv_usec, end.tv_sec, end.tv_usec);
if (timercmp(&now, &end, >))
{
CP_verbose(Stream, PerRankVerbose, "Returning from wait after timing out\n");
return;
}
/* wait until we get the timestep metadata or something else changes */
STREAM_CONDITION_WAIT(Stream);
}
/* NOTREACHED */
}
static void releasePriorTimesteps(SstStream Stream, long Latest)
{
struct _TimestepMetadataList *Next, *Last;
STREAM_ASSERT_LOCKED(Stream);
CP_verbose(Stream, PerRankVerbose, "Releasing any timestep earlier than %d\n", Latest);
Next = Stream->Timesteps;
Last = NULL;
while (Next)
{
if ((Next->MetadataMsg->Timestep < Latest) &&
(Next->MetadataMsg->Timestep != Stream->CurrentWorkingTimestep))
{
struct _TimestepMetadataList *This = Next;
struct _ReleaseTimestepMsg Msg;
Next = This->Next;
/*
* before discarding, install any precious metadata from this
* message
*/
if (Stream->WriterConfigParams->MarshalMethod == SstMarshalFFS)
{
FFSMarshalInstallPreciousMetadata(Stream, This->MetadataMsg);
}
else if (Stream->WriterConfigParams->MarshalMethod == SstMarshalBP5)
{
AddFormatsToMetaMetaInfo(Stream, This->MetadataMsg);
AddAttributesToAttrDataList(Stream, This->MetadataMsg);
}
memset(&Msg, 0, sizeof(Msg));
Msg.Timestep = This->MetadataMsg->Timestep;
/*
* send each writer rank a release for this timestep (actually goes
* to WSR
* Streams)
*/
CP_verbose(Stream, PerRankVerbose,
"Sending ReleaseTimestep message for RELEASE "
"PRIOR timestep %d, one to each writer\n",
This->MetadataMsg->Timestep);
if (Last == NULL)
{
Stream->Timesteps = Next;
}
else
{
Last->Next = Next;
}
STREAM_MUTEX_UNLOCK(Stream);
sendOneToEachWriterRank(Stream, Stream->CPInfo->SharedCM->ReleaseTimestepFormat, &Msg,
&Msg.WSR_Stream);
if (This->MetadataMsg == NULL)
printf("READER RETURN_BUFFER, metadatamsg == %p, line %d\n", This->MetadataMsg,
__LINE__);
CMreturn_buffer(Stream->CPInfo->SharedCM->cm, This->MetadataMsg);
STREAM_MUTEX_LOCK(Stream);
free(This);
}
else
{
Last = Next;
Next = Next->Next;
}
}
}
static void FreeTimestep(SstStream Stream, long Timestep)
{
/*
* remove local metadata for that timestep
*/
struct _TimestepMetadataList *List = Stream->Timesteps;
STREAM_ASSERT_LOCKED(Stream);
if (Stream->Timesteps->MetadataMsg->Timestep == Timestep)
{
Stream->Timesteps = List->Next;
if (List->MetadataMsg == NULL)
printf("READER RETURN_BUFFER, List->MEtadataMsg == %p, line %d\n", List->MetadataMsg,
__LINE__);
CMreturn_buffer(Stream->CPInfo->SharedCM->cm, List->MetadataMsg);
free(List);
}
else
{
struct _TimestepMetadataList *last = List;
List = List->Next;
while (List != NULL)
{
if (List->MetadataMsg->Timestep == Timestep)
{
last->Next = List->Next;
if (List->MetadataMsg == NULL)
printf("READER RETURN_BUFFER, List->MEtadataMsg == %p, "
"line %d\n",
List->MetadataMsg, __LINE__);
CMreturn_buffer(Stream->CPInfo->SharedCM->cm, List->MetadataMsg);
free(List);
break;
}
last = List;
List = List->Next;
}
}
}
static TSMetadataList waitForNextMetadata(SstStream Stream, long LastTimestep)
{
TSMetadataList FoundTS = NULL;
CP_verbose(Stream, PerRankVerbose, "Wait for next metadata after last timestep %d\n",
LastTimestep);
while (1)
{
struct _TimestepMetadataList *Next;
Next = Stream->Timesteps;
while (Next)
{
CP_verbose(Stream, TraceVerbose, "Examining metadata for Timestep %d\n",
Next->MetadataMsg->Timestep);
if (((Next->MetadataMsg->Metadata == NULL) ||
(Next->MetadataMsg->Timestep < Stream->DiscardPriorTimestep)) &&
(FoundTS == NULL))
{
/*
* Either this is a dummy timestep for something that
* was discarded on the writer side, or it is a
* timestep that satisfies DiscardPriorTimestep and
* we've already sent a release for it. Now is the
* time to install the 'precious' info that it carried
* (Attributes and formats) and then discard it.
*/
CP_verbose(Stream, PerRankVerbose,
"SstAdvanceStep installing precious "
"metadata for discarded TS %d\n",
Next->MetadataMsg->Timestep);
if (Stream->WriterConfigParams->MarshalMethod == SstMarshalFFS)
{
FFSMarshalInstallPreciousMetadata(Stream, Next->MetadataMsg);
}
else if (Stream->WriterConfigParams->MarshalMethod == SstMarshalBP5)
{
AddFormatsToMetaMetaInfo(Stream, Next->MetadataMsg);
AddAttributesToAttrDataList(Stream, Next->MetadataMsg);
}
TSMetadataList Tmp = Next;
Next = Next->Next;
FreeTimestep(Stream, Tmp->MetadataMsg->Timestep);
continue;
}
if (Next->MetadataMsg->Timestep >= LastTimestep)
{
if ((FoundTS == NULL) && (Next->MetadataMsg->Timestep > LastTimestep))
{
FoundTS = Next;
break;
}
else if ((FoundTS != NULL) &&
(FoundTS->MetadataMsg->Timestep > Next->MetadataMsg->Timestep))
{
FoundTS = Next;
break;
}
}
Next = Next->Next;
}
if (FoundTS)
{
CP_verbose(Stream, PerRankVerbose, "Returning metadata for Timestep %d\n",
FoundTS->MetadataMsg->Timestep);
Stream->CurrentWorkingTimestep = FoundTS->MetadataMsg->Timestep;
return FoundTS;
}
/* didn't find a good next timestep, check Stream status */
if ((Stream->Status != Established) ||
((Stream->FinalTimestep != INT_MAX) && (Stream->FinalTimestep >= LastTimestep)))
{
CP_verbose(Stream, TraceVerbose, "Stream Final Timestep is %d, last timestep was %d\n",
Stream->FinalTimestep, LastTimestep);
if (Stream->Status == NotOpen)
{
CP_verbose(Stream, PerRankVerbose,
"Wait for next metadata returning NULL because "
"channel was never fully established\n");
}
else if (Stream->Status == PeerFailed)
{
CP_verbose(Stream, PerRankVerbose,
"Wait for next metadata returning NULL because "
"the connection failed before final timestep "
"notification\n");
}
else
{
CP_verbose(Stream, PerStepVerbose,
"Wait for next metadata returning NULL, status %d ", Stream->Status);
}
/* closed or failed, return NULL */
Stream->CurrentWorkingTimestep = -1;
return NULL;
}
CP_verbose(Stream, PerRankVerbose, "Waiting for metadata for a Timestep later than TS %d\n",
LastTimestep);
CP_verbose(Stream, TraceVerbose, "(PID %lx, TID %lx) Stream status is %s\n", (long)getpid(),
(long)gettid(), SSTStreamStatusStr[Stream->Status]);
/* wait until we get the timestep metadata or something else changes */
STREAM_CONDITION_WAIT(Stream);
}
/* NOTREACHED */
}
// SstGetCurMetadata is an SST entry point only called by the main
// program thread. Only accesses the CurrentMetadata field which is
// touched only by other subroutines called by the main program
// thread, it needs no locking.
extern SstFullMetadata SstGetCurMetadata(SstStream Stream) { return Stream->CurrentMetadata; }
extern SstMetaMetaList SstGetNewMetaMetaData(SstStream Stream, long Timestep)
{
int RetCount = 0;
STREAM_MUTEX_LOCK(Stream);
int64_t LastRetTimestep = -1;
int i;
for (i = 0; i < Stream->InternalMetaMetaCount; i++)
{
if ((LastRetTimestep == -1) ||
(Stream->InternalMetaMetaInfo[i].TimestepAdded >= LastRetTimestep))
RetCount++;
}
if (RetCount == 0)
{
STREAM_MUTEX_UNLOCK(Stream);
return NULL;
}
SstMetaMetaList ret = malloc(sizeof(ret[0]) * (RetCount + 1));
int j = 0;
for (i = 0; i < Stream->InternalMetaMetaCount; i++)
{
if ((LastRetTimestep == -1) ||
(Stream->InternalMetaMetaInfo[i].TimestepAdded >= LastRetTimestep))
{
// no copies, keep memory ownership in SST
ret[j].BlockData = Stream->InternalMetaMetaInfo[i].BlockData;
ret[j].BlockSize = Stream->InternalMetaMetaInfo[i].BlockSize;
ret[j].ID = Stream->InternalMetaMetaInfo[i].ID;
ret[j].IDSize = Stream->InternalMetaMetaInfo[i].IDSize;
j++;
}
}
memset(&ret[j], 0, sizeof(ret[j]));
LastRetTimestep = Timestep;
STREAM_MUTEX_UNLOCK(Stream);
return ret;
}
extern SstBlock SstGetAttributeData(SstStream Stream, long Timestep)
{
STREAM_MUTEX_LOCK(Stream);
struct _SstBlock *InternalAttrDataInfo = Stream->InternalAttrDataInfo;
Stream->AttrsRetrieved = 1;
STREAM_MUTEX_UNLOCK(Stream);
return InternalAttrDataInfo;
}
static void AddToReadStats(SstStream Stream, int Rank, long Timestep, size_t Length)
{
if (!Stream->RanksRead)
Stream->RanksRead = calloc(1, Stream->WriterCohortSize);
Stream->RanksRead[Rank] = 1;
Stream->Stats.BytesRead += Length;
}
#ifndef min
#define min(a, b) (((a) < (b)) ? (a) : (b))
#endif
static void ReleaseTSReadStats(SstStream Stream, long Timestep)
{
int ThisFanIn = 0;
if (Stream->RanksRead)
{
for (int i = 0; i < Stream->WriterCohortSize; i++)
{
if (Stream->RanksRead[i])
ThisFanIn++;
}
memset(Stream->RanksRead, 0, Stream->WriterCohortSize);
}
if (Stream->Stats.TimestepsConsumed == 1)
{
Stream->Stats.RunningFanIn = ThisFanIn;
}
else
{
Stream->Stats.RunningFanIn =
Stream->Stats.RunningFanIn + ((double)ThisFanIn - Stream->Stats.RunningFanIn) /
min(Stream->Stats.TimestepsConsumed, 100);
}
}
// SstReadRemotememory is only called by the main
// program thread.
extern void *SstReadRemoteMemory(SstStream Stream, int Rank, long Timestep, size_t Offset,
size_t Length, void *Buffer, void *DP_TimestepInfo)
{
if (Stream->ConfigParams->ReaderShortCircuitReads)
return NULL;
Stream->Stats.BytesTransferred += Length;
AddToReadStats(Stream, Rank, Timestep, Length);
return Stream->DP_Interface->readRemoteMemory(&Svcs, Stream->DP_Stream, Rank, Timestep, Offset,
Length, Buffer, DP_TimestepInfo);
}
static void sendOneToEachWriterRank(SstStream Stream, CMFormat f, void *Msg, void **WS_StreamPtr)
{
if (Stream->WriterConfigParams->CPCommPattern == SstCPCommPeer)
{
int i = 0;
while (Stream->Peers[i] != -1)
{
int peer = Stream->Peers[i];
CMConnection conn = Stream->ConnectionsToWriter[peer].CMconn;
/* add the writer Stream identifier to each outgoing
* message */
*WS_StreamPtr = Stream->ConnectionsToWriter[peer].RemoteStreamID;
if (CMwrite(conn, f, Msg) != 1)
{
switch (Stream->Status)
{
case NotOpen:
case Opening:
case Established:
CP_verbose(Stream, CriticalVerbose,
"Message failed to send to writer %d (%p)\n", peer, *WS_StreamPtr);
break;
case PeerClosed:
case PeerFailed:
case Closed:
case Destroyed:
// Don't warn on send failures for closing/closed clients
break;
}
}
i++;
}
}
else
{
if (Stream->Rank == 0)
{
int peer = 0;
CMConnection conn = Stream->ConnectionsToWriter[peer].CMconn;
/* add the writer Stream identifier to each outgoing
* message */
*WS_StreamPtr = Stream->ConnectionsToWriter[peer].RemoteStreamID;
if (CMwrite(conn, f, Msg) != 1)
{
switch (Stream->Status)
{
case NotOpen:
case Opening:
case Established:
CP_verbose(Stream, CriticalVerbose,
"Message failed to send to writer %d (%p)\n", peer, *WS_StreamPtr);
break;
case PeerClosed:
case PeerFailed:
case Closed:
case Destroyed:
// Don't warn on send failures for closing/closed clients
break;
}
}
}
}
}
// SstReaderDefinitionLock is only called by the main
// program thread.
extern void SstReaderDefinitionLock(SstStream Stream, long EffectiveTimestep)
{
struct _LockReaderDefinitionsMsg Msg;
memset(&Msg, 0, sizeof(Msg));
Msg.Timestep = EffectiveTimestep;
sendOneToEachWriterRank(Stream, Stream->CPInfo->SharedCM->LockReaderDefinitionsFormat, &Msg,
&Msg.WSR_Stream);
}
// SstReleaseStep is only called by the main program thread. It
// locks to protect the timestep list before freeing the local
// representation of the resleased timestep.
extern void SstReleaseStep(SstStream Stream)
{
long Timestep = Stream->ReaderTimestep;
struct _ReleaseTimestepMsg Msg;
PERFSTUBS_TIMER_START_FUNC(timer);
STREAM_MUTEX_LOCK(Stream);
if (Stream->DP_Interface->RSReleaseTimestep)
{
(Stream->DP_Interface->RSReleaseTimestep)(&Svcs, Stream->DP_Stream, Timestep);
}
ReleaseTSReadStats(Stream, Timestep);
STREAM_MUTEX_UNLOCK(Stream);
if ((Stream->WriterConfigParams->CPCommPattern == SstCPCommPeer) || (Stream->Rank == 0))
{
STREAM_MUTEX_LOCK(Stream);
FreeTimestep(Stream, Timestep);
STREAM_MUTEX_UNLOCK(Stream);
}
SMPI_Barrier(Stream->mpiComm);
memset(&Msg, 0, sizeof(Msg));
Msg.Timestep = Timestep;
/*
* send each writer rank a release for this timestep (actually goes to WSR
* Streams)
*/
CP_verbose(Stream, PerRankVerbose,
"Sending ReleaseTimestep message for timestep %d, one to each writer\n", Timestep);
sendOneToEachWriterRank(Stream, Stream->CPInfo->SharedCM->ReleaseTimestepFormat, &Msg,
&Msg.WSR_Stream);
if (Stream->WriterConfigParams->MarshalMethod == SstMarshalFFS)
{
FFSClearTimestepData(Stream);
}
PERFSTUBS_TIMER_STOP_FUNC(timer);
}
static void NotifyDPArrivedMetadata(SstStream Stream, struct _TimestepMetadataMsg *MetadataMsg)
{
if ((MetadataMsg->Metadata != NULL) && (MetadataMsg->Timestep > Stream->LastDPNotifiedTimestep))
{
if (Stream->DP_Interface->timestepArrived)
{
Stream->DP_Interface->timestepArrived(&Svcs, Stream->DP_Stream, MetadataMsg->Timestep,
MetadataMsg->PreloadMode);
}
Stream->LastDPNotifiedTimestep = MetadataMsg->Timestep;
}
}
/*
* wait for metadata for Timestep indicated to arrive, or fail with EndOfStream
* or Error
*/
static SstStatusValue SstAdvanceStepPeer(SstStream Stream, SstStepMode mode,
const float timeout_sec)
{
TSMetadataList Entry;
PERFSTUBS_TIMER_START(timer, "Waiting on metadata per rank per timestep");
if ((timeout_sec >= 0.0) || (mode == SstLatestAvailable))
{
struct _GlobalOpInfo
{
float timeout_sec;
int mode;
long LatestTimestep;
};
struct _GlobalOpInfo my_info;
struct _GlobalOpInfo *global_info = NULL;
long NextTimestep;
if (Stream->Rank == 0)
{
global_info = malloc(sizeof(my_info) * Stream->CohortSize);
CP_verbose(Stream, PerRankVerbose,
"In special case of advancestep, mode is %d, "
"Timeout Sec is %g, flt_max is %g\n",
mode, timeout_sec, FLT_MAX);
}
my_info.LatestTimestep = MaxQueuedMetadata(Stream);
my_info.timeout_sec = timeout_sec;
my_info.mode = mode;
SMPI_Gather(&my_info, sizeof(my_info), SMPI_CHAR, global_info, sizeof(my_info), SMPI_CHAR,
0, Stream->mpiComm);
if (Stream->Rank == 0)
{
long Biggest = -1;
long Smallest = LONG_MAX;
for (int i = 0; i < Stream->CohortSize; i++)
{
if (global_info[i].LatestTimestep > Biggest)
{
Biggest = global_info[i].LatestTimestep;
}
if (global_info[i].LatestTimestep < Smallest)
{
Smallest = global_info[i].LatestTimestep;
}
}
free(global_info);
/*
* Several situations are possible here, depending upon
* whether or not a timeout is specified and/or
* LatestAvailable is specified, and whether or not we
* have timesteps queued anywhere. If they want
* LatestAvailable and we have any Timesteps queued
* anywhere, we decide upon a timestep to return and
* assume that all ranks will get it soon (or else we're
* in failure mode). If there are no timesteps queued
* anywhere, then we're going to wait for timeout seconds
* ON RANK 0. RANK 0 AND ONLY RANK 0 WILL DECIDE IF WE
* TIMEOUT OR RETURN WITH DATA. It is possible that other
* ranks get timestep metadata before the timeout expires,
* but we don't care. Whatever would happen on rank 0 is
* what happens everywhere.
*/
if (Biggest == -1)
{
// AllQueuesEmpty
if (timeout_sec >= 0.0)
{
waitForMetadataWithTimeout(Stream, timeout_sec);
}
else
{
waitForMetadataWithTimeout(Stream, FLT_MAX);
}
NextTimestep = MaxQueuedMetadata(Stream); /* might be -1 if we timed out */
}
else
{
/*
* we've actually got a choice here. "Smallest" is
* the LatestTimestep that everyone has. "Biggest" is
* the Latest that someone has seen, and presumably
* others will see shortly. I'm going to go with Biggest
* until I have a reason to prefer one or the other.
*/
if (mode == SstLatestAvailable)
{
// latest available
CP_verbose(Stream, PerRankVerbose,
"Returning Biggest timestep available "
"%ld because LatestAvailable "
"specified\n",
Biggest);
NextTimestep = Biggest;
}
else
{
// next available (take the oldest that everyone has)
CP_verbose(Stream, PerRankVerbose,
"Returning Smallest timestep available "
"%ld because NextAvailable specified\n",
Smallest);
NextTimestep = Smallest;
}
}
if ((NextTimestep == -1) && (Stream->Status == PeerClosed))
{
/* force everyone to close */
NextTimestep = -2;
}
if ((NextTimestep == -1) && (Stream->Status == PeerFailed))
{
/* force everyone to return failed */
NextTimestep = -3;
}
SMPI_Bcast(&NextTimestep, 1, SMPI_LONG, 0, Stream->mpiComm);
}
else
{
STREAM_MUTEX_UNLOCK(Stream);
SMPI_Bcast(&NextTimestep, 1, SMPI_LONG, 0, Stream->mpiComm);
STREAM_MUTEX_LOCK(Stream);
}
if (NextTimestep == -2)
{
/* there was a peerClosed setting on rank0, we'll close */
Stream->Status = PeerClosed;
CP_verbose(Stream, PerStepVerbose,
"SstAdvanceStep returning EndOfStream at timestep %d\n",
Stream->ReaderTimestep);
return SstEndOfStream;
}
if (NextTimestep == -3)
{
/* there was a peerFailed setting on rank0, we'll fail */
Stream->Status = PeerFailed;
CP_verbose(Stream, PerStepVerbose,
"SstAdvanceStep returning EndOfStream at timestep %d\n",
Stream->ReaderTimestep);
STREAM_MUTEX_UNLOCK(Stream);
Stream->DP_Interface->notifyConnFailure(&Svcs, Stream->DP_Stream, 0);
STREAM_MUTEX_LOCK(Stream);
return SstFatalError;
}
if (NextTimestep == -1)
{
CP_verbose(Stream, PerStepVerbose, "AdvancestepPeer timing out on no data\n");
return SstTimeout;
}
if (mode == SstLatestAvailable)
{
// latest available
/* release all timesteps from before NextTimestep, then fall
* through below */
/* Side note: It is possible that someone could get a "prior"
* timestep after this point. It has to be released upon
* arrival */
CP_verbose(Stream, PerStepVerbose,
"timed or Latest timestep, determined NextTimestep %d\n", NextTimestep);
Stream->DiscardPriorTimestep = NextTimestep;
releasePriorTimesteps(Stream, NextTimestep);
}
}
Entry = waitForNextMetadata(Stream, Stream->ReaderTimestep);
PERFSTUBS_TIMER_STOP(timer);
if (Entry)
{
NotifyDPArrivedMetadata(Stream, Entry->MetadataMsg);
if (Stream->WriterConfigParams->MarshalMethod == SstMarshalFFS)
{
PERFSTUBS_TIMER_START(timerFFS, "FFS marshaling case");
FFSMarshalInstallMetadata(Stream, Entry->MetadataMsg);
PERFSTUBS_TIMER_STOP(timerFFS);
}
else if (Stream->WriterConfigParams->MarshalMethod == SstMarshalBP5)
{
AddFormatsToMetaMetaInfo(Stream, Entry->MetadataMsg);
AddAttributesToAttrDataList(Stream, Entry->MetadataMsg);
}
Stream->ReaderTimestep = Entry->MetadataMsg->Timestep;
SstFullMetadata Mdata = malloc(sizeof(struct _SstFullMetadata));
memset(Mdata, 0, sizeof(struct _SstFullMetadata));
Mdata->WriterCohortSize = Entry->MetadataMsg->CohortSize;
Mdata->WriterMetadata = malloc(sizeof(Mdata->WriterMetadata[0]) * Mdata->WriterCohortSize);
for (int i = 0; i < Mdata->WriterCohortSize; i++)
{
Mdata->WriterMetadata[i] = &Entry->MetadataMsg->Metadata[i];
}
if (Stream->DP_Interface->TimestepInfoFormats == NULL)
{
// DP didn't provide struct info, no valid data
Mdata->DP_TimestepInfo = NULL;
}
else
{
Mdata->DP_TimestepInfo = Entry->MetadataMsg->DP_TimestepInfo;
}
Stream->CurrentWorkingTimestep = Entry->MetadataMsg->Timestep;
Stream->CurrentMetadata = Mdata;
CP_verbose(Stream, PerStepVerbose, "SstAdvanceStep returning Success on timestep %d\n",
Entry->MetadataMsg->Timestep);
return SstSuccess;
}
if (Stream->Status == PeerClosed)
{
CP_verbose(Stream, PerStepVerbose,
"SstAdvanceStepPeer returning EndOfStream at timestep %d\n",
Stream->ReaderTimestep);
return SstEndOfStream;
}
else
{
CP_verbose(Stream, PerStepVerbose, "SstAdvanceStep returning FatalError at timestep %d\n",
Stream->ReaderTimestep);
return SstFatalError;
}
}
static SstStatusValue SstAdvanceStepMin(SstStream Stream, SstStepMode mode, const float timeout_sec)
{
TSMetadataDistributionMsg ReturnData;
struct _TimestepMetadataMsg *MetadataMsg;
SstStatusValue ret;
void *free_block;
if (Stream->Rank == 0)
{
struct _TimestepMetadataDistributionMsg msg;
SstStatusValue return_value = SstSuccess;
TSMetadataList RootEntry = NULL;
memset(&msg, 0, sizeof(msg));
msg.TSmsg = NULL;
msg.CommPatternLockedTimestep = -1;
if (Stream->CommPatternLocked == 1)
{
msg.CommPatternLockedTimestep = Stream->CommPatternLockedTimestep;
}
if ((timeout_sec >= 0.0) || (mode == SstLatestAvailable))
{
long NextTimestep = -1;
long LatestTimestep = MaxQueuedMetadata(Stream);
/*
* Several situations are possible here, depending upon
* whether or not a timeout is specified and/or
* LatestAvailable is specified, and whether or not we
* have timesteps queued anywhere. If they want
* LatestAvailable and we have any Timesteps queued
* anywhere, we decide upon a timestep to return and
* assume that all ranks will get it soon (or else we're
* in failure mode). If there are no timesteps queued
* anywhere, then we're going to wait for timeout seconds
* ON RANK 0. RANK 0 AND ONLY RANK 0 WILL DECIDE IF WE
* TIMEOUT OR RETURN WITH DATA. It is possible that other
* ranks get timestep metadata before the timeout expires,
* but we don't care. Whatever would happen on rank 0 is
* what happens everywhere.
*/
if (LatestTimestep == -1)
{
// AllQueuesEmpty
if (timeout_sec >= 0.0)
{
waitForMetadataWithTimeout(Stream, timeout_sec);
}
else
{
waitForMetadataWithTimeout(Stream, FLT_MAX);
}
NextTimestep = MaxQueuedMetadata(Stream); /* might be -1 if we timed out */
}
else
{
if (mode == SstLatestAvailable)
{
// latest available
CP_verbose(Stream, PerStepVerbose,
"Returning latest timestep available "
"%ld because LatestAvailable "
"specified\n",
LatestTimestep);
NextTimestep = LatestTimestep;
}
else
{
// next available (take the oldest that everyone has)
NextTimestep = NextQueuedMetadata(Stream);
CP_verbose(Stream, PerStepVerbose,
"Returning Smallest timestep available "
"%ld because NextAvailable specified\n",
NextTimestep);
}
}
if (Stream->Status == PeerFailed)
{
CP_verbose(Stream, PerStepVerbose,
"SstAdvanceStepMin returning FatalError because of "
"connection failure at timestep %d\n",
Stream->ReaderTimestep);
return_value = SstFatalError;
}
else if ((NextTimestep == -1) && (Stream->Status == PeerClosed))
{
CP_verbose(Stream, PerStepVerbose,
"SstAdvanceStepMin returning EndOfStream at timestep %d\n",
Stream->ReaderTimestep);
return_value = SstEndOfStream;
}
else if (NextTimestep == -1)
{
CP_verbose(Stream, PerStepVerbose, "AdvancestepMin timing out on no data\n");
return_value = SstTimeout;
}
else if (mode == SstLatestAvailable)
{
// latest available
/* release all timesteps from before NextTimestep, then fall
* through below */
/* Side note: It is possible that someone could get a "prior"
* timestep after this point. It has to be released upon
* arrival */
CP_verbose(Stream, PerStepVerbose,
"timed or Latest timestep, determined NextTimestep %d\n", NextTimestep);
Stream->DiscardPriorTimestep = NextTimestep;
releasePriorTimesteps(Stream, NextTimestep);
}
}
if (Stream->Status == PeerFailed)
{
CP_verbose(Stream, PerStepVerbose,
"SstAdvanceStepMin returning FatalError because of "
"conn failure at timestep %d\n",
Stream->ReaderTimestep);
return_value = SstFatalError;
}
if (return_value == SstSuccess)
{
RootEntry = waitForNextMetadata(Stream, Stream->ReaderTimestep);
}
if (RootEntry)
{
msg.TSmsg = RootEntry->MetadataMsg;
msg.ReturnValue = return_value;
CP_verbose(Stream, TraceVerbose, "Setting TSmsg to Rootentry value\n");
}
else
{
if (return_value == SstSuccess)
{
if (Stream->Status == PeerClosed)
{
CP_verbose(Stream, PerStepVerbose,
"SstAdvanceStepMin rank 0 returning "
"EndOfStream at timestep %d\n",
Stream->ReaderTimestep);
msg.ReturnValue = SstEndOfStream;
}
else
{
CP_verbose(Stream, PerStepVerbose,
"SstAdvanceStepMin rank 0 returning "
"FatalError at timestep %d\n",
Stream->ReaderTimestep);
msg.ReturnValue = SstFatalError;
}
CP_verbose(Stream, TraceVerbose, "Setting TSmsg to NULL\n");
msg.TSmsg = NULL;
}
else
{
msg.ReturnValue = return_value;
}
}
// AddArrivedMetadataInfo(Stream, &msg);
ReturnData = CP_distributeDataFromRankZero(
Stream, &msg, Stream->CPInfo->TimestepDistributionFormat, &free_block);
}
else
{
STREAM_MUTEX_UNLOCK(Stream);
ReturnData = CP_distributeDataFromRankZero(
Stream, NULL, Stream->CPInfo->CombinedWriterInfoFormat, &free_block);
STREAM_MUTEX_LOCK(Stream);
}
ret = (SstStatusValue)ReturnData->ReturnValue;
if (ReturnData->ReturnValue != SstSuccess)
{
if ((Stream->WriterConfigParams->MarshalMethod == SstMarshalFFS) && (ReturnData->TSmsg))
{
CP_verbose(Stream, PerRankVerbose,
"SstAdvanceStep installing precious metadata before exiting\n");
FFSMarshalInstallPreciousMetadata(Stream, ReturnData->TSmsg);
}
else if ((Stream->WriterConfigParams->MarshalMethod == SstMarshalBP5) &&
(ReturnData->TSmsg))
{
AddFormatsToMetaMetaInfo(Stream, ReturnData->TSmsg);
AddAttributesToAttrDataList(Stream, ReturnData->TSmsg);
}
free(free_block);
CP_verbose(Stream, PerStepVerbose, "SstAdvanceStep returning FAILURE\n");
return ret;
}
MetadataMsg = ReturnData->TSmsg;
if (ReturnData->CommPatternLockedTimestep != -1)
{
Stream->CommPatternLockedTimestep = ReturnData->CommPatternLockedTimestep;
Stream->CommPatternLocked = 2;
STREAM_MUTEX_UNLOCK(Stream);
if (Stream->DP_Interface->RSreadPatternLocked)
{
Stream->DP_Interface->RSreadPatternLocked(&Svcs, Stream->DP_Stream,
Stream->CommPatternLockedTimestep);
}
STREAM_MUTEX_LOCK(Stream);
}
if (MetadataMsg)
{
NotifyDPArrivedMetadata(Stream, MetadataMsg);
Stream->ReaderTimestep = MetadataMsg->Timestep;
if (Stream->WriterConfigParams->MarshalMethod == SstMarshalFFS)
{
CP_verbose(Stream, TraceVerbose, "Calling install metadata from metadata block %p\n",
MetadataMsg);
FFSMarshalInstallMetadata(Stream, MetadataMsg);
}
else if (Stream->WriterConfigParams->MarshalMethod == SstMarshalBP5)
{
AddFormatsToMetaMetaInfo(Stream, MetadataMsg);
AddAttributesToAttrDataList(Stream, MetadataMsg);
}
SstFullMetadata Mdata = malloc(sizeof(struct _SstFullMetadata));
memset(Mdata, 0, sizeof(struct _SstFullMetadata));
Mdata->WriterCohortSize = MetadataMsg->CohortSize;
Mdata->WriterMetadata = malloc(sizeof(Mdata->WriterMetadata[0]) * Mdata->WriterCohortSize);
for (int i = 0; i < Mdata->WriterCohortSize; i++)
{
Mdata->WriterMetadata[i] = &MetadataMsg->Metadata[i];
}
if (Stream->DP_Interface->TimestepInfoFormats == NULL)
{
// DP didn't provide struct info, no valid data
Mdata->DP_TimestepInfo = NULL;
}
else
{
Mdata->DP_TimestepInfo = MetadataMsg->DP_TimestepInfo;
}
Stream->CurrentWorkingTimestep = MetadataMsg->Timestep;
Mdata->FreeBlock = free_block;
Stream->CurrentMetadata = Mdata;
CP_verbose(Stream, PerStepVerbose, "SstAdvanceStep returning Success on timestep %d\n",
MetadataMsg->Timestep);
return SstSuccess;
}
CP_verbose(Stream, TraceVerbose, "SstAdvanceStep final return\n");
return ret;
}
// SstAdvanceStep is only called by the main program thread.
extern SstStatusValue SstAdvanceStep(SstStream Stream, const float timeout_sec)
{
SstStatusValue result;
STREAM_MUTEX_LOCK(Stream);
if (Stream->CurrentMetadata != NULL)
{
if (Stream->CurrentMetadata->FreeBlock)
{
free(Stream->CurrentMetadata->FreeBlock);
}
if (Stream->CurrentMetadata->WriterMetadata)
{
free(Stream->CurrentMetadata->WriterMetadata);
}
free(Stream->CurrentMetadata);
Stream->CurrentMetadata = NULL;
}
if (Stream->WriterConfigParams->StepDistributionMode == StepsOnDemand)
{
struct _ReaderRequestStepMsg Msg;
CP_verbose(Stream, PerRankVerbose, "Sending Reader Request Step messages to writer\n");
memset(&Msg, 0, sizeof(Msg));
sendOneToEachWriterRank(Stream, Stream->CPInfo->SharedCM->ReaderRequestStepFormat, &Msg,
&Msg.WSR_Stream);
}
SstStepMode mode = SstNextAvailable;
if (Stream->ConfigParams->AlwaysProvideLatestTimestep)
{
mode = SstLatestAvailable;
}
if (Stream->WriterConfigParams->CPCommPattern == SstCPCommPeer)
{
result = SstAdvanceStepPeer(Stream, mode, timeout_sec);
}
else
{
result = SstAdvanceStepMin(Stream, mode, timeout_sec);
}
if (result == SstSuccess)
{
Stream->Stats.TimestepsConsumed++;
}
STREAM_MUTEX_UNLOCK(Stream);
return result;
}
// SstReaderClose is only called by the main program thread and
// needs no locking as it only accesses data set by the main thread
extern void SstReaderClose(SstStream Stream)
{
/* need to have a reader-side shutdown protocol, but for now, just sleep for
* a little while to makes sure our release message for the last timestep
* got received */
struct timeval CloseTime, Diff;
struct _ReaderCloseMsg Msg;
/* wait until each reader rank has done SstReaderClose() */
SMPI_Barrier(Stream->mpiComm);
gettimeofday(&CloseTime, NULL);
timersub(&CloseTime, &Stream->ValidStartTime, &Diff);
memset(&Msg, 0, sizeof(Msg));
sendOneToEachWriterRank(Stream, Stream->CPInfo->SharedCM->ReaderCloseFormat, &Msg,
&Msg.WSR_Stream);
Stream->Stats.StreamValidTimeSecs = (double)Diff.tv_usec / 1e6 + Diff.tv_sec;
if (Stream->CPVerbosityLevel >= (int)SummaryVerbose)
{
DoStreamSummary(Stream);
}
CMusleep(Stream->CPInfo->SharedCM->cm, 100000);
if (Stream->CurrentMetadata != NULL)
{
if (Stream->CurrentMetadata->FreeBlock)
free(Stream->CurrentMetadata->FreeBlock);
if (Stream->CurrentMetadata->WriterMetadata)
free(Stream->CurrentMetadata->WriterMetadata);
free(Stream->CurrentMetadata);
Stream->CurrentMetadata = NULL;
}
STREAM_MUTEX_LOCK(Stream);
for (int i = 0; i < Stream->InternalMetaMetaCount; i++)
{
free(Stream->InternalMetaMetaInfo[i].ID);
free(Stream->InternalMetaMetaInfo[i].BlockData);
}
free(Stream->InternalMetaMetaInfo);
if (Stream->InternalAttrDataInfo)
{
for (int i = 0; i < Stream->InternalAttrDataCount; i++)
{
free(Stream->InternalAttrDataInfo[i].BlockData);
}
free(Stream->InternalAttrDataInfo);
}
STREAM_MUTEX_UNLOCK(Stream);
}
// SstWaitForCompletion is only called by the main program thread and
// needs no locking
extern SstStatusValue SstWaitForCompletion(SstStream Stream, void *handle)
{
if (Stream->ConfigParams->ReaderShortCircuitReads)
return SstSuccess;
if (Stream->DP_Interface->waitForCompletion(&Svcs, handle) != 1)
{
return SstFatalError;
}
else
{
return SstSuccess;
}
}
|
4cbfa6053611d559ae156b722ada35baa0f6d47c
|
a411a55762de11dc2c9d913ff33d2f1477ac02cf
|
/lte/gateway/c/core/oai/common/enum_string.c
|
9fb03d25a953c94caa28e1619d45094e6371f7c0
|
[
"BSD-3-Clause"
] |
permissive
|
magma/magma
|
0dc48c1513d9968bd05fb7589f302c192b7c0f94
|
0e1d895dfe625681229e181fbc2dbad83e13c5cb
|
refs/heads/master
| 2023-09-04T09:31:56.140395
| 2023-08-29T13:54:49
| 2023-08-29T13:54:49
| 170,803,235
| 1,219
| 525
|
NOASSERTION
| 2023-09-07T17:45:42
| 2019-02-15T04:46:24
|
C++
|
UTF-8
|
C
| false
| false
| 3,382
|
c
|
enum_string.c
|
/*
* Copyright (c) 2015, EURECOM (www.eurecom.fr)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are
* those of the authors and should not be interpreted as representing official
* policies, either expressed or implied, of the FreeBSD Project.
*/
/*! \file enum_string.c
\brief
\author Sebastien ROUX
\company Eurecom
*/
#include <stdio.h>
#include <stdlib.h>
#include "lte/gateway/c/core/oai/common/common_types.h"
#include "lte/gateway/c/core/oai/common/enum_string.h"
enum_to_string_t rat_to_string[NUMBER_OF_RAT_TYPE] = {
{RAT_WLAN, "WLAN"}, {RAT_VIRTUAL, "VIRUTAL"},
{RAT_UTRAN, "UTRAN"}, {RAT_GERAN, "GERAN"},
{RAT_GAN, "GAN"}, {RAT_HSPA_EVOLUTION, "HSPA_EVOLUTION"},
{RAT_EUTRAN, "E-UTRAN"}, {RAT_CDMA2000_1X, "CDMA2000_1X"},
{RAT_HRPD, "HRPD"}, {RAT_UMB, "UMB"},
{RAT_EHRPD, "EHRPD"},
};
enum_to_string_t network_access_mode_to_string[NAM_MAX] = {
{NAM_PACKET_AND_CIRCUIT, "PACKET AND CIRCUIT"},
{NAM_RESERVED, "RESERVED"},
{NAM_ONLY_PACKET, "ONLY PACKET"},
};
enum_to_string_t all_apn_conf_ind_to_string[ALL_APN_MAX] = {
{ALL_APN_CONFIGURATIONS_INCLUDED, "ALL APN CONFIGURATIONS INCLUDED"},
{MODIFIED_ADDED_APN_CONFIGURATIONS_INCLUDED,
"MODIFIED ADDED APN CONFIGURATIONS INCLUDED"},
};
enum_to_string_t pdn_type_to_string[IP_MAX] = {
{IPv4, "IPv4"},
{IPv6, "IPv6"},
{IPv4_AND_v6, "IPv4 and IPv6"},
{IPv4_OR_v6, "IPv4 or IPv6"},
};
static int compare_values(const void* m1, const void* m2) {
enum_to_string_t* mi1 = (enum_to_string_t*)m1;
enum_to_string_t* mi2 = (enum_to_string_t*)m2;
return (mi1->enum_value - mi2->enum_value);
}
char* enum_to_string(int enum_val, enum_to_string_t* string_table,
int nb_element) {
enum_to_string_t* res;
enum_to_string_t temp;
temp.enum_value = enum_val;
res = bsearch(&temp, string_table, nb_element, sizeof(enum_to_string_t),
compare_values);
if (res == NULL) {
return "UNKNOWN";
}
return res->enum_value_name;
}
|
c6606d07587284dce8770229dd3c10beb0edaae6
|
e1cddfd754d952134e72dfd03522c5ea4fb6008e
|
/src/vnet/span/span.api
|
95d5ad11c364d717f686bf5bcd854e6751090082
|
[
"Apache-2.0"
] |
permissive
|
FDio/vpp
|
0ad30fa1bec2975ffa6b66b45c9f4f32163123b6
|
f234b0d4626d7e686422cc9dfd25958584f4931e
|
refs/heads/master
| 2023-08-31T16:09:04.068646
| 2022-03-14T09:49:15
| 2023-08-31T09:50:00
| 96,556,718
| 1,048
| 630
|
Apache-2.0
| 2023-06-21T05:39:17
| 2017-07-07T16:29:40
|
C
|
UTF-8
|
C
| false
| false
| 2,432
|
api
|
span.api
|
/* Hey Emacs use -*- mode: C -*- */
/*
* Copyright (c) 2016 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
option version = "2.0.0";
import "vnet/interface_types.api";
enum span_state
{
SPAN_STATE_API_DISABLED = 0,
SPAN_STATE_API_RX = 1,
SPAN_STATE_API_TX = 2,
SPAN_STATE_API_RX_TX = 3,
};
/** \brief Enable/Disable span to mirror traffic from one interface to another
@param client_index - opaque cookie to identify the sender
@param context - sender context which was passed in the request
@param sw_if_index_from - interface to be mirrored
@param sw_if_index_to - interface where the traffic is mirrored
@param state - 0 = disabled, 1 = rx enabled, 2 = tx enabled, 3 tx & rx enabled
@param is_l2 - 0 = mirror at hw device level, 1 = mirror at L2
*/
autoreply define sw_interface_span_enable_disable {
u32 client_index;
u32 context;
vl_api_interface_index_t sw_if_index_from;
vl_api_interface_index_t sw_if_index_to;
vl_api_span_state_t state;
bool is_l2;
};
/** \brief SPAN dump request
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request
@param is_l2 - 0 = hw device level, 1 = L2
*/
define sw_interface_span_dump {
u32 client_index;
u32 context;
bool is_l2;
};
/** \brief Reply to SPAN dump request
@param context - sender context which was passed in the request
@param sw_if_index_from - mirrored interface
@param sw_if_index_to - interface where the traffic is mirrored
@param state - 0 = disabled, 1 = rx enabled, 2 = tx enabled, 3 tx & rx enabled
@param is_l2 - 0 = mirrored at hw device level, 1 = mirrored at l2
*/
define sw_interface_span_details {
u32 context;
vl_api_interface_index_t sw_if_index_from;
vl_api_interface_index_t sw_if_index_to;
vl_api_span_state_t state;
bool is_l2;
};
|
b9eb5a4d9ad13990544b0e104ef0dbd5e1585228
|
2b3a800fa524e0feee9098c5e29b8142545497bb
|
/6/asm.h
|
6011264ed9c3cada633ebeed7e9ac0a64af6ab4a
|
[
"MIT"
] |
permissive
|
oridb/mc
|
775ce818dc74701752a6c9f5ae6afb5d84cf27d2
|
74d91a0021de012908cfdb35fb61a1473a376130
|
refs/heads/master
| 2023-08-27T05:43:30.279203
| 2022-05-23T01:02:07
| 2022-05-23T01:02:07
| 16,144,976
| 409
| 46
|
MIT
| 2020-05-06T03:33:42
| 2014-01-22T16:33:30
|
C
|
UTF-8
|
C
| false
| false
| 7,747
|
h
|
asm.h
|
#define Maxarg 4 /* maximum number of args an insn can have */
#define Wordsz 4 /* the size of a "natural int" */
#define Ptrsz 8 /* the size of a machine word (ie, pointer size) */
typedef size_t regid;
typedef struct Insn Insn;
typedef struct Loc Loc;
typedef struct Func Func;
typedef struct Blob Blob;
typedef struct Isel Isel;
typedef struct Asmbb Asmbb;
typedef enum {
#define Insn(val, gasfmt, p9fmt, use, def) val,
#include "insns.def"
#undef Insn
} AsmOp;
typedef enum {
#define Reg(r, gasname, p9name, mode) r,
#include "regs.def"
#undef Reg
Nreg
} Reg;
typedef enum {
Locnone,
Loclbl, /* label */
Locreg, /* register */
Locmem, /* reg offset mem */
Locmeml, /* label offset mem */
Loclit, /* literal value */
Loclitl /* label address */
} Loctype;
typedef enum {
ModeNone,
ModeB, /* byte */
ModeW, /* short */
ModeL, /* long */
ModeQ, /* quad */
ModeF, /* float32 */
ModeD, /* float64 */
Nmode,
} Mode;
typedef enum {
PassInNoPref,
PassInSSE,
PassInInt,
PassInMemory,
} PassIn;
typedef enum {
ArgVoid,
/* Either int or flt, depending on Loc* type */
ArgReg,
/* Small aggregates packed into registers */
ArgAggrI,
ArgAggrF,
ArgAggrII,
ArgAggrFI,
ArgAggrIF,
ArgAggrFF,
ArgBig,
} ArgType;
typedef enum {
Classbad,
Classint,
Classflt,
Nclass,
} Rclass;
typedef enum {
Gnugaself,
Gnugasmacho,
Plan9,
} Asmsyntax;
typedef enum {
Bti8,
Bti16,
Bti32,
Bti64,
Btimin, /* byte-packed uint */
Btref,
Btbytes,
Btseq,
Btpad,
} Blobtype;
struct Blob {
Blobtype type;
size_t align;
char *lbl; /* may be null */
char isglobl;
char iscomdat;
union {
uvlong npad;
uvlong ival;
struct {
char *str;
char isextern;
size_t off;
} ref;
struct {
size_t len;
char *buf;
} bytes;
struct {
size_t nsub;
Blob **sub;
} seq;
};
};
/* a register, label, or memory location */
struct Loc {
Loctype type; /* the type of loc */
Mode mode; /* the mode of this location */
void *list;
union {
char *lbl; /* for Loclbl, Loclitl */
struct { /* for Locreg */
regid id;
Reg colour;
} reg;
long lit; /* for Loclit */
/*
* for Locmem, Locmeml.
* address format is
* disp(base + index)
*/
struct {
/* only one of lbldisp and constdisp may be used */
char *lbldisp;
long constdisp;
int scale; /* 0,1,2,4, or 8 */
Loc *base; /* needed */
Loc *idx; /* optional */
} mem;
};
};
struct Insn {
size_t uid;
AsmOp op;
Loc *args[Maxarg];
size_t nargs;
};
struct Func {
char *name; /* function name */
Srcloc loc; /* location of definition */
Type *type; /* type of function */
Node **args; /* argument list */
size_t nargs; /* number of args, including hidden ones */
Htab *stkoff; /* Loc* -> int stkoff map */
Htab *envoff; /* Loc* -> int envoff map */
size_t stksz; /* stack size */
Node *ret; /* return value */
ArgType rettype; /* how to actually get ret out */
Cfg *cfg; /* flow graph */
char isexport; /* is this exported from the asm? */
char hasenv; /* do we have an environment? */
};
struct Asmbb {
int id; /* unique identifier */
char **lbls; /* list of BB labels */
size_t nlbls; /* number of labels */
Insn **il; /* instructions */
size_t ni; /* number of instructions */
Bitset *pred; /* set of predecessor BB ids */
Bitset *succ; /* set of successor BB ids */
Bitset *use; /* registers used by this BB */
Bitset *def; /* registers defined by this BB */
Bitset *livein; /* variables live on entrance to BB */
Bitset *liveout; /* variables live on exit from BB */
};
/* instruction selection state */
struct Isel {
char *name;
char *cwd;
Cfg *cfg; /* cfg built with nodes */
Asmbb **bb; /* 1:1 mappings with the Node bbs in the CFG */
size_t nbb;
Asmbb *curbb;
Node *ret; /* we store the return into here */
ArgType rettype; /* how ret actually gets out of the function */
Htab *spillslots; /* reg id => int stkoff */
Htab *reglocs; /* decl id => Loc *reg */
Htab *stkoff; /* decl id => int stkoff */
Htab *envoff; /* decl id => int envoff */
Htab *globls; /* decl id => char *globlname */
Loc *envp;
/* increased when we spill */
Loc *stksz;
Loc *calleesave[Nreg];
size_t nsaved;
/* register allocator state */
size_t *gbits; /* igraph matrix repr */
regid **gadj; /* igraph adj set repr */
size_t *ngadj;
size_t *gadjsz;
size_t nreg; /* maxregid at time of alloc */
int *degree; /* degree of nodes */
int *nuses; /* number of uses of nodes */
Loc **aliasmap; /* mapping of aliases */
Bitset *shouldspill; /* the first registers we should try to spill */
Bitset *neverspill; /* registers we should never spill */
Insn ***rmoves;
size_t *nrmoves;
/* move sets */
Insn **mcoalesced;
size_t nmcoalesced;
Insn **mconstrained;
size_t nmconstrained;
Insn **mfrozen;
size_t nmfrozen;
Bitset *mactiveset;
Insn **mactive;
size_t nmactive;
/* worklists */
Bitset *wlmoveset;
Insn **wlmove;
size_t nwlmove;
Loc **wlspill;
size_t nwlspill;
Loc **wlfreeze;
size_t nwlfreeze;
Loc **wlsimp;
size_t nwlsimp;
Loc **selstk;
size_t nselstk;
Bitset *coalesced;
Bitset *spilled;
Bitset *prepainted; /* locations that need to be a specific colour */
Bitset *initial; /* initial set of locations used by this fn */
};
/* globals */
extern Type *tyintptr;
extern Type *tyword;
extern Type *tyvoid;
extern Node *abortoob;
/* options */
extern int extracheck;
extern Asmsyntax asmsyntax;
void initconsts(Htab *globls);
void fillglobls(Stab *st, Htab *globls);
void simpglobl(Node *dcl, Htab *globls, Func ***fn, size_t *nfn, Node ***blob, size_t *nblob);
void selfunc(Isel *is, Func *fn, Htab *globls, Htab *strtab);
void gen(char *out);
void gengas(FILE *fd);
void genp9(FILE *fd);
/* blob stuff */
Blob *mkblobpad(size_t sz);
Blob *mkblobi(Blobtype type, uint64_t ival);
Blob *mkblobbytes(char *buf, size_t len);
Blob *mkblobseq(Blob **sub, size_t nsub);
Blob *mkblobref(char *lbl, size_t off, int isextern);
void blobfree(Blob *b);
Blob *tydescblob(Type *t);
Blob *litblob(Htab *globls, Htab *strtab, Node *n);
size_t blobsz(Blob *b);
/* location generation */
extern size_t maxregid;
extern Loc **locmap; /* mapping from reg id => Loc * */
void resetregs(void);
char *genlocallblstr(char *buf, size_t sz);
Type *codetype(Type *ft);
Type *closuretype(Type *ft);
Loc *loclbl(Node *lbl);
Loc *locstrlbl(char *lbl);
Loc *locreg(Mode m);
Loc *locphysreg(Reg r);
Loc *locmem(long disp, Loc *base, Loc *idx, Mode mode);
Loc *locmeml(char *disp, Loc *base, Loc *idx, Mode mode);
Loc *locmems(long disp, Loc *base, Loc *idx, int scale, Mode mode);
Loc *locmemls(char *disp, Loc *base, Loc *idx, int scale, Mode mode);
Loc *loclit(long val, Mode m);
Loc *loclitl(char *lbl);
char *asmname(Node *dcl);
char *tydescid(char *buf, size_t bufsz, Type *ty);
Loc *coreg(Reg r, Mode m);
int isfloatmode(Mode m);
int isintmode(Mode m);
int issubreg(Loc *, Loc *);
int dumbmov(Loc *, Loc *);
/* emitting instructions */
Insn *mkinsn(int op, ...);
void dbgiprintf(FILE *fd, Insn *insn);
void dbglocprint(FILE *fd, Loc *l, char spec);
/* register allocation */
void regalloc(Isel *s);
Rclass rclass(Loc *l);
/* machine dependent optimization */
void peep(Isel *s);
/* useful functions */
size_t tysize(Type *t);
size_t tyalign(Type *t);
size_t size(Node *n);
ssize_t tyoffset(Type *ty, Node *memb);
ssize_t offset(Node *aggr, Node *memb);
size_t countargs(Type *t);
ArgType classify(Type *t);
int isaggregate(Type *t);
int stacknode(Node *n);
int floatnode(Node *n);
void breakhere();
void dumpasm(Isel *s, FILE *fd);
size_t alignto(size_t sz, Type *t);
|
40fa73638a97c6c2e08aae6912d51cf1b0cab1c3
|
2c052c996d4267623276a681308bf87ea7388f60
|
/src/runtime/heap/heap.h
|
e37e94473d47f7488968401729963a9dbd30b955
|
[
"Apache-2.0"
] |
permissive
|
nanovms/nanos
|
17d3ce113b63c4370e40d291b8fd8fb9d943c02d
|
9085e091e5250fc58bf036591c8959e05fd7957f
|
refs/heads/master
| 2023-08-25T16:49:14.521701
| 2023-08-25T14:00:54
| 2023-08-25T14:14:13
| 115,159,616
| 2,055
| 131
|
Apache-2.0
| 2023-09-14T17:16:19
| 2017-12-23T00:25:34
|
C
|
UTF-8
|
C
| false
| false
| 3,218
|
h
|
heap.h
|
// should consider a drain function
struct heap {
struct table metadata;
u64 (*alloc)(struct heap *h, bytes b);
void (*dealloc)(struct heap *h, u64 a, bytes b);
void (*destroy)(struct heap *h);
bytes (*allocated)(struct heap *h);
bytes (*total)(struct heap *h);
value (*management)(struct heap *h);
bytes pagesize;
};
typedef struct backed_heap {
struct heap h;
void *(*alloc_map)(struct backed_heap *bh, bytes len, u64 *phys);
void (*dealloc_unmap)(struct backed_heap *bh, void *virt, u64 phys, bytes len);
} *backed_heap;
#define alloc_map(__bh, __l, __p) ((__bh)->alloc_map(__bh, __l, __p))
#define dealloc_unmap(__bh, __v, __p, __l) ((__bh)->dealloc_unmap(__bh, __v, __p, __l))
typedef struct caching_heap {
struct heap h;
bytes (*drain)(struct caching_heap *ch, bytes len, bytes retain);
} *caching_heap;
#define CACHE_DRAIN_ALL ((bytes)-1)
#define cache_drain(__ch, __l, __r) ((__ch)->drain(__ch, __l, __r))
heap debug_heap(heap m, heap p);
heap mem_debug(heap m, heap p, u64 padsize);
heap mem_debug_objcache(heap meta, heap parent, u64 objsize, u64 pagesize);
static inline u64 heap_allocated(heap h)
{
return h->allocated ? h->allocated(h) : INVALID_PHYSICAL;
}
static inline u64 heap_total(heap h)
{
return h->total ? h->total(h) : INVALID_PHYSICAL;
}
static inline u64 heap_free(heap h)
{
return heap_total(h) - heap_allocated(h);
}
static inline value heap_management(heap h)
{
return h->management ? h->management(h) : 0;
}
heap wrap_freelist(heap meta, heap parent, bytes size);
caching_heap allocate_objcache(heap meta, heap parent, bytes objsize, bytes pagesize, boolean locking);
caching_heap allocate_wrapped_objcache(heap meta, heap parent, bytes objsize, bytes pagesize, heap wrapper);
caching_heap allocate_objcache_preallocated(heap meta, heap parent, bytes objsize, bytes pagesize, u64 prealloc_count, boolean prealloc_only);
boolean objcache_validate(heap h);
heap objcache_from_object(u64 obj, bytes parent_pagesize);
heap allocate_mcache(heap meta, heap parent, int min_order, int max_order, bytes pagesize);
heap reserve_heap_wrapper(heap meta, heap parent, bytes reserved);
backed_heap reserve_backed_heap_wrapper(heap meta, backed_heap parent, bytes reserved);
// really internals
static inline void *page_of(void *x, bytes pagesize)
{
return((void *)((unsigned long)x &
(~((unsigned long)pagesize-1))));
}
static inline int subdivide(int quantum, int per, int s, int o)
{
// this overallocates
int base = ((s-o)/quantum) * per;
return (pad(o + base, quantum));
}
#define allocate_u64(__h, __b) ((__h)->alloc(__h, __b))
#define allocate(__h, __b) pointer_from_u64(allocate_u64(__h, __b))
#define deallocate_u64(__h, __b, __s) ((__h)->dealloc(__h, __b, __s))
#define deallocate(__h, __b, __s) deallocate_u64(__h, u64_from_pointer(__b), __s)
#define allocate_zero(__h, __b) ({\
u64 __len = __b;\
void *x = allocate(__h, __len); \
if (x != INVALID_ADDRESS) zero(x, __len); \
x; })
#define destroy_heap(__h) do { if (__h) (__h)->destroy(__h); } while(0)
static inline void leak(heap h, u64 x, bytes length)
{
}
|
fe5d27f7b122fe05402eef88c649b8aa1ce8bd8e
|
d10090b0c23c789baaac67f40cccb61f39554e07
|
/Chapter_13/Src/mainUsbReadTest.c
|
fa0390b658459fb08afa92966c8b59365ec44196
|
[
"MIT"
] |
permissive
|
PacktPublishing/Hands-On-RTOS-with-Microcontrollers
|
b6b78ebf4a462a10c115338f85edb2769ac6cd58
|
9cb30e4846482cd2cf19aa631757bfe916cc245f
|
refs/heads/master
| 2023-08-08T16:48:34.456178
| 2023-01-30T10:00:49
| 2023-01-30T10:00:49
| 206,287,816
| 128
| 84
|
MIT
| 2023-07-22T15:18:15
| 2019-09-04T09:55:46
|
C
|
UTF-8
|
C
| false
| false
| 3,673
|
c
|
mainUsbReadTest.c
|
/**
* MIT License
*
* Copyright (c) 2019 Brian Amos
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
#include <FreeRTOS.h>
#include <task.h>
#include <Nucleo_F767ZI_GPIO.h>
#include <SEGGER_SYSVIEW.h>
#include <Nucleo_F767ZI_Init.h>
#include <stm32f7xx_hal.h>
#include "VirtualCommDriverMultiTask.h"
#include <string.h>
#include <stdio.h>
// some common variables to use for each task
// 128 * 4 = 512 bytes
//(recommended min stack size per task)
#define STACK_SIZE 128
void monitorUsbRx( void* NotUsed);
void usbPrintOutTask( void* Number);
int main(void)
{
BaseType_t retVal;
HWInit();
VirtualCommInit(256, configMAX_PRIORITIES-2);
SEGGER_SYSVIEW_Conf();
HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4); //ensure proper priority grouping for freeRTOS
//setup tasks, making sure they have been properly created before moving on
retVal = xTaskCreate(monitorUsbRx, "usbRx", STACK_SIZE, NULL, configMAX_PRIORITIES-1, NULL);
assert_param(retVal == pdPASS);
retVal = xTaskCreate(usbPrintOutTask, "usbprint1", STACK_SIZE, (void*)1, tskIDLE_PRIORITY + 2, NULL);
assert_param(retVal == pdPASS);
retVal = xTaskCreate(usbPrintOutTask, "usbprint2", STACK_SIZE, (void*)2, tskIDLE_PRIORITY + 2, NULL);
assert_param(retVal == pdPASS);
//start the scheduler - shouldn't return unless there's a problem
vTaskStartScheduler();
//if you've wound up here, there is likely an issue with overrunning the freeRTOS heap
while(1)
{
}
}
/**
* this is a simple monitor task that will print anythign received over
* USB to the SEGGER SYSVIEW
*/
void monitorUsbRx( void* NotUsed)
{
#define CURR_MSG_LEN 100
char currentMsg[CURR_MSG_LEN];
while(1)
{
memset(currentMsg, 0, CURR_MSG_LEN);
//since this is the only task receiving from the streamBuffer, we don't
//need to acquire a mutex before accessing it
//if more than one task was to be receiving, vcom_rxStream would require
//protection from a mutex
xStreamBufferReceive( *GetUsbRxStreamBuff(),
currentMsg,
CURR_MSG_LEN-1, //make sure to leave a null terminator
99);
SEGGER_SYSVIEW_PrintfHost(currentMsg);
}
}
/**
* Define a single task which prints out a string with the argument
* Number appended to it (for easy identification)
*/
void usbPrintOutTask( void* Number)
{
#define TESTSIZE 10
char testString[TESTSIZE];
memset(testString, 0, TESTSIZE);
snprintf(testString, TESTSIZE, "task %i\n", (int) Number);
while(1)
{
/**
* transmit the test string, waiting up to 100 mS for space to become available
* in the buffer
*/
TransmitUsbData((uint8_t*)testString, sizeof(testString), 100);
vTaskDelay(2);
}
}
|
b57e9a8a70df9636e317fa645c0096aeba01cbaf
|
79d343002bb63a44f8ab0dbac0c9f4ec54078c3a
|
/lib/include/ppc_wrappers/mm_malloc.h
|
7c1e625e44d511f7c82218be95a589d86bfc5d4f
|
[
"MIT"
] |
permissive
|
ziglang/zig
|
4aa75d8d3bcc9e39bf61d265fd84b7f005623fc5
|
f4c9e19bc3213c2bc7e03d7b06d7129882f39f6c
|
refs/heads/master
| 2023-08-31T13:16:45.980913
| 2023-08-31T05:50:29
| 2023-08-31T05:50:29
| 40,276,274
| 25,560
| 2,399
|
MIT
| 2023-09-14T21:09:50
| 2015-08-06T00:51:28
|
Zig
|
UTF-8
|
C
| false
| false
| 1,337
|
h
|
mm_malloc.h
|
/*===---- mm_malloc.h - Implementation of _mm_malloc and _mm_free ----------===
*
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
* See https://llvm.org/LICENSE.txt for license information.
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*
*===-----------------------------------------------------------------------===
*/
#ifndef _MM_MALLOC_H_INCLUDED
#define _MM_MALLOC_H_INCLUDED
#if defined(__powerpc64__) && \
(defined(__linux__) || defined(__FreeBSD__) || defined(_AIX))
#include <stdlib.h>
/* We can't depend on <stdlib.h> since the prototype of posix_memalign
may not be visible. */
#ifndef __cplusplus
extern int posix_memalign(void **, size_t, size_t);
#else
extern "C" int posix_memalign(void **, size_t, size_t);
#endif
static __inline void *_mm_malloc(size_t __size, size_t __alignment) {
/* PowerPC64 ELF V2 ABI requires quadword alignment. */
size_t __vec_align = sizeof(__vector float);
void *__ptr;
if (__alignment < __vec_align)
__alignment = __vec_align;
if (posix_memalign(&__ptr, __alignment, __size) == 0)
return __ptr;
else
return NULL;
}
static __inline void _mm_free(void *__ptr) { free(__ptr); }
#else
#include_next <mm_malloc.h>
#endif
#endif /* _MM_MALLOC_H_INCLUDED */
|
59527fbfe74cb2ce9dc5d48585ecaee6d7c0d406
|
5eff7a36d9a9917dce9111f0c3074375fe6f7656
|
/lib/mesa/src/gallium/drivers/iris/iris_program.c
|
931bfc30d0a1b0e11e68ccb51425179bbd59b470
|
[] |
no_license
|
openbsd/xenocara
|
cb392d02ebba06f6ff7d826fd8a89aa3b8401779
|
a012b5de33ea0b977095d77316a521195b26cc6b
|
refs/heads/master
| 2023-08-25T12:16:58.862008
| 2023-08-12T16:16:25
| 2023-08-12T16:16:25
| 66,967,384
| 177
| 66
| null | 2023-07-22T18:12:37
| 2016-08-30T18:36:01
|
C
|
UTF-8
|
C
| false
| false
| 107,780
|
c
|
iris_program.c
|
/*
* Copyright © 2017 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/**
* @file iris_program.c
*
* This file contains the driver interface for compiling shaders.
*
* See iris_program_cache.c for the in-memory program cache where the
* compiled shaders are stored.
*/
#include <stdio.h>
#include <errno.h>
#include "pipe/p_defines.h"
#include "pipe/p_state.h"
#include "pipe/p_context.h"
#include "pipe/p_screen.h"
#include "util/u_atomic.h"
#include "util/u_upload_mgr.h"
#include "util/u_debug.h"
#include "util/u_async_debug.h"
#include "compiler/nir/nir.h"
#include "compiler/nir/nir_builder.h"
#include "compiler/nir/nir_serialize.h"
#include "intel/compiler/brw_compiler.h"
#include "intel/compiler/brw_nir.h"
#include "intel/compiler/brw_prim.h"
#include "iris_context.h"
#include "nir/tgsi_to_nir.h"
#define KEY_INIT(prefix) \
.prefix.program_string_id = ish->program_id, \
.prefix.limit_trig_input_range = screen->driconf.limit_trig_input_range
#define BRW_KEY_INIT(gen, prog_id, limit_trig_input) \
.base.program_string_id = prog_id, \
.base.limit_trig_input_range = limit_trig_input, \
.base.tex.swizzles[0 ... BRW_MAX_SAMPLERS - 1] = 0x688, \
.base.tex.compressed_multisample_layout_mask = ~0, \
.base.tex.msaa_16 = (gen >= 9 ? ~0 : 0)
struct iris_threaded_compile_job {
struct iris_screen *screen;
struct u_upload_mgr *uploader;
struct util_debug_callback *dbg;
struct iris_uncompiled_shader *ish;
struct iris_compiled_shader *shader;
};
static unsigned
get_new_program_id(struct iris_screen *screen)
{
return p_atomic_inc_return(&screen->program_id);
}
void
iris_finalize_program(struct iris_compiled_shader *shader,
struct brw_stage_prog_data *prog_data,
uint32_t *streamout,
enum brw_param_builtin *system_values,
unsigned num_system_values,
unsigned kernel_input_size,
unsigned num_cbufs,
const struct iris_binding_table *bt)
{
shader->prog_data = prog_data;
shader->streamout = streamout;
shader->system_values = system_values;
shader->num_system_values = num_system_values;
shader->kernel_input_size = kernel_input_size;
shader->num_cbufs = num_cbufs;
shader->bt = *bt;
ralloc_steal(shader, shader->prog_data);
ralloc_steal(shader->prog_data, (void *)prog_data->relocs);
ralloc_steal(shader->prog_data, prog_data->param);
ralloc_steal(shader, shader->streamout);
ralloc_steal(shader, shader->system_values);
}
static struct brw_vs_prog_key
iris_to_brw_vs_key(const struct iris_screen *screen,
const struct iris_vs_prog_key *key)
{
return (struct brw_vs_prog_key) {
BRW_KEY_INIT(screen->devinfo.ver, key->vue.base.program_string_id,
key->vue.base.limit_trig_input_range),
/* Don't tell the backend about our clip plane constants, we've
* already lowered them in NIR and don't want it doing it again.
*/
.nr_userclip_plane_consts = 0,
};
}
static struct brw_tcs_prog_key
iris_to_brw_tcs_key(const struct iris_screen *screen,
const struct iris_tcs_prog_key *key)
{
return (struct brw_tcs_prog_key) {
BRW_KEY_INIT(screen->devinfo.ver, key->vue.base.program_string_id,
key->vue.base.limit_trig_input_range),
._tes_primitive_mode = key->_tes_primitive_mode,
.input_vertices = key->input_vertices,
.patch_outputs_written = key->patch_outputs_written,
.outputs_written = key->outputs_written,
.quads_workaround = key->quads_workaround,
};
}
static struct brw_tes_prog_key
iris_to_brw_tes_key(const struct iris_screen *screen,
const struct iris_tes_prog_key *key)
{
return (struct brw_tes_prog_key) {
BRW_KEY_INIT(screen->devinfo.ver, key->vue.base.program_string_id,
key->vue.base.limit_trig_input_range),
.patch_inputs_read = key->patch_inputs_read,
.inputs_read = key->inputs_read,
};
}
static struct brw_gs_prog_key
iris_to_brw_gs_key(const struct iris_screen *screen,
const struct iris_gs_prog_key *key)
{
return (struct brw_gs_prog_key) {
BRW_KEY_INIT(screen->devinfo.ver, key->vue.base.program_string_id,
key->vue.base.limit_trig_input_range),
};
}
static struct brw_wm_prog_key
iris_to_brw_fs_key(const struct iris_screen *screen,
const struct iris_fs_prog_key *key)
{
return (struct brw_wm_prog_key) {
BRW_KEY_INIT(screen->devinfo.ver, key->base.program_string_id,
key->base.limit_trig_input_range),
.nr_color_regions = key->nr_color_regions,
.flat_shade = key->flat_shade,
.alpha_test_replicate_alpha = key->alpha_test_replicate_alpha,
.alpha_to_coverage = key->alpha_to_coverage,
.clamp_fragment_color = key->clamp_fragment_color,
.persample_interp = key->persample_interp,
.multisample_fbo = key->multisample_fbo,
.force_dual_color_blend = key->force_dual_color_blend,
.coherent_fb_fetch = key->coherent_fb_fetch,
.color_outputs_valid = key->color_outputs_valid,
.input_slots_valid = key->input_slots_valid,
.ignore_sample_mask_out = !key->multisample_fbo,
};
}
static struct brw_cs_prog_key
iris_to_brw_cs_key(const struct iris_screen *screen,
const struct iris_cs_prog_key *key)
{
return (struct brw_cs_prog_key) {
BRW_KEY_INIT(screen->devinfo.ver, key->base.program_string_id,
key->base.limit_trig_input_range),
};
}
static void *
upload_state(struct u_upload_mgr *uploader,
struct iris_state_ref *ref,
unsigned size,
unsigned alignment)
{
void *p = NULL;
u_upload_alloc(uploader, 0, size, alignment, &ref->offset, &ref->res, &p);
return p;
}
void
iris_upload_ubo_ssbo_surf_state(struct iris_context *ice,
struct pipe_shader_buffer *buf,
struct iris_state_ref *surf_state,
isl_surf_usage_flags_t usage)
{
struct pipe_context *ctx = &ice->ctx;
struct iris_screen *screen = (struct iris_screen *) ctx->screen;
bool ssbo = usage & ISL_SURF_USAGE_STORAGE_BIT;
void *map =
upload_state(ice->state.surface_uploader, surf_state,
screen->isl_dev.ss.size, 64);
if (!unlikely(map)) {
surf_state->res = NULL;
return;
}
struct iris_resource *res = (void *) buf->buffer;
struct iris_bo *surf_bo = iris_resource_bo(surf_state->res);
surf_state->offset += iris_bo_offset_from_base_address(surf_bo);
const bool dataport = ssbo || !screen->compiler->indirect_ubos_use_sampler;
isl_buffer_fill_state(&screen->isl_dev, map,
.address = res->bo->address + res->offset +
buf->buffer_offset,
.size_B = buf->buffer_size - res->offset,
.format = dataport ? ISL_FORMAT_RAW
: ISL_FORMAT_R32G32B32A32_FLOAT,
.swizzle = ISL_SWIZZLE_IDENTITY,
.stride_B = 1,
.mocs = iris_mocs(res->bo, &screen->isl_dev, usage));
}
static nir_ssa_def *
get_aoa_deref_offset(nir_builder *b,
nir_deref_instr *deref,
unsigned elem_size)
{
unsigned array_size = elem_size;
nir_ssa_def *offset = nir_imm_int(b, 0);
while (deref->deref_type != nir_deref_type_var) {
assert(deref->deref_type == nir_deref_type_array);
/* This level's element size is the previous level's array size */
nir_ssa_def *index = nir_ssa_for_src(b, deref->arr.index, 1);
assert(deref->arr.index.ssa);
offset = nir_iadd(b, offset,
nir_imul(b, index, nir_imm_int(b, array_size)));
deref = nir_deref_instr_parent(deref);
assert(glsl_type_is_array(deref->type));
array_size *= glsl_get_length(deref->type);
}
/* Accessing an invalid surface index with the dataport can result in a
* hang. According to the spec "if the index used to select an individual
* element is negative or greater than or equal to the size of the array,
* the results of the operation are undefined but may not lead to
* termination" -- which is one of the possible outcomes of the hang.
* Clamp the index to prevent access outside of the array bounds.
*/
return nir_umin(b, offset, nir_imm_int(b, array_size - elem_size));
}
static void
iris_lower_storage_image_derefs(nir_shader *nir)
{
nir_function_impl *impl = nir_shader_get_entrypoint(nir);
nir_builder b;
nir_builder_init(&b, impl);
nir_foreach_block(block, impl) {
nir_foreach_instr_safe(instr, block) {
if (instr->type != nir_instr_type_intrinsic)
continue;
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
switch (intrin->intrinsic) {
case nir_intrinsic_image_deref_load:
case nir_intrinsic_image_deref_store:
case nir_intrinsic_image_deref_atomic_add:
case nir_intrinsic_image_deref_atomic_imin:
case nir_intrinsic_image_deref_atomic_umin:
case nir_intrinsic_image_deref_atomic_imax:
case nir_intrinsic_image_deref_atomic_umax:
case nir_intrinsic_image_deref_atomic_and:
case nir_intrinsic_image_deref_atomic_or:
case nir_intrinsic_image_deref_atomic_xor:
case nir_intrinsic_image_deref_atomic_exchange:
case nir_intrinsic_image_deref_atomic_comp_swap:
case nir_intrinsic_image_deref_size:
case nir_intrinsic_image_deref_samples:
case nir_intrinsic_image_deref_load_raw_intel:
case nir_intrinsic_image_deref_store_raw_intel: {
nir_deref_instr *deref = nir_src_as_deref(intrin->src[0]);
nir_variable *var = nir_deref_instr_get_variable(deref);
b.cursor = nir_before_instr(&intrin->instr);
nir_ssa_def *index =
nir_iadd(&b, nir_imm_int(&b, var->data.driver_location),
get_aoa_deref_offset(&b, deref, 1));
nir_rewrite_image_intrinsic(intrin, index, false);
break;
}
default:
break;
}
}
}
}
static bool
iris_uses_image_atomic(const nir_shader *shader)
{
nir_foreach_function(function, shader) {
if (function->impl == NULL)
continue;
nir_foreach_block(block, function->impl) {
nir_foreach_instr(instr, block) {
if (instr->type != nir_instr_type_intrinsic)
continue;
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
switch (intrin->intrinsic) {
case nir_intrinsic_image_deref_atomic_add:
case nir_intrinsic_image_deref_atomic_imin:
case nir_intrinsic_image_deref_atomic_umin:
case nir_intrinsic_image_deref_atomic_imax:
case nir_intrinsic_image_deref_atomic_umax:
case nir_intrinsic_image_deref_atomic_and:
case nir_intrinsic_image_deref_atomic_or:
case nir_intrinsic_image_deref_atomic_xor:
case nir_intrinsic_image_deref_atomic_exchange:
case nir_intrinsic_image_deref_atomic_comp_swap:
unreachable("Should have been lowered in "
"iris_lower_storage_image_derefs");
case nir_intrinsic_image_atomic_add:
case nir_intrinsic_image_atomic_imin:
case nir_intrinsic_image_atomic_umin:
case nir_intrinsic_image_atomic_imax:
case nir_intrinsic_image_atomic_umax:
case nir_intrinsic_image_atomic_and:
case nir_intrinsic_image_atomic_or:
case nir_intrinsic_image_atomic_xor:
case nir_intrinsic_image_atomic_exchange:
case nir_intrinsic_image_atomic_comp_swap:
return true;
default:
break;
}
}
}
}
return false;
}
/**
* Undo nir_lower_passthrough_edgeflags but keep the inputs_read flag.
*/
static bool
iris_fix_edge_flags(nir_shader *nir)
{
if (nir->info.stage != MESA_SHADER_VERTEX) {
nir_shader_preserve_all_metadata(nir);
return false;
}
nir_variable *var = nir_find_variable_with_location(nir, nir_var_shader_out,
VARYING_SLOT_EDGE);
if (!var) {
nir_shader_preserve_all_metadata(nir);
return false;
}
var->data.mode = nir_var_shader_temp;
nir->info.outputs_written &= ~VARYING_BIT_EDGE;
nir->info.inputs_read &= ~VERT_BIT_EDGEFLAG;
nir_fixup_deref_modes(nir);
nir_foreach_function(f, nir) {
if (f->impl) {
nir_metadata_preserve(f->impl, nir_metadata_block_index |
nir_metadata_dominance |
nir_metadata_live_ssa_defs |
nir_metadata_loop_analysis);
}
}
return true;
}
/**
* Fix an uncompiled shader's stream output info.
*
* Core Gallium stores output->register_index as a "slot" number, where
* slots are assigned consecutively to all outputs in info->outputs_written.
* This naive packing of outputs doesn't work for us - we too have slots,
* but the layout is defined by the VUE map, which we won't have until we
* compile a specific shader variant. So, we remap these and simply store
* VARYING_SLOT_* in our copy's output->register_index fields.
*
* We also fix up VARYING_SLOT_{LAYER,VIEWPORT,PSIZ} to select the Y/Z/W
* components of our VUE header. See brw_vue_map.c for the layout.
*/
static void
update_so_info(struct pipe_stream_output_info *so_info,
uint64_t outputs_written)
{
uint8_t reverse_map[64] = {};
unsigned slot = 0;
while (outputs_written) {
reverse_map[slot++] = u_bit_scan64(&outputs_written);
}
for (unsigned i = 0; i < so_info->num_outputs; i++) {
struct pipe_stream_output *output = &so_info->output[i];
/* Map Gallium's condensed "slots" back to real VARYING_SLOT_* enums */
output->register_index = reverse_map[output->register_index];
/* The VUE header contains three scalar fields packed together:
* - gl_PointSize is stored in VARYING_SLOT_PSIZ.w
* - gl_Layer is stored in VARYING_SLOT_PSIZ.y
* - gl_ViewportIndex is stored in VARYING_SLOT_PSIZ.z
*/
switch (output->register_index) {
case VARYING_SLOT_LAYER:
assert(output->num_components == 1);
output->register_index = VARYING_SLOT_PSIZ;
output->start_component = 1;
break;
case VARYING_SLOT_VIEWPORT:
assert(output->num_components == 1);
output->register_index = VARYING_SLOT_PSIZ;
output->start_component = 2;
break;
case VARYING_SLOT_PSIZ:
assert(output->num_components == 1);
output->start_component = 3;
break;
}
//info->outputs_written |= 1ull << output->register_index;
}
}
static void
setup_vec4_image_sysval(uint32_t *sysvals, uint32_t idx,
unsigned offset, unsigned n)
{
assert(offset % sizeof(uint32_t) == 0);
for (unsigned i = 0; i < n; ++i)
sysvals[i] = BRW_PARAM_IMAGE(idx, offset / sizeof(uint32_t) + i);
for (unsigned i = n; i < 4; ++i)
sysvals[i] = BRW_PARAM_BUILTIN_ZERO;
}
/**
* Associate NIR uniform variables with the prog_data->param[] mechanism
* used by the backend. Also, decide which UBOs we'd like to push in an
* ideal situation (though the backend can reduce this).
*/
static void
iris_setup_uniforms(const struct brw_compiler *compiler,
void *mem_ctx,
nir_shader *nir,
struct brw_stage_prog_data *prog_data,
unsigned kernel_input_size,
enum brw_param_builtin **out_system_values,
unsigned *out_num_system_values,
unsigned *out_num_cbufs)
{
UNUSED const struct intel_device_info *devinfo = compiler->devinfo;
unsigned system_values_start = ALIGN(kernel_input_size, sizeof(uint32_t));
const unsigned IRIS_MAX_SYSTEM_VALUES =
PIPE_MAX_SHADER_IMAGES * BRW_IMAGE_PARAM_SIZE;
enum brw_param_builtin *system_values =
rzalloc_array(mem_ctx, enum brw_param_builtin, IRIS_MAX_SYSTEM_VALUES);
unsigned num_system_values = 0;
unsigned patch_vert_idx = -1;
unsigned ucp_idx[IRIS_MAX_CLIP_PLANES];
unsigned img_idx[PIPE_MAX_SHADER_IMAGES];
unsigned variable_group_size_idx = -1;
unsigned work_dim_idx = -1;
memset(ucp_idx, -1, sizeof(ucp_idx));
memset(img_idx, -1, sizeof(img_idx));
nir_function_impl *impl = nir_shader_get_entrypoint(nir);
nir_builder b;
nir_builder_init(&b, impl);
b.cursor = nir_before_block(nir_start_block(impl));
nir_ssa_def *temp_ubo_name = nir_ssa_undef(&b, 1, 32);
/* Turn system value intrinsics into uniforms */
nir_foreach_block(block, impl) {
nir_foreach_instr_safe(instr, block) {
if (instr->type != nir_instr_type_intrinsic)
continue;
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
nir_ssa_def *offset;
switch (intrin->intrinsic) {
case nir_intrinsic_load_constant: {
unsigned load_size = intrin->dest.ssa.num_components *
intrin->dest.ssa.bit_size / 8;
unsigned load_align = intrin->dest.ssa.bit_size / 8;
/* This one is special because it reads from the shader constant
* data and not cbuf0 which gallium uploads for us.
*/
b.cursor = nir_instr_remove(&intrin->instr);
nir_ssa_def *offset =
nir_iadd_imm(&b, nir_ssa_for_src(&b, intrin->src[0], 1),
nir_intrinsic_base(intrin));
assert(load_size < b.shader->constant_data_size);
unsigned max_offset = b.shader->constant_data_size - load_size;
offset = nir_umin(&b, offset, nir_imm_int(&b, max_offset));
nir_ssa_def *const_data_base_addr = nir_pack_64_2x32_split(&b,
nir_load_reloc_const_intel(&b, BRW_SHADER_RELOC_CONST_DATA_ADDR_LOW),
nir_load_reloc_const_intel(&b, BRW_SHADER_RELOC_CONST_DATA_ADDR_HIGH));
nir_ssa_def *data =
nir_load_global_constant(&b, nir_iadd(&b, const_data_base_addr,
nir_u2u64(&b, offset)),
load_align,
intrin->dest.ssa.num_components,
intrin->dest.ssa.bit_size);
nir_ssa_def_rewrite_uses(&intrin->dest.ssa,
data);
continue;
}
case nir_intrinsic_load_user_clip_plane: {
unsigned ucp = nir_intrinsic_ucp_id(intrin);
if (ucp_idx[ucp] == -1) {
ucp_idx[ucp] = num_system_values;
num_system_values += 4;
}
for (int i = 0; i < 4; i++) {
system_values[ucp_idx[ucp] + i] =
BRW_PARAM_BUILTIN_CLIP_PLANE(ucp, i);
}
b.cursor = nir_before_instr(instr);
offset = nir_imm_int(&b, system_values_start +
ucp_idx[ucp] * sizeof(uint32_t));
break;
}
case nir_intrinsic_load_patch_vertices_in:
if (patch_vert_idx == -1)
patch_vert_idx = num_system_values++;
system_values[patch_vert_idx] =
BRW_PARAM_BUILTIN_PATCH_VERTICES_IN;
b.cursor = nir_before_instr(instr);
offset = nir_imm_int(&b, system_values_start +
patch_vert_idx * sizeof(uint32_t));
break;
case nir_intrinsic_image_deref_load_param_intel: {
assert(devinfo->ver < 9);
nir_deref_instr *deref = nir_src_as_deref(intrin->src[0]);
nir_variable *var = nir_deref_instr_get_variable(deref);
if (img_idx[var->data.binding] == -1) {
/* GL only allows arrays of arrays of images. */
assert(glsl_type_is_image(glsl_without_array(var->type)));
unsigned num_images = MAX2(1, glsl_get_aoa_size(var->type));
for (int i = 0; i < num_images; i++) {
const unsigned img = var->data.binding + i;
img_idx[img] = num_system_values;
num_system_values += BRW_IMAGE_PARAM_SIZE;
uint32_t *img_sv = &system_values[img_idx[img]];
setup_vec4_image_sysval(
img_sv + BRW_IMAGE_PARAM_OFFSET_OFFSET, img,
offsetof(struct brw_image_param, offset), 2);
setup_vec4_image_sysval(
img_sv + BRW_IMAGE_PARAM_SIZE_OFFSET, img,
offsetof(struct brw_image_param, size), 3);
setup_vec4_image_sysval(
img_sv + BRW_IMAGE_PARAM_STRIDE_OFFSET, img,
offsetof(struct brw_image_param, stride), 4);
setup_vec4_image_sysval(
img_sv + BRW_IMAGE_PARAM_TILING_OFFSET, img,
offsetof(struct brw_image_param, tiling), 3);
setup_vec4_image_sysval(
img_sv + BRW_IMAGE_PARAM_SWIZZLING_OFFSET, img,
offsetof(struct brw_image_param, swizzling), 2);
}
}
b.cursor = nir_before_instr(instr);
offset = nir_iadd(&b,
get_aoa_deref_offset(&b, deref, BRW_IMAGE_PARAM_SIZE * 4),
nir_imm_int(&b, system_values_start +
img_idx[var->data.binding] * 4 +
nir_intrinsic_base(intrin) * 16));
break;
}
case nir_intrinsic_load_workgroup_size: {
assert(nir->info.workgroup_size_variable);
if (variable_group_size_idx == -1) {
variable_group_size_idx = num_system_values;
num_system_values += 3;
for (int i = 0; i < 3; i++) {
system_values[variable_group_size_idx + i] =
BRW_PARAM_BUILTIN_WORK_GROUP_SIZE_X + i;
}
}
b.cursor = nir_before_instr(instr);
offset = nir_imm_int(&b, system_values_start +
variable_group_size_idx * sizeof(uint32_t));
break;
}
case nir_intrinsic_load_work_dim: {
if (work_dim_idx == -1) {
work_dim_idx = num_system_values++;
system_values[work_dim_idx] = BRW_PARAM_BUILTIN_WORK_DIM;
}
b.cursor = nir_before_instr(instr);
offset = nir_imm_int(&b, system_values_start +
work_dim_idx * sizeof(uint32_t));
break;
}
case nir_intrinsic_load_kernel_input: {
assert(nir_intrinsic_base(intrin) +
nir_intrinsic_range(intrin) <= kernel_input_size);
b.cursor = nir_before_instr(instr);
offset = nir_iadd_imm(&b, intrin->src[0].ssa,
nir_intrinsic_base(intrin));
break;
}
default:
continue;
}
nir_ssa_def *load =
nir_load_ubo(&b, intrin->dest.ssa.num_components, intrin->dest.ssa.bit_size,
temp_ubo_name, offset,
.align_mul = 4,
.align_offset = 0,
.range_base = 0,
.range = ~0);
nir_ssa_def_rewrite_uses(&intrin->dest.ssa,
load);
nir_instr_remove(instr);
}
}
nir_validate_shader(nir, "before remapping");
/* Uniforms are stored in constant buffer 0, the
* user-facing UBOs are indexed by one. So if any constant buffer is
* needed, the constant buffer 0 will be needed, so account for it.
*/
unsigned num_cbufs = nir->info.num_ubos;
if (num_cbufs || nir->num_uniforms)
num_cbufs++;
/* Place the new params in a new cbuf. */
if (num_system_values > 0 || kernel_input_size > 0) {
unsigned sysval_cbuf_index = num_cbufs;
num_cbufs++;
system_values = reralloc(mem_ctx, system_values, enum brw_param_builtin,
num_system_values);
nir_foreach_block(block, impl) {
nir_foreach_instr_safe(instr, block) {
if (instr->type != nir_instr_type_intrinsic)
continue;
nir_intrinsic_instr *load = nir_instr_as_intrinsic(instr);
if (load->intrinsic != nir_intrinsic_load_ubo)
continue;
b.cursor = nir_before_instr(instr);
assert(load->src[0].is_ssa);
if (load->src[0].ssa == temp_ubo_name) {
nir_ssa_def *imm = nir_imm_int(&b, sysval_cbuf_index);
nir_instr_rewrite_src(instr, &load->src[0],
nir_src_for_ssa(imm));
}
}
}
/* We need to fold the new iadds for brw_nir_analyze_ubo_ranges */
nir_opt_constant_folding(nir);
} else {
ralloc_free(system_values);
system_values = NULL;
}
assert(num_cbufs < PIPE_MAX_CONSTANT_BUFFERS);
nir_validate_shader(nir, "after remap");
/* We don't use params[] but gallium leaves num_uniforms set. We use this
* to detect when cbuf0 exists but we don't need it anymore when we get
* here. Instead, zero it out so that the back-end doesn't get confused
* when nr_params * 4 != num_uniforms != nr_params * 4.
*/
nir->num_uniforms = 0;
*out_system_values = system_values;
*out_num_system_values = num_system_values;
*out_num_cbufs = num_cbufs;
}
static const char *surface_group_names[] = {
[IRIS_SURFACE_GROUP_RENDER_TARGET] = "render target",
[IRIS_SURFACE_GROUP_RENDER_TARGET_READ] = "non-coherent render target read",
[IRIS_SURFACE_GROUP_CS_WORK_GROUPS] = "CS work groups",
[IRIS_SURFACE_GROUP_TEXTURE_LOW64] = "texture",
[IRIS_SURFACE_GROUP_TEXTURE_HIGH64] = "texture",
[IRIS_SURFACE_GROUP_UBO] = "ubo",
[IRIS_SURFACE_GROUP_SSBO] = "ssbo",
[IRIS_SURFACE_GROUP_IMAGE] = "image",
};
static void
iris_print_binding_table(FILE *fp, const char *name,
const struct iris_binding_table *bt)
{
STATIC_ASSERT(ARRAY_SIZE(surface_group_names) == IRIS_SURFACE_GROUP_COUNT);
uint32_t total = 0;
uint32_t compacted = 0;
for (int i = 0; i < IRIS_SURFACE_GROUP_COUNT; i++) {
uint32_t size = bt->sizes[i];
total += size;
if (size)
compacted += util_bitcount64(bt->used_mask[i]);
}
if (total == 0) {
fprintf(fp, "Binding table for %s is empty\n\n", name);
return;
}
if (total != compacted) {
fprintf(fp, "Binding table for %s "
"(compacted to %u entries from %u entries)\n",
name, compacted, total);
} else {
fprintf(fp, "Binding table for %s (%u entries)\n", name, total);
}
uint32_t entry = 0;
for (int i = 0; i < IRIS_SURFACE_GROUP_COUNT; i++) {
uint64_t mask = bt->used_mask[i];
while (mask) {
int index = u_bit_scan64(&mask);
fprintf(fp, " [%u] %s #%d\n", entry++, surface_group_names[i], index);
}
}
fprintf(fp, "\n");
}
enum {
/* Max elements in a surface group. */
SURFACE_GROUP_MAX_ELEMENTS = 64,
};
/**
* Map a <group, index> pair to a binding table index.
*
* For example: <UBO, 5> => binding table index 12
*/
uint32_t
iris_group_index_to_bti(const struct iris_binding_table *bt,
enum iris_surface_group group, uint32_t index)
{
assert(index < bt->sizes[group]);
uint64_t mask = bt->used_mask[group];
uint64_t bit = 1ull << index;
if (bit & mask) {
return bt->offsets[group] + util_bitcount64((bit - 1) & mask);
} else {
return IRIS_SURFACE_NOT_USED;
}
}
/**
* Map a binding table index back to a <group, index> pair.
*
* For example: binding table index 12 => <UBO, 5>
*/
uint32_t
iris_bti_to_group_index(const struct iris_binding_table *bt,
enum iris_surface_group group, uint32_t bti)
{
uint64_t used_mask = bt->used_mask[group];
assert(bti >= bt->offsets[group]);
uint32_t c = bti - bt->offsets[group];
while (used_mask) {
int i = u_bit_scan64(&used_mask);
if (c == 0)
return i;
c--;
}
return IRIS_SURFACE_NOT_USED;
}
static void
rewrite_src_with_bti(nir_builder *b, struct iris_binding_table *bt,
nir_instr *instr, nir_src *src,
enum iris_surface_group group)
{
assert(bt->sizes[group] > 0);
b->cursor = nir_before_instr(instr);
nir_ssa_def *bti;
if (nir_src_is_const(*src)) {
uint32_t index = nir_src_as_uint(*src);
bti = nir_imm_intN_t(b, iris_group_index_to_bti(bt, group, index),
src->ssa->bit_size);
} else {
/* Indirect usage makes all the surfaces of the group to be available,
* so we can just add the base.
*/
assert(bt->used_mask[group] == BITFIELD64_MASK(bt->sizes[group]));
bti = nir_iadd_imm(b, src->ssa, bt->offsets[group]);
}
nir_instr_rewrite_src(instr, src, nir_src_for_ssa(bti));
}
static void
mark_used_with_src(struct iris_binding_table *bt, nir_src *src,
enum iris_surface_group group)
{
assert(bt->sizes[group] > 0);
if (nir_src_is_const(*src)) {
uint64_t index = nir_src_as_uint(*src);
assert(index < bt->sizes[group]);
bt->used_mask[group] |= 1ull << index;
} else {
/* There's an indirect usage, we need all the surfaces. */
bt->used_mask[group] = BITFIELD64_MASK(bt->sizes[group]);
}
}
static bool
skip_compacting_binding_tables(void)
{
static int skip = -1;
if (skip < 0)
skip = debug_get_bool_option("INTEL_DISABLE_COMPACT_BINDING_TABLE", false);
return skip;
}
/**
* Set up the binding table indices and apply to the shader.
*/
static void
iris_setup_binding_table(const struct intel_device_info *devinfo,
struct nir_shader *nir,
struct iris_binding_table *bt,
unsigned num_render_targets,
unsigned num_system_values,
unsigned num_cbufs)
{
const struct shader_info *info = &nir->info;
memset(bt, 0, sizeof(*bt));
/* Set the sizes for each surface group. For some groups, we already know
* upfront how many will be used, so mark them.
*/
if (info->stage == MESA_SHADER_FRAGMENT) {
bt->sizes[IRIS_SURFACE_GROUP_RENDER_TARGET] = num_render_targets;
/* All render targets used. */
bt->used_mask[IRIS_SURFACE_GROUP_RENDER_TARGET] =
BITFIELD64_MASK(num_render_targets);
/* Setup render target read surface group in order to support non-coherent
* framebuffer fetch on Gfx8
*/
if (devinfo->ver == 8 && info->outputs_read) {
bt->sizes[IRIS_SURFACE_GROUP_RENDER_TARGET_READ] = num_render_targets;
bt->used_mask[IRIS_SURFACE_GROUP_RENDER_TARGET_READ] =
BITFIELD64_MASK(num_render_targets);
}
} else if (info->stage == MESA_SHADER_COMPUTE) {
bt->sizes[IRIS_SURFACE_GROUP_CS_WORK_GROUPS] = 1;
}
assert(ARRAY_SIZE(info->textures_used) >= 4);
int max_tex = BITSET_LAST_BIT(info->textures_used);
assert(max_tex <= 128);
bt->sizes[IRIS_SURFACE_GROUP_TEXTURE_LOW64] = MIN2(64, max_tex);
bt->sizes[IRIS_SURFACE_GROUP_TEXTURE_HIGH64] = MAX2(0, max_tex - 64);
bt->used_mask[IRIS_SURFACE_GROUP_TEXTURE_LOW64] =
info->textures_used[0] | ((uint64_t)info->textures_used[1]) << 32;
bt->used_mask[IRIS_SURFACE_GROUP_TEXTURE_HIGH64] =
info->textures_used[2] | ((uint64_t)info->textures_used[3]) << 32;
bt->samplers_used_mask = info->samplers_used[0];
bt->sizes[IRIS_SURFACE_GROUP_IMAGE] = BITSET_LAST_BIT(info->images_used);
/* Allocate an extra slot in the UBO section for NIR constants.
* Binding table compaction will remove it if unnecessary.
*
* We don't include them in iris_compiled_shader::num_cbufs because
* they are uploaded separately from shs->constbuf[], but from a shader
* point of view, they're another UBO (at the end of the section).
*/
bt->sizes[IRIS_SURFACE_GROUP_UBO] = num_cbufs + 1;
bt->sizes[IRIS_SURFACE_GROUP_SSBO] = info->num_ssbos;
for (int i = 0; i < IRIS_SURFACE_GROUP_COUNT; i++)
assert(bt->sizes[i] <= SURFACE_GROUP_MAX_ELEMENTS);
/* Mark surfaces used for the cases we don't have the information available
* upfront.
*/
nir_function_impl *impl = nir_shader_get_entrypoint(nir);
nir_foreach_block (block, impl) {
nir_foreach_instr (instr, block) {
if (instr->type != nir_instr_type_intrinsic)
continue;
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
switch (intrin->intrinsic) {
case nir_intrinsic_load_num_workgroups:
bt->used_mask[IRIS_SURFACE_GROUP_CS_WORK_GROUPS] = 1;
break;
case nir_intrinsic_load_output:
if (devinfo->ver == 8) {
mark_used_with_src(bt, &intrin->src[0],
IRIS_SURFACE_GROUP_RENDER_TARGET_READ);
}
break;
case nir_intrinsic_image_size:
case nir_intrinsic_image_load:
case nir_intrinsic_image_store:
case nir_intrinsic_image_atomic_add:
case nir_intrinsic_image_atomic_imin:
case nir_intrinsic_image_atomic_umin:
case nir_intrinsic_image_atomic_imax:
case nir_intrinsic_image_atomic_umax:
case nir_intrinsic_image_atomic_and:
case nir_intrinsic_image_atomic_or:
case nir_intrinsic_image_atomic_xor:
case nir_intrinsic_image_atomic_exchange:
case nir_intrinsic_image_atomic_comp_swap:
case nir_intrinsic_image_load_raw_intel:
case nir_intrinsic_image_store_raw_intel:
mark_used_with_src(bt, &intrin->src[0], IRIS_SURFACE_GROUP_IMAGE);
break;
case nir_intrinsic_load_ubo:
mark_used_with_src(bt, &intrin->src[0], IRIS_SURFACE_GROUP_UBO);
break;
case nir_intrinsic_store_ssbo:
mark_used_with_src(bt, &intrin->src[1], IRIS_SURFACE_GROUP_SSBO);
break;
case nir_intrinsic_get_ssbo_size:
case nir_intrinsic_ssbo_atomic_add:
case nir_intrinsic_ssbo_atomic_imin:
case nir_intrinsic_ssbo_atomic_umin:
case nir_intrinsic_ssbo_atomic_imax:
case nir_intrinsic_ssbo_atomic_umax:
case nir_intrinsic_ssbo_atomic_and:
case nir_intrinsic_ssbo_atomic_or:
case nir_intrinsic_ssbo_atomic_xor:
case nir_intrinsic_ssbo_atomic_exchange:
case nir_intrinsic_ssbo_atomic_comp_swap:
case nir_intrinsic_ssbo_atomic_fmin:
case nir_intrinsic_ssbo_atomic_fmax:
case nir_intrinsic_ssbo_atomic_fcomp_swap:
case nir_intrinsic_load_ssbo:
mark_used_with_src(bt, &intrin->src[0], IRIS_SURFACE_GROUP_SSBO);
break;
default:
break;
}
}
}
/* When disable we just mark everything as used. */
if (unlikely(skip_compacting_binding_tables())) {
for (int i = 0; i < IRIS_SURFACE_GROUP_COUNT; i++)
bt->used_mask[i] = BITFIELD64_MASK(bt->sizes[i]);
}
/* Calculate the offsets and the binding table size based on the used
* surfaces. After this point, the functions to go between "group indices"
* and binding table indices can be used.
*/
uint32_t next = 0;
for (int i = 0; i < IRIS_SURFACE_GROUP_COUNT; i++) {
if (bt->used_mask[i] != 0) {
bt->offsets[i] = next;
next += util_bitcount64(bt->used_mask[i]);
}
}
bt->size_bytes = next * 4;
if (INTEL_DEBUG(DEBUG_BT)) {
iris_print_binding_table(stderr, gl_shader_stage_name(info->stage), bt);
}
/* Apply the binding table indices. The backend compiler is not expected
* to change those, as we haven't set any of the *_start entries in brw
* binding_table.
*/
nir_builder b;
nir_builder_init(&b, impl);
nir_foreach_block (block, impl) {
nir_foreach_instr (instr, block) {
if (instr->type == nir_instr_type_tex) {
nir_tex_instr *tex = nir_instr_as_tex(instr);
if (tex->texture_index < 64) {
tex->texture_index =
iris_group_index_to_bti(bt, IRIS_SURFACE_GROUP_TEXTURE_LOW64,
tex->texture_index);
} else {
tex->texture_index =
iris_group_index_to_bti(bt, IRIS_SURFACE_GROUP_TEXTURE_HIGH64,
tex->texture_index - 64);
}
continue;
}
if (instr->type != nir_instr_type_intrinsic)
continue;
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
switch (intrin->intrinsic) {
case nir_intrinsic_image_size:
case nir_intrinsic_image_load:
case nir_intrinsic_image_store:
case nir_intrinsic_image_atomic_add:
case nir_intrinsic_image_atomic_imin:
case nir_intrinsic_image_atomic_umin:
case nir_intrinsic_image_atomic_imax:
case nir_intrinsic_image_atomic_umax:
case nir_intrinsic_image_atomic_and:
case nir_intrinsic_image_atomic_or:
case nir_intrinsic_image_atomic_xor:
case nir_intrinsic_image_atomic_exchange:
case nir_intrinsic_image_atomic_comp_swap:
case nir_intrinsic_image_load_raw_intel:
case nir_intrinsic_image_store_raw_intel:
rewrite_src_with_bti(&b, bt, instr, &intrin->src[0],
IRIS_SURFACE_GROUP_IMAGE);
break;
case nir_intrinsic_load_ubo:
rewrite_src_with_bti(&b, bt, instr, &intrin->src[0],
IRIS_SURFACE_GROUP_UBO);
break;
case nir_intrinsic_store_ssbo:
rewrite_src_with_bti(&b, bt, instr, &intrin->src[1],
IRIS_SURFACE_GROUP_SSBO);
break;
case nir_intrinsic_load_output:
if (devinfo->ver == 8) {
rewrite_src_with_bti(&b, bt, instr, &intrin->src[0],
IRIS_SURFACE_GROUP_RENDER_TARGET_READ);
}
break;
case nir_intrinsic_get_ssbo_size:
case nir_intrinsic_ssbo_atomic_add:
case nir_intrinsic_ssbo_atomic_imin:
case nir_intrinsic_ssbo_atomic_umin:
case nir_intrinsic_ssbo_atomic_imax:
case nir_intrinsic_ssbo_atomic_umax:
case nir_intrinsic_ssbo_atomic_and:
case nir_intrinsic_ssbo_atomic_or:
case nir_intrinsic_ssbo_atomic_xor:
case nir_intrinsic_ssbo_atomic_exchange:
case nir_intrinsic_ssbo_atomic_comp_swap:
case nir_intrinsic_ssbo_atomic_fmin:
case nir_intrinsic_ssbo_atomic_fmax:
case nir_intrinsic_ssbo_atomic_fcomp_swap:
case nir_intrinsic_load_ssbo:
rewrite_src_with_bti(&b, bt, instr, &intrin->src[0],
IRIS_SURFACE_GROUP_SSBO);
break;
default:
break;
}
}
}
}
static void
iris_debug_recompile(struct iris_screen *screen,
struct util_debug_callback *dbg,
struct iris_uncompiled_shader *ish,
const struct brw_base_prog_key *key)
{
if (!ish || list_is_empty(&ish->variants)
|| list_is_singular(&ish->variants))
return;
const struct brw_compiler *c = screen->compiler;
const struct shader_info *info = &ish->nir->info;
brw_shader_perf_log(c, dbg, "Recompiling %s shader for program %s: %s\n",
_mesa_shader_stage_to_string(info->stage),
info->name ? info->name : "(no identifier)",
info->label ? info->label : "");
struct iris_compiled_shader *shader =
list_first_entry(&ish->variants, struct iris_compiled_shader, link);
const void *old_iris_key = &shader->key;
union brw_any_prog_key old_key;
switch (info->stage) {
case MESA_SHADER_VERTEX:
old_key.vs = iris_to_brw_vs_key(screen, old_iris_key);
break;
case MESA_SHADER_TESS_CTRL:
old_key.tcs = iris_to_brw_tcs_key(screen, old_iris_key);
break;
case MESA_SHADER_TESS_EVAL:
old_key.tes = iris_to_brw_tes_key(screen, old_iris_key);
break;
case MESA_SHADER_GEOMETRY:
old_key.gs = iris_to_brw_gs_key(screen, old_iris_key);
break;
case MESA_SHADER_FRAGMENT:
old_key.wm = iris_to_brw_fs_key(screen, old_iris_key);
break;
case MESA_SHADER_COMPUTE:
old_key.cs = iris_to_brw_cs_key(screen, old_iris_key);
break;
default:
unreachable("invalid shader stage");
}
brw_debug_key_recompile(c, dbg, info->stage, &old_key.base, key);
}
static void
check_urb_size(struct iris_context *ice,
unsigned needed_size,
gl_shader_stage stage)
{
unsigned last_allocated_size = ice->shaders.urb.size[stage];
/* If the last URB allocation wasn't large enough for our needs,
* flag it as needing to be reconfigured. Otherwise, we can use
* the existing config. However, if the URB is constrained, and
* we can shrink our size for this stage, we may be able to gain
* extra concurrency by reconfiguring it to be smaller. Do so.
*/
if (last_allocated_size < needed_size ||
(ice->shaders.urb.constrained && last_allocated_size > needed_size)) {
ice->state.dirty |= IRIS_DIRTY_URB;
}
}
/**
* Get the shader for the last enabled geometry stage.
*
* This stage is the one which will feed stream output and the rasterizer.
*/
static gl_shader_stage
last_vue_stage(struct iris_context *ice)
{
if (ice->shaders.uncompiled[MESA_SHADER_GEOMETRY])
return MESA_SHADER_GEOMETRY;
if (ice->shaders.uncompiled[MESA_SHADER_TESS_EVAL])
return MESA_SHADER_TESS_EVAL;
return MESA_SHADER_VERTEX;
}
/**
* \param added Set to \c true if the variant was added to the list (i.e., a
* variant matching \c key was not found). Set to \c false
* otherwise.
*/
static inline struct iris_compiled_shader *
find_or_add_variant(const struct iris_screen *screen,
struct iris_uncompiled_shader *ish,
enum iris_program_cache_id cache_id,
const void *key, unsigned key_size,
bool *added)
{
struct list_head *start = ish->variants.next;
*added = false;
if (screen->precompile) {
/* Check the first list entry. There will always be at least one
* variant in the list (most likely the precompile variant), and
* other contexts only append new variants, so we can safely check
* it without locking, saving that cost in the common case.
*/
struct iris_compiled_shader *first =
list_first_entry(&ish->variants, struct iris_compiled_shader, link);
if (memcmp(&first->key, key, key_size) == 0) {
util_queue_fence_wait(&first->ready);
return first;
}
/* Skip this one in the loop below */
start = first->link.next;
}
struct iris_compiled_shader *variant = NULL;
/* If it doesn't match, we have to walk the list; other contexts may be
* concurrently appending shaders to it, so we need to lock here.
*/
simple_mtx_lock(&ish->lock);
list_for_each_entry_from(struct iris_compiled_shader, v, start,
&ish->variants, link) {
if (memcmp(&v->key, key, key_size) == 0) {
variant = v;
break;
}
}
if (variant == NULL) {
variant = iris_create_shader_variant(screen, NULL, cache_id,
key_size, key);
/* Append our new variant to the shader's variant list. */
list_addtail(&variant->link, &ish->variants);
*added = true;
simple_mtx_unlock(&ish->lock);
} else {
simple_mtx_unlock(&ish->lock);
util_queue_fence_wait(&variant->ready);
}
return variant;
}
static void
iris_threaded_compile_job_delete(void *_job, UNUSED void *_gdata,
UNUSED int thread_index)
{
free(_job);
}
static void
iris_schedule_compile(struct iris_screen *screen,
struct util_queue_fence *ready_fence,
struct util_debug_callback *dbg,
struct iris_threaded_compile_job *job,
util_queue_execute_func execute)
{
struct util_async_debug_callback async_debug;
if (dbg) {
u_async_debug_init(&async_debug);
job->dbg = &async_debug.base;
}
util_queue_add_job(&screen->shader_compiler_queue, job, ready_fence, execute,
iris_threaded_compile_job_delete, 0);
if (screen->driconf.sync_compile || dbg)
util_queue_fence_wait(ready_fence);
if (dbg) {
u_async_debug_drain(&async_debug, dbg);
u_async_debug_cleanup(&async_debug);
}
}
/**
* Compile a vertex shader, and upload the assembly.
*/
static void
iris_compile_vs(struct iris_screen *screen,
struct u_upload_mgr *uploader,
struct util_debug_callback *dbg,
struct iris_uncompiled_shader *ish,
struct iris_compiled_shader *shader)
{
const struct brw_compiler *compiler = screen->compiler;
const struct intel_device_info *devinfo = &screen->devinfo;
void *mem_ctx = ralloc_context(NULL);
struct brw_vs_prog_data *vs_prog_data =
rzalloc(mem_ctx, struct brw_vs_prog_data);
struct brw_vue_prog_data *vue_prog_data = &vs_prog_data->base;
struct brw_stage_prog_data *prog_data = &vue_prog_data->base;
enum brw_param_builtin *system_values;
unsigned num_system_values;
unsigned num_cbufs;
nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir);
const struct iris_vs_prog_key *const key = &shader->key.vs;
if (key->vue.nr_userclip_plane_consts) {
nir_function_impl *impl = nir_shader_get_entrypoint(nir);
nir_lower_clip_vs(nir, (1 << key->vue.nr_userclip_plane_consts) - 1,
true, false, NULL);
nir_lower_io_to_temporaries(nir, impl, true, false);
nir_lower_global_vars_to_local(nir);
nir_lower_vars_to_ssa(nir);
nir_shader_gather_info(nir, impl);
}
prog_data->use_alt_mode = nir->info.use_legacy_math_rules;
iris_setup_uniforms(compiler, mem_ctx, nir, prog_data, 0, &system_values,
&num_system_values, &num_cbufs);
struct iris_binding_table bt;
iris_setup_binding_table(devinfo, nir, &bt, /* num_render_targets */ 0,
num_system_values, num_cbufs);
brw_nir_analyze_ubo_ranges(compiler, nir, NULL, prog_data->ubo_ranges);
brw_compute_vue_map(devinfo,
&vue_prog_data->vue_map, nir->info.outputs_written,
nir->info.separate_shader, /* pos_slots */ 1);
struct brw_vs_prog_key brw_key = iris_to_brw_vs_key(screen, key);
struct brw_compile_vs_params params = {
.nir = nir,
.key = &brw_key,
.prog_data = vs_prog_data,
.log_data = dbg,
};
const unsigned *program = brw_compile_vs(compiler, mem_ctx, ¶ms);
if (program == NULL) {
dbg_printf("Failed to compile vertex shader: %s\n", params.error_str);
ralloc_free(mem_ctx);
shader->compilation_failed = true;
util_queue_fence_signal(&shader->ready);
return;
}
shader->compilation_failed = false;
iris_debug_recompile(screen, dbg, ish, &brw_key.base);
uint32_t *so_decls =
screen->vtbl.create_so_decl_list(&ish->stream_output,
&vue_prog_data->vue_map);
iris_finalize_program(shader, prog_data, so_decls, system_values,
num_system_values, 0, num_cbufs, &bt);
iris_upload_shader(screen, ish, shader, NULL, uploader, IRIS_CACHE_VS,
sizeof(*key), key, program);
iris_disk_cache_store(screen->disk_cache, ish, shader, key, sizeof(*key));
ralloc_free(mem_ctx);
}
/**
* Update the current vertex shader variant.
*
* Fill out the key, look in the cache, compile and bind if needed.
*/
static void
iris_update_compiled_vs(struct iris_context *ice)
{
struct iris_screen *screen = (struct iris_screen *)ice->ctx.screen;
struct iris_shader_state *shs = &ice->state.shaders[MESA_SHADER_VERTEX];
struct u_upload_mgr *uploader = ice->shaders.uploader_driver;
struct iris_uncompiled_shader *ish =
ice->shaders.uncompiled[MESA_SHADER_VERTEX];
struct iris_vs_prog_key key = { KEY_INIT(vue.base) };
screen->vtbl.populate_vs_key(ice, &ish->nir->info, last_vue_stage(ice), &key);
struct iris_compiled_shader *old = ice->shaders.prog[IRIS_CACHE_VS];
bool added;
struct iris_compiled_shader *shader =
find_or_add_variant(screen, ish, IRIS_CACHE_VS, &key, sizeof(key), &added);
if (added && !iris_disk_cache_retrieve(screen, uploader, ish, shader,
&key, sizeof(key))) {
iris_compile_vs(screen, uploader, &ice->dbg, ish, shader);
}
if (shader->compilation_failed)
shader = NULL;
if (old != shader) {
iris_shader_variant_reference(&ice->shaders.prog[MESA_SHADER_VERTEX],
shader);
ice->state.dirty |= IRIS_DIRTY_VF_SGVS;
ice->state.stage_dirty |= IRIS_STAGE_DIRTY_VS |
IRIS_STAGE_DIRTY_BINDINGS_VS |
IRIS_STAGE_DIRTY_CONSTANTS_VS;
shs->sysvals_need_upload = true;
unsigned urb_entry_size = shader ?
((struct brw_vue_prog_data *) shader->prog_data)->urb_entry_size : 0;
check_urb_size(ice, urb_entry_size, MESA_SHADER_VERTEX);
}
}
/**
* Get the shader_info for a given stage, or NULL if the stage is disabled.
*/
const struct shader_info *
iris_get_shader_info(const struct iris_context *ice, gl_shader_stage stage)
{
const struct iris_uncompiled_shader *ish = ice->shaders.uncompiled[stage];
if (!ish)
return NULL;
const nir_shader *nir = ish->nir;
return &nir->info;
}
/**
* Get the union of TCS output and TES input slots.
*
* TCS and TES need to agree on a common URB entry layout. In particular,
* the data for all patch vertices is stored in a single URB entry (unlike
* GS which has one entry per input vertex). This means that per-vertex
* array indexing needs a stride.
*
* SSO requires locations to match, but doesn't require the number of
* outputs/inputs to match (in fact, the TCS often has extra outputs).
* So, we need to take the extra step of unifying these on the fly.
*/
static void
get_unified_tess_slots(const struct iris_context *ice,
uint64_t *per_vertex_slots,
uint32_t *per_patch_slots)
{
const struct shader_info *tcs =
iris_get_shader_info(ice, MESA_SHADER_TESS_CTRL);
const struct shader_info *tes =
iris_get_shader_info(ice, MESA_SHADER_TESS_EVAL);
*per_vertex_slots = tes->inputs_read;
*per_patch_slots = tes->patch_inputs_read;
if (tcs) {
*per_vertex_slots |= tcs->outputs_written;
*per_patch_slots |= tcs->patch_outputs_written;
}
}
/**
* Compile a tessellation control shader, and upload the assembly.
*/
static void
iris_compile_tcs(struct iris_screen *screen,
struct hash_table *passthrough_ht,
struct u_upload_mgr *uploader,
struct util_debug_callback *dbg,
struct iris_uncompiled_shader *ish,
struct iris_compiled_shader *shader)
{
const struct brw_compiler *compiler = screen->compiler;
const struct nir_shader_compiler_options *options =
compiler->nir_options[MESA_SHADER_TESS_CTRL];
void *mem_ctx = ralloc_context(NULL);
struct brw_tcs_prog_data *tcs_prog_data =
rzalloc(mem_ctx, struct brw_tcs_prog_data);
struct brw_vue_prog_data *vue_prog_data = &tcs_prog_data->base;
struct brw_stage_prog_data *prog_data = &vue_prog_data->base;
const struct intel_device_info *devinfo = &screen->devinfo;
enum brw_param_builtin *system_values = NULL;
unsigned num_system_values = 0;
unsigned num_cbufs = 0;
nir_shader *nir;
struct iris_binding_table bt;
const struct iris_tcs_prog_key *const key = &shader->key.tcs;
struct brw_tcs_prog_key brw_key = iris_to_brw_tcs_key(screen, key);
if (ish) {
nir = nir_shader_clone(mem_ctx, ish->nir);
iris_setup_uniforms(compiler, mem_ctx, nir, prog_data, 0, &system_values,
&num_system_values, &num_cbufs);
iris_setup_binding_table(devinfo, nir, &bt, /* num_render_targets */ 0,
num_system_values, num_cbufs);
brw_nir_analyze_ubo_ranges(compiler, nir, NULL, prog_data->ubo_ranges);
} else {
nir =
brw_nir_create_passthrough_tcs(mem_ctx, compiler, options, &brw_key);
/* Reserve space for passing the default tess levels as constants. */
num_cbufs = 1;
num_system_values = 8;
system_values =
rzalloc_array(mem_ctx, enum brw_param_builtin, num_system_values);
prog_data->param = rzalloc_array(mem_ctx, uint32_t, num_system_values);
prog_data->nr_params = num_system_values;
if (key->_tes_primitive_mode == TESS_PRIMITIVE_QUADS) {
for (int i = 0; i < 4; i++)
system_values[7 - i] = BRW_PARAM_BUILTIN_TESS_LEVEL_OUTER_X + i;
system_values[3] = BRW_PARAM_BUILTIN_TESS_LEVEL_INNER_X;
system_values[2] = BRW_PARAM_BUILTIN_TESS_LEVEL_INNER_Y;
} else if (key->_tes_primitive_mode == TESS_PRIMITIVE_TRIANGLES) {
for (int i = 0; i < 3; i++)
system_values[7 - i] = BRW_PARAM_BUILTIN_TESS_LEVEL_OUTER_X + i;
system_values[4] = BRW_PARAM_BUILTIN_TESS_LEVEL_INNER_X;
} else {
assert(key->_tes_primitive_mode == TESS_PRIMITIVE_ISOLINES);
system_values[7] = BRW_PARAM_BUILTIN_TESS_LEVEL_OUTER_Y;
system_values[6] = BRW_PARAM_BUILTIN_TESS_LEVEL_OUTER_X;
}
/* Manually setup the TCS binding table. */
memset(&bt, 0, sizeof(bt));
bt.sizes[IRIS_SURFACE_GROUP_UBO] = 1;
bt.used_mask[IRIS_SURFACE_GROUP_UBO] = 1;
bt.size_bytes = 4;
prog_data->ubo_ranges[0].length = 1;
}
struct brw_compile_tcs_params params = {
.nir = nir,
.key = &brw_key,
.prog_data = tcs_prog_data,
.log_data = dbg,
};
const unsigned *program = brw_compile_tcs(compiler, mem_ctx, ¶ms);
if (program == NULL) {
dbg_printf("Failed to compile control shader: %s\n", params.error_str);
ralloc_free(mem_ctx);
shader->compilation_failed = true;
util_queue_fence_signal(&shader->ready);
return;
}
shader->compilation_failed = false;
iris_debug_recompile(screen, dbg, ish, &brw_key.base);
iris_finalize_program(shader, prog_data, NULL, system_values,
num_system_values, 0, num_cbufs, &bt);
iris_upload_shader(screen, ish, shader, passthrough_ht, uploader,
IRIS_CACHE_TCS, sizeof(*key), key, program);
if (ish)
iris_disk_cache_store(screen->disk_cache, ish, shader, key, sizeof(*key));
ralloc_free(mem_ctx);
}
/**
* Update the current tessellation control shader variant.
*
* Fill out the key, look in the cache, compile and bind if needed.
*/
static void
iris_update_compiled_tcs(struct iris_context *ice)
{
struct iris_shader_state *shs = &ice->state.shaders[MESA_SHADER_TESS_CTRL];
struct iris_uncompiled_shader *tcs =
ice->shaders.uncompiled[MESA_SHADER_TESS_CTRL];
struct iris_screen *screen = (struct iris_screen *)ice->ctx.screen;
struct u_upload_mgr *uploader = ice->shaders.uploader_driver;
const struct brw_compiler *compiler = screen->compiler;
const struct intel_device_info *devinfo = &screen->devinfo;
const struct shader_info *tes_info =
iris_get_shader_info(ice, MESA_SHADER_TESS_EVAL);
struct iris_tcs_prog_key key = {
.vue.base.program_string_id = tcs ? tcs->program_id : 0,
._tes_primitive_mode = tes_info->tess._primitive_mode,
.input_vertices =
!tcs || compiler->use_tcs_multi_patch ? ice->state.vertices_per_patch : 0,
.quads_workaround = devinfo->ver < 9 &&
tes_info->tess._primitive_mode == TESS_PRIMITIVE_QUADS &&
tes_info->tess.spacing == TESS_SPACING_EQUAL,
};
get_unified_tess_slots(ice, &key.outputs_written,
&key.patch_outputs_written);
screen->vtbl.populate_tcs_key(ice, &key);
struct iris_compiled_shader *old = ice->shaders.prog[IRIS_CACHE_TCS];
struct iris_compiled_shader *shader;
bool added = false;
if (tcs != NULL) {
shader = find_or_add_variant(screen, tcs, IRIS_CACHE_TCS, &key,
sizeof(key), &added);
} else {
/* Look for and possibly create a passthrough TCS */
shader = iris_find_cached_shader(ice, IRIS_CACHE_TCS, sizeof(key), &key);
if (shader == NULL) {
shader = iris_create_shader_variant(screen, ice->shaders.cache,
IRIS_CACHE_TCS, sizeof(key), &key);
added = true;
}
}
/* If the shader was not found in (whichever cache), call iris_compile_tcs
* if either ish is NULL or the shader could not be found in the disk
* cache.
*/
if (added &&
(tcs == NULL || !iris_disk_cache_retrieve(screen, uploader, tcs, shader,
&key, sizeof(key)))) {
iris_compile_tcs(screen, ice->shaders.cache, uploader, &ice->dbg, tcs,
shader);
}
if (shader->compilation_failed)
shader = NULL;
if (old != shader) {
iris_shader_variant_reference(&ice->shaders.prog[MESA_SHADER_TESS_CTRL],
shader);
ice->state.stage_dirty |= IRIS_STAGE_DIRTY_TCS |
IRIS_STAGE_DIRTY_BINDINGS_TCS |
IRIS_STAGE_DIRTY_CONSTANTS_TCS;
shs->sysvals_need_upload = true;
unsigned urb_entry_size = shader ?
((struct brw_vue_prog_data *) shader->prog_data)->urb_entry_size : 0;
check_urb_size(ice, urb_entry_size, MESA_SHADER_TESS_CTRL);
}
}
/**
* Compile a tessellation evaluation shader, and upload the assembly.
*/
static void
iris_compile_tes(struct iris_screen *screen,
struct u_upload_mgr *uploader,
struct util_debug_callback *dbg,
struct iris_uncompiled_shader *ish,
struct iris_compiled_shader *shader)
{
const struct brw_compiler *compiler = screen->compiler;
void *mem_ctx = ralloc_context(NULL);
struct brw_tes_prog_data *tes_prog_data =
rzalloc(mem_ctx, struct brw_tes_prog_data);
struct brw_vue_prog_data *vue_prog_data = &tes_prog_data->base;
struct brw_stage_prog_data *prog_data = &vue_prog_data->base;
enum brw_param_builtin *system_values;
const struct intel_device_info *devinfo = &screen->devinfo;
unsigned num_system_values;
unsigned num_cbufs;
nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir);
const struct iris_tes_prog_key *const key = &shader->key.tes;
if (key->vue.nr_userclip_plane_consts) {
nir_function_impl *impl = nir_shader_get_entrypoint(nir);
nir_lower_clip_vs(nir, (1 << key->vue.nr_userclip_plane_consts) - 1,
true, false, NULL);
nir_lower_io_to_temporaries(nir, impl, true, false);
nir_lower_global_vars_to_local(nir);
nir_lower_vars_to_ssa(nir);
nir_shader_gather_info(nir, impl);
}
iris_setup_uniforms(compiler, mem_ctx, nir, prog_data, 0, &system_values,
&num_system_values, &num_cbufs);
struct iris_binding_table bt;
iris_setup_binding_table(devinfo, nir, &bt, /* num_render_targets */ 0,
num_system_values, num_cbufs);
brw_nir_analyze_ubo_ranges(compiler, nir, NULL, prog_data->ubo_ranges);
struct brw_vue_map input_vue_map;
brw_compute_tess_vue_map(&input_vue_map, key->inputs_read,
key->patch_inputs_read);
struct brw_tes_prog_key brw_key = iris_to_brw_tes_key(screen, key);
struct brw_compile_tes_params params = {
.nir = nir,
.key = &brw_key,
.prog_data = tes_prog_data,
.input_vue_map = &input_vue_map,
.log_data = dbg,
};
const unsigned *program = brw_compile_tes(compiler, mem_ctx, ¶ms);
if (program == NULL) {
dbg_printf("Failed to compile evaluation shader: %s\n", params.error_str);
ralloc_free(mem_ctx);
shader->compilation_failed = true;
util_queue_fence_signal(&shader->ready);
return;
}
shader->compilation_failed = false;
iris_debug_recompile(screen, dbg, ish, &brw_key.base);
uint32_t *so_decls =
screen->vtbl.create_so_decl_list(&ish->stream_output,
&vue_prog_data->vue_map);
iris_finalize_program(shader, prog_data, so_decls, system_values,
num_system_values, 0, num_cbufs, &bt);
iris_upload_shader(screen, ish, shader, NULL, uploader, IRIS_CACHE_TES,
sizeof(*key), key, program);
iris_disk_cache_store(screen->disk_cache, ish, shader, key, sizeof(*key));
ralloc_free(mem_ctx);
}
/**
* Update the current tessellation evaluation shader variant.
*
* Fill out the key, look in the cache, compile and bind if needed.
*/
static void
iris_update_compiled_tes(struct iris_context *ice)
{
struct iris_screen *screen = (struct iris_screen *)ice->ctx.screen;
struct u_upload_mgr *uploader = ice->shaders.uploader_driver;
struct iris_shader_state *shs = &ice->state.shaders[MESA_SHADER_TESS_EVAL];
struct iris_uncompiled_shader *ish =
ice->shaders.uncompiled[MESA_SHADER_TESS_EVAL];
struct iris_tes_prog_key key = { KEY_INIT(vue.base) };
get_unified_tess_slots(ice, &key.inputs_read, &key.patch_inputs_read);
screen->vtbl.populate_tes_key(ice, &ish->nir->info, last_vue_stage(ice), &key);
struct iris_compiled_shader *old = ice->shaders.prog[IRIS_CACHE_TES];
bool added;
struct iris_compiled_shader *shader =
find_or_add_variant(screen, ish, IRIS_CACHE_TES, &key, sizeof(key), &added);
if (added && !iris_disk_cache_retrieve(screen, uploader, ish, shader,
&key, sizeof(key))) {
iris_compile_tes(screen, uploader, &ice->dbg, ish, shader);
}
if (shader->compilation_failed)
shader = NULL;
if (old != shader) {
iris_shader_variant_reference(&ice->shaders.prog[MESA_SHADER_TESS_EVAL],
shader);
ice->state.stage_dirty |= IRIS_STAGE_DIRTY_TES |
IRIS_STAGE_DIRTY_BINDINGS_TES |
IRIS_STAGE_DIRTY_CONSTANTS_TES;
shs->sysvals_need_upload = true;
unsigned urb_entry_size = shader ?
((struct brw_vue_prog_data *) shader->prog_data)->urb_entry_size : 0;
check_urb_size(ice, urb_entry_size, MESA_SHADER_TESS_EVAL);
}
/* TODO: Could compare and avoid flagging this. */
const struct shader_info *tes_info = &ish->nir->info;
if (BITSET_TEST(tes_info->system_values_read, SYSTEM_VALUE_VERTICES_IN)) {
ice->state.stage_dirty |= IRIS_STAGE_DIRTY_CONSTANTS_TES;
ice->state.shaders[MESA_SHADER_TESS_EVAL].sysvals_need_upload = true;
}
}
/**
* Compile a geometry shader, and upload the assembly.
*/
static void
iris_compile_gs(struct iris_screen *screen,
struct u_upload_mgr *uploader,
struct util_debug_callback *dbg,
struct iris_uncompiled_shader *ish,
struct iris_compiled_shader *shader)
{
const struct brw_compiler *compiler = screen->compiler;
const struct intel_device_info *devinfo = &screen->devinfo;
void *mem_ctx = ralloc_context(NULL);
struct brw_gs_prog_data *gs_prog_data =
rzalloc(mem_ctx, struct brw_gs_prog_data);
struct brw_vue_prog_data *vue_prog_data = &gs_prog_data->base;
struct brw_stage_prog_data *prog_data = &vue_prog_data->base;
enum brw_param_builtin *system_values;
unsigned num_system_values;
unsigned num_cbufs;
nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir);
const struct iris_gs_prog_key *const key = &shader->key.gs;
if (key->vue.nr_userclip_plane_consts) {
nir_function_impl *impl = nir_shader_get_entrypoint(nir);
nir_lower_clip_gs(nir, (1 << key->vue.nr_userclip_plane_consts) - 1,
false, NULL);
nir_lower_io_to_temporaries(nir, impl, true, false);
nir_lower_global_vars_to_local(nir);
nir_lower_vars_to_ssa(nir);
nir_shader_gather_info(nir, impl);
}
iris_setup_uniforms(compiler, mem_ctx, nir, prog_data, 0, &system_values,
&num_system_values, &num_cbufs);
struct iris_binding_table bt;
iris_setup_binding_table(devinfo, nir, &bt, /* num_render_targets */ 0,
num_system_values, num_cbufs);
brw_nir_analyze_ubo_ranges(compiler, nir, NULL, prog_data->ubo_ranges);
brw_compute_vue_map(devinfo,
&vue_prog_data->vue_map, nir->info.outputs_written,
nir->info.separate_shader, /* pos_slots */ 1);
struct brw_gs_prog_key brw_key = iris_to_brw_gs_key(screen, key);
struct brw_compile_gs_params params = {
.nir = nir,
.key = &brw_key,
.prog_data = gs_prog_data,
.log_data = dbg,
};
const unsigned *program = brw_compile_gs(compiler, mem_ctx, ¶ms);
if (program == NULL) {
dbg_printf("Failed to compile geometry shader: %s\n", params.error_str);
ralloc_free(mem_ctx);
shader->compilation_failed = true;
util_queue_fence_signal(&shader->ready);
return;
}
shader->compilation_failed = false;
iris_debug_recompile(screen, dbg, ish, &brw_key.base);
uint32_t *so_decls =
screen->vtbl.create_so_decl_list(&ish->stream_output,
&vue_prog_data->vue_map);
iris_finalize_program(shader, prog_data, so_decls, system_values,
num_system_values, 0, num_cbufs, &bt);
iris_upload_shader(screen, ish, shader, NULL, uploader, IRIS_CACHE_GS,
sizeof(*key), key, program);
iris_disk_cache_store(screen->disk_cache, ish, shader, key, sizeof(*key));
ralloc_free(mem_ctx);
}
/**
* Update the current geometry shader variant.
*
* Fill out the key, look in the cache, compile and bind if needed.
*/
static void
iris_update_compiled_gs(struct iris_context *ice)
{
struct iris_shader_state *shs = &ice->state.shaders[MESA_SHADER_GEOMETRY];
struct u_upload_mgr *uploader = ice->shaders.uploader_driver;
struct iris_uncompiled_shader *ish =
ice->shaders.uncompiled[MESA_SHADER_GEOMETRY];
struct iris_compiled_shader *old = ice->shaders.prog[IRIS_CACHE_GS];
struct iris_compiled_shader *shader = NULL;
struct iris_screen *screen = (struct iris_screen *)ice->ctx.screen;
if (ish) {
struct iris_gs_prog_key key = { KEY_INIT(vue.base) };
screen->vtbl.populate_gs_key(ice, &ish->nir->info, last_vue_stage(ice), &key);
bool added;
shader = find_or_add_variant(screen, ish, IRIS_CACHE_GS, &key,
sizeof(key), &added);
if (added && !iris_disk_cache_retrieve(screen, uploader, ish, shader,
&key, sizeof(key))) {
iris_compile_gs(screen, uploader, &ice->dbg, ish, shader);
}
if (shader->compilation_failed)
shader = NULL;
}
if (old != shader) {
iris_shader_variant_reference(&ice->shaders.prog[MESA_SHADER_GEOMETRY],
shader);
ice->state.stage_dirty |= IRIS_STAGE_DIRTY_GS |
IRIS_STAGE_DIRTY_BINDINGS_GS |
IRIS_STAGE_DIRTY_CONSTANTS_GS;
shs->sysvals_need_upload = true;
unsigned urb_entry_size = shader ?
((struct brw_vue_prog_data *) shader->prog_data)->urb_entry_size : 0;
check_urb_size(ice, urb_entry_size, MESA_SHADER_GEOMETRY);
}
}
/**
* Compile a fragment (pixel) shader, and upload the assembly.
*/
static void
iris_compile_fs(struct iris_screen *screen,
struct u_upload_mgr *uploader,
struct util_debug_callback *dbg,
struct iris_uncompiled_shader *ish,
struct iris_compiled_shader *shader,
struct brw_vue_map *vue_map)
{
const struct brw_compiler *compiler = screen->compiler;
void *mem_ctx = ralloc_context(NULL);
struct brw_wm_prog_data *fs_prog_data =
rzalloc(mem_ctx, struct brw_wm_prog_data);
struct brw_stage_prog_data *prog_data = &fs_prog_data->base;
enum brw_param_builtin *system_values;
const struct intel_device_info *devinfo = &screen->devinfo;
unsigned num_system_values;
unsigned num_cbufs;
nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir);
const struct iris_fs_prog_key *const key = &shader->key.fs;
prog_data->use_alt_mode = nir->info.use_legacy_math_rules;
iris_setup_uniforms(compiler, mem_ctx, nir, prog_data, 0, &system_values,
&num_system_values, &num_cbufs);
/* Lower output variables to load_output intrinsics before setting up
* binding tables, so iris_setup_binding_table can map any load_output
* intrinsics to IRIS_SURFACE_GROUP_RENDER_TARGET_READ on Gfx8 for
* non-coherent framebuffer fetches.
*/
brw_nir_lower_fs_outputs(nir);
/* On Gfx11+, shader RT write messages have a "Null Render Target" bit
* and do not need a binding table entry with a null surface. Earlier
* generations need an entry for a null surface.
*/
int null_rts = devinfo->ver < 11 ? 1 : 0;
struct iris_binding_table bt;
iris_setup_binding_table(devinfo, nir, &bt,
MAX2(key->nr_color_regions, null_rts),
num_system_values, num_cbufs);
brw_nir_analyze_ubo_ranges(compiler, nir, NULL, prog_data->ubo_ranges);
struct brw_wm_prog_key brw_key = iris_to_brw_fs_key(screen, key);
struct brw_compile_fs_params params = {
.nir = nir,
.key = &brw_key,
.prog_data = fs_prog_data,
.allow_spilling = true,
.vue_map = vue_map,
.log_data = dbg,
};
const unsigned *program = brw_compile_fs(compiler, mem_ctx, ¶ms);
if (program == NULL) {
dbg_printf("Failed to compile fragment shader: %s\n", params.error_str);
ralloc_free(mem_ctx);
shader->compilation_failed = true;
util_queue_fence_signal(&shader->ready);
return;
}
shader->compilation_failed = false;
iris_debug_recompile(screen, dbg, ish, &brw_key.base);
iris_finalize_program(shader, prog_data, NULL, system_values,
num_system_values, 0, num_cbufs, &bt);
iris_upload_shader(screen, ish, shader, NULL, uploader, IRIS_CACHE_FS,
sizeof(*key), key, program);
iris_disk_cache_store(screen->disk_cache, ish, shader, key, sizeof(*key));
ralloc_free(mem_ctx);
}
/**
* Update the current fragment shader variant.
*
* Fill out the key, look in the cache, compile and bind if needed.
*/
static void
iris_update_compiled_fs(struct iris_context *ice)
{
struct iris_shader_state *shs = &ice->state.shaders[MESA_SHADER_FRAGMENT];
struct u_upload_mgr *uploader = ice->shaders.uploader_driver;
struct iris_uncompiled_shader *ish =
ice->shaders.uncompiled[MESA_SHADER_FRAGMENT];
struct iris_screen *screen = (struct iris_screen *)ice->ctx.screen;
struct iris_fs_prog_key key = { KEY_INIT(base) };
screen->vtbl.populate_fs_key(ice, &ish->nir->info, &key);
struct brw_vue_map *last_vue_map =
&brw_vue_prog_data(ice->shaders.last_vue_shader->prog_data)->vue_map;
if (ish->nos & (1ull << IRIS_NOS_LAST_VUE_MAP))
key.input_slots_valid = last_vue_map->slots_valid;
struct iris_compiled_shader *old = ice->shaders.prog[IRIS_CACHE_FS];
bool added;
struct iris_compiled_shader *shader =
find_or_add_variant(screen, ish, IRIS_CACHE_FS, &key,
sizeof(key), &added);
if (added && !iris_disk_cache_retrieve(screen, uploader, ish, shader,
&key, sizeof(key))) {
iris_compile_fs(screen, uploader, &ice->dbg, ish, shader, last_vue_map);
}
if (shader->compilation_failed)
shader = NULL;
if (old != shader) {
// XXX: only need to flag CLIP if barycentric has NONPERSPECTIVE
// toggles. might be able to avoid flagging SBE too.
iris_shader_variant_reference(&ice->shaders.prog[MESA_SHADER_FRAGMENT],
shader);
ice->state.dirty |= IRIS_DIRTY_WM |
IRIS_DIRTY_CLIP |
IRIS_DIRTY_SBE;
ice->state.stage_dirty |= IRIS_STAGE_DIRTY_FS |
IRIS_STAGE_DIRTY_BINDINGS_FS |
IRIS_STAGE_DIRTY_CONSTANTS_FS;
shs->sysvals_need_upload = true;
}
}
/**
* Update the last enabled stage's VUE map.
*
* When the shader feeding the rasterizer's output interface changes, we
* need to re-emit various packets.
*/
static void
update_last_vue_map(struct iris_context *ice,
struct iris_compiled_shader *shader)
{
struct brw_vue_prog_data *vue_prog_data = (void *) shader->prog_data;
struct brw_vue_map *vue_map = &vue_prog_data->vue_map;
struct brw_vue_map *old_map = !ice->shaders.last_vue_shader ? NULL :
&brw_vue_prog_data(ice->shaders.last_vue_shader->prog_data)->vue_map;
const uint64_t changed_slots =
(old_map ? old_map->slots_valid : 0ull) ^ vue_map->slots_valid;
if (changed_slots & VARYING_BIT_VIEWPORT) {
ice->state.num_viewports =
(vue_map->slots_valid & VARYING_BIT_VIEWPORT) ? IRIS_MAX_VIEWPORTS : 1;
ice->state.dirty |= IRIS_DIRTY_CLIP |
IRIS_DIRTY_SF_CL_VIEWPORT |
IRIS_DIRTY_CC_VIEWPORT |
IRIS_DIRTY_SCISSOR_RECT;
ice->state.stage_dirty |= IRIS_STAGE_DIRTY_UNCOMPILED_FS |
ice->state.stage_dirty_for_nos[IRIS_NOS_LAST_VUE_MAP];
}
if (changed_slots || (old_map && old_map->separate != vue_map->separate)) {
ice->state.dirty |= IRIS_DIRTY_SBE;
}
iris_shader_variant_reference(&ice->shaders.last_vue_shader, shader);
}
static void
iris_update_pull_constant_descriptors(struct iris_context *ice,
gl_shader_stage stage)
{
struct iris_compiled_shader *shader = ice->shaders.prog[stage];
if (!shader || !shader->prog_data->has_ubo_pull)
return;
struct iris_shader_state *shs = &ice->state.shaders[stage];
bool any_new_descriptors =
shader->num_system_values > 0 && shs->sysvals_need_upload;
unsigned bound_cbufs = shs->bound_cbufs;
while (bound_cbufs) {
const int i = u_bit_scan(&bound_cbufs);
struct pipe_shader_buffer *cbuf = &shs->constbuf[i];
struct iris_state_ref *surf_state = &shs->constbuf_surf_state[i];
if (!surf_state->res && cbuf->buffer) {
iris_upload_ubo_ssbo_surf_state(ice, cbuf, surf_state,
ISL_SURF_USAGE_CONSTANT_BUFFER_BIT);
any_new_descriptors = true;
}
}
if (any_new_descriptors)
ice->state.stage_dirty |= IRIS_STAGE_DIRTY_BINDINGS_VS << stage;
}
/**
* Update the current shader variants for the given state.
*
* This should be called on every draw call to ensure that the correct
* shaders are bound. It will also flag any dirty state triggered by
* swapping out those shaders.
*/
void
iris_update_compiled_shaders(struct iris_context *ice)
{
const uint64_t stage_dirty = ice->state.stage_dirty;
if (stage_dirty & (IRIS_STAGE_DIRTY_UNCOMPILED_TCS |
IRIS_STAGE_DIRTY_UNCOMPILED_TES)) {
struct iris_uncompiled_shader *tes =
ice->shaders.uncompiled[MESA_SHADER_TESS_EVAL];
if (tes) {
iris_update_compiled_tcs(ice);
iris_update_compiled_tes(ice);
} else {
iris_shader_variant_reference(&ice->shaders.prog[MESA_SHADER_TESS_CTRL], NULL);
iris_shader_variant_reference(&ice->shaders.prog[MESA_SHADER_TESS_EVAL], NULL);
ice->state.stage_dirty |=
IRIS_STAGE_DIRTY_TCS | IRIS_STAGE_DIRTY_TES |
IRIS_STAGE_DIRTY_BINDINGS_TCS | IRIS_STAGE_DIRTY_BINDINGS_TES |
IRIS_STAGE_DIRTY_CONSTANTS_TCS | IRIS_STAGE_DIRTY_CONSTANTS_TES;
if (ice->shaders.urb.constrained)
ice->state.dirty |= IRIS_DIRTY_URB;
}
}
if (stage_dirty & IRIS_STAGE_DIRTY_UNCOMPILED_VS)
iris_update_compiled_vs(ice);
if (stage_dirty & IRIS_STAGE_DIRTY_UNCOMPILED_GS)
iris_update_compiled_gs(ice);
if (stage_dirty & (IRIS_STAGE_DIRTY_UNCOMPILED_GS |
IRIS_STAGE_DIRTY_UNCOMPILED_TES)) {
const struct iris_compiled_shader *gs =
ice->shaders.prog[MESA_SHADER_GEOMETRY];
const struct iris_compiled_shader *tes =
ice->shaders.prog[MESA_SHADER_TESS_EVAL];
bool points_or_lines = false;
if (gs) {
const struct brw_gs_prog_data *gs_prog_data = (void *) gs->prog_data;
points_or_lines =
gs_prog_data->output_topology == _3DPRIM_POINTLIST ||
gs_prog_data->output_topology == _3DPRIM_LINESTRIP;
} else if (tes) {
const struct brw_tes_prog_data *tes_data = (void *) tes->prog_data;
points_or_lines =
tes_data->output_topology == BRW_TESS_OUTPUT_TOPOLOGY_LINE ||
tes_data->output_topology == BRW_TESS_OUTPUT_TOPOLOGY_POINT;
}
if (ice->shaders.output_topology_is_points_or_lines != points_or_lines) {
/* Outbound to XY Clip enables */
ice->shaders.output_topology_is_points_or_lines = points_or_lines;
ice->state.dirty |= IRIS_DIRTY_CLIP;
}
}
gl_shader_stage last_stage = last_vue_stage(ice);
struct iris_compiled_shader *shader = ice->shaders.prog[last_stage];
struct iris_uncompiled_shader *ish = ice->shaders.uncompiled[last_stage];
update_last_vue_map(ice, shader);
if (ice->state.streamout != shader->streamout) {
ice->state.streamout = shader->streamout;
ice->state.dirty |= IRIS_DIRTY_SO_DECL_LIST | IRIS_DIRTY_STREAMOUT;
}
if (ice->state.streamout_active) {
for (int i = 0; i < PIPE_MAX_SO_BUFFERS; i++) {
struct iris_stream_output_target *so =
(void *) ice->state.so_target[i];
if (so)
so->stride = ish->stream_output.stride[i] * sizeof(uint32_t);
}
}
if (stage_dirty & IRIS_STAGE_DIRTY_UNCOMPILED_FS)
iris_update_compiled_fs(ice);
for (int i = MESA_SHADER_VERTEX; i <= MESA_SHADER_FRAGMENT; i++) {
if (ice->state.stage_dirty & (IRIS_STAGE_DIRTY_CONSTANTS_VS << i))
iris_update_pull_constant_descriptors(ice, i);
}
}
static void
iris_compile_cs(struct iris_screen *screen,
struct u_upload_mgr *uploader,
struct util_debug_callback *dbg,
struct iris_uncompiled_shader *ish,
struct iris_compiled_shader *shader)
{
const struct brw_compiler *compiler = screen->compiler;
void *mem_ctx = ralloc_context(NULL);
struct brw_cs_prog_data *cs_prog_data =
rzalloc(mem_ctx, struct brw_cs_prog_data);
struct brw_stage_prog_data *prog_data = &cs_prog_data->base;
enum brw_param_builtin *system_values;
const struct intel_device_info *devinfo = &screen->devinfo;
unsigned num_system_values;
unsigned num_cbufs;
nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir);
const struct iris_cs_prog_key *const key = &shader->key.cs;
NIR_PASS_V(nir, brw_nir_lower_cs_intrinsics);
iris_setup_uniforms(compiler, mem_ctx, nir, prog_data,
ish->kernel_input_size,
&system_values, &num_system_values, &num_cbufs);
struct iris_binding_table bt;
iris_setup_binding_table(devinfo, nir, &bt, /* num_render_targets */ 0,
num_system_values, num_cbufs);
struct brw_cs_prog_key brw_key = iris_to_brw_cs_key(screen, key);
struct brw_compile_cs_params params = {
.nir = nir,
.key = &brw_key,
.prog_data = cs_prog_data,
.log_data = dbg,
};
const unsigned *program = brw_compile_cs(compiler, mem_ctx, ¶ms);
if (program == NULL) {
dbg_printf("Failed to compile compute shader: %s\n", params.error_str);
shader->compilation_failed = true;
util_queue_fence_signal(&shader->ready);
return;
}
shader->compilation_failed = false;
iris_debug_recompile(screen, dbg, ish, &brw_key.base);
iris_finalize_program(shader, prog_data, NULL, system_values,
num_system_values, ish->kernel_input_size, num_cbufs,
&bt);
iris_upload_shader(screen, ish, shader, NULL, uploader, IRIS_CACHE_CS,
sizeof(*key), key, program);
iris_disk_cache_store(screen->disk_cache, ish, shader, key, sizeof(*key));
ralloc_free(mem_ctx);
}
static void
iris_update_compiled_cs(struct iris_context *ice)
{
struct iris_shader_state *shs = &ice->state.shaders[MESA_SHADER_COMPUTE];
struct u_upload_mgr *uploader = ice->shaders.uploader_driver;
struct iris_uncompiled_shader *ish =
ice->shaders.uncompiled[MESA_SHADER_COMPUTE];
struct iris_screen *screen = (struct iris_screen *)ice->ctx.screen;
struct iris_cs_prog_key key = { KEY_INIT(base) };
screen->vtbl.populate_cs_key(ice, &key);
struct iris_compiled_shader *old = ice->shaders.prog[IRIS_CACHE_CS];
bool added;
struct iris_compiled_shader *shader =
find_or_add_variant(screen, ish, IRIS_CACHE_CS, &key,
sizeof(key), &added);
if (added && !iris_disk_cache_retrieve(screen, uploader, ish, shader,
&key, sizeof(key))) {
iris_compile_cs(screen, uploader, &ice->dbg, ish, shader);
}
if (shader->compilation_failed)
shader = NULL;
if (old != shader) {
iris_shader_variant_reference(&ice->shaders.prog[MESA_SHADER_COMPUTE],
shader);
ice->state.stage_dirty |= IRIS_STAGE_DIRTY_CS |
IRIS_STAGE_DIRTY_BINDINGS_CS |
IRIS_STAGE_DIRTY_CONSTANTS_CS;
shs->sysvals_need_upload = true;
}
}
void
iris_update_compiled_compute_shader(struct iris_context *ice)
{
if (ice->state.stage_dirty & IRIS_STAGE_DIRTY_UNCOMPILED_CS)
iris_update_compiled_cs(ice);
if (ice->state.stage_dirty & IRIS_STAGE_DIRTY_CONSTANTS_CS)
iris_update_pull_constant_descriptors(ice, MESA_SHADER_COMPUTE);
}
void
iris_fill_cs_push_const_buffer(struct brw_cs_prog_data *cs_prog_data,
unsigned threads,
uint32_t *dst)
{
assert(brw_cs_push_const_total_size(cs_prog_data, threads) > 0);
assert(cs_prog_data->push.cross_thread.size == 0);
assert(cs_prog_data->push.per_thread.dwords == 1);
assert(cs_prog_data->base.param[0] == BRW_PARAM_BUILTIN_SUBGROUP_ID);
for (unsigned t = 0; t < threads; t++)
dst[8 * t] = t;
}
/**
* Allocate scratch BOs as needed for the given per-thread size and stage.
*/
struct iris_bo *
iris_get_scratch_space(struct iris_context *ice,
unsigned per_thread_scratch,
gl_shader_stage stage)
{
struct iris_screen *screen = (struct iris_screen *)ice->ctx.screen;
struct iris_bufmgr *bufmgr = screen->bufmgr;
const struct intel_device_info *devinfo = &screen->devinfo;
unsigned encoded_size = ffs(per_thread_scratch) - 11;
assert(encoded_size < ARRAY_SIZE(ice->shaders.scratch_bos));
assert(per_thread_scratch == 1 << (encoded_size + 10));
/* On GFX version 12.5, scratch access changed to a surface-based model.
* Instead of each shader type having its own layout based on IDs passed
* from the relevant fixed-function unit, all scratch access is based on
* thread IDs like it always has been for compute.
*/
if (devinfo->verx10 >= 125)
stage = MESA_SHADER_COMPUTE;
struct iris_bo **bop = &ice->shaders.scratch_bos[encoded_size][stage];
if (!*bop) {
assert(stage < ARRAY_SIZE(devinfo->max_scratch_ids));
uint32_t size = per_thread_scratch * devinfo->max_scratch_ids[stage];
*bop = iris_bo_alloc(bufmgr, "scratch", size, 1024,
IRIS_MEMZONE_SHADER, 0);
}
return *bop;
}
const struct iris_state_ref *
iris_get_scratch_surf(struct iris_context *ice,
unsigned per_thread_scratch)
{
struct iris_screen *screen = (struct iris_screen *)ice->ctx.screen;
ASSERTED const struct intel_device_info *devinfo = &screen->devinfo;
assert(devinfo->verx10 >= 125);
unsigned encoded_size = ffs(per_thread_scratch) - 11;
assert(encoded_size < ARRAY_SIZE(ice->shaders.scratch_surfs));
assert(per_thread_scratch == 1 << (encoded_size + 10));
struct iris_state_ref *ref = &ice->shaders.scratch_surfs[encoded_size];
if (ref->res)
return ref;
struct iris_bo *scratch_bo =
iris_get_scratch_space(ice, per_thread_scratch, MESA_SHADER_COMPUTE);
void *map = upload_state(ice->state.scratch_surface_uploader, ref,
screen->isl_dev.ss.size, 64);
isl_buffer_fill_state(&screen->isl_dev, map,
.address = scratch_bo->address,
.size_B = scratch_bo->size,
.format = ISL_FORMAT_RAW,
.swizzle = ISL_SWIZZLE_IDENTITY,
.mocs = iris_mocs(scratch_bo, &screen->isl_dev, 0),
.stride_B = per_thread_scratch,
.is_scratch = true);
return ref;
}
/* ------------------------------------------------------------------- */
/**
* The pipe->create_[stage]_state() driver hooks.
*
* Performs basic NIR preprocessing, records any state dependencies, and
* returns an iris_uncompiled_shader as the Gallium CSO.
*
* Actual shader compilation to assembly happens later, at first use.
*/
static void *
iris_create_uncompiled_shader(struct iris_screen *screen,
nir_shader *nir,
const struct pipe_stream_output_info *so_info)
{
struct iris_uncompiled_shader *ish =
calloc(1, sizeof(struct iris_uncompiled_shader));
if (!ish)
return NULL;
pipe_reference_init(&ish->ref, 1);
list_inithead(&ish->variants);
simple_mtx_init(&ish->lock, mtx_plain);
util_queue_fence_init(&ish->ready);
ish->uses_atomic_load_store = iris_uses_image_atomic(nir);
ish->program_id = get_new_program_id(screen);
ish->nir = nir;
if (so_info) {
memcpy(&ish->stream_output, so_info, sizeof(*so_info));
update_so_info(&ish->stream_output, nir->info.outputs_written);
}
if (screen->disk_cache) {
/* Serialize the NIR to a binary blob that we can hash for the disk
* cache. Drop unnecessary information (like variable names)
* so the serialized NIR is smaller, and also to let us detect more
* isomorphic shaders when hashing, increasing cache hits.
*/
struct blob blob;
blob_init(&blob);
nir_serialize(&blob, nir, true);
_mesa_sha1_compute(blob.data, blob.size, ish->nir_sha1);
blob_finish(&blob);
}
return ish;
}
static void *
iris_create_compute_state(struct pipe_context *ctx,
const struct pipe_compute_state *state)
{
struct iris_context *ice = (void *) ctx;
struct iris_screen *screen = (void *) ctx->screen;
struct u_upload_mgr *uploader = ice->shaders.uploader_unsync;
const nir_shader_compiler_options *options =
screen->compiler->nir_options[MESA_SHADER_COMPUTE];
nir_shader *nir;
switch (state->ir_type) {
case PIPE_SHADER_IR_NIR:
nir = (void *)state->prog;
break;
case PIPE_SHADER_IR_NIR_SERIALIZED: {
struct blob_reader reader;
const struct pipe_binary_program_header *hdr = state->prog;
blob_reader_init(&reader, hdr->blob, hdr->num_bytes);
nir = nir_deserialize(NULL, options, &reader);
break;
}
default:
unreachable("Unsupported IR");
}
/* Most of iris doesn't really care about the difference between compute
* shaders and kernels. We also tend to hard-code COMPUTE everywhere so
* it's way easier if we just normalize to COMPUTE here.
*/
assert(nir->info.stage == MESA_SHADER_COMPUTE ||
nir->info.stage == MESA_SHADER_KERNEL);
nir->info.stage = MESA_SHADER_COMPUTE;
struct iris_uncompiled_shader *ish =
iris_create_uncompiled_shader(screen, nir, NULL);
ish->kernel_input_size = state->req_input_mem;
ish->kernel_shared_size = state->req_local_mem;
// XXX: disallow more than 64KB of shared variables
if (screen->precompile) {
struct iris_cs_prog_key key = { KEY_INIT(base) };
struct iris_compiled_shader *shader =
iris_create_shader_variant(screen, NULL, IRIS_CACHE_CS,
sizeof(key), &key);
/* Append our new variant to the shader's variant list. */
list_addtail(&shader->link, &ish->variants);
if (!iris_disk_cache_retrieve(screen, uploader, ish, shader,
&key, sizeof(key))) {
iris_compile_cs(screen, uploader, &ice->dbg, ish, shader);
}
}
return ish;
}
static void
iris_compile_shader(void *_job, UNUSED void *_gdata, UNUSED int thread_index)
{
const struct iris_threaded_compile_job *job =
(struct iris_threaded_compile_job *) _job;
struct iris_screen *screen = job->screen;
struct u_upload_mgr *uploader = job->uploader;
struct util_debug_callback *dbg = job->dbg;
struct iris_uncompiled_shader *ish = job->ish;
struct iris_compiled_shader *shader = job->shader;
switch (ish->nir->info.stage) {
case MESA_SHADER_VERTEX:
iris_compile_vs(screen, uploader, dbg, ish, shader);
break;
case MESA_SHADER_TESS_CTRL:
iris_compile_tcs(screen, NULL, uploader, dbg, ish, shader);
break;
case MESA_SHADER_TESS_EVAL:
iris_compile_tes(screen, uploader, dbg, ish, shader);
break;
case MESA_SHADER_GEOMETRY:
iris_compile_gs(screen, uploader, dbg, ish, shader);
break;
case MESA_SHADER_FRAGMENT:
iris_compile_fs(screen, uploader, dbg, ish, shader, NULL);
break;
default:
unreachable("Invalid shader stage.");
}
}
static void *
iris_create_shader_state(struct pipe_context *ctx,
const struct pipe_shader_state *state)
{
struct iris_context *ice = (void *) ctx;
struct iris_screen *screen = (void *) ctx->screen;
struct nir_shader *nir;
if (state->type == PIPE_SHADER_IR_TGSI)
nir = tgsi_to_nir(state->tokens, ctx->screen, false);
else
nir = state->ir.nir;
const struct shader_info *const info = &nir->info;
struct iris_uncompiled_shader *ish =
iris_create_uncompiled_shader(screen, nir, &state->stream_output);
union iris_any_prog_key key;
unsigned key_size = 0;
memset(&key, 0, sizeof(key));
switch (info->stage) {
case MESA_SHADER_VERTEX:
/* User clip planes */
if (info->clip_distance_array_size == 0)
ish->nos |= (1ull << IRIS_NOS_RASTERIZER);
key.vs = (struct iris_vs_prog_key) { KEY_INIT(vue.base) };
key_size = sizeof(key.vs);
break;
case MESA_SHADER_TESS_CTRL: {
key.tcs = (struct iris_tcs_prog_key) {
KEY_INIT(vue.base),
// XXX: make sure the linker fills this out from the TES...
._tes_primitive_mode =
info->tess._primitive_mode ? info->tess._primitive_mode
: TESS_PRIMITIVE_TRIANGLES,
.outputs_written = info->outputs_written,
.patch_outputs_written = info->patch_outputs_written,
};
/* MULTI_PATCH mode needs the key to contain the input patch dimensionality.
* We don't have that information, so we randomly guess that the input
* and output patches are the same size. This is a bad guess, but we
* can't do much better.
*/
if (screen->compiler->use_tcs_multi_patch)
key.tcs.input_vertices = info->tess.tcs_vertices_out;
key_size = sizeof(key.tcs);
break;
}
case MESA_SHADER_TESS_EVAL:
/* User clip planes */
if (info->clip_distance_array_size == 0)
ish->nos |= (1ull << IRIS_NOS_RASTERIZER);
key.tes = (struct iris_tes_prog_key) {
KEY_INIT(vue.base),
// XXX: not ideal, need TCS output/TES input unification
.inputs_read = info->inputs_read,
.patch_inputs_read = info->patch_inputs_read,
};
key_size = sizeof(key.tes);
break;
case MESA_SHADER_GEOMETRY:
/* User clip planes */
if (info->clip_distance_array_size == 0)
ish->nos |= (1ull << IRIS_NOS_RASTERIZER);
key.gs = (struct iris_gs_prog_key) { KEY_INIT(vue.base) };
key_size = sizeof(key.gs);
break;
case MESA_SHADER_FRAGMENT:
ish->nos |= (1ull << IRIS_NOS_FRAMEBUFFER) |
(1ull << IRIS_NOS_DEPTH_STENCIL_ALPHA) |
(1ull << IRIS_NOS_RASTERIZER) |
(1ull << IRIS_NOS_BLEND);
/* The program key needs the VUE map if there are > 16 inputs */
if (util_bitcount64(info->inputs_read & BRW_FS_VARYING_INPUT_MASK) > 16) {
ish->nos |= (1ull << IRIS_NOS_LAST_VUE_MAP);
}
const uint64_t color_outputs = info->outputs_written &
~(BITFIELD64_BIT(FRAG_RESULT_DEPTH) |
BITFIELD64_BIT(FRAG_RESULT_STENCIL) |
BITFIELD64_BIT(FRAG_RESULT_SAMPLE_MASK));
bool can_rearrange_varyings =
util_bitcount64(info->inputs_read & BRW_FS_VARYING_INPUT_MASK) <= 16;
const struct intel_device_info *devinfo = &screen->devinfo;
key.fs = (struct iris_fs_prog_key) {
KEY_INIT(base),
.nr_color_regions = util_bitcount(color_outputs),
.coherent_fb_fetch = devinfo->ver >= 9,
.input_slots_valid =
can_rearrange_varyings ? 0 : info->inputs_read | VARYING_BIT_POS,
};
key_size = sizeof(key.fs);
break;
default:
unreachable("Invalid shader stage.");
}
if (screen->precompile) {
struct u_upload_mgr *uploader = ice->shaders.uploader_unsync;
struct iris_compiled_shader *shader =
iris_create_shader_variant(screen, NULL,
(enum iris_program_cache_id) info->stage,
key_size, &key);
/* Append our new variant to the shader's variant list. */
list_addtail(&shader->link, &ish->variants);
if (!iris_disk_cache_retrieve(screen, uploader, ish, shader,
&key, key_size)) {
assert(!util_queue_fence_is_signalled(&shader->ready));
struct iris_threaded_compile_job *job = calloc(1, sizeof(*job));
job->screen = screen;
job->uploader = uploader;
job->ish = ish;
job->shader = shader;
iris_schedule_compile(screen, &ish->ready, &ice->dbg, job,
iris_compile_shader);
}
}
return ish;
}
/**
* Called when the refcount on the iris_uncompiled_shader reaches 0.
*
* Frees the iris_uncompiled_shader.
*
* \sa iris_delete_shader_state
*/
void
iris_destroy_shader_state(struct pipe_context *ctx, void *state)
{
struct iris_uncompiled_shader *ish = state;
/* No need to take ish->lock; we hold the last reference to ish */
list_for_each_entry_safe(struct iris_compiled_shader, shader,
&ish->variants, link) {
list_del(&shader->link);
iris_shader_variant_reference(&shader, NULL);
}
simple_mtx_destroy(&ish->lock);
util_queue_fence_destroy(&ish->ready);
ralloc_free(ish->nir);
free(ish);
}
/**
* The pipe->delete_[stage]_state() driver hooks.
*
* \sa iris_destroy_shader_state
*/
static void
iris_delete_shader_state(struct pipe_context *ctx, void *state)
{
struct iris_uncompiled_shader *ish = state;
struct iris_context *ice = (void *) ctx;
const gl_shader_stage stage = ish->nir->info.stage;
if (ice->shaders.uncompiled[stage] == ish) {
ice->shaders.uncompiled[stage] = NULL;
ice->state.stage_dirty |= IRIS_STAGE_DIRTY_UNCOMPILED_VS << stage;
}
if (pipe_reference(&ish->ref, NULL))
iris_destroy_shader_state(ctx, state);
}
/**
* The pipe->bind_[stage]_state() driver hook.
*
* Binds an uncompiled shader as the current one for a particular stage.
* Updates dirty tracking to account for the shader's NOS.
*/
static void
bind_shader_state(struct iris_context *ice,
struct iris_uncompiled_shader *ish,
gl_shader_stage stage)
{
uint64_t stage_dirty_bit = IRIS_STAGE_DIRTY_UNCOMPILED_VS << stage;
const uint64_t nos = ish ? ish->nos : 0;
const struct shader_info *old_info = iris_get_shader_info(ice, stage);
const struct shader_info *new_info = ish ? &ish->nir->info : NULL;
if ((old_info ? BITSET_LAST_BIT(old_info->samplers_used) : 0) !=
(new_info ? BITSET_LAST_BIT(new_info->samplers_used) : 0)) {
ice->state.stage_dirty |= IRIS_STAGE_DIRTY_SAMPLER_STATES_VS << stage;
}
ice->shaders.uncompiled[stage] = ish;
ice->state.stage_dirty |= stage_dirty_bit;
/* Record that CSOs need to mark IRIS_DIRTY_UNCOMPILED_XS when they change
* (or that they no longer need to do so).
*/
for (int i = 0; i < IRIS_NOS_COUNT; i++) {
if (nos & (1 << i))
ice->state.stage_dirty_for_nos[i] |= stage_dirty_bit;
else
ice->state.stage_dirty_for_nos[i] &= ~stage_dirty_bit;
}
}
static void
iris_bind_vs_state(struct pipe_context *ctx, void *state)
{
struct iris_context *ice = (struct iris_context *)ctx;
struct iris_uncompiled_shader *ish = state;
if (ish) {
const struct shader_info *info = &ish->nir->info;
if (ice->state.window_space_position != info->vs.window_space_position) {
ice->state.window_space_position = info->vs.window_space_position;
ice->state.dirty |= IRIS_DIRTY_CLIP |
IRIS_DIRTY_RASTER |
IRIS_DIRTY_CC_VIEWPORT;
}
const bool uses_draw_params =
BITSET_TEST(info->system_values_read, SYSTEM_VALUE_FIRST_VERTEX) ||
BITSET_TEST(info->system_values_read, SYSTEM_VALUE_BASE_INSTANCE);
const bool uses_derived_draw_params =
BITSET_TEST(info->system_values_read, SYSTEM_VALUE_DRAW_ID) ||
BITSET_TEST(info->system_values_read, SYSTEM_VALUE_IS_INDEXED_DRAW);
const bool needs_sgvs_element = uses_draw_params ||
BITSET_TEST(info->system_values_read, SYSTEM_VALUE_INSTANCE_ID) ||
BITSET_TEST(info->system_values_read,
SYSTEM_VALUE_VERTEX_ID_ZERO_BASE);
if (ice->state.vs_uses_draw_params != uses_draw_params ||
ice->state.vs_uses_derived_draw_params != uses_derived_draw_params ||
ice->state.vs_needs_edge_flag != info->vs.needs_edge_flag ||
ice->state.vs_needs_sgvs_element != needs_sgvs_element) {
ice->state.dirty |= IRIS_DIRTY_VERTEX_BUFFERS |
IRIS_DIRTY_VERTEX_ELEMENTS;
}
ice->state.vs_uses_draw_params = uses_draw_params;
ice->state.vs_uses_derived_draw_params = uses_derived_draw_params;
ice->state.vs_needs_sgvs_element = needs_sgvs_element;
ice->state.vs_needs_edge_flag = info->vs.needs_edge_flag;
}
bind_shader_state((void *) ctx, state, MESA_SHADER_VERTEX);
}
static void
iris_bind_tcs_state(struct pipe_context *ctx, void *state)
{
bind_shader_state((void *) ctx, state, MESA_SHADER_TESS_CTRL);
}
static void
iris_bind_tes_state(struct pipe_context *ctx, void *state)
{
struct iris_context *ice = (struct iris_context *)ctx;
struct iris_screen *screen = (struct iris_screen *) ctx->screen;
const struct intel_device_info *devinfo = &screen->devinfo;
/* Enabling/disabling optional stages requires a URB reconfiguration. */
if (!!state != !!ice->shaders.uncompiled[MESA_SHADER_TESS_EVAL])
ice->state.dirty |= IRIS_DIRTY_URB | (devinfo->verx10 >= 125 ?
IRIS_DIRTY_VFG : 0);
bind_shader_state((void *) ctx, state, MESA_SHADER_TESS_EVAL);
}
static void
iris_bind_gs_state(struct pipe_context *ctx, void *state)
{
struct iris_context *ice = (struct iris_context *)ctx;
/* Enabling/disabling optional stages requires a URB reconfiguration. */
if (!!state != !!ice->shaders.uncompiled[MESA_SHADER_GEOMETRY])
ice->state.dirty |= IRIS_DIRTY_URB;
bind_shader_state((void *) ctx, state, MESA_SHADER_GEOMETRY);
}
static void
iris_bind_fs_state(struct pipe_context *ctx, void *state)
{
struct iris_context *ice = (struct iris_context *) ctx;
struct iris_screen *screen = (struct iris_screen *) ctx->screen;
const struct intel_device_info *devinfo = &screen->devinfo;
struct iris_uncompiled_shader *old_ish =
ice->shaders.uncompiled[MESA_SHADER_FRAGMENT];
struct iris_uncompiled_shader *new_ish = state;
const unsigned color_bits =
BITFIELD64_BIT(FRAG_RESULT_COLOR) |
BITFIELD64_RANGE(FRAG_RESULT_DATA0, BRW_MAX_DRAW_BUFFERS);
/* Fragment shader outputs influence HasWriteableRT */
if (!old_ish || !new_ish ||
(old_ish->nir->info.outputs_written & color_bits) !=
(new_ish->nir->info.outputs_written & color_bits))
ice->state.dirty |= IRIS_DIRTY_PS_BLEND;
if (devinfo->ver == 8)
ice->state.dirty |= IRIS_DIRTY_PMA_FIX;
bind_shader_state((void *) ctx, state, MESA_SHADER_FRAGMENT);
}
static void
iris_bind_cs_state(struct pipe_context *ctx, void *state)
{
bind_shader_state((void *) ctx, state, MESA_SHADER_COMPUTE);
}
static char *
iris_finalize_nir(struct pipe_screen *_screen, void *nirptr)
{
struct iris_screen *screen = (struct iris_screen *)_screen;
struct nir_shader *nir = (struct nir_shader *) nirptr;
const struct intel_device_info *devinfo = &screen->devinfo;
NIR_PASS_V(nir, iris_fix_edge_flags);
struct brw_nir_compiler_opts opts = {};
brw_preprocess_nir(screen->compiler, nir, &opts);
NIR_PASS_V(nir, brw_nir_lower_storage_image, devinfo);
NIR_PASS_V(nir, iris_lower_storage_image_derefs);
nir_sweep(nir);
return NULL;
}
static void
iris_set_max_shader_compiler_threads(struct pipe_screen *pscreen,
unsigned max_threads)
{
struct iris_screen *screen = (struct iris_screen *) pscreen;
util_queue_adjust_num_threads(&screen->shader_compiler_queue, max_threads);
}
static bool
iris_is_parallel_shader_compilation_finished(struct pipe_screen *pscreen,
void *v_shader,
enum pipe_shader_type p_stage)
{
struct iris_screen *screen = (struct iris_screen *) pscreen;
/* Threaded compilation is only used for the precompile. If precompile is
* disabled, threaded compilation is "done."
*/
if (!screen->precompile)
return true;
struct iris_uncompiled_shader *ish = v_shader;
/* When precompile is enabled, the first entry is the precompile variant.
* Check the ready fence of the precompile variant.
*/
struct iris_compiled_shader *first =
list_first_entry(&ish->variants, struct iris_compiled_shader, link);
return util_queue_fence_is_signalled(&first->ready);
}
void
iris_init_screen_program_functions(struct pipe_screen *pscreen)
{
pscreen->is_parallel_shader_compilation_finished =
iris_is_parallel_shader_compilation_finished;
pscreen->set_max_shader_compiler_threads =
iris_set_max_shader_compiler_threads;
pscreen->finalize_nir = iris_finalize_nir;
}
void
iris_init_program_functions(struct pipe_context *ctx)
{
ctx->create_vs_state = iris_create_shader_state;
ctx->create_tcs_state = iris_create_shader_state;
ctx->create_tes_state = iris_create_shader_state;
ctx->create_gs_state = iris_create_shader_state;
ctx->create_fs_state = iris_create_shader_state;
ctx->create_compute_state = iris_create_compute_state;
ctx->delete_vs_state = iris_delete_shader_state;
ctx->delete_tcs_state = iris_delete_shader_state;
ctx->delete_tes_state = iris_delete_shader_state;
ctx->delete_gs_state = iris_delete_shader_state;
ctx->delete_fs_state = iris_delete_shader_state;
ctx->delete_compute_state = iris_delete_shader_state;
ctx->bind_vs_state = iris_bind_vs_state;
ctx->bind_tcs_state = iris_bind_tcs_state;
ctx->bind_tes_state = iris_bind_tes_state;
ctx->bind_gs_state = iris_bind_gs_state;
ctx->bind_fs_state = iris_bind_fs_state;
ctx->bind_compute_state = iris_bind_cs_state;
}
|
cb85866c6fbfb15a723c4665b7e0e72c22514e14
|
28d0f8c01599f8f6c711bdde0b59f9c2cd221203
|
/sys/arch/evbppc/virtex/dcr.c
|
e2068fe0db82d5d41714394ab43413ec20bd4439
|
[] |
no_license
|
NetBSD/src
|
1a9cbc22ed778be638b37869ed4fb5c8dd616166
|
23ee83f7c0aea0777bd89d8ebd7f0cde9880d13c
|
refs/heads/trunk
| 2023-08-31T13:24:58.105962
| 2023-08-27T15:50:47
| 2023-08-27T15:50:47
| 88,439,547
| 656
| 348
| null | 2023-07-20T20:07:24
| 2017-04-16T20:03:43
| null |
UTF-8
|
C
| false
| false
| 2,393
|
c
|
dcr.c
|
/* $NetBSD: dcr.c,v 1.3 2022/03/10 00:14:16 riastradh Exp $ */
/*
* Copyright (c) 2006 Jachym Holecek
* All rights reserved.
*
* Written for DFC Design, s.r.o.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* DCR bus space size & base addresses are hardcoded and runtime-checked,
* so there's no point in maintaning extents etc -- just provide placebo
* implementations so that we can use bus_space as usual (add more as
* needed).
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dcr.c,v 1.3 2022/03/10 00:14:16 riastradh Exp $");
#include <sys/types.h>
#include <sys/bus.h>
#include <evbppc/virtex/dcr.h>
int
dcr_map(bus_space_tag_t bst, bus_addr_t addr, bus_size_t size, int flags,
bus_space_handle_t *bsh)
{
*bsh = addr;
return (0);
}
void
dcr_unmap(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t size)
{
/* Nothing to do. */
}
int
dcr_subregion(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t offset,
bus_size_t size, bus_space_handle_t *bshp)
{
*bshp = bsh + offset;
return (0);
}
void
dcr_barrier(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t offset,
bus_size_t size, int flags)
{
/* XXX EIEIO? */
}
|
d7fd3aed7568faf32429ecb59611162283b45283
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/arch/cris/include/arch-v10/arch/irq.h
|
ca2675ae08ed95d1c3de56ad0a507af390b348e3
|
[
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later",
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 6,078
|
h
|
irq.h
|
/*
* Interrupt handling assembler and defines for Linux/CRISv10
*/
#ifndef _ASM_ARCH_IRQ_H
#define _ASM_ARCH_IRQ_H
#include <arch/sv_addr_ag.h>
#define NR_IRQS 32
/* The first vector number used for IRQs in v10 is really 0x20 */
/* but all the code and constants are offseted to make 0 the first */
#define FIRST_IRQ 0
#define SOME_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, some) /* 0 ? */
#define NMI_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, nmi) /* 1 */
#define TIMER0_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, timer0) /* 2 */
#define TIMER1_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, timer1) /* 3 */
/* mio, ata, par0, scsi0 on 4 */
/* par1, scsi1 on 5 */
#define NETWORK_STATUS_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, network) /* 6 */
#define SERIAL_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, serial) /* 8 */
#define PA_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, pa) /* 11 */
/* extdma0 and extdma1 is at irq 12 and 13 and/or same as dma5 and dma6 ? */
#define EXTDMA0_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, ext_dma0)
#define EXTDMA1_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, ext_dma1)
/* dma0-9 is irq 16..25 */
/* 16,17: network */
#define DMA0_TX_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, dma0)
#define DMA1_RX_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, dma1)
#define NETWORK_DMA_TX_IRQ_NBR DMA0_TX_IRQ_NBR
#define NETWORK_DMA_RX_IRQ_NBR DMA1_RX_IRQ_NBR
/* 18,19: dma2 and dma3 shared by par0, scsi0, ser2 and ata */
#define DMA2_TX_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, dma2)
#define DMA3_RX_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, dma3)
#define SER2_DMA_TX_IRQ_NBR DMA2_TX_IRQ_NBR
#define SER2_DMA_RX_IRQ_NBR DMA3_RX_IRQ_NBR
/* 20,21: dma4 and dma5 shared by par1, scsi1, ser3 and extdma0 */
#define DMA4_TX_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, dma4)
#define DMA5_RX_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, dma5)
#define SER3_DMA_TX_IRQ_NBR DMA4_TX_IRQ_NBR
#define SER3_DMA_RX_IRQ_NBR DMA5_RX_IRQ_NBR
/* 22,23: dma6 and dma7 shared by ser0, extdma1 and mem2mem */
#define DMA6_TX_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, dma6)
#define DMA7_RX_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, dma7)
#define SER0_DMA_TX_IRQ_NBR DMA6_TX_IRQ_NBR
#define SER0_DMA_RX_IRQ_NBR DMA7_RX_IRQ_NBR
#define MEM2MEM_DMA_TX_IRQ_NBR DMA6_TX_IRQ_NBR
#define MEM2MEM_DMA_RX_IRQ_NBR DMA7_RX_IRQ_NBR
/* 24,25: dma8 and dma9 shared by ser1 and usb */
#define DMA8_TX_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, dma8)
#define DMA9_RX_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, dma9)
#define SER1_DMA_TX_IRQ_NBR DMA8_TX_IRQ_NBR
#define SER1_DMA_RX_IRQ_NBR DMA9_RX_IRQ_NBR
#define USB_DMA_TX_IRQ_NBR DMA8_TX_IRQ_NBR
#define USB_DMA_RX_IRQ_NBR DMA9_RX_IRQ_NBR
/* usb: controller at irq 31 + uses DMA8 and DMA9 */
#define USB_HC_IRQ_NBR IO_BITNR(R_VECT_MASK_RD, usb)
/* our fine, global, etrax irq vector! the pointer lives in the head.S file. */
typedef void (*irqvectptr)(void);
struct etrax_interrupt_vector {
irqvectptr v[256];
};
extern struct etrax_interrupt_vector *etrax_irv;
void set_int_vector(int n, irqvectptr addr);
void set_break_vector(int n, irqvectptr addr);
#define __STR(x) #x
#define STR(x) __STR(x)
/* SAVE_ALL saves registers so they match pt_regs */
#define SAVE_ALL \
"move $irp,[$sp=$sp-16]\n\t" /* push instruction pointer and fake SBFS struct */ \
"push $srp\n\t" /* push subroutine return pointer */ \
"push $dccr\n\t" /* push condition codes */ \
"push $mof\n\t" /* push multiply overflow reg */ \
"di\n\t" /* need to disable irq's at this point */\
"subq 14*4,$sp\n\t" /* make room for r0-r13 */ \
"movem $r13,[$sp]\n\t" /* push the r0-r13 registers */ \
"push $r10\n\t" /* push orig_r10 */ \
"clear.d [$sp=$sp-4]\n\t" /* frametype - this is a normal stackframe */
/* BLOCK_IRQ and UNBLOCK_IRQ do the same as
* crisv10_mask_irq and crisv10_unmask_irq */
#define BLOCK_IRQ(mask,nr) \
"move.d " #mask ",$r0\n\t" \
"move.d $r0,[0xb00000d8]\n\t"
#define UNBLOCK_IRQ(mask) \
"move.d " #mask ",$r0\n\t" \
"move.d $r0,[0xb00000dc]\n\t"
#define IRQ_NAME2(nr) nr##_interrupt(void)
#define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
#define sIRQ_NAME(nr) IRQ_NAME2(sIRQ##nr)
#define BAD_IRQ_NAME(nr) IRQ_NAME2(bad_IRQ##nr)
/* the asm IRQ handler makes sure the causing IRQ is blocked, then it calls
* do_IRQ (with irq disabled still). after that it unblocks and jumps to
* ret_from_intr (entry.S)
*
* The reason the IRQ is blocked is to allow an sti() before the handler which
* will acknowledge the interrupt is run.
*/
#define BUILD_IRQ(nr,mask) \
void IRQ_NAME(nr); \
__asm__ ( \
".text\n\t" \
"IRQ" #nr "_interrupt:\n\t" \
SAVE_ALL \
BLOCK_IRQ(mask,nr) /* this must be done to prevent irq loops when we ei later */ \
"moveq "#nr",$r10\n\t" \
"move.d $sp,$r11\n\t" \
"jsr do_IRQ\n\t" /* irq.c, r10 and r11 are arguments */ \
UNBLOCK_IRQ(mask) \
"moveq 0,$r9\n\t" /* make ret_from_intr realise we came from an irq */ \
"jump ret_from_intr\n\t");
/* This is subtle. The timer interrupt is crucial and it should not be disabled for
* too long. However, if it had been a normal interrupt as per BUILD_IRQ, it would
* have been BLOCK'ed, and then softirq's are run before we return here to UNBLOCK.
* If the softirq's take too much time to run, the timer irq won't run and the
* watchdog will kill us.
*
* Furthermore, if a lot of other irq's occur before we return here, the multiple_irq
* handler is run and it prioritizes the timer interrupt. However if we had BLOCK'ed
* it here, we would not get the multiple_irq at all.
*
* The non-blocking here is based on the knowledge that the timer interrupt is
* registered as a fast interrupt (IRQF_DISABLED) so that we _know_ there will not
* be an sti() before the timer irq handler is run to acknowledge the interrupt.
*/
#define BUILD_TIMER_IRQ(nr,mask) \
void IRQ_NAME(nr); \
__asm__ ( \
".text\n\t" \
"IRQ" #nr "_interrupt:\n\t" \
SAVE_ALL \
"moveq "#nr",$r10\n\t" \
"move.d $sp,$r11\n\t" \
"jsr do_IRQ\n\t" /* irq.c, r10 and r11 are arguments */ \
"moveq 0,$r9\n\t" /* make ret_from_intr realise we came from an irq */ \
"jump ret_from_intr\n\t");
#endif
|
cbd5410b3a4db2507f82c16d0812d0f825b2c07f
|
b9dc55919b29da24c24f8ee367c5618c9532f56f
|
/Code_source/Compiled/signal/decay2~.c
|
ba59fc1f47ccb5c234bff11249169b4abf63d42d
|
[
"WTFPL",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
porres/pd-else
|
075e8b7ac7a78f442055fbd30d6602cae49c887e
|
b30e8c13c88bb9752c08f78514d64c6206d6678b
|
refs/heads/master
| 2023-08-18T22:26:31.120893
| 2023-08-18T00:46:59
| 2023-08-18T00:46:59
| 56,870,805
| 238
| 42
|
WTFPL
| 2023-09-12T15:55:56
| 2016-04-22T16:45:29
|
C
|
UTF-8
|
C
| false
| false
| 4,029
|
c
|
decay2~.c
|
// Porres 2017
#include "m_pd.h"
#include <math.h>
#define LOG001 log(0.001)
typedef struct _decay2{
t_object x_obj;
t_inlet *x_inlet_attack;
t_inlet *x_inlet_decay;
t_outlet *x_out;
t_float x_sr_khz;
t_int x_flag;
double x_last1;
double x_last2;
double x_f;
}t_decay2;
static t_class *decay2_class;
static void decay2_bang(t_decay2 *x){
x->x_flag = 1;
}
static void decay2_float(t_decay2 *x, t_float f){
x->x_f = (double)f;
x->x_flag = 1;
}
static t_int *decay2_perform(t_int *w){
t_decay2 *x = (t_decay2 *)(w[1]);
int nblock = (int)(w[2]);
t_float *in1 = (t_float *)(w[3]);
t_float *in2 = (t_float *)(w[4]);
t_float *in3 = (t_float *)(w[5]);
t_float *out = (t_float *)(w[6]);
double last1 = x->x_last1;
double last2 = x->x_last2;
t_float sr_khz = x->x_sr_khz;
while(nblock--){
double a1, a2, yn1, yn2, a, b, n, t, xn = *in1++, attack = *in2++, decay = *in3++;
if(x->x_flag){
xn = x->x_f;
x->x_flag = 0;
}
if(attack <= 0)
yn1 = 0;
else{
a1 = exp(LOG001 / (attack * sr_khz));
yn1 = xn + a1 * last1;
last1 = yn1;
a = 1000 * log(1000) / attack;
}
if (decay <= 0)
yn2 = xn;
else{
a2 = exp(LOG001 / (decay * sr_khz));
yn2 = xn + a2 * last2;
last2 = yn2;
b = 1000 * log(1000) / decay;
}
if((attack > 0 && decay > 0) && (attack != decay)){
t = log(a/b) / (a-b);
n = fabs(1/(exp(-b*t) - exp(-a*t)));
*out++ = (yn2 - yn1) * n;
}
else
*out++ = yn2 - yn1;
}
x->x_last1 = last1;
x->x_last2 = last2;
return (w + 7);
}
static void decay2_dsp(t_decay2 *x, t_signal **sp)
{
x->x_sr_khz = sp[0]->s_sr * 0.001;
dsp_add(decay2_perform, 6, x, sp[0]->s_n, sp[0]->s_vec,
sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec);
}
static void decay2_clear(t_decay2 *x)
{
x->x_last1 = 0.;
x->x_last2 = 0.;
}
static void *decay2_new(t_symbol *s, int argc, t_atom *argv){
t_symbol *dummy = s;
dummy = NULL;
t_decay2 *x = (t_decay2 *)pd_new(decay2_class);
float attack = 100;
float decay = 1000;
x->x_f = 1.;
/////////////////////////////////////////////////////////////////////////////////////
int argnum = 0;
while(argc > 0)
{
if(argv -> a_type == A_FLOAT)
{ //if current argument is a float
t_float argval = atom_getfloatarg(0, argc, argv);
switch(argnum)
{
case 0:
attack = argval;
case 1:
decay = argval;
default:
break;
};
argnum++;
argc--;
argv++;
}
else
{
goto errstate;
};
};
/////////////////////////////////////////////////////////////////////////////////////
x->x_inlet_attack = inlet_new((t_object *)x, (t_pd *)x, &s_signal, &s_signal);
pd_float((t_pd *)x->x_inlet_attack, attack);
x->x_inlet_decay = inlet_new((t_object *)x, (t_pd *)x, &s_signal, &s_signal);
pd_float((t_pd *)x->x_inlet_decay, decay);
x->x_out = outlet_new((t_object *)x, &s_signal);
return (x);
errstate:
pd_error(x, "decay2~: improper args");
return NULL;
}
void decay2_tilde_setup(void)
{
decay2_class = class_new(gensym("decay2~"), (t_newmethod)decay2_new, 0,
sizeof(t_decay2), CLASS_DEFAULT, A_GIMME, 0);
class_addmethod(decay2_class, (t_method)decay2_dsp, gensym("dsp"), A_CANT, 0);
class_addmethod(decay2_class, nullfn, gensym("signal"), 0);
class_addmethod(decay2_class, (t_method)decay2_clear, gensym("clear"), 0);
class_addfloat(decay2_class, (t_method)decay2_float);
class_addbang(decay2_class, (t_method)decay2_bang);
}
|
0cfe2bb5a11e025eb749c47633b4b2de45618c5c
|
6373feb75865c2ef98da15d4469dd45268065959
|
/ThirdParty/libzip/zip_algorithm_xz.c
|
f0c2fd37ab1bd52eade8d08c69638d8957fef0df
|
[
"BSD-3-Clause",
"Zlib",
"MIT"
] |
permissive
|
serpentiem/ddmk
|
05ef05f7d65602f77f80e5d54afd60d441220f17
|
d27d40a6e773255f4a5d9b0403e1da87af95ea2d
|
refs/heads/master
| 2022-02-04T07:32:25.441401
| 2022-01-27T20:14:28
| 2022-01-27T20:14:28
| 128,766,177
| 218
| 29
|
Zlib
| 2021-04-18T20:11:06
| 2018-04-09T12:11:06
|
JavaScript
|
UTF-8
|
C
| false
| false
| 12,853
|
c
|
zip_algorithm_xz.c
|
/*
zip_algorithm_xz.c -- LZMA/XZ (de)compression routines
Bazed on zip_algorithm_deflate.c -- deflate (de)compression routines
Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP archives.
The authors can be contacted at <libzip@nih.at>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The names of the authors may not be used to endorse or promote
products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "zipint.h"
#include <limits.h>
#include <lzma.h>
#include <stdlib.h>
#include <zlib.h>
enum header_state { INCOMPLETE, OUTPUT, DONE };
#define HEADER_BYTES_ZIP 9
#define HEADER_MAGIC_LENGTH 4
#define HEADER_MAGIC1_OFFSET 0
#define HEADER_MAGIC2_OFFSET 2
#define HEADER_SIZE_OFFSET 9
#define HEADER_SIZE_LENGTH 8
#define HEADER_PARAMETERS_LENGTH 5
#define HEADER_LZMA_ALONE_LENGTH (HEADER_PARAMETERS_LENGTH + HEADER_SIZE_LENGTH)
struct ctx {
zip_error_t *error;
bool compress;
zip_uint32_t compression_flags;
bool end_of_input;
lzma_stream zstr;
zip_uint16_t method;
/* header member is used for converting from zip to "lzma alone"
* format
*
* "lzma alone" file format starts with:
* 5 bytes lzma parameters
* 8 bytes uncompressed size
* compressed data
*
* zip archive on-disk format starts with
* 4 bytes magic (first two bytes vary, e.g. 0x0914 or 0x1002, next bytes are 0x0500)
* 5 bytes lzma parameters
* compressed data
*
* we read the data into a header of the form
* 4 bytes magic
* 5 bytes lzma parameters
* 8 bytes uncompressed size
*/
zip_uint8_t header[HEADER_MAGIC_LENGTH + HEADER_LZMA_ALONE_LENGTH];
zip_uint8_t header_bytes_offset;
enum header_state header_state;
zip_uint64_t uncompresssed_size;
};
static zip_uint64_t
maximum_compressed_size(zip_uint64_t uncompressed_size) {
/*
According to https://sourceforge.net/p/sevenzip/discussion/45797/thread/b6bd62f8/
1) you can use
outSize = 1.10 * originalSize + 64 KB.
in most cases outSize is less then 1.02 from originalSize.
2) You can try LZMA2, where
outSize can be = 1.001 * originalSize + 1 KB.
*/
/* 13 bytes added for lzma alone header */
zip_uint64_t compressed_size = (zip_uint64_t)((double)uncompressed_size * 1.1) + 64 * 1024 + 13;
if (compressed_size < uncompressed_size) {
return ZIP_UINT64_MAX;
}
return compressed_size;
}
static void *
allocate(bool compress, int compression_flags, zip_error_t *error, zip_uint16_t method) {
struct ctx *ctx;
if ((ctx = (struct ctx *)malloc(sizeof(*ctx))) == NULL) {
zip_error_set(error, ZIP_ER_MEMORY, 0);
return NULL;
}
ctx->error = error;
ctx->compress = compress;
if (compression_flags < 0 || compression_flags > 9) {
ctx->compression_flags = 6; /* default value */
} else {
ctx->compression_flags = (zip_uint32_t)compression_flags;
}
ctx->compression_flags |= LZMA_PRESET_EXTREME;
ctx->end_of_input = false;
memset(ctx->header, 0, sizeof(ctx->header));
ctx->header_bytes_offset = 0;
if (ZIP_CM_LZMA) {
ctx->header_state = INCOMPLETE;
}
else {
ctx->header_state = DONE;
}
memset(&ctx->zstr, 0, sizeof(ctx->zstr));
ctx->method = method;
return ctx;
}
static void *
compress_allocate(zip_uint16_t method, int compression_flags, zip_error_t *error) {
return allocate(true, compression_flags, error, method);
}
static void *
decompress_allocate(zip_uint16_t method, int compression_flags, zip_error_t *error) {
return allocate(false, compression_flags, error, method);
}
static void
deallocate(void *ud) {
struct ctx *ctx = (struct ctx *)ud;
free(ctx);
}
static zip_uint16_t
general_purpose_bit_flags(void *ud) {
struct ctx *ctx = (struct ctx *)ud;
if (!ctx->compress) {
return 0;
}
if (ctx->method == ZIP_CM_LZMA) {
/* liblzma always returns an EOS/EOPM marker, see
* https://sourceforge.net/p/lzmautils/discussion/708858/thread/84c5dbb9/#a5e4/3764 */
return 1 << 1;
}
return 0;
}
static int
map_error(lzma_ret ret) {
switch (ret) {
case LZMA_DATA_ERROR:
case LZMA_UNSUPPORTED_CHECK:
return ZIP_ER_COMPRESSED_DATA;
case LZMA_MEM_ERROR:
return ZIP_ER_MEMORY;
case LZMA_OPTIONS_ERROR:
return ZIP_ER_INVAL;
default:
return ZIP_ER_INTERNAL;
}
}
static bool
start(void *ud, zip_stat_t *st, zip_file_attributes_t *attributes) {
struct ctx *ctx = (struct ctx *)ud;
lzma_ret ret;
lzma_options_lzma opt_lzma;
lzma_lzma_preset(&opt_lzma, ctx->compression_flags);
lzma_filter filters[] = {
{.id = (ctx->method == ZIP_CM_LZMA ? LZMA_FILTER_LZMA1 : LZMA_FILTER_LZMA2), .options = &opt_lzma},
{.id = LZMA_VLI_UNKNOWN, .options = NULL},
};
ctx->zstr.avail_in = 0;
ctx->zstr.next_in = NULL;
ctx->zstr.avail_out = 0;
ctx->zstr.next_out = NULL;
if (ctx->compress) {
if (ctx->method == ZIP_CM_LZMA)
ret = lzma_alone_encoder(&ctx->zstr, filters[0].options);
else
ret = lzma_stream_encoder(&ctx->zstr, filters, LZMA_CHECK_CRC64);
}
else {
if (ctx->method == ZIP_CM_LZMA)
ret = lzma_alone_decoder(&ctx->zstr, UINT64_MAX);
else
ret = lzma_stream_decoder(&ctx->zstr, UINT64_MAX, LZMA_CONCATENATED);
}
if (ret != LZMA_OK) {
zip_error_set(ctx->error, map_error(ret), 0);
return false;
}
/* If general purpose bits 1 & 2 are both zero, write real uncompressed size in header. */
if ((attributes->valid & ZIP_FILE_ATTRIBUTES_GENERAL_PURPOSE_BIT_FLAGS) && (attributes->general_purpose_bit_mask & 0x6) == 0x6 && (attributes->general_purpose_bit_flags & 0x06) == 0 && (st->valid & ZIP_STAT_SIZE)) {
ctx->uncompresssed_size = st->size;
}
else {
ctx->uncompresssed_size = ZIP_UINT64_MAX;
}
return true;
}
static bool
end(void *ud) {
struct ctx *ctx = (struct ctx *)ud;
lzma_end(&ctx->zstr);
return true;
}
static bool
input(void *ud, zip_uint8_t *data, zip_uint64_t length) {
struct ctx *ctx = (struct ctx *)ud;
if (length > UINT_MAX || ctx->zstr.avail_in > 0) {
zip_error_set(ctx->error, ZIP_ER_INVAL, 0);
return false;
}
/* For decompression of LZMA1: Have we read the full "lzma alone" header yet? */
if (ctx->method == ZIP_CM_LZMA && !ctx->compress && ctx->header_state == INCOMPLETE) {
/* if not, get more of the data */
zip_uint8_t got = (zip_uint8_t)ZIP_MIN(HEADER_BYTES_ZIP - ctx->header_bytes_offset, length);
memcpy(ctx->header + ctx->header_bytes_offset, data, got);
ctx->header_bytes_offset += got;
length -= got;
data += got;
/* Do we have a complete header now? */
if (ctx->header_bytes_offset == HEADER_BYTES_ZIP) {
Bytef empty_buffer[1];
zip_buffer_t *buffer;
/* check magic */
if (ctx->header[HEADER_MAGIC2_OFFSET] != 0x05 || ctx->header[HEADER_MAGIC2_OFFSET + 1] != 0x00) {
/* magic does not match */
zip_error_set(ctx->error, ZIP_ER_COMPRESSED_DATA, 0);
return false;
}
/* set size of uncompressed data in "lzma alone" header to "unknown" */
if ((buffer = _zip_buffer_new(ctx->header + HEADER_SIZE_OFFSET, HEADER_SIZE_LENGTH)) == NULL) {
zip_error_set(ctx->error, ZIP_ER_MEMORY, 0);
return false;
}
_zip_buffer_put_64(buffer, ctx->uncompresssed_size);
_zip_buffer_free(buffer);
/* Feed header into "lzma alone" decoder, for
* initialization; this should not produce output. */
ctx->zstr.next_in = (void *)(ctx->header + HEADER_MAGIC_LENGTH);
ctx->zstr.avail_in = HEADER_LZMA_ALONE_LENGTH;
ctx->zstr.total_in = 0;
ctx->zstr.next_out = empty_buffer;
ctx->zstr.avail_out = sizeof(*empty_buffer);
ctx->zstr.total_out = 0;
/* this just initializes the decoder and does not produce output, so it consumes the complete header */
if (lzma_code(&ctx->zstr, LZMA_RUN) != LZMA_OK || ctx->zstr.total_out > 0) {
zip_error_set(ctx->error, ZIP_ER_COMPRESSED_DATA, 0);
return false;
}
ctx->header_state = DONE;
}
}
ctx->zstr.avail_in = (uInt)length;
ctx->zstr.next_in = (Bytef *)data;
return true;
}
static void
end_of_input(void *ud) {
struct ctx *ctx = (struct ctx *)ud;
ctx->end_of_input = true;
}
static zip_compression_status_t
process(void *ud, zip_uint8_t *data, zip_uint64_t *length) {
struct ctx *ctx = (struct ctx *)ud;
lzma_ret ret;
/* for compression of LZMA1 */
if (ctx->method == ZIP_CM_LZMA && ctx->compress) {
if (ctx->header_state == INCOMPLETE) {
/* write magic to output buffer */
ctx->header[0] = 0x09;
ctx->header[1] = 0x14;
ctx->header[2] = 0x05;
ctx->header[3] = 0x00;
/* generate lzma parameters into output buffer */
ctx->zstr.avail_out = HEADER_LZMA_ALONE_LENGTH;
ctx->zstr.next_out = ctx->header + HEADER_MAGIC_LENGTH;
ret = lzma_code(&ctx->zstr, LZMA_RUN);
if (ret != LZMA_OK || ctx->zstr.avail_out != 0) {
/* assume that the whole header will be provided with the first call to lzma_code */
return ZIP_COMPRESSION_ERROR;
}
ctx->header_state = OUTPUT;
}
if (ctx->header_state == OUTPUT) {
/* write header */
zip_uint8_t write_len = (zip_uint8_t)ZIP_MIN(HEADER_BYTES_ZIP - ctx->header_bytes_offset, *length);
memcpy(data, ctx->header + ctx->header_bytes_offset, write_len);
ctx->header_bytes_offset += write_len;
*length = write_len;
if (ctx->header_bytes_offset == HEADER_BYTES_ZIP) {
ctx->header_state = DONE;
}
return ZIP_COMPRESSION_OK;
}
}
ctx->zstr.avail_out = (uInt)ZIP_MIN(UINT_MAX, *length);
ctx->zstr.next_out = (Bytef *)data;
ret = lzma_code(&ctx->zstr, ctx->end_of_input ? LZMA_FINISH : LZMA_RUN);
*length = *length - ctx->zstr.avail_out;
switch (ret) {
case LZMA_OK:
return ZIP_COMPRESSION_OK;
case LZMA_STREAM_END:
return ZIP_COMPRESSION_END;
case LZMA_BUF_ERROR:
if (ctx->zstr.avail_in == 0) {
return ZIP_COMPRESSION_NEED_DATA;
}
/* fallthrough */
default:
zip_error_set(ctx->error, map_error(ret), 0);
return ZIP_COMPRESSION_ERROR;
}
}
/* Version Required should be set to 63 (6.3) because this compression
method was only defined in appnote.txt version 6.3.8, but Winzip
does not unpack it if the value is not 20. */
/* clang-format off */
zip_compression_algorithm_t zip_algorithm_xz_compress = {
maximum_compressed_size,
compress_allocate,
deallocate,
general_purpose_bit_flags,
20,
start,
end,
input,
end_of_input,
process
};
zip_compression_algorithm_t zip_algorithm_xz_decompress = {
maximum_compressed_size,
decompress_allocate,
deallocate,
general_purpose_bit_flags,
20,
start,
end,
input,
end_of_input,
process
};
/* clang-format on */
|
d4ecddef036824204e95b7ebf6f3f52f29a0ab04
|
b49bb32eafeea931b86ddfc44ef43c01e81a9128
|
/CoreFoundation/StringEncodings.subproj/CFUnicodePrecomposition.c
|
88776c45ef5211844044f0a60e337793eaa2ca37
|
[
"Apache-2.0",
"Swift-exception"
] |
permissive
|
apple/swift-corelibs-foundation
|
a70e9d95bc69de33ea26343efde3941c5d4d7c85
|
9f53cc551e065d73b327a80147895822bc8f89e0
|
refs/heads/main
| 2023-08-18T01:25:02.154068
| 2023-08-11T20:54:56
| 2023-08-11T20:54:56
| 45,863,890
| 5,583
| 1,542
|
Apache-2.0
| 2023-09-12T00:47:36
| 2015-11-09T20:12:23
|
Swift
|
UTF-8
|
C
| false
| false
| 11,997
|
c
|
CFUnicodePrecomposition.c
|
/* CFUnicodePrecomposition.c
Copyright (c) 1999-2019, Apple Inc. and the Swift project authors
Portions Copyright (c) 2014-2019, Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See http://swift.org/LICENSE.txt for license information
See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
Responsibility: Foundation Team
*/
#include <string.h>
#include <CoreFoundation/CFBase.h>
#include <CoreFoundation/CFCharacterSet.h>
#include "CFUniChar.h"
#include "CFUnicodePrecomposition.h"
#include "CFInternal.h"
#include "CFUniCharPriv.h"
// Canonical Precomposition
static UTF32Char *__CFUniCharPrecompSourceTable = NULL;
static uint32_t __CFUniCharPrecompositionTableLength = 0;
static uint16_t *__CFUniCharBMPPrecompDestinationTable = NULL;
static uint32_t *__CFUniCharNonBMPPrecompDestinationTable = NULL;
static const uint8_t *__CFUniCharNonBaseBitmapForBMP_P = NULL; // Adding _P so the symbol name is different from the one in CFUnicodeDecomposition.c
static const uint8_t *__CFUniCharCombiningClassForBMP = NULL;
static CFLock_t __CFUniCharPrecompositionTableLock = CFLockInit;
static void __CFUniCharLoadPrecompositionTable(void) {
__CFLock(&__CFUniCharPrecompositionTableLock);
if (NULL == __CFUniCharPrecompSourceTable) {
const uint32_t *bytes = (const uint32_t *)CFUniCharGetMappingData(kCFUniCharCanonicalPrecompMapping);
uint32_t bmpMappingLength;
if (NULL == bytes) {
__CFUnlock(&__CFUniCharPrecompositionTableLock);
return;
}
__CFUniCharPrecompositionTableLength = *(bytes++);
bmpMappingLength = *(bytes++);
__CFUniCharPrecompSourceTable = (UTF32Char *)bytes;
__CFUniCharBMPPrecompDestinationTable = (uint16_t *)((intptr_t)bytes + (__CFUniCharPrecompositionTableLength * sizeof(UTF32Char) * 2));
__CFUniCharNonBMPPrecompDestinationTable = (uint32_t *)(((intptr_t)__CFUniCharBMPPrecompDestinationTable) + bmpMappingLength);
__CFUniCharNonBaseBitmapForBMP_P = CFUniCharGetBitmapPtrForPlane(kCFUniCharNonBaseCharacterSet, 0);
__CFUniCharCombiningClassForBMP = (const uint8_t *)CFUniCharGetUnicodePropertyDataForPlane(kCFUniCharCombiningProperty, 0);
}
__CFUnlock(&__CFUniCharPrecompositionTableLock);
}
// Adding _P so the symbol name is different from the one in CFUnicodeDecomposition.c
#define __CFUniCharIsNonBaseCharacter __CFUniCharIsNonBaseCharacter_P
CF_INLINE bool __CFUniCharIsNonBaseCharacter(UTF32Char character) {
return CFUniCharIsMemberOfBitmap(character, (character < 0x10000 ? __CFUniCharNonBaseBitmapForBMP_P : CFUniCharGetBitmapPtrForPlane(kCFUniCharNonBaseCharacterSet, ((character >> 16) & 0xFF))));
}
typedef struct {
UTF16Char _key;
UTF16Char _value;
} __CFUniCharPrecomposeBMPMappings;
static UTF16Char __CFUniCharGetMappedBMPValue(const __CFUniCharPrecomposeBMPMappings *theTable, uint32_t numElem, UTF16Char character) {
const __CFUniCharPrecomposeBMPMappings *p, *q, *divider;
if ((character < theTable[0]._key) || (character > theTable[numElem-1]._key)) {
return 0;
}
p = theTable;
q = p + (numElem-1);
while (p <= q) {
divider = p + ((q - p) >> 1); /* divide by 2 */
if (character < divider->_key) { q = divider - 1; }
else if (character > divider->_key) { p = divider + 1; }
else { return divider->_value; }
}
return 0;
}
typedef struct {
UTF32Char _key;
uint32_t _value;
} __CFUniCharPrecomposeMappings;
static uint32_t __CFUniCharGetMappedValue_P(const __CFUniCharPrecomposeMappings *theTable, uint32_t numElem, UTF32Char character) {
const __CFUniCharPrecomposeMappings *p, *q, *divider;
if ((character < theTable[0]._key) || (character > theTable[numElem-1]._key)) {
return 0;
}
p = theTable;
q = p + (numElem-1);
while (p <= q) {
divider = p + ((q - p) >> 1); /* divide by 2 */
if (character < divider->_key) { q = divider - 1; }
else if (character > divider->_key) { p = divider + 1; }
else { return divider->_value; }
}
return 0;
}
CF_PRIVATE
UTF32Char CFUniCharPrecomposeCharacter(UTF32Char base, UTF32Char combining) {
uint32_t value;
if (NULL == __CFUniCharPrecompSourceTable) __CFUniCharLoadPrecompositionTable();
if (!(value = __CFUniCharGetMappedValue_P((const __CFUniCharPrecomposeMappings *)__CFUniCharPrecompSourceTable, __CFUniCharPrecompositionTableLength, combining))) return 0xFFFD;
// We don't have precomposition in non-BMP
if (value & kCFUniCharNonBmpFlag) {
value = __CFUniCharGetMappedValue_P((const __CFUniCharPrecomposeMappings *)((uint32_t *)__CFUniCharNonBMPPrecompDestinationTable + (value & 0xFFFF)), (value >> 16) & 0x7FFF, base);
} else {
value = __CFUniCharGetMappedBMPValue((const __CFUniCharPrecomposeBMPMappings *)((uint32_t *)__CFUniCharBMPPrecompDestinationTable + (value & 0xFFFF)), (value >> 16), base);
}
return (value ? value : 0xFFFD);
}
#define HANGUL_SBASE 0xAC00
#define HANGUL_LBASE 0x1100
#define HANGUL_VBASE 0x1161
#define HANGUL_TBASE 0x11A7
#define HANGUL_SCOUNT 11172
#define HANGUL_LCOUNT 19
#define HANGUL_VCOUNT 21
#define HANGUL_TCOUNT 28
#define HANGUL_NCOUNT (HANGUL_VCOUNT * HANGUL_TCOUNT)
CF_INLINE void __CFUniCharMoveBufferFromEnd0(UTF16Char *convertedChars, CFIndex length, CFIndex delta) {
const UTF16Char *limit = convertedChars;
UTF16Char *dstP;
convertedChars += length;
dstP = convertedChars + delta;
while (convertedChars > limit) *(--dstP) = *(--convertedChars);
}
bool CFUniCharPrecompose(const UTF16Char *characters, CFIndex length, CFIndex *consumedLength, UTF16Char *precomposed, CFIndex maxLength, CFIndex *filledLength) {
UTF32Char currentChar = 0, lastChar = 0, precomposedChar = 0xFFFD;
CFIndex originalLength = length, usedLength = 0;
UTF16Char *currentBase = precomposed;
uint8_t currentClass, lastClass = 0;
bool currentBaseIsBMP = true;
bool isPrecomposed;
if (NULL == __CFUniCharPrecompSourceTable) __CFUniCharLoadPrecompositionTable();
while (length > 0) {
currentChar = *(characters++);
--length;
if (CFUniCharIsSurrogateHighCharacter(currentChar) && (length > 0) && CFUniCharIsSurrogateLowCharacter(*characters)) {
currentChar = CFUniCharGetLongCharacterForSurrogatePair(currentChar, *(characters++));
--length;
}
if (lastChar && __CFUniCharIsNonBaseCharacter(currentChar)) {
isPrecomposed = (precomposedChar == 0xFFFD ? false : true);
if (isPrecomposed) lastChar = precomposedChar;
currentClass = (currentChar > 0xFFFF ? CFUniCharGetUnicodeProperty(currentChar, kCFUniCharCombiningProperty) : CFUniCharGetCombiningPropertyForCharacter(currentChar, __CFUniCharCombiningClassForBMP));
if ((lastClass == 0) || (currentClass > lastClass)) {
if ((precomposedChar = CFUniCharPrecomposeCharacter(lastChar, currentChar)) == 0xFFFD) {
if (isPrecomposed) precomposedChar = lastChar;
lastClass = currentClass;
} else {
continue;
}
}
if (currentChar > 0xFFFF) { // Non-BMP
usedLength += 2;
if (usedLength > maxLength) break;
currentChar -= 0x10000;
*(precomposed++) = (UTF16Char)((currentChar >> 10) + 0xD800UL);
*(precomposed++) = (UTF16Char)((currentChar & 0x3FF) + 0xDC00UL);
} else {
++usedLength;
if (usedLength > maxLength) break;
*(precomposed++) = (UTF16Char)currentChar;
}
} else {
if ((currentChar >= HANGUL_LBASE) && (currentChar < (HANGUL_LBASE + 0xFF))) { // Hangul Jamo
int8_t lIndex = currentChar - HANGUL_LBASE;
if ((length > 0) && (0 <= lIndex) && (lIndex <= HANGUL_LCOUNT)) {
int16_t vIndex = *characters - HANGUL_VBASE;
if ((vIndex >= 0) && (vIndex <= HANGUL_VCOUNT)) {
int16_t tIndex = 0;
++characters; --length;
if (length > 0) {
tIndex = *characters - HANGUL_TBASE;
if ((tIndex < 0) || (tIndex > HANGUL_TCOUNT)) {
tIndex = 0;
} else {
++characters; --length;
}
}
currentChar = (lIndex * HANGUL_VCOUNT + vIndex) * HANGUL_TCOUNT + tIndex + HANGUL_SBASE;
}
}
}
if (precomposedChar != 0xFFFD) {
if (currentBaseIsBMP) { // Non-BMP
if (lastChar > 0xFFFF) { // Last char was Non-BMP
--usedLength;
memmove(currentBase + 1, currentBase + 2, (precomposed - (currentBase + 2)) * sizeof(UTF16Char));
}
*(currentBase) = (UTF16Char)precomposedChar;
} else {
if (lastChar < 0x10000) { // Last char was BMP
++usedLength;
if (usedLength > maxLength) break;
__CFUniCharMoveBufferFromEnd0(currentBase + 1, precomposed - (currentBase + 1), 1);
}
precomposedChar -= 0x10000;
*currentBase = (UTF16Char)((precomposedChar >> 10) + 0xD800UL);
*(currentBase + 1) = (UTF16Char)((precomposedChar & 0x3FF) + 0xDC00UL);
}
precomposedChar = 0xFFFD;
}
currentBase = precomposed;
lastChar = currentChar;
lastClass = 0;
if (currentChar > 0xFFFF) { // Non-BMP
usedLength += 2;
if (usedLength > maxLength) break;
currentChar -= 0x10000;
*(precomposed++) = (UTF16Char)((currentChar >> 10) + 0xD800UL);
*(precomposed++) = (UTF16Char)((currentChar & 0x3FF) + 0xDC00UL);
currentBaseIsBMP = false;
} else {
++usedLength;
if (usedLength > maxLength) break;
*(precomposed++) = (UTF16Char)currentChar;
currentBaseIsBMP = true;
}
}
}
if (precomposedChar != 0xFFFD) {
if (currentChar > 0xFFFF) { // Non-BMP
if (lastChar < 0x10000) { // Last char was BMP
++usedLength;
if (usedLength > maxLength) {
if (consumedLength) *consumedLength = originalLength - length;
if (filledLength) *filledLength = usedLength;
return false;
}
__CFUniCharMoveBufferFromEnd0(currentBase + 1, precomposed - (currentBase + 1), 1);
}
precomposedChar -= 0x10000;
*currentBase = (UTF16Char)((precomposedChar >> 10) + 0xD800UL);
*(currentBase + 1) = (UTF16Char)((precomposedChar & 0x3FF) + 0xDC00UL);
} else {
if (lastChar > 0xFFFF) { // Last char was Non-BMP
--usedLength;
memmove(currentBase + 1, currentBase + 2, (precomposed - (currentBase + 2)) * sizeof(UTF16Char));
}
*(currentBase) = (UTF16Char)precomposedChar;
}
}
if (consumedLength) *consumedLength = originalLength - length;
if (filledLength) *filledLength = usedLength;
return true;
}
#undef __CFUniCharIsNonBaseCharacter
#undef HANGUL_SBASE
#undef HANGUL_LBASE
#undef HANGUL_VBASE
#undef HANGUL_TBASE
#undef HANGUL_SCOUNT
#undef HANGUL_LCOUNT
#undef HANGUL_VCOUNT
#undef HANGUL_TCOUNT
#undef HANGUL_NCOUNT
|
a99b76c62b84c6b9b9ae18999c69f29205f8cb9f
|
99bdb3251fecee538e0630f15f6574054dfc1468
|
/bsp/hpmicro/libraries/hpm_sdk/utils/hpm_ffssi.c
|
75ca411ff1fa76d3ee3e8e921641f5edeffe201b
|
[
"Zlib",
"LicenseRef-scancode-proprietary-license",
"MIT",
"BSD-3-Clause",
"X11",
"BSD-4-Clause-UC",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] |
permissive
|
RT-Thread/rt-thread
|
03a7c52c2aeb1b06a544143b0e803d72f47d1ece
|
3602f891211904a27dcbd51e5ba72fefce7326b2
|
refs/heads/master
| 2023-09-01T04:10:20.295801
| 2023-08-31T16:20:55
| 2023-08-31T16:20:55
| 7,408,108
| 9,599
| 5,805
|
Apache-2.0
| 2023-09-14T13:37:26
| 2013-01-02T14:49:21
|
C
|
UTF-8
|
C
| false
| false
| 316
|
c
|
hpm_ffssi.c
|
/*
* Copyright (c) 2021 HPMicro
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
#include "hpm_common.h"
int __ffssi2(int x)
{
int i = 0;
if (!x) {
return 0;
}
for (i = 0; (i < sizeof(x) * 8 - 1); i++) {
if ((x >> i) & 1) {
break;
}
}
return i + 1;
}
|
1fdadcf23eba7bd7b39844263372c29ce444c639
|
e2bd18a0b6a1d92755573befb52553f90c21d177
|
/system/Drivers/STM8Lxx_StdPeriph_Driver/inc/stm8l15x_tim3.h
|
ae5f30512cc7691a4bb92315c7da3bd893855c6f
|
[
"BSD-3-Clause"
] |
permissive
|
stm32duino/Arduino_Core_STM8
|
2b86bf16943a0ae4f984df79e8a8d7890feae5bf
|
cc4d30f28145a4778dfe228856e6ea48b00390b5
|
refs/heads/main
| 2023-09-02T11:14:06.407352
| 2023-03-31T07:08:07
| 2023-03-31T07:08:07
| 124,064,982
| 143
| 52
|
BSD-3-Clause
| 2021-12-08T09:57:52
| 2018-03-06T10:56:31
|
C
|
UTF-8
|
C
| false
| false
| 28,253
|
h
|
stm8l15x_tim3.h
|
/**
******************************************************************************
* @file stm8l15x_tim3.h
* @author MCD Application Team
* @version V1.6.1
* @date 30-September-2014
* @brief This file contains all the functions prototypes for the TIM3 firmware
* library.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT 2014 STMicroelectronics</center></h2>
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM8L15x_TIM3_H
#define __STM8L15x_TIM3_H
/* Includes ------------------------------------------------------------------*/
#include "stm8l15x.h"
/** @defgroup STM8L15x_StdPeriph_Driver
* @{
*/
/** @defgroup TIM3
* @{
*/
/* Exported types ------------------------------------------------------------*/
/** @defgroup TIM3_Exported_Types
* @{
*/
/** @defgroup TIM3_Forced_Action
* @{
*/
typedef enum
{
TIM3_ForcedAction_Active = ((uint8_t)0x50), /*!< Output Reference is forced low */
TIM3_ForcedAction_Inactive = ((uint8_t)0x40) /*!< Output Reference is forced high */
}
TIM3_ForcedAction_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Prescaler
* @{
*/
typedef enum
{
TIM3_Prescaler_1 = ((uint8_t)0x00), /*!< Time base Prescaler = 1 (No effect)*/
TIM3_Prescaler_2 = ((uint8_t)0x01), /*!< Time base Prescaler = 2 */
TIM3_Prescaler_4 = ((uint8_t)0x02), /*!< Time base Prescaler = 4 */
TIM3_Prescaler_8 = ((uint8_t)0x03), /*!< Time base Prescaler = 8 */
TIM3_Prescaler_16 = ((uint8_t)0x04), /*!< Time base Prescaler = 16 */
TIM3_Prescaler_32 = ((uint8_t)0x05), /*!< Time base Prescaler = 32 */
TIM3_Prescaler_64 = ((uint8_t)0x06), /*!< Time base Prescaler = 64 */
TIM3_Prescaler_128 = ((uint8_t)0x07) /*!< Time base Prescaler = 128 */
}TIM3_Prescaler_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_OCMode
* @{
*/
typedef enum
{
TIM3_OCMode_Timing = ((uint8_t)0x00), /*!< Timing (Frozen) Mode*/
TIM3_OCMode_Active = ((uint8_t)0x10), /*!< Active Mode*/
TIM3_OCMode_Inactive = ((uint8_t)0x20), /*!< Inactive Mode*/
TIM3_OCMode_Toggle = ((uint8_t)0x30), /*!< Toggle Mode*/
TIM3_OCMode_PWM1 = ((uint8_t)0x60), /*!< PWM Mode 1*/
TIM3_OCMode_PWM2 = ((uint8_t)0x70) /*!< PWM Mode 2*/
}TIM3_OCMode_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_OnePulseMode
* @{
*/
typedef enum
{
TIM3_OPMode_Single = ((uint8_t)0x01), /*!< Single one Pulse mode (OPM Active) */
TIM3_OPMode_Repetitive = ((uint8_t)0x00) /*!< Repetitive Pulse mode (OPM inactive) */
}TIM3_OPMode_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Channel
* @{
*/
typedef enum
{
TIM3_Channel_1 = ((uint8_t)0x00), /*!< Channel 1*/
TIM3_Channel_2 = ((uint8_t)0x01) /*!< Channel 2*/
}TIM3_Channel_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_CounterMode
* @{
*/
typedef enum
{
TIM3_CounterMode_Up = ((uint8_t)0x00), /*!< Counter Up Mode */
TIM3_CounterMode_Down = ((uint8_t)0x10), /*!< Counter Down Mode */
TIM3_CounterMode_CenterAligned1 = ((uint8_t)0x20), /*!< Counter Central aligned Mode 1 */
TIM3_CounterMode_CenterAligned2 = ((uint8_t)0x40), /*!< Counter Central aligned Mode 2 */
TIM3_CounterMode_CenterAligned3 = ((uint8_t)0x60) /*!< Counter Central aligned Mode 3 */
}TIM3_CounterMode_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Output_Compare_Polarity
* @{
*/
typedef enum
{
TIM3_OCPolarity_High = ((uint8_t)0x00), /*!< Output compare polarity = High */
TIM3_OCPolarity_Low = ((uint8_t)0x01) /*!< Output compare polarity = Low */
}TIM3_OCPolarity_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Output_State
* @{
*/
typedef enum
{
TIM3_OutputState_Disable = ((uint8_t)0x00), /*!< Output compare State disabled
(channel output disabled) */
TIM3_OutputState_Enable = ((uint8_t)0x01) /*!< Output compare State enabled
(channel output enabled) */
}TIM3_OutputState_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Break_State
* @{
*/
typedef enum
{
TIM3_BreakState_Disable = ((uint8_t)0x00), /*!< Break State disabled (break option disabled) */
TIM3_BreakState_Enable = ((uint8_t)0x10) /*!< Break State enabled (break option enabled) */
}TIM3_BreakState_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Break_Polarity
* @{
*/
typedef enum
{
TIM3_BreakPolarity_High = ((uint8_t)0x20), /*!< if Break, channel polarity = High */
TIM3_BreakPolarity_Low = ((uint8_t)0x00) /*!< if Break, channel polarity = Low */
}TIM3_BreakPolarity_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Automatic_Output
* @{
*/
typedef enum
{
TIM3_AutomaticOutput_Enable = ((uint8_t)0x40), /*!< Automatic Output option enabled */
TIM3_AutomaticOutput_Disable = ((uint8_t)0x00) /*!< Automatic Output option disabled */
}TIM3_AutomaticOutput_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Lock_Level
* @{
*/
typedef enum
{
TIM3_LockLevel_Off = ((uint8_t)0x00), /*!< Lock option disabled */
TIM3_LockLevel_1 = ((uint8_t)0x01), /*!< Select Lock Level 1 */
TIM3_LockLevel_2 = ((uint8_t)0x02), /*!< Select Lock Level 2 */
TIM3_LockLevel_3 = ((uint8_t)0x03) /*!< Select Lock Level 3 */
}TIM3_LockLevel_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_OSSI_State
* @{
*/
typedef enum
{
TIM3_OSSIState_Enable = ((uint8_t)0x04), /*!< Off-State Selection for Idle mode enabled */
TIM3_OSSIState_Disable = ((uint8_t)0x00) /*!< Off-State Selection for Idle mode disabled */
}TIM3_OSSIState_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Output_Compare_Idle_state
* @{
*/
typedef enum
{
TIM3_OCIdleState_Reset = ((uint8_t)0x00), /*!< Output Compare Idle state = Reset */
TIM3_OCIdleState_Set = ((uint8_t)0x01) /*!< Output Compare Idle state = Set */
}TIM3_OCIdleState_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Input_Capture_Polarity
* @{
*/
typedef enum
{
TIM3_ICPolarity_Rising = ((uint8_t)0x00), /*!< Input Capture on Rising Edge*/
TIM3_ICPolarity_Falling = ((uint8_t)0x01) /*!< Input Capture on Falling Edge*/
}TIM3_ICPolarity_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Input_Capture_Selection
* @{
*/
typedef enum
{
TIM3_ICSelection_DirectTI = ((uint8_t)0x01), /*!< Input Capture mapped on the direct input*/
TIM3_ICSelection_IndirectTI = ((uint8_t)0x02), /*!< Input Capture mapped on the indirect input*/
TIM3_ICSelection_TRGI = ((uint8_t)0x03) /*!< Input Capture mapped on the Trigger Input*/
}TIM3_ICSelection_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Input_Capture_Prescaler
* @{
*/
typedef enum
{
TIM3_ICPSC_DIV1 = ((uint8_t)0x00), /*!< Input Capture Prescaler = 1 (one capture every 1 event) */
TIM3_ICPSC_DIV2 = ((uint8_t)0x04), /*!< Input Capture Prescaler = 2 (one capture every 2 events) */
TIM3_ICPSC_DIV4 = ((uint8_t)0x08), /*!< Input Capture Prescaler = 4 (one capture every 4 events) */
TIM3_ICPSC_DIV8 = ((uint8_t)0x0C) /*!< Input Capture Prescaler = 8 (one capture every 8 events) */
}TIM3_ICPSC_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Interrupts
* @{
*/
typedef enum
{
TIM3_IT_Update = ((uint8_t)0x01), /*!< Update Interrupt*/
TIM3_IT_CC1 = ((uint8_t)0x02), /*!< Capture Compare Channel1 Interrupt*/
TIM3_IT_CC2 = ((uint8_t)0x04), /*!< Capture Compare Channel2 Interrupt*/
TIM3_IT_Trigger = ((uint8_t)0x40), /*!< Trigger Interrupt*/
TIM3_IT_Break = ((uint8_t)0x80) /*!< Break Interrupt*/
}TIM3_IT_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_External_Trigger_Prescaler
* @{
*/
typedef enum
{
TIM3_ExtTRGPSC_OFF = ((uint8_t)0x00), /*!< No External Trigger prescaler */
TIM3_ExtTRGPSC_DIV2 = ((uint8_t)0x10), /*!< External Trigger prescaler = 2 (ETRP frequency divided by 2) */
TIM3_ExtTRGPSC_DIV4 = ((uint8_t)0x20), /*!< External Trigger prescaler = 4 (ETRP frequency divided by 4) */
TIM3_ExtTRGPSC_DIV8 = ((uint8_t)0x30) /*!< External Trigger prescaler = 8 (ETRP frequency divided by 8) */
}TIM3_ExtTRGPSC_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Internal_Trigger_Selection
* @{
*/
typedef enum
{
TIM3_TRGSelection_TIM4 = ((uint8_t)0x00), /*!< TRIG Input source = TIM TRIG Output */
TIM3_TRGSelection_TIM1 = ((uint8_t)0x10), /*!< TRIG Input source = TIM TRIG Output */
TIM3_TRGSelection_TIM5 = ((uint8_t)0x20), /*!< TRIG Input source = TIM TRIG Output */
TIM3_TRGSelection_TIM2 = ((uint8_t)0x30), /*!< TRIG Input source = TIM TRIG Output */
TIM3_TRGSelection_TI1F_ED = ((uint8_t)0x40), /*!< TRIG Input source = TI1F_ED (TI1 Edge Detector) */
TIM3_TRGSelection_TI1FP1 = ((uint8_t)0x50), /*!< TRIG Input source = TI1FP1 (Filtered Timer Input 1) */
TIM3_TRGSelection_TI2FP2 = ((uint8_t)0x60), /*!< TRIG Input source = TI2FP2 (Filtered Timer Input 2) */
TIM3_TRGSelection_ETRF = ((uint8_t)0x70) /*!< TRIG Input source = ETRF (External Trigger Input ) */
}TIM3_TRGSelection_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_TI_External_Clock_Source
* @{
*/
typedef enum
{
TIM3_TIxExternalCLK1Source_TI1ED = ((uint8_t)0x40), /*!< External Clock mode 1 source = TI1ED */
TIM3_TIxExternalCLK1Source_TI1 = ((uint8_t)0x50), /*!< External Clock mode 1 source = TI1 */
TIM3_TIxExternalCLK1Source_TI2 = ((uint8_t)0x60) /*!< External Clock mode 1 source = TI2 */
}TIM3_TIxExternalCLK1Source_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_External_Trigger_Polarity
* @{
*/
typedef enum
{
TIM3_ExtTRGPolarity_Inverted = ((uint8_t)0x80), /*!< External Trigger Polarity = inverted */
TIM3_ExtTRGPolarity_NonInverted = ((uint8_t)0x00) /*!< External Trigger Polarity = non inverted */
}TIM3_ExtTRGPolarity_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Prescaler_Reload_Mode
* @{
*/
typedef enum
{
TIM3_PSCReloadMode_Update = ((uint8_t)0x00), /*!< Prescaler value is reloaded at every update*/
TIM3_PSCReloadMode_Immediate = ((uint8_t)0x01) /*!< Prescaler value is reloaded immediatly*/
}TIM3_PSCReloadMode_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Encoder_Mode
* @{
*/
typedef enum
{
TIM3_EncoderMode_TI1 = ((uint8_t)0x01), /*!< Encoder mode 1*/
TIM3_EncoderMode_TI2 = ((uint8_t)0x02), /*!< Encoder mode 2*/
TIM3_EncoderMode_TI12 = ((uint8_t)0x03) /*!< Encoder mode 3*/
}TIM3_EncoderMode_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Event_Source
* @{
*/
typedef enum
{
TIM3_EventSource_Update = ((uint8_t)0x01), /*!< Update Event*/
TIM3_EventSource_CC1 = ((uint8_t)0x02), /*!< Capture Compare Channel1 Event*/
TIM3_EventSource_CC2 = ((uint8_t)0x04), /*!< Capture Compare Channel2 Event*/
TIM3_EventSource_Trigger = ((uint8_t)0x40), /*!< Trigger Event*/
TIM3_EventSource_Break = ((uint8_t)0x80) /*!< Break Event*/
}TIM3_EventSource_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Update_Source
* @{
*/
typedef enum
{
TIM3_UpdateSource_Global = ((uint8_t)0x00), /*!< Global Update request source */
TIM3_UpdateSource_Regular = ((uint8_t)0x01) /*!< Regular Update request source */
}TIM3_UpdateSource_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Trigger_Output_Source
* @{
*/
typedef enum
{
TIM3_TRGOSource_Reset = ((uint8_t)0x00), /*!< Trigger Output source = Reset*/
TIM3_TRGOSource_Enable = ((uint8_t)0x10), /*!< Trigger Output source = TIM3 is enabled*/
TIM3_TRGOSource_Update = ((uint8_t)0x20), /*!< Trigger Output source = Update event*/
TIM3_TRGOSource_OC1 = ((uint8_t)0x30), /*!< Trigger Output source = output compare channel1 */
TIM3_TRGOSource_OC1REF = ((uint8_t)0x40), /*!< Trigger Output source = output compare channel 1 reference */
TIM3_TRGOSource_OC2REF = ((uint8_t)0x50) /*!< Trigger Output source = output compare channel 2 reference */
}TIM3_TRGOSource_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Slave_Mode
* @{
*/
typedef enum
{
TIM3_SlaveMode_Reset = ((uint8_t)0x04), /*!< Slave Mode Selection = Reset*/
TIM3_SlaveMode_Gated = ((uint8_t)0x05), /*!< Slave Mode Selection = Gated*/
TIM3_SlaveMode_Trigger = ((uint8_t)0x06), /*!< Slave Mode Selection = Trigger*/
TIM3_SlaveMode_External1 = ((uint8_t)0x07) /*!< Slave Mode Selection = External 1*/
}TIM3_SlaveMode_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_Flags
* @{
*/
typedef enum
{
TIM3_FLAG_Update = ((uint16_t)0x0001), /*!< Update Flag */
TIM3_FLAG_CC1 = ((uint16_t)0x0002), /*!< Capture compare 1 Flag */
TIM3_FLAG_CC2 = ((uint16_t)0x0004), /*!< Capture compare 2 Flag */
TIM3_FLAG_Trigger = ((uint16_t)0x0040), /*!< Trigger Flag */
TIM3_FLAG_Break = ((uint16_t)0x0080), /*!< Break Flag */
TIM3_FLAG_CC1OF = ((uint16_t)0x0200), /*!< Capture compare 1 over capture Flag */
TIM3_FLAG_CC2OF = ((uint16_t)0x0400) /*!< Capture compare 2 over capture Flag */
}TIM3_FLAG_TypeDef;
/**
* @}
*/
/** @defgroup TIM3_DMA_Source_Requests
* @{
*/
typedef enum
{
TIM3_DMASource_Update = ((uint8_t)0x01), /*!< TIM3 DMA Update Request*/
TIM3_DMASource_CC1 = ((uint8_t)0x02),
TIM3_DMASource_CC2 = ((uint8_t)0x04)
}TIM3_DMASource_TypeDef;
/**
* @}
*/
/**
* @}
*/
/* Exported constants --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/** @defgroup TIM3_Exported_Macros
* @{
*/
/**
* @brief Macro used by the assert function to check the different functions parameters.
*/
/**
* @brief Macro TIM3 Forced Action
*/
#define IS_TIM3_FORCED_ACTION(ACTION) \
(((ACTION) == TIM3_ForcedAction_Active) || \
((ACTION) == TIM3_ForcedAction_Inactive))
/**
* @brief Macro TIM3 Prescaler
*/
#define IS_TIM3_PRESCALER(PRESCALER) \
(((PRESCALER) == TIM3_Prescaler_1) || \
((PRESCALER) == TIM3_Prescaler_2) || \
((PRESCALER) == TIM3_Prescaler_4) || \
((PRESCALER) == TIM3_Prescaler_8) || \
((PRESCALER) == TIM3_Prescaler_16) || \
((PRESCALER) == TIM3_Prescaler_32) || \
((PRESCALER) == TIM3_Prescaler_64) || \
((PRESCALER) == TIM3_Prescaler_128))
/**
* @brief Macro TIM3 Output Compare and PWM modes
*/
#define IS_TIM3_OC_MODE(MODE) \
(((MODE) == TIM3_OCMode_Timing) || \
((MODE) == TIM3_OCMode_Active) || \
((MODE) == TIM3_OCMode_Inactive) || \
((MODE) == TIM3_OCMode_Toggle) || \
((MODE) == TIM3_OCMode_PWM1) || \
((MODE) == TIM3_OCMode_PWM2))
#define IS_TIM3_OCM(MODE) \
(((MODE) == TIM3_OCMode_Timing) || \
((MODE) == TIM3_OCMode_Active) || \
((MODE) == TIM3_OCMode_Inactive) || \
((MODE) == TIM3_OCMode_Toggle) || \
((MODE) == TIM3_OCMode_PWM1) || \
((MODE) == TIM3_OCMode_PWM2) || \
((MODE) == (uint8_t)TIM3_ForcedAction_Active) || \
((MODE) == (uint8_t)TIM3_ForcedAction_Inactive))
/**
* @brief Macro TIM3 One Pulse Mode
*/
#define IS_TIM3_OPM_MODE(MODE) \
(((MODE) == TIM3_OPMode_Single) || \
((MODE) == TIM3_OPMode_Repetitive))
/**
* @brief Macro TIM3 Channel
*/
#define IS_TIM3_CHANNEL(CHANNEL) \
(((CHANNEL) == TIM3_Channel_1) || \
((CHANNEL) == TIM3_Channel_2) )
/**
* @brief Macro TIM3 Counter Mode
*/
#define IS_TIM3_COUNTER_MODE(MODE) \
(((MODE) == TIM3_CounterMode_Up) || \
((MODE) == TIM3_CounterMode_Down) || \
((MODE) == TIM3_CounterMode_CenterAligned1) || \
((MODE) == TIM3_CounterMode_CenterAligned2) || \
((MODE) == TIM3_CounterMode_CenterAligned3))
/**
* @brief Macro TIM3 Output Compare Polarity
*/
#define IS_TIM3_OC_POLARITY(POLARITY) \
(((POLARITY) == TIM3_OCPolarity_High) || \
((POLARITY) == TIM3_OCPolarity_Low))
/**
* @brief Macro TIM3 Output Compare states
*/
#define IS_TIM3_OUTPUT_STATE(STATE) \
(((STATE) == TIM3_OutputState_Disable) || \
((STATE) == TIM3_OutputState_Enable))
/**
* @brief Macro Break Input enable/disable
*/
#define IS_TIM3_BREAK_STATE(STATE) \
(((STATE) == TIM3_BreakState_Enable) || \
((STATE) == TIM3_BreakState_Disable))
/**
* @brief Macro Break Polarity
*/
#define IS_TIM3_BREAK_POLARITY(POLARITY) \
(((POLARITY) == TIM3_BreakPolarity_Low) || \
((POLARITY) == TIM3_BreakPolarity_High))
/**
* @brief Macro TIM3 AOE Bit Set/Reset
*/
#define IS_TIM3_AUTOMATIC_OUTPUT_STATE(STATE) \
(((STATE) == TIM3_AutomaticOutput_Enable) || \
((STATE) == TIM3_AutomaticOutput_Disable))
/**
* @brief Macro Lock levels
*/
#define IS_TIM3_LOCK_LEVEL(LEVEL) \
(((LEVEL) == TIM3_LockLevel_Off) || \
((LEVEL) == TIM3_LockLevel_1) || \
((LEVEL) == TIM3_LockLevel_2) || \
((LEVEL) == TIM3_LockLevel_3))
/**
* @brief Macro OSSI: Off-State Selection for Idle mode states
*/
#define IS_TIM3_OSSI_STATE(STATE) \
(((STATE) == TIM3_OSSIState_Enable) || \
((STATE) == TIM3_OSSIState_Disable))
/**
* @brief Macro TIM3 OC IDLE STATE
*/
#define IS_TIM3_OCIDLE_STATE(STATE) \
(((STATE) == TIM3_OCIdleState_Set) || \
((STATE) == TIM3_OCIdleState_Reset))
/**
* @brief Macro TIM3 IC POLARITY
*/
#define IS_TIM3_IC_POLARITY(POLARITY) \
(((POLARITY) == TIM3_ICPolarity_Rising) || \
((POLARITY) == TIM3_ICPolarity_Falling))
/**
* @brief Macro TIM3 IC SELECTION
*/
#define IS_TIM3_IC_SELECTION(SELECTION) \
(((SELECTION) == TIM3_ICSelection_DirectTI) || \
((SELECTION) == TIM3_ICSelection_IndirectTI) || \
((SELECTION) == TIM3_ICSelection_TRGI))
/**
* @brief Macro TIM3 IC PRESCALER
*/
#define IS_TIM3_IC_PRESCALER(PRESCALER) \
(((PRESCALER) == TIM3_ICPSC_DIV1) || \
((PRESCALER) == TIM3_ICPSC_DIV2) || \
((PRESCALER) == TIM3_ICPSC_DIV4) || \
((PRESCALER) == TIM3_ICPSC_DIV8))
/**
* @brief Macro TIM3 Input Capture Filter Value
*/
#define IS_TIM3_IC_FILTER(ICFILTER) \
((ICFILTER) <= 0x0F)
/**
* @brief Macro TIM3 Interrupts
*/
#define IS_TIM3_IT(IT) \
((IT) != 0x00)
#define IS_TIM3_GET_IT(IT) \
(((IT) == TIM3_IT_Update) || \
((IT) == TIM3_IT_CC1) || \
((IT) == TIM3_IT_CC2) || \
((IT) == TIM3_IT_Trigger) || \
((IT) == TIM3_IT_Break))
/**
* @brief Macro TIM3 external trigger prescaler
*/
#define IS_TIM3_EXT_PRESCALER(PRESCALER) \
(((PRESCALER) == TIM3_ExtTRGPSC_OFF) || \
((PRESCALER) == TIM3_ExtTRGPSC_DIV2) || \
((PRESCALER) == TIM3_ExtTRGPSC_DIV4) || \
((PRESCALER) == TIM3_ExtTRGPSC_DIV8))
/**
* @brief Macro TIM3 Trigger Selection
*/
#define IS_TIM3_TRIGGER_SELECTION(SELECTION) \
(((SELECTION) == TIM3_TRGSelection_TI1F_ED) || \
((SELECTION) == TIM3_TRGSelection_TI1FP1) || \
((SELECTION) == TIM3_TRGSelection_TI2FP2) || \
((SELECTION) == TIM3_TRGSelection_TIM4) || \
((SELECTION) == TIM3_TRGSelection_TIM1) || \
((SELECTION) == TIM3_TRGSelection_TIM5) || \
((SELECTION) == TIM3_TRGSelection_TIM2) || \
((SELECTION) == TIM3_TRGSelection_ETRF))
#define IS_TIM3_TIX_TRIGGER_SELECTION(SELECTION) \
(((SELECTION) == TIM3_TRGSelection_TI1F_ED) || \
((SELECTION) == TIM3_TRGSelection_TI1FP1) || \
((SELECTION) == TIM3_TRGSelection_TI2FP2))
/**
* @brief Macro TIM3 TIx external Clock Selection
*/
#define IS_TIM3_TIXCLK_SOURCE(SOURCE) \
(((SOURCE) == TIM3_TIxExternalCLK1Source_TI1ED) || \
((SOURCE) == TIM3_TIxExternalCLK1Source_TI2) || \
((SOURCE) == TIM3_TIxExternalCLK1Source_TI1))
/**
* @brief Macro TIM3 Trigger Polarity
*/
#define IS_TIM3_EXT_POLARITY(POLARITY) \
(((POLARITY) == TIM3_ExtTRGPolarity_Inverted) || \
((POLARITY) == TIM3_ExtTRGPolarity_NonInverted))
/**
* @brief Macro TIM3 External Trigger Filter
*/
#define IS_TIM3_EXT_FILTER(EXTFILTER) \
((EXTFILTER) <= 0x0F)
/**
* @brief Macro TIM3 Prescaler Reload
*/
#define IS_TIM3_PRESCALER_RELOAD(RELOAD) \
(((RELOAD) == TIM3_PSCReloadMode_Update) || \
((RELOAD) == TIM3_PSCReloadMode_Immediate))
/**
* @brief Macro TIM3 encoder mode
*/
#define IS_TIM3_ENCODER_MODE(MODE) \
(((MODE) == TIM3_EncoderMode_TI1) || \
((MODE) == TIM3_EncoderMode_TI2) || \
((MODE) == TIM3_EncoderMode_TI12))
/**
* @brief Macro TIM3 event source
*/
#define IS_TIM3_EVENT_SOURCE(SOURCE) \
((((SOURCE) & (uint8_t)0x18) == 0x00) && ((SOURCE) != 0x00))
/**
* @brief Macro TIM3 update source
*/
#define IS_TIM3_UPDATE_SOURCE(SOURCE) \
(((SOURCE) == TIM3_UpdateSource_Global) || \
((SOURCE) == TIM3_UpdateSource_Regular))
/**
* @brief Macro TIM3 TRGO source
*/
#define IS_TIM3_TRGO_SOURCE(SOURCE) \
(((SOURCE) == TIM3_TRGOSource_Reset) || \
((SOURCE) == TIM3_TRGOSource_Enable) || \
((SOURCE) == TIM3_TRGOSource_Update) || \
((SOURCE) == TIM3_TRGOSource_OC1) || \
((SOURCE) == TIM3_TRGOSource_OC1REF) || \
((SOURCE) == TIM3_TRGOSource_OC2REF))
/**
* @brief Macro TIM3 Slave mode
*/
#define IS_TIM3_SLAVE_MODE(MODE) \
(((MODE) == TIM3_SlaveMode_Reset) || \
((MODE) == TIM3_SlaveMode_Gated) || \
((MODE) == TIM3_SlaveMode_Trigger) || \
((MODE) == TIM3_SlaveMode_External1))
/**
* @brief Macro TIM3 Flags
*/
#define IS_TIM3_GET_FLAG(FLAG) \
(((FLAG) == TIM3_FLAG_Update) || \
((FLAG) == TIM3_FLAG_CC1) || \
((FLAG) == TIM3_FLAG_CC2) || \
((FLAG) == TIM3_FLAG_Trigger) || \
((FLAG) == TIM3_FLAG_Break) || \
((FLAG) == TIM3_FLAG_CC1OF) || \
((FLAG) == TIM3_FLAG_CC2OF))
#define IS_TIM3_CLEAR_FLAG(FLAG) \
((((FLAG) & (uint16_t)0xE100) == 0x0000) && ((FLAG) != 0x0000))
/**
* @brief Macro TIM3 DMA sources
*/
#define IS_TIM3_DMA_SOURCE(SOURCE) \
(((SOURCE) == TIM3_DMASource_Update) || \
((SOURCE) == TIM3_DMASource_CC1) || \
((SOURCE) == TIM3_DMASource_CC2))
/**
* @}
*/
/* Exported functions ------------------------------------------------------- */
/* TimeBase management ********************************************************/
void TIM3_DeInit(void);
void TIM3_TimeBaseInit(TIM3_Prescaler_TypeDef TIM3_Prescaler,
TIM3_CounterMode_TypeDef TIM3_CounterMode,
uint16_t TIM3_Period);
void TIM3_PrescalerConfig(TIM3_Prescaler_TypeDef Prescaler,
TIM3_PSCReloadMode_TypeDef TIM3_PSCReloadMode);
void TIM3_CounterModeConfig(TIM3_CounterMode_TypeDef TIM3_CounterMode);
void TIM3_SetCounter(uint16_t Counter);
void TIM3_SetAutoreload(uint16_t Autoreload);
uint16_t TIM3_GetCounter(void);
TIM3_Prescaler_TypeDef TIM3_GetPrescaler(void);
void TIM3_UpdateDisableConfig(FunctionalState NewState);
void TIM3_UpdateRequestConfig(TIM3_UpdateSource_TypeDef TIM3_UpdateSource);
void TIM3_ARRPreloadConfig(FunctionalState NewState);
void TIM3_SelectOnePulseMode(TIM3_OPMode_TypeDef TIM3_OPMode);
void TIM3_Cmd(FunctionalState NewState);
/* Output Compare management **************************************************/
void TIM3_OC1Init(TIM3_OCMode_TypeDef TIM3_OCMode,
TIM3_OutputState_TypeDef TIM3_OutputState,
uint16_t TIM3_Pulse,
TIM3_OCPolarity_TypeDef TIM3_OCPolarity,
TIM3_OCIdleState_TypeDef TIM3_OCIdleState);
void TIM3_OC2Init(TIM3_OCMode_TypeDef TIM3_OCMode,
TIM3_OutputState_TypeDef TIM3_OutputState,
uint16_t TIM3_Pulse,
TIM3_OCPolarity_TypeDef TIM3_OCPolarity,
TIM3_OCIdleState_TypeDef TIM3_OCIdleState);
void TIM3_BKRConfig(TIM3_OSSIState_TypeDef TIM3_OSSIState,
TIM3_LockLevel_TypeDef TIM3_LockLevel,
TIM3_BreakState_TypeDef TIM3_BreakState,
TIM3_BreakPolarity_TypeDef TIM3_BreakPolarity,
TIM3_AutomaticOutput_TypeDef TIM3_AutomaticOutput);
void TIM3_CtrlPWMOutputs(FunctionalState NewState);
void TIM3_SelectOCxM(TIM3_Channel_TypeDef TIM3_Channel,
TIM3_OCMode_TypeDef TIM3_OCMode);
void TIM3_SetCompare1(uint16_t Compare);
void TIM3_SetCompare2(uint16_t Compare);
void TIM3_ForcedOC1Config(TIM3_ForcedAction_TypeDef TIM3_ForcedAction);
void TIM3_ForcedOC2Config(TIM3_ForcedAction_TypeDef TIM3_ForcedAction);
void TIM3_OC1PreloadConfig(FunctionalState NewState);
void TIM3_OC2PreloadConfig(FunctionalState NewState);
void TIM3_OC1FastConfig(FunctionalState NewState);
void TIM3_OC2FastConfig(FunctionalState NewState);
void TIM3_OC1PolarityConfig(TIM3_OCPolarity_TypeDef TIM3_OCPolarity);
void TIM3_OC2PolarityConfig(TIM3_OCPolarity_TypeDef TIM3_OCPolarity);
void TIM3_CCxCmd(TIM3_Channel_TypeDef TIM3_Channel, FunctionalState NewState);
/* Input Capture management ***************************************************/
void TIM3_ICInit(TIM3_Channel_TypeDef TIM3_Channel,
TIM3_ICPolarity_TypeDef TIM3_ICPolarity,
TIM3_ICSelection_TypeDef TIM3_ICSelection,
TIM3_ICPSC_TypeDef TIM3_ICPrescaler,
uint8_t TIM3_ICFilter);
void TIM3_PWMIConfig(TIM3_Channel_TypeDef TIM3_Channel,
TIM3_ICPolarity_TypeDef TIM3_ICPolarity,
TIM3_ICSelection_TypeDef TIM3_ICSelection,
TIM3_ICPSC_TypeDef TIM3_ICPrescaler,
uint8_t TIM3_ICFilter);
uint16_t TIM3_GetCapture1(void);
uint16_t TIM3_GetCapture2(void);
void TIM3_SetIC1Prescaler(TIM3_ICPSC_TypeDef TIM3_IC1Prescaler);
void TIM3_SetIC2Prescaler(TIM3_ICPSC_TypeDef TIM3_IC2Prescaler);
/* Interrupts, DMA and flags management ***************************************/
void TIM3_ITConfig(TIM3_IT_TypeDef TIM3_IT, FunctionalState NewState);
void TIM3_GenerateEvent(TIM3_EventSource_TypeDef TIM3_EventSource);
FlagStatus TIM3_GetFlagStatus(TIM3_FLAG_TypeDef TIM3_FLAG);
void TIM3_ClearFlag(TIM3_FLAG_TypeDef TIM3_FLAG);
ITStatus TIM3_GetITStatus(TIM3_IT_TypeDef TIM3_IT);
void TIM3_ClearITPendingBit(TIM3_IT_TypeDef TIM3_IT);
void TIM3_DMACmd(TIM3_DMASource_TypeDef TIM3_DMASource, FunctionalState NewState);
void TIM3_SelectCCDMA(FunctionalState NewState);
/* Clocks management **********************************************************/
void TIM3_InternalClockConfig(void);
void TIM3_TIxExternalClockConfig(TIM3_TIxExternalCLK1Source_TypeDef TIM3_TIxExternalCLKSource,
TIM3_ICPolarity_TypeDef TIM3_ICPolarity,
uint8_t ICFilter);
void TIM3_ETRClockMode1Config(TIM3_ExtTRGPSC_TypeDef TIM3_ExtTRGPrescaler,
TIM3_ExtTRGPolarity_TypeDef TIM3_ExtTRGPolarity,
uint8_t ExtTRGFilter);
void TIM3_ETRClockMode2Config(TIM3_ExtTRGPSC_TypeDef TIM3_ExtTRGPrescaler,
TIM3_ExtTRGPolarity_TypeDef TIM3_ExtTRGPolarity,
uint8_t ExtTRGFilter);
/* Synchronization management *************************************************/
void TIM3_SelectInputTrigger(TIM3_TRGSelection_TypeDef TIM3_InputTriggerSource);
void TIM3_SelectOutputTrigger(TIM3_TRGOSource_TypeDef TIM3_TRGOSource);
void TIM3_SelectSlaveMode(TIM3_SlaveMode_TypeDef TIM3_SlaveMode);
void TIM3_SelectMasterSlaveMode(FunctionalState NewState);
void TIM3_ETRConfig(TIM3_ExtTRGPSC_TypeDef TIM3_ExtTRGPrescaler,
TIM3_ExtTRGPolarity_TypeDef TIM3_ExtTRGPolarity,
uint8_t ExtTRGFilter);
/* Specific interface management **********************************************/
void TIM3_EncoderInterfaceConfig(TIM3_EncoderMode_TypeDef TIM3_EncoderMode,
TIM3_ICPolarity_TypeDef TIM3_IC1Polarity,
TIM3_ICPolarity_TypeDef TIM3_IC2Polarity);
void TIM3_SelectHallSensor(FunctionalState NewState);
#endif /* __STM8L15x_TIM3_H */
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
46515be41a8cb2e66f7e3743b82b95db0573d9a5
|
7c857119fe1505b1d80d6e62969661c06dc1a2f4
|
/MdePkg/Include/Protocol/FormBrowser2.h
|
fa2a8c01a0a2d85a8ed49bf6fe6bacd99f3c42ae
|
[
"BSD-2-Clause"
] |
permissive
|
CloverHackyColor/CloverBootloader
|
7042ca7dd6b513d22be591a295e49071ae1482ee
|
2711170df4f60b2ae5aa20add3e00f35cf57b7e5
|
refs/heads/master
| 2023-08-30T22:14:34.590134
| 2023-08-27T19:14:02
| 2023-08-27T19:14:02
| 205,810,121
| 4,734
| 770
|
BSD-2-Clause
| 2023-09-03T12:41:33
| 2019-09-02T08:22:14
|
C
|
UTF-8
|
C
| false
| false
| 6,814
|
h
|
FormBrowser2.h
|
/** @file
This protocol is defined in UEFI spec.
The EFI_FORM_BROWSER2_PROTOCOL is the interface to call for drivers to
leverage the EFI configuration driver interface.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __EFI_FORM_BROWSER2_H__
#define __EFI_FORM_BROWSER2_H__
#include <Guid/HiiPlatformSetupFormset.h>
#define EFI_FORM_BROWSER2_PROTOCOL_GUID \
{0xb9d4c360, 0xbcfb, 0x4f9b, {0x92, 0x98, 0x53, 0xc1, 0x36, 0x98, 0x22, 0x58 }}
typedef struct _EFI_FORM_BROWSER2_PROTOCOL EFI_FORM_BROWSER2_PROTOCOL;
/**
@param LeftColumn The value that designates the text column
where the browser window will begin from
the left-hand side of the screen
@param RightColumn The value that designates the text
column where the browser window will end
on the right-hand side of the screen.
@param TopRow The value that designates the text row from the
top of the screen where the browser window
will start.
@param BottomRow The value that designates the text row from the
bottom of the screen where the browser
window will end.
**/
typedef struct {
UINTN LeftColumn;
UINTN RightColumn;
UINTN TopRow;
UINTN BottomRow;
} EFI_SCREEN_DESCRIPTOR;
typedef UINTN EFI_BROWSER_ACTION_REQUEST;
#define EFI_BROWSER_ACTION_REQUEST_NONE 0
#define EFI_BROWSER_ACTION_REQUEST_RESET 1
#define EFI_BROWSER_ACTION_REQUEST_SUBMIT 2
#define EFI_BROWSER_ACTION_REQUEST_EXIT 3
#define EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT 4
#define EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT 5
#define EFI_BROWSER_ACTION_REQUEST_FORM_APPLY 6
#define EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD 7
#define EFI_BROWSER_ACTION_REQUEST_RECONNECT 8
/**
Initialize the browser to display the specified configuration forms.
This function is the primary interface to the internal forms-based browser.
The forms browser will display forms associated with the specified Handles.
The browser will select all forms in packages which have the specified Type
and (for EFI_HII_PACKAGE_TYPE_GUID) the specified PackageGuid.
@param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL instance
@param Handles A pointer to an array of Handles. This value should correspond
to the value of the HII form package that is required to be displayed.
@param HandleCount The number of Handles specified in Handle.
@param FormSetGuid This field points to the EFI_GUID which must match the Guid field or one of the
elements of the ClassId field in the EFI_IFR_FORM_SET op-code. If
FormsetGuid is NULL, then this function will display the form set class
EFI_HII_PLATFORM_SETUP_FORMSET_GUID.
@param FormId This field specifies the identifier of the form within the form set to render as the first
displayable page. If this field has a value of 0x0000, then the Forms Browser will
render the first enabled form in the form set.
@param ScreenDimensions Points to recommended form dimensions, including any non-content area, in
characters.
@param ActionRequest Points to the action recommended by the form.
@retval EFI_SUCCESS The function completed successfully
@retval EFI_NOT_FOUND The variable was not found.
@retval EFI_INVALID_PARAMETER One of the parameters has an
invalid value.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SEND_FORM2)(
IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,
IN EFI_HII_HANDLE *Handle,
IN UINTN HandleCount,
IN EFI_GUID *FormSetGuid, OPTIONAL
IN EFI_FORM_ID FormId, OPTIONAL
IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL
OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest OPTIONAL
);
/**
This function is called by a callback handler to retrieve uncommitted state data from the browser.
This routine is called by a routine which was called by the
browser. This routine called this service in the browser to
retrieve or set certain uncommitted state information.
@param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL instance.
@param ResultsDataSize A pointer to the size of the buffer
associated with ResultsData. On input, the size in
bytes of ResultsData. On output, the size of data
returned in ResultsData.
@param ResultsData A string returned from an IFR browser or
equivalent. The results string will have
no routing information in them.
@param RetrieveData A BOOLEAN field which allows an agent to
retrieve (if RetrieveData = TRUE) data
from the uncommitted browser state
information or set (if RetrieveData =
FALSE) data in the uncommitted browser
state information.
@param VariableGuid An optional field to indicate the target
variable GUID name to use.
@param VariableName An optional field to indicate the target
human-readable variable name.
@retval EFI_SUCCESS The results have been distributed or are
awaiting distribution.
@retval EFI_OUT_OF_RESOURCES The ResultsDataSize specified
was too small to contain the
results data.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_BROWSER_CALLBACK2)(
IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,
IN OUT UINTN *ResultsDataSize,
IN OUT EFI_STRING ResultsData,
IN CONST BOOLEAN RetrieveData,
IN CONST EFI_GUID *VariableGuid, OPTIONAL
IN CONST CHAR16 *VariableName OPTIONAL
);
///
/// This interface will allow the caller to direct the configuration
/// driver to use either the HII database or use the passed-in packet of data.
///
struct _EFI_FORM_BROWSER2_PROTOCOL {
EFI_SEND_FORM2 SendForm;
EFI_BROWSER_CALLBACK2 BrowserCallback;
} ;
extern EFI_GUID gEfiFormBrowser2ProtocolGuid;
#endif
|
42f7dbfa528ed98603b055b5f72a5939ed58fec5
|
bed3ac926beac0f4e0293303d7b2a6031ee476c9
|
/Modules/ThirdParty/VNL/src/vxl/v3p/netlib/minpack/dpmpar.h
|
ef1373ce2d60099972bca6ce52412c56826d5ff0
|
[
"IJG",
"Zlib",
"LicenseRef-scancode-proprietary-license",
"SMLNJ",
"BSD-3-Clause",
"BSD-4.3TAHOE",
"LicenseRef-scancode-free-unknown",
"Spencer-86",
"LicenseRef-scancode-llnl",
"FSFUL",
"Libpng",
"libtiff",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-hdf5",
"MIT",
"NTP",
"LicenseRef-scancode-mit-old-style",
"GPL-1.0-or-later",
"LicenseRef-scancode-unknown-license-reference",
"MPL-2.0",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] |
permissive
|
InsightSoftwareConsortium/ITK
|
ed9dbbc5b8b3f7511f007c0fc0eebb3ad37b88eb
|
3eb8fd7cdfbc5ac2d0c2e5e776848a4cbab3d7e1
|
refs/heads/master
| 2023-08-31T17:21:47.754304
| 2023-08-31T00:58:51
| 2023-08-31T14:12:21
| 800,928
| 1,229
| 656
|
Apache-2.0
| 2023-09-14T17:54:00
| 2010-07-27T15:48:04
|
C++
|
UTF-8
|
C
| false
| false
| 80
|
h
|
dpmpar.h
|
extern v3p_netlib_doublereal v3p_netlib_dpmpar_(
v3p_netlib_integer *i__
);
|
64872b1f6af66972ecfc82525ca4b21b7c14c8f8
|
99ecf2e42d663a4ab4abbe968e2dda7a34e23ec8
|
/lib/pkcs11_ec.c
|
d1965ab18b66787825d3c635e48c822a99d0ab5f
|
[
"Apache-2.0"
] |
permissive
|
Mastercard/pkcs11-tools
|
de6a93f5baf650fc70d808b51e0fb60735850da2
|
d29802e8ee7b3f6d863231083788fd4d5d96d087
|
refs/heads/master
| 2023-09-01T06:59:29.438052
| 2023-08-18T07:04:19
| 2023-08-18T07:04:19
| 160,555,428
| 116
| 29
|
NOASSERTION
| 2023-09-08T14:08:04
| 2018-12-05T17:38:24
|
C
|
UTF-8
|
C
| false
| false
| 7,250
|
c
|
pkcs11_ec.c
|
/* -*- mode: c; c-file-style:"stroustrup"; -*- */
/*
* Copyright (c) 2018 Mastercard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stddef.h>
#include <unistd.h>
#include <assert.h>
#include "pkcs11lib.h"
#include <openssl/objects.h>
#include <openssl/err.h>
static const uint8_t id_edwards25519[] = { 0x13, 0x0C, 'e', 'd', 'w', 'a', 'r', 'd', 's', '2', '5', '5', '1', '9' };
static const uint8_t id_edwards448[] = { 0x13, 0x0A, 'e', 'd', 'w', 'a', 'r', 'd', 's', '4', '4', '8' };
/* Edwards curves may be specified it two flavours:
* - as an OID, in which case it will be parsed by d2i_ASN1_OBJECT
* - as a PrintableString 'edwards25519' or 'edwards448'
* the later case cannot be converted directly to an OID
* The two following functions implement that detection.
*/
inline bool pkcs11_is_ed_param_named_25519(const uint8_t *ecparam, size_t ecparamlen)
{
return ecparamlen==sizeof id_edwards25519 && memcmp(ecparam, id_edwards25519, sizeof id_edwards25519)==0;
}
inline bool pkcs11_is_ed_param_named_448(const uint8_t *ecparam, size_t ecparamlen)
{
return ecparamlen==sizeof id_edwards448 && memcmp(ecparam, id_edwards448, sizeof id_edwards448)==0;
}
bool pkcs11_ex_curvename2oid(char *name, CK_BYTE **where, CK_ULONG *len, key_type_t keytype)
{
bool rc = false;
ASN1_OBJECT *obj=NULL;
unsigned char *pp = NULL;
char repr[80];
char uname[80]; /* to uppercase the name. Limited to 80 chars */
int i2dlen;
/* first we try to convert string to ASN.1 object */
*where = NULL;
*len = 0;
if(name && where && len ) {
/* For Edwards, we expect to have an uppercase string */
strncpy(uname, name, sizeof uname); uname[sizeof uname -1]=0;
int i;
for(i=0; i<strlen(uname); i++) {
uname[i] = toupper(uname[i]);
}
if ( (obj = OBJ_txt2obj(name, 0)) == NULL && (obj = OBJ_txt2obj(uname, 0)) == NULL ) {
P_ERR();
goto err;
}
/* we convert back to an OID in order to compare the prefix */
/* with well-known OID for elliptic curves */
#define ANSI_X9_62_CURVES "1.2.840.10045.3"
#define CERTICOM_CURVES "1.3.132.0"
#define WAP_WSG_CURVES "2.23.43.1.4"
#define ED25519 "1.3.101.112"
#define ED448 "1.3.101.113"
OBJ_obj2txt(repr, sizeof repr - 1, obj, 1);
/* TODO do a better job at doing this */
if( keytype == ec && ( strncmp(ANSI_X9_62_CURVES, repr, strlen(ANSI_X9_62_CURVES)) == 0
||
strncmp(CERTICOM_CURVES, repr, strlen(CERTICOM_CURVES)) == 0
||
strncmp(WAP_WSG_CURVES, repr, strlen(WAP_WSG_CURVES)) == 0 ) ) {
/* if it is EC, we allocate the DER space onto target pointer */
i2dlen = i2d_ASN1_OBJECT(obj, NULL);
if(i2dlen<0) {
P_ERR();
goto err;
} else {
*where = OPENSSL_malloc(i2dlen);
if(*where==NULL) {
P_ERR();
goto err;
}
pp = *where;
i2dlen = i2d_ASN1_OBJECT(obj, &pp);
if(i2dlen<0) {
P_ERR();
goto err;
}
*len = i2dlen;
rc = true;
}
}
/* although we could use the OID for key generation, */
/* it seems like HSM implementations prefer using the curve strings instead */
/* note that PKCS#11 3.0 requires to support both ways. */
if ( keytype == ed ) {
size_t wanted_len;
if (strncmp(ED25519, repr, strlen(ED25519)) == 0) {
wanted_len = sizeof id_edwards25519;
pp = (uint8_t *)id_edwards25519;
}
else if (strncmp(ED448, repr, strlen(ED448)) == 0 ) {
wanted_len = sizeof id_edwards448;
pp = (uint8_t *)id_edwards448;
}
else {
fprintf(stderr, "Error: unsupported edwards curve");
goto err;
}
*where = OPENSSL_malloc(wanted_len);
if(*where==NULL) {
P_ERR();
goto err;
}
memcpy(*where,pp,wanted_len);
*len = wanted_len;
rc = true;
}
}
err:
if(rc==false) {
if(*where!=NULL) { OPENSSL_free(*where); *where = NULL; *len=0; }
}
if(obj) { ASN1_OBJECT_free(obj); }
return rc;
}
/* aliases for EC and ED */
inline bool pkcs11_ec_curvename2oid(char *name, CK_BYTE **where, CK_ULONG *len) {
return pkcs11_ex_curvename2oid(name, where, len, ec);
}
inline bool pkcs11_ed_curvename2oid(char *name, CK_BYTE **where, CK_ULONG *len) {
return pkcs11_ex_curvename2oid(name, where, len, ed);
}
static void pkcs11_ex_freeoid(CK_BYTE_PTR buf)
{
if(buf) {
OPENSSL_free(buf);
}
}
/* aliases for EC and ED */
void pkcs11_ec_freeoid(CK_BYTE_PTR buf) {
pkcs11_ex_freeoid(buf);
}
void pkcs11_ed_freeoid(CK_BYTE_PTR buf) {
pkcs11_ex_freeoid(buf);
}
static char * pkcs11_ex_oid2curvename(CK_BYTE *param, CK_ULONG param_len, char *where, size_t maxlen, key_type_t keytype)
{
ASN1_OBJECT *obj = NULL;
if(param && where && param_len>0 && maxlen>0) {
const unsigned char *pp = param;
switch(keytype) {
case ec:
if( (obj = d2i_ASN1_OBJECT(NULL, &pp, param_len)) == NULL ) {
P_ERR();
strncpy(where, "unknown(\?\?\?)", maxlen);
where[maxlen-1]=0;
goto cleanup;
}
if( OBJ_obj2txt(where, maxlen, obj, 0) == 0 ) {
P_ERR();
strncpy(where, "unknown(\?\?\?)", maxlen);
where[maxlen-1]=0;
}
break;
case ed:
/* it will be a regular OID or one of the parameters below */
/*
13 0c 65 64 77 61 72 64 73 32 35 35 31 39 ..edwards25519
13 0a 65 64 77 61 72 64 73 34 34 38 ..edwards448
*/
{
if( ( obj = d2i_ASN1_OBJECT(NULL, &pp, param_len) ) != NULL) { /* case 1: OID - from public key */
if( OBJ_obj2txt(where, maxlen, obj, 0) == 0 ) {
P_ERR();
strncpy(where, "unknown(\?\?\?)", maxlen);
where[maxlen-1]=0;
}
/* happy path here */
} else {
if(param_len == sizeof id_edwards25519 && memcmp(id_edwards25519, param, sizeof id_edwards25519)==0 ) {
strncpy(where, "ED25519", maxlen);
where[maxlen-1]=0;
} else if(param_len == sizeof id_edwards448 && memcmp(id_edwards448, param, sizeof id_edwards448)==0) {
strncpy(where, "ED448", maxlen);
where[maxlen-1]=0;
} else {
strncpy(where, "unknown(\?\?\?)", maxlen);
where[maxlen-1]=0;
}
}
}
break;
default:
assert(0);
}
}
cleanup:
if(obj) { ASN1_OBJECT_free(obj); }
return where;
}
/* aliases for EC and ED */
inline char * pkcs11_ec_oid2curvename(CK_BYTE *param, CK_ULONG param_len, char *where, size_t maxlen) {
return pkcs11_ex_oid2curvename(param, param_len, where, maxlen, ec);
}
inline char * pkcs11_ed_oid2curvename(CK_BYTE *param, CK_ULONG param_len, char *where, size_t maxlen) {
return pkcs11_ex_oid2curvename(param, param_len, where, maxlen, ed);
}
/* EOF */
|
7a6e35345f34e75fbbb0288f4b3e9044668c20a9
|
035660e8cc10571ebbd0d4393fef063bb7eb98f6
|
/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.h
|
89d9a4aae2eef0b02e3d5fd4785f89e0362ae59c
|
[] |
no_license
|
zeldaret/mm
|
f163a5e7c4314105777369fa7671ce9c2a99922a
|
4ae00e909e74044f05155683b49d2561f91de7ba
|
refs/heads/master
| 2023-08-06T07:22:04.912966
| 2023-08-04T20:36:03
| 2023-08-04T20:36:03
| 247,875,852
| 915
| 328
| null | 2023-09-14T11:48:59
| 2020-03-17T04:03:07
|
C
|
UTF-8
|
C
| false
| false
| 356
|
h
|
z_en_tanron6.h
|
#ifndef Z_EN_TANRON6_H
#define Z_EN_TANRON6_H
#include "global.h"
struct EnTanron6;
typedef void (*EnTanron6ActionFunc)(struct EnTanron6*, PlayState*);
typedef struct EnTanron6 {
/* 0x000 */ Actor actor;
/* 0x144 */ UNK_TYPE1 unk_144[0xBC];
/* 0x200 */ EnTanron6ActionFunc actionFunc;
} EnTanron6; // size = 0x204
#endif // Z_EN_TANRON6_H
|
f1345748ca7b74aca8d8a7ab919de92a58d42a20
|
aa3befea459382dc5c01c925653d54f435b3fb0f
|
/arch/arm/src/imxrt/imxrt_mpuinit.c
|
5f8db353ca42ca1a8d627b36945f0ef948657af0
|
[
"MIT-open-group",
"BSD-3-Clause",
"HPND-sell-variant",
"BSD-4-Clause-UC",
"LicenseRef-scancode-warranty-disclaimer",
"MIT-0",
"LicenseRef-scancode-bsd-atmel",
"LicenseRef-scancode-gary-s-brown",
"LicenseRef-scancode-proprietary-license",
"SunPro",
"MIT",
"LicenseRef-scancode-public-domain-disclaimer",
"LicenseRef-scancode-other-permissive",
"HPND",
"ISC",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"GPL-1.0-or-later",
"CC-BY-2.0",
"CC-BY-4.0"
] |
permissive
|
apache/nuttx
|
14519a7bff4a87935d94fb8fb2b19edb501c7cec
|
606b6d9310fb25c7d92c6f95bf61737e3c79fa0f
|
refs/heads/master
| 2023-08-25T06:55:45.822534
| 2023-08-23T16:03:31
| 2023-08-24T21:25:47
| 228,103,273
| 407
| 241
|
Apache-2.0
| 2023-09-14T18:26:05
| 2019-12-14T23:27:55
|
C
|
UTF-8
|
C
| false
| false
| 8,169
|
c
|
imxrt_mpuinit.c
|
/****************************************************************************
* arch/arm/src/imxrt/imxrt_mpuinit.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <assert.h>
#include <sys/param.h>
#include <nuttx/userspace.h>
#include "mpu.h"
#include "barriers.h"
#include "hardware/imxrt_memorymap.h"
#include "imxrt_mpuinit.h"
#ifdef CONFIG_ARM_MPU
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef CONFIG_ARMV7M_DCACHE
/* With Dcache off:
* Cacheable (MPU_RASR_C) and Bufferable (MPU_RASR_B) needs to be off
*/
# undef MPU_RASR_B
# define MPU_RASR_B 0
# define RASR_B_VALUE 0
# define RASR_C_VALUE 0
#else
# ifndef CONFIG_ARMV7M_DCACHE_WRITETHROUGH
/* With Dcache on:
* Cacheable (MPU_RASR_C) and Bufferable (MPU_RASR_B) needs to be on
*/
# define RASR_B_VALUE MPU_RASR_B
# define RASR_C_VALUE MPU_RASR_C
# else
/* With Dcache in WRITETHROUGH Bufferable (MPU_RASR_B)
* needs to be off, except for FLASH for alignment leniency
*/
# define RASR_B_VALUE 0
# define RASR_C_VALUE MPU_RASR_C
# endif
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: imxrt_mpu_initialize
*
* Description:
* Configure the MPU to permit user-space access to only restricted i.MXRT
* resources.
*
****************************************************************************/
void imxrt_mpu_initialize(void)
{
#ifdef CONFIG_BUILD_PROTECTED
uintptr_t datastart;
uintptr_t dataend;
#endif
/* Show MPU information */
mpu_showtype();
/* Reset MPU if enabled */
mpu_reset();
#ifdef CONFIG_ARMV7M_DCACHE
/* Memory barrier */
ARM_DMB();
#ifdef CONFIG_IMXFT_QSPI
/* Make QSPI memory region strongly ordered */
mpu_priv_stronglyordered(IMXRT_QSPIMEM_BASE, IMXRT_QSPIMEM_SIZE);
#endif
#endif
#ifdef CONFIG_BUILD_PROTECTED
/* Configure user flash and SRAM space */
DEBUGASSERT(USERSPACE->us_textend >= USERSPACE->us_textstart);
mpu_user_flash(USERSPACE->us_textstart,
USERSPACE->us_textend - USERSPACE->us_textstart);
datastart = MIN(USERSPACE->us_datastart, USERSPACE->us_bssstart);
dataend = MAX(USERSPACE->us_dataend, USERSPACE->us_bssend);
DEBUGASSERT(dataend >= datastart);
mpu_user_intsram(datastart, dataend - datastart);
#else
mpu_configure_region(0xc0000000, 512 * 1024 * 1024,
MPU_RASR_TEX_DEV | /* Device
* Not Cacheable
* Not Bufferable
* Not Shareable */
MPU_RASR_AP_RWRW); /* P:RW U:RW
* Instruction access */
mpu_configure_region(IMXRT_EXTMEM_BASE, 1024 * 1024 * 1024,
MPU_RASR_TEX_DEV | /* Device
* Not Cacheable
* Not Bufferable
* Not Shareable */
MPU_RASR_AP_RWRW); /* P:RW U:RW
* Instruction access */
mpu_configure_region(IMXRT_FLEXCIPHER_BASE, 8 * 1024 * 1024,
MPU_RASR_TEX_NOR | /* Normal */
RASR_C_VALUE | /* Cacheable */
MPU_RASR_B | /* Bufferable
* Not Shareable */
MPU_RASR_AP_RORO); /* P:RO U:RO
* Instruction access */
mpu_configure_region(IMXRT_ITCM_BASE, 128 * 1024,
MPU_RASR_TEX_NOR | /* Normal */
RASR_C_VALUE | /* Cacheable */
RASR_B_VALUE | /* Bufferable
* Not Shareable */
MPU_RASR_AP_RWRW); /* P:RW U:RW
* Instruction access */
mpu_configure_region(IMXRT_DTCM_BASE, 128 * 1024,
MPU_RASR_TEX_NOR | /* Normal */
RASR_C_VALUE | /* Cacheable */
RASR_B_VALUE | /* Bufferable
* Not Shareable */
MPU_RASR_AP_RWRW); /* P:RW U:RW
* Instruction access */
mpu_configure_region(IMXRT_OCRAM2_BASE, 512 * 1024,
MPU_RASR_TEX_NOR | /* Normal */
RASR_C_VALUE | /* Cacheable */
RASR_B_VALUE | /* Bufferable
* Not Shareable */
MPU_RASR_AP_RWRW); /* P:RW U:RW
* Instruction access */
mpu_configure_region(IMXRT_OCRAM_BASE, 512 * 1024,
MPU_RASR_TEX_NOR | /* Normal */
RASR_C_VALUE | /* Cacheable */
RASR_B_VALUE | /* Bufferable
* Not Shareable */
MPU_RASR_AP_RWRW); /* P:RW U:RW
* Instruction access */
mpu_configure_region(IMXRT_EXTMEM_BASE, 32 * 1024 * 1024,
MPU_RASR_TEX_SO | /* Ordered */
RASR_C_VALUE | /* Cacheable */
RASR_B_VALUE | /* Bufferable
* Not Shareable */
MPU_RASR_AP_RWRW); /* P:RW U:RW
* Instruction access */
mpu_configure_region(0x81e00000, 2 * 1024 * 1024,
MPU_RASR_TEX_NOR | /* Normal
* Not Cacheable
* Not Bufferable
* Not Shareable */
MPU_RASR_AP_RWRW); /* P:RW U:RW
* Instruction access */
mpu_control(true, true, true);
return;
#endif
/* Then enable the MPU */
mpu_control(true, false, true);
}
/****************************************************************************
* Name: imxrt_mpu_uheap
*
* Description:
* Map the user-heap region.
*
* This logic may need an extension to handle external SDRAM).
*
****************************************************************************/
#ifdef CONFIG_BUILD_PROTECTED
void imxrt_mpu_uheap(uintptr_t start, size_t size)
{
mpu_user_intsram(start, size);
}
#endif
#endif /* CONFIG_ARM_MPU */
|
3460836e4edba713c11c5e48ff61394a9afdf5f3
|
9eedaea06306b20520151321854f989a73c7daf8
|
/src/video/riscos/SDL_riscosvideo.c
|
dd57ce839e57356f38f7af95bc8433970b1c68e6
|
[
"Zlib"
] |
permissive
|
libsdl-org/SDL
|
cf56bdc8a9e198e9735201674118c822d0e3edf3
|
8387fae698745969ce366c4de9bcc1b4a364a7dd
|
refs/heads/main
| 2023-09-04T06:58:34.316952
| 2023-09-03T15:11:13
| 2023-09-03T15:11:13
| 330,008,801
| 6,912
| 1,605
|
Zlib
| 2023-09-13T19:12:26
| 2021-01-15T19:55:54
|
C
|
UTF-8
|
C
| false
| false
| 3,429
|
c
|
SDL_riscosvideo.c
|
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "SDL_internal.h"
#ifdef SDL_VIDEO_DRIVER_RISCOS
#include "../SDL_sysvideo.h"
#include "../SDL_pixels_c.h"
#include "../../events/SDL_events_c.h"
#include "SDL_riscosvideo.h"
#include "SDL_riscosevents_c.h"
#include "SDL_riscosframebuffer_c.h"
#include "SDL_riscosmouse.h"
#include "SDL_riscosmodes.h"
#include "SDL_riscoswindow.h"
#define RISCOSVID_DRIVER_NAME "riscos"
/* Initialization/Query functions */
static int RISCOS_VideoInit(SDL_VideoDevice *_this);
static void RISCOS_VideoQuit(SDL_VideoDevice *_this);
/* RISC OS driver bootstrap functions */
static void RISCOS_DeleteDevice(SDL_VideoDevice *device)
{
SDL_free(device->driverdata);
SDL_free(device);
}
static SDL_VideoDevice *RISCOS_CreateDevice(void)
{
SDL_VideoDevice *device;
SDL_VideoData *phdata;
/* Initialize all variables that we clean on shutdown */
device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice));
if (device == NULL) {
SDL_OutOfMemory();
return 0;
}
/* Initialize internal data */
phdata = (SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData));
if (phdata == NULL) {
SDL_OutOfMemory();
SDL_free(device);
return NULL;
}
device->driverdata = phdata;
/* Set the function pointers */
device->VideoInit = RISCOS_VideoInit;
device->VideoQuit = RISCOS_VideoQuit;
device->PumpEvents = RISCOS_PumpEvents;
device->GetDisplayModes = RISCOS_GetDisplayModes;
device->SetDisplayMode = RISCOS_SetDisplayMode;
device->CreateSDLWindow = RISCOS_CreateWindow;
device->DestroyWindow = RISCOS_DestroyWindow;
device->GetWindowWMInfo = RISCOS_GetWindowWMInfo;
device->CreateWindowFramebuffer = RISCOS_CreateWindowFramebuffer;
device->UpdateWindowFramebuffer = RISCOS_UpdateWindowFramebuffer;
device->DestroyWindowFramebuffer = RISCOS_DestroyWindowFramebuffer;
device->free = RISCOS_DeleteDevice;
return device;
}
VideoBootStrap RISCOS_bootstrap = {
RISCOSVID_DRIVER_NAME, "SDL RISC OS video driver",
RISCOS_CreateDevice
};
static int RISCOS_VideoInit(SDL_VideoDevice *_this)
{
if (RISCOS_InitEvents(_this) < 0) {
return -1;
}
if (RISCOS_InitMouse(_this) < 0) {
return -1;
}
if (RISCOS_InitModes(_this) < 0) {
return -1;
}
/* We're done! */
return 0;
}
static void RISCOS_VideoQuit(SDL_VideoDevice *_this)
{
RISCOS_QuitEvents(_this);
}
#endif /* SDL_VIDEO_DRIVER_RISCOS */
|
2b919f7fc4bde571ce7289fe41165a5983b0add5
|
2898fa4f2ad766afa0495a837f59fe95daa081a7
|
/tests/unit-pass/call-link-loc.c
|
421e2d4898a8dcaa953215ed14c7a0ba0d8fed3e
|
[
"NCSA"
] |
permissive
|
kframework/c-semantics
|
12fcc1b1bf1f7792636d1c37f6f7bb1b89a392b5
|
e6879d14455771aa0cb3e3d201131d4d763a73a2
|
refs/heads/master
| 2023-07-31T23:57:03.316456
| 2022-02-01T17:50:31
| 2022-02-01T17:50:31
| 11,747,541
| 312
| 52
|
NOASSERTION
| 2022-02-01T17:50:33
| 2013-07-29T19:13:25
|
C
|
UTF-8
|
C
| false
| false
| 104
|
c
|
call-link-loc.c
|
int g(int);
int (*f)(int) = g;
int g(int x) { return x - 1; }
int main(void) {
return f(1);
}
|
94a14816d7981716c3daba5e3ff8aee28ef72afc
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/drivers/staging/line6/revision.h
|
b4eee2b73831e2be19fe1ddc1c5d2de6494918a2
|
[
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later",
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 98
|
h
|
revision.h
|
#ifndef DRIVER_REVISION
/* current subversion revision */
#define DRIVER_REVISION " (904)"
#endif
|
e671530425137c3ff0c179074c542c8986cdbc82
|
c8b39acfd4a857dc15ed3375e0d93e75fa3f1f64
|
/Engine/Plugins/Experimental/AlembicImporter/Source/ThirdParty/Alembic/hdf5/fortran/src/H5FDmpiof.c
|
bbdb1701bbdfbdd1ab9e9d1c855c5f117fab8e1f
|
[
"MIT",
"LicenseRef-scancode-proprietary-license"
] |
permissive
|
windystrife/UnrealEngine_NVIDIAGameWorks
|
c3c7863083653caf1bc67d3ef104fb4b9f302e2a
|
b50e6338a7c5b26374d66306ebc7807541ff815e
|
refs/heads/4.18-GameWorks
| 2023-03-11T02:50:08.471040
| 2022-01-13T20:50:29
| 2022-01-13T20:50:29
| 124,100,479
| 262
| 179
|
MIT
| 2022-12-16T05:36:38
| 2018-03-06T15:44:09
|
C++
|
UTF-8
|
C
| false
| false
| 6,784
|
c
|
H5FDmpiof.c
|
/****h* H5FDmpiof/H5FDmpiof
*
* PURPOSE
* This file contains C stubs for Parallel Fortran APIs
*
* COPYRIGHT
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
******
*/
#include "H5f90.h"
#include <mpi.h>
#include "H5public.h"
/* Support for C to Fortran translation in MPI */
#ifndef H5_HAVE_MPI_MULTI_LANG_Comm
#define MPI_Comm_c2f(comm) (int_f)(comm)
#define MPI_Comm_f2c(comm) (MPI_Comm)(comm)
#endif /*MPI Comm*/
#ifndef H5_HAVE_MPI_MULTI_LANG_Info
#define MPI_Info_c2f(info) (int_f)(info)
#define MPI_Info_f2c(info) (MPI_Info)(info)
#endif /*MPI Info*/
/****if* H5FDmpiof/h5pset_fapl_mpio_c
* NAME
* h5pset_fapl_mpio_c
* PURPOSE
* Call H5Pset_fapl_mpio to set mode for parallel I/O and the user
* supplied communicator and info object
* INPUTS
* prp_id - property list identifier
* comm - MPI communicator
* info - MPI info object
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
* Elena Pourmal
* Thursday, October 26, 2000
* HISTORY
*
* SOURCE
*/
int_f
nh5pset_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret;
MPI_Comm c_comm;
MPI_Info c_info;
c_comm = MPI_Comm_f2c(*comm);
c_info = MPI_Info_f2c(*info);
/*
* Call H5Pset_mpi function.
*/
c_prp_id = *prp_id;
ret = H5Pset_fapl_mpio(c_prp_id, c_comm, c_info);
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
/****if* H5FDmpiof/h5pget_fapl_mpio_c
* NAME
* h5pget_fapl_mpio_c
* PURPOSE
* Call H5Pget_fapl_mpio to retrieve communicator and info object
* INPUTS
* prp_id - property list identifier
* comm - buffer to return MPI communicator
* info - buffer to return MPI info object
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
* Elena Pourmal
* Thursday, October 26, 2000
* HISTORY
*
* SOURCE
*/
int_f
nh5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret;
MPI_Comm c_comm;
MPI_Info c_info;
/*
* Call H5Pget_mpi function.
*/
c_prp_id = *prp_id;
ret = H5Pget_fapl_mpio(c_prp_id, &c_comm, &c_info);
if (ret < 0) return ret_value;
*comm = (int_f) MPI_Comm_c2f(c_comm);
*info = (int_f) MPI_Info_c2f(c_info);
ret_value = 0;
return ret_value;
}
/****if* H5FDmpiof/h5pset_dxpl_mpio_c
* NAME
* h5pset_dxpl_mpio_c
* PURPOSE
* Call H5Pset_dxpl_mpio to set transfer mode of the dataset
* trasfer property list
* INPUTS
* prp_id - property list identifier
* data_xfer_mode - transfer mode
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
* Elena Pourmal
* Thursday, October 26, 2000
* HISTORY
*
* SOURCE
*/
int_f
nh5pset_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret;
H5FD_mpio_xfer_t c_data_xfer_mode;
/*
switch (*data_xfer_mode) {
case H5FD_MPIO_INDEPENDENT_F:
c_data_xfer_mode = H5FD_MPIO_INDEPENDENT;
break;
case H5FD_MPIO_COLLECTIVE_F:
c_data_xfer_mode = H5FD_MPIO_COLLECTIVE;
break;
default:
return ret_value;
}
*/
c_data_xfer_mode = (H5FD_mpio_xfer_t)*data_xfer_mode;
/*
* Call H5Pset_dxpl_mpio function.
*/
c_prp_id = *prp_id;
ret = H5Pset_dxpl_mpio(c_prp_id, c_data_xfer_mode);
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
/****if* H5FDmpiof/h5pget_dxpl_mpio_c
* NAME
* h5pget_dxpl_mpio_c
* PURPOSE
* Call H5Pget_dxpl_mpio to get transfer mode of the dataset
* trasfer property list
* INPUTS
* prp_id - property list identifier
* data_xfer_mode - buffer to retrieve transfer mode
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
* Elena Pourmal
* Thursday, June 15, 2000
* HISTORY
*
* SOURCE
*/
int_f
nh5pget_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret;
H5FD_mpio_xfer_t c_data_xfer_mode;
/*
* Call H5Pget_xfer function.
*/
c_prp_id = *prp_id;
ret = H5Pget_dxpl_mpio(c_prp_id, &c_data_xfer_mode);
if (ret < 0) return ret_value;
*data_xfer_mode = (int_f)c_data_xfer_mode;
/*
switch (c_data_xfer_mode) {
case H5FD_MPIO_INDEPENDENT:
*data_xfer_mode = H5FD_MPIO_INDEPENDENT_F;
break;
case H5FD_MPIO_COLLECTIVE:
*data_xfer_mode = H5FD_MPIO_COLLECTIVE_F;
break;
default:
return ret_value;
}
*/
ret_value = 0;
return ret_value;
}
/****if* H5Pf/h5pget_mpio_actual_io_mode_c
* NAME
* h5pget_mpio_actual_io_mode_c
* PURPOSE
* Calls H5Pget_mpio_actual_io_mode
*
* INPUTS
* dxpl_id - Dataset transfer property list identifier.
* OUTPUTS
* actual_io_mode - The type of I/O performed by this process.
*
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
* M. Scot Breitenfeld
* July 27, 2012
* SOURCE
*/
int_f
nh5pget_mpio_actual_io_mode_c(hid_t_f *dxpl_id, int_f *actual_io_mode)
/******/
{
int ret_value = -1;
H5D_mpio_actual_io_mode_t c_actual_io_mode;
/*
* Call H5Pget_mpio_actual_io_mode_f function.
*/
if( (H5Pget_mpio_actual_io_mode((hid_t)*dxpl_id, &c_actual_io_mode)) <0 )
return ret_value; /* error occurred */
*actual_io_mode =(int_f)c_actual_io_mode;
ret_value = 0;
return ret_value;
}
|
be0d3ae3271d74d51ca307cd5c29231439bd737d
|
28d0f8c01599f8f6c711bdde0b59f9c2cd221203
|
/sys/arch/arm/xscale/becc.c
|
48dca6a6ce079e9251f6d296c0a2c6d3347ce2eb
|
[] |
no_license
|
NetBSD/src
|
1a9cbc22ed778be638b37869ed4fb5c8dd616166
|
23ee83f7c0aea0777bd89d8ebd7f0cde9880d13c
|
refs/heads/trunk
| 2023-08-31T13:24:58.105962
| 2023-08-27T15:50:47
| 2023-08-27T15:50:47
| 88,439,547
| 656
| 348
| null | 2023-07-20T20:07:24
| 2017-04-16T20:03:43
| null |
UTF-8
|
C
| false
| false
| 10,152
|
c
|
becc.c
|
/* $NetBSD: becc.c,v 1.18 2021/08/07 16:18:46 thorpej Exp $ */
/*
* Copyright (c) 2002, 2003 Wasabi Systems, Inc.
* All rights reserved.
*
* Written by Jason R. Thorpe for Wasabi Systems, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed for the NetBSD Project by
* Wasabi Systems, Inc.
* 4. The name of Wasabi Systems, Inc. may not be used to endorse
* or promote products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Autoconfiguration support for the ADI Engineering Big Endian
* Companion Chip.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: becc.c,v 1.18 2021/08/07 16:18:46 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/bus.h>
#include <arm/xscale/i80200reg.h>
#include <arm/xscale/beccreg.h>
#include <arm/xscale/beccvar.h>
/*
* Virtual address at which the BECC is mapped. This is filled in
* by machine-dependent code.
*/
vaddr_t becc_vaddr;
/*
* BECC revision number. This is initialized by early bootstrap code.
*/
int becc_rev;
const char *becc_revisions[] = {
"<= 7",
"8",
">= 9",
};
/*
* There can be only one BECC, so we keep a global pointer to
* the softc, so board-specific code can use features of the
* BECC without having to have a handle on the softc itself.
*/
struct becc_softc *becc_softc;
static int becc_search(device_t, cfdata_t, const int *, void *);
static int becc_print(void *, const char *);
static void becc_pci_dma_init(struct becc_softc *);
static void becc_local_dma_init(struct becc_softc *);
/*
* becc_attach:
*
* Board-independent attach routine for the BECC.
*/
void
becc_attach(struct becc_softc *sc)
{
struct pcibus_attach_args pba;
uint32_t reg;
becc_softc = sc;
/*
* Set the AF bit in the BCUMOD since the BECC will honor it.
* This allows the BECC to return the requested 4-byte word
* first when filling a cache line.
*/
__asm volatile("mrc p13, 0, %0, c1, c1, 0" : "=r" (reg));
__asm volatile("mcr p13, 0, %0, c1, c1, 0" : : "r" (reg | BCUMOD_AF));
/*
* Program the address windows of the PCI core. Note
* that PCI master and target cycles must be disabled
* while we configure the windows.
*/
reg = becc_pcicore_read(sc, PCI_COMMAND_STATUS_REG);
reg &= ~(PCI_COMMAND_MEM_ENABLE|PCI_COMMAND_MASTER_ENABLE);
becc_pcicore_write(sc, PCI_COMMAND_STATUS_REG, reg);
/*
* Program the two inbound PCI memory windows.
*/
becc_pcicore_write(sc, PCI_MAPREG_START + 0,
sc->sc_iwin[0].iwin_base | PCI_MAPREG_MEM_TYPE_32BIT |
PCI_MAPREG_MEM_PREFETCHABLE_MASK);
reg = becc_pcicore_read(sc, PCI_MAPREG_START + 0);
BECC_CSR_WRITE(BECC_PSTR0, sc->sc_iwin[0].iwin_xlate & PSTRx_ADDRMASK);
becc_pcicore_write(sc, PCI_MAPREG_START + 4,
sc->sc_iwin[1].iwin_base | PCI_MAPREG_MEM_TYPE_32BIT |
PCI_MAPREG_MEM_PREFETCHABLE_MASK);
reg = becc_pcicore_read(sc, PCI_MAPREG_START + 4);
BECC_CSR_WRITE(BECC_PSTR1, sc->sc_iwin[1].iwin_xlate & PSTRx_ADDRMASK);
/*
* ...and the third on v8 and later.
*/
if (becc_rev >= BECC_REV_V8) {
becc_pcicore_write(sc, PCI_MAPREG_START + 8,
sc->sc_iwin[2].iwin_base | PCI_MAPREG_MEM_TYPE_32BIT |
PCI_MAPREG_MEM_PREFETCHABLE_MASK);
reg = becc_pcicore_read(sc, PCI_MAPREG_START + 8);
BECC_CSR_WRITE(BECC_PSTR2,
sc->sc_iwin[2].iwin_xlate & PSTR2_ADDRMASK);
}
/*
* Program the two outbound PCI memory windows.
* NOTE: WE DO NOT BYTE-SWAP OUTBOUND WINDOWS IN BIG-ENDIAN
* MODE. I know this seems counter-intuitive, but that's
* how it is.
*
* There's a third window on v9 and later, but we don't
* use it for anything; program it anyway, just to be
* safe.
*/
BECC_CSR_WRITE(BECC_POMR1, sc->sc_owin_xlate[0] /* | POMRx_F32 */);
BECC_CSR_WRITE(BECC_POMR2, sc->sc_owin_xlate[1] /* | POMRx_F32 */);
if (becc_rev >= BECC_REV_V9)
BECC_CSR_WRITE(BECC_POMR3,
sc->sc_owin_xlate[2] /* | POMRx_F32 */);
/*
* Program the PCI I/O window. See note above about byte-swapping.
*
* XXX What about STREAM transfers?
*/
BECC_CSR_WRITE(BECC_POIR, sc->sc_ioout_xlate);
/*
* Configure PCI configuration cycle access.
*/
BECC_CSR_WRITE(BECC_POCR, 0);
/*
* ...and now reenable PCI access.
*/
reg = becc_pcicore_read(sc, PCI_COMMAND_STATUS_REG);
reg |= PCI_COMMAND_MEM_ENABLE | PCI_COMMAND_MASTER_ENABLE |
PCI_COMMAND_PARITY_ENABLE | PCI_COMMAND_SERR_ENABLE;
becc_pcicore_write(sc, PCI_COMMAND_STATUS_REG, reg);
/* Initialize the bus space tags. */
becc_io_bs_init(&sc->sc_pci_iot, sc);
becc_mem_bs_init(&sc->sc_pci_memt, sc);
/* Initialize the PCI chipset tag. */
becc_pci_init(&sc->sc_pci_chipset, sc);
/* Initialize the DMA tags. */
becc_pci_dma_init(sc);
becc_local_dma_init(sc);
/*
* Attach any on-chip peripherals. We used indirect config, since
* the BECC is a soft-core with a variety of peripherals, depending
* on configuration.
*/
config_search(sc->sc_dev, NULL,
CFARGS(.search = becc_search,
.iattr = "becc"));
/*
* Attach the PCI bus.
*/
pba.pba_iot = &sc->sc_pci_iot;
pba.pba_memt = &sc->sc_pci_memt;
pba.pba_dmat = &sc->sc_pci_dmat;
pba.pba_dmat64 = NULL;
pba.pba_pc = &sc->sc_pci_chipset;
pba.pba_bus = 0;
pba.pba_bridgetag = NULL;
pba.pba_intrswiz = 0;
pba.pba_intrtag = 0;
pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
config_found(sc->sc_dev, &pba, pcibusprint,
CFARGS(.iattr = "pcibus"));
}
/*
* becc_search:
*
* Indirect autoconfiguration glue for BECC.
*/
static int
becc_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
struct becc_softc *sc = device_private(parent);
struct becc_attach_args ba;
ba.ba_dmat = &sc->sc_local_dmat;
if (config_probe(parent, cf, &ba))
config_attach(parent, cf, &ba, becc_print, CFARGS_NONE);
return (0);
}
/*
* becc_print:
*
* Autoconfiguration cfprint routine when attaching
* to the BECC.
*/
static int
becc_print(void *aux, const char *pnp)
{
return (UNCONF);
}
/*
* becc_pci_dma_init:
*
* Initialize the PCI DMA tag.
*/
static void
becc_pci_dma_init(struct becc_softc *sc)
{
bus_dma_tag_t dmat = &sc->sc_pci_dmat;
struct arm32_dma_range *dr = sc->sc_pci_dma_range;
int i = 0;
/*
* If we have the 128MB window, put it first, since it
* will always cover the entire memory range.
*/
if (becc_rev >= BECC_REV_V8) {
dr[i].dr_sysbase = sc->sc_iwin[2].iwin_xlate;
dr[i].dr_busbase = sc->sc_iwin[2].iwin_base;
dr[i].dr_len = (128U * 1024 * 1024);
i++;
}
dr[i].dr_sysbase = sc->sc_iwin[0].iwin_xlate;
dr[i].dr_busbase = sc->sc_iwin[0].iwin_base;
dr[i].dr_len = (32U * 1024 * 1024);
i++;
dr[i].dr_sysbase = sc->sc_iwin[1].iwin_xlate;
dr[i].dr_busbase = sc->sc_iwin[1].iwin_base;
dr[i].dr_len = (32U * 1024 * 1024);
i++;
dmat->_ranges = dr;
dmat->_nranges = i;
dmat->_dmamap_create = _bus_dmamap_create;
dmat->_dmamap_destroy = _bus_dmamap_destroy;
dmat->_dmamap_load = _bus_dmamap_load;
dmat->_dmamap_load_mbuf = _bus_dmamap_load_mbuf;
dmat->_dmamap_load_uio = _bus_dmamap_load_uio;
dmat->_dmamap_load_raw = _bus_dmamap_load_raw;
dmat->_dmamap_unload = _bus_dmamap_unload;
dmat->_dmamap_sync_pre = _bus_dmamap_sync;
dmat->_dmamap_sync_post = NULL;
dmat->_dmamem_alloc = _bus_dmamem_alloc;
dmat->_dmamem_free = _bus_dmamem_free;
dmat->_dmamem_map = _bus_dmamem_map;
dmat->_dmamem_unmap = _bus_dmamem_unmap;
dmat->_dmamem_mmap = _bus_dmamem_mmap;
dmat->_dmatag_subregion = _bus_dmatag_subregion;
dmat->_dmatag_destroy = _bus_dmatag_destroy;
}
/*
* becc_local_dma_init:
*
* Initialize the local DMA tag.
*/
static void
becc_local_dma_init(struct becc_softc *sc)
{
bus_dma_tag_t dmat = &sc->sc_local_dmat;
dmat->_ranges = NULL;
dmat->_nranges = 0;
dmat->_dmamap_create = _bus_dmamap_create;
dmat->_dmamap_destroy = _bus_dmamap_destroy;
dmat->_dmamap_load = _bus_dmamap_load;
dmat->_dmamap_load_mbuf = _bus_dmamap_load_mbuf;
dmat->_dmamap_load_uio = _bus_dmamap_load_uio;
dmat->_dmamap_load_raw = _bus_dmamap_load_raw;
dmat->_dmamap_unload = _bus_dmamap_unload;
dmat->_dmamap_sync_pre = _bus_dmamap_sync;
dmat->_dmamap_sync_post = NULL;
dmat->_dmamem_alloc = _bus_dmamem_alloc;
dmat->_dmamem_free = _bus_dmamem_free;
dmat->_dmamem_map = _bus_dmamem_map;
dmat->_dmamem_unmap = _bus_dmamem_unmap;
dmat->_dmamem_mmap = _bus_dmamem_mmap;
}
uint32_t
becc_pcicore_read(struct becc_softc *sc, bus_addr_t reg)
{
vaddr_t va = sc->sc_pci_cfg_base | (1U << BECC_IDSEL_BIT) | reg;
return (*(volatile uint32_t *) va);
}
void
becc_pcicore_write(struct becc_softc *sc, bus_addr_t reg, uint32_t val)
{
vaddr_t va = sc->sc_pci_cfg_base | (1U << BECC_IDSEL_BIT) | reg;
*(volatile uint32_t *) va = val;
}
|
0a4a7b35b06e2d60e907ebc1f4fab5975284c2ca
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/sound/soc/codecs/dmic.c
|
66967ba6f7576c8f1fc816bb7e894f3e7799e3a2
|
[
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 2,501
|
c
|
dmic.c
|
/*
* dmic.c -- SoC audio for Generic Digital MICs
*
* Author: Liam Girdwood <lrg@slimlogic.co.uk>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
static struct snd_soc_dai_driver dmic_dai = {
.name = "dmic-hifi",
.capture = {
.stream_name = "Capture",
.channels_min = 1,
.channels_max = 8,
.rates = SNDRV_PCM_RATE_CONTINUOUS,
.formats = SNDRV_PCM_FMTBIT_S32_LE
| SNDRV_PCM_FMTBIT_S24_LE
| SNDRV_PCM_FMTBIT_S16_LE,
},
};
static const struct snd_soc_dapm_widget dmic_dapm_widgets[] = {
SND_SOC_DAPM_AIF_OUT("DMIC AIF", "Capture", 0,
SND_SOC_NOPM, 0, 0),
SND_SOC_DAPM_INPUT("DMic"),
};
static const struct snd_soc_dapm_route intercon[] = {
{"DMIC AIF", NULL, "DMic"},
};
static int dmic_probe(struct snd_soc_codec *codec)
{
struct snd_soc_dapm_context *dapm = &codec->dapm;
snd_soc_dapm_new_controls(dapm, dmic_dapm_widgets,
ARRAY_SIZE(dmic_dapm_widgets));
snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon));
snd_soc_dapm_new_widgets(dapm);
return 0;
}
static struct snd_soc_codec_driver soc_dmic = {
.probe = dmic_probe,
};
static int dmic_dev_probe(struct platform_device *pdev)
{
return snd_soc_register_codec(&pdev->dev,
&soc_dmic, &dmic_dai, 1);
}
static int dmic_dev_remove(struct platform_device *pdev)
{
snd_soc_unregister_codec(&pdev->dev);
return 0;
}
MODULE_ALIAS("platform:dmic-codec");
static struct platform_driver dmic_driver = {
.driver = {
.name = "dmic-codec",
.owner = THIS_MODULE,
},
.probe = dmic_dev_probe,
.remove = dmic_dev_remove,
};
module_platform_driver(dmic_driver);
MODULE_DESCRIPTION("Generic DMIC driver");
MODULE_AUTHOR("Liam Girdwood <lrg@slimlogic.co.uk>");
MODULE_LICENSE("GPL");
|
3e629f702eb1bf30561a804018da0c5359111140
|
c85df9a1ad627707fc603f40f7df056af16900c9
|
/source/libs/libwolfssl/wolfcrypt/port/silabs/silabs_aes.h
|
616ecb800336acfc0021eea61ccb3cd36359d1b2
|
[] |
no_license
|
wiidev/usbloadergx
|
28b582c2c8231ca7f313a321a134d6784358a770
|
e25c4e96430524c080767679b0c4a0d7595412a8
|
refs/heads/enhanced
| 2023-08-11T18:47:12.728031
| 2023-01-07T23:30:02
| 2023-01-07T23:30:02
| 204,522,898
| 313
| 124
| null | 2023-07-21T17:06:18
| 2019-08-26T17:05:59
|
C
|
UTF-8
|
C
| false
| false
| 2,387
|
h
|
silabs_aes.h
|
/* silabs_aes.h
*
* Copyright (C) 2006-2022 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifndef _SILABS_AES_H_
#define _SILABS_AES_H_
#include <em_device.h>
#if defined(WOLFSSL_SILABS_SE_ACCEL)
#include <libs/libwolfssl/wolfcrypt/types.h>
#include <sl_se_manager.h>
#include <sl_se_manager_cipher.h>
typedef struct {
sl_se_command_context_t cmd_ctx;
sl_se_key_descriptor_t key;
} silabs_aes_t;
typedef struct Aes Aes;
#ifdef HAVE_AESGCM
int wc_AesGcmEncrypt_silabs (Aes* aes, byte* out, const byte* in, word32 sz,
const byte* iv, word32 ivSz,
byte* authTag, word32 authTagSz,
const byte* authIn, word32 authInSz);
int wc_AesGcmDecrypt_silabs (Aes* aes, byte* out, const byte* in, word32 sz,
const byte* iv, word32 ivSz,
const byte* authTag, word32 authTagSz,
const byte* authIn, word32 authInSz);
#endif /* HAVE_AESGCM */
#ifdef HAVE_AESCCM
int wc_AesCcmEncrypt_silabs (Aes* aes, byte* out, const byte* in, word32 sz,
const byte* iv, word32 ivSz,
byte* authTag, word32 authTagSz,
const byte* authIn, word32 authInSz);
int wc_AesCcmDecrypt_silabs (Aes* aes, byte* out, const byte* in, word32 sz,
const byte* iv, word32 ivSz,
const byte* authTag, word32 authTagSz,
const byte* authIn, word32 authInSz);
#endif /* HAVE_AESCCM */
#endif /* defined(WOLFSSL_SILABS_SE_ACCEL) */
#endif /* _SILABS_AES_H_ */
|
87bd268f2becf6159300964025f160607f27c98f
|
6ac836e1407adf108a31600c7b9b83786f10a473
|
/src/ConEmuLn/ConEmuLn_Lang.h
|
2da7864229e79b418a93cfef292200d25a73143a
|
[
"BSD-3-Clause"
] |
permissive
|
Maximus5/ConEmu
|
d618cc620d69a0bdf4fb19d6d5593becf561b5e6
|
740b09c363cb16fbb730d72c53eaca1c530a016e
|
refs/heads/master
| 2023-08-08T12:53:57.054618
| 2023-07-24T00:05:45
| 2023-07-24T00:05:45
| 2,857,373
| 8,870
| 768
|
BSD-3-Clause
| 2023-07-23T13:17:02
| 2011-11-26T19:48:52
|
C++
|
UTF-8
|
C
| false
| false
| 235
|
h
|
ConEmuLn_Lang.h
|
#pragma once
enum {
CEPluginName=0,
CEPluginEnable,
CEColorPanelLabel,
CEColorEditorLabel,
CEColorViewerLabel,
CEColorType,
CEColorTypeLines,
CEColorTypeStripes,
CEHilightPlugins,
CEPluginColor,
CEBtnOK,
CEBtnCancel,
};
|
744849ecffeeb2b0a911fe793694174fe89a6978
|
b452bbb87214f174122f425f6f98f4c3890c3cca
|
/internal/ccall/gvc/gvrender.c
|
05771a4c09c9f864c6eaf11d02b21434ba10fd60
|
[
"MIT"
] |
permissive
|
goccy/go-graphviz
|
bea9bc86b42734aff7ffae283aeae71702ca588a
|
865af036ddbb745c4424bbd2fdaa9a75668cf0d4
|
refs/heads/master
| 2023-07-20T08:05:39.868377
| 2023-03-21T23:49:44
| 2023-03-21T23:49:44
| 236,740,615
| 511
| 66
|
MIT
| 2023-07-07T13:53:28
| 2020-01-28T13:24:09
|
Go
|
UTF-8
|
C
| false
| false
| 17,749
|
c
|
gvrender.c
|
/* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************/
/*
* graphics code generator wrapper
*
* This library forms the socket for run-time loadable render plugins.
*/
#include "config.h"
#include <string.h>
#include "memory.h"
#include "const.h"
#include "macros.h"
#include "colorprocs.h"
#include "gvplugin_render.h"
#include "cgraph.h"
#include "gvcint.h"
#include "geom.h"
#include "geomprocs.h"
#include "gvcproc.h"
extern int emit_once(char *str);
extern shape_desc *find_user_shape(const char *name);
extern boolean mapbool(char *s);
#ifndef HAVE_STRCASECMP
extern int strcasecmp(const char *s1, const char *s2);
#endif
/* storage for temporary hacks until client API is FP */
static pointf *AF;
static int sizeAF;
/* end hack */
int gvrender_select(GVJ_t * job, const char *str)
{
GVC_t *gvc = job->gvc;
gvplugin_available_t *plugin;
gvplugin_installed_t *typeptr;
gvplugin_load(gvc, API_device, str);
/* When job is created, it is zeroed out.
* Some flags, such as OUTPUT_NOT_REQUIRED, may already be set,
* so don't reset.
*/
/* job->flags = 0; */
plugin = gvc->api[API_device];
if (plugin) {
typeptr = plugin->typeptr;
job->device.engine = (gvdevice_engine_t *) (typeptr->engine);
job->device.features = (gvdevice_features_t *) (typeptr->features);
job->device.id = typeptr->id;
job->device.type = plugin->typestr;
job->flags |= job->device.features->flags;
} else
return NO_SUPPORT; /* FIXME - should differentiate problem */
/* The device plugin has a dependency on a render plugin,
* so the render plugin should be available as well now */
plugin = gvc->api[API_render];
if (plugin) {
typeptr = plugin->typeptr;
job->render.engine = (gvrender_engine_t *) (typeptr->engine);
job->render.features = (gvrender_features_t *) (typeptr->features);
job->render.type = plugin->typestr;
job->flags |= job->render.features->flags;
if (job->device.engine)
job->render.id = typeptr->id;
else
/* A null device engine indicates that the device id is also the renderer id
* and that the renderer doesn't need "device" functions.
* Device "features" settings are still available */
job->render.id = job->device.id;
return GVRENDER_PLUGIN;
}
job->render.engine = NULL;
return NO_SUPPORT; /* FIXME - should differentiate problem */
}
int gvrender_features(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
int features = 0;
if (gvre) {
features = job->render.features->flags;
}
return features;
}
/* gvrender_begin_job:
* Return 0 on success
*/
int gvrender_begin_job(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvdevice_initialize(job))
return 1;
if (gvre) {
if (gvre->begin_job)
gvre->begin_job(job);
}
return 0;
}
void gvrender_end_job(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->end_job)
gvre->end_job(job);
}
job->gvc->common.lib = NULL; /* FIXME - minimally this doesn't belong here */
gvdevice_finalize(job);
}
/* font modifiers */
#define REGULAR 0
#define BOLD 1
#define ITALIC 2
pointf gvrender_ptf(GVJ_t * job, pointf p)
{
pointf rv, translation, scale;
translation = job->translation;
scale.x = job->zoom * job->devscale.x;
scale.y = job->zoom * job->devscale.y;
if (job->rotation) {
rv.x = -(p.y + translation.y) * scale.x;
rv.y = (p.x + translation.x) * scale.y;
} else {
rv.x = (p.x + translation.x) * scale.x;
rv.y = (p.y + translation.y) * scale.y;
}
return rv;
}
/* transform an array of n points */
/* *AF and *af must be preallocated */
/* *AF can be the same as *af for inplace transforms */
pointf *gvrender_ptf_A(GVJ_t * job, pointf * af, pointf * AF, int n)
{
int i;
double t;
pointf translation, scale;
translation = job->translation;
scale.x = job->zoom * job->devscale.x;
scale.y = job->zoom * job->devscale.y;
if (job->rotation) {
for (i = 0; i < n; i++) {
t = -(af[i].y + translation.y) * scale.x;
AF[i].y = (af[i].x + translation.x) * scale.y;
AF[i].x = t;
}
} else {
for (i = 0; i < n; i++) {
AF[i].x = (af[i].x + translation.x) * scale.x;
AF[i].y = (af[i].y + translation.y) * scale.y;
}
}
return AF;
}
static void gvrender_resolve_color(gvrender_features_t * features,
char *name, gvcolor_t * color)
{
char *tok;
int rc;
color->u.string = name;
color->type = COLOR_STRING;
tok = canontoken(name);
if (!features->knowncolors
||
(bsearch
(tok, features->knowncolors, features->sz_knowncolors,
sizeof(char *), (int(*)(const void*, const void*)) strcmp)) == NULL) {
/* if tok was not found in known_colors */
rc = colorxlate(name, color, features->color_type);
if (rc != COLOR_OK) {
if (rc == COLOR_UNKNOWN) {
char *missedcolor = gmalloc(strlen(name) + 16);
sprintf(missedcolor, "color %s", name);
if (emit_once(missedcolor))
agerr(AGWARN, "%s is not a known color.\n", name);
free(missedcolor);
} else {
agerr(AGERR, "error in colxlate()\n");
}
}
}
}
void gvrender_begin_graph(GVJ_t * job, graph_t * g)
{
/* GVC_t *gvc = job->gvc; */
gvrender_engine_t *gvre = job->render.engine;
/* char *s; */
if (gvre) {
/* render specific init */
if (gvre->begin_graph)
gvre->begin_graph(job);
#if 0
/* background color */
if (((s = agget(g, "bgcolor")) != 0) && s[0]) {
gvrender_resolve_color(job->render.features, s,
&(gvc->bgcolor));
if (gvre->resolve_color)
gvre->resolve_color(job, &(gvc->bgcolor));
}
#endif
}
}
void gvrender_end_graph(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->end_graph)
gvre->end_graph(job);
}
gvdevice_format(job);
}
void gvrender_begin_page(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->begin_page)
gvre->begin_page(job);
}
}
void gvrender_end_page(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->end_page)
gvre->end_page(job);
}
}
void gvrender_begin_layer(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->begin_layer)
gvre->begin_layer(job, job->gvc->layerIDs[job->layerNum],
job->layerNum, job->numLayers);
}
}
void gvrender_end_layer(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->end_layer)
gvre->end_layer(job);
}
}
void gvrender_begin_cluster(GVJ_t * job, graph_t * sg)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->begin_cluster)
gvre->begin_cluster(job);
}
}
void gvrender_end_cluster(GVJ_t * job, graph_t * g)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->end_cluster)
gvre->end_cluster(job);
}
}
void gvrender_begin_nodes(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->begin_nodes)
gvre->begin_nodes(job);
}
}
void gvrender_end_nodes(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->end_nodes)
gvre->end_nodes(job);
}
}
void gvrender_begin_edges(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->begin_edges)
gvre->begin_edges(job);
}
}
void gvrender_end_edges(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->end_edges)
gvre->end_edges(job);
}
}
void gvrender_begin_node(GVJ_t * job, node_t * n)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->begin_node)
gvre->begin_node(job);
}
}
void gvrender_end_node(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->end_node)
gvre->end_node(job);
}
}
void gvrender_begin_edge(GVJ_t * job, edge_t * e)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->begin_edge)
gvre->begin_edge(job);
}
}
void gvrender_end_edge(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->end_edge)
gvre->end_edge(job);
}
}
void gvrender_begin_anchor(GVJ_t * job, char *href, char *tooltip,
char *target, char *id)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->begin_anchor)
gvre->begin_anchor(job, href, tooltip, target, id);
}
}
void gvrender_end_anchor(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->end_anchor)
gvre->end_anchor(job);
}
}
void gvrender_begin_label(GVJ_t * job, label_type type)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->begin_label)
gvre->begin_label(job, type);
}
}
void gvrender_end_label(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->end_label)
gvre->end_label(job);
}
}
void gvrender_textspan(GVJ_t * job, pointf p, textspan_t * span)
{
gvrender_engine_t *gvre = job->render.engine;
pointf PF;
if (span->str && span->str[0]
&& (!job->obj /* because of xdgen non-conformity */
|| job->obj->pen != PEN_NONE)) {
if (job->flags & GVRENDER_DOES_TRANSFORM)
PF = p;
else
PF = gvrender_ptf(job, p);
if (gvre) {
if (gvre->textspan)
gvre->textspan(job, PF, span);
}
}
}
void gvrender_set_pencolor(GVJ_t * job, char *name)
{
gvrender_engine_t *gvre = job->render.engine;
gvcolor_t *color = &(job->obj->pencolor);
char *cp = NULL;
if ((cp = strstr(name, ":"))) /* if its a color list, then use only first */
*cp = '\0';
if (gvre) {
gvrender_resolve_color(job->render.features, name, color);
if (gvre->resolve_color)
gvre->resolve_color(job, color);
}
if (cp) /* restore color list */
*cp = ':';
}
void gvrender_set_fillcolor(GVJ_t * job, char *name)
{
gvrender_engine_t *gvre = job->render.engine;
gvcolor_t *color = &(job->obj->fillcolor);
char *cp = NULL;
if ((cp = strstr(name, ":"))) /* if its a color list, then use only first */
*cp = '\0';
if (gvre) {
gvrender_resolve_color(job->render.features, name, color);
if (gvre->resolve_color)
gvre->resolve_color(job, color);
}
if (cp)
*cp = ':';
}
void gvrender_set_gradient_vals (GVJ_t * job, char *stopcolor, int angle, float frac)
{
gvrender_engine_t *gvre = job->render.engine;
gvcolor_t *color = &(job->obj->stopcolor);
if (gvre) {
gvrender_resolve_color(job->render.features, stopcolor, color);
if (gvre->resolve_color)
gvre->resolve_color(job, color);
}
job->obj->gradient_angle = angle;
job->obj->gradient_frac = frac;
}
void gvrender_set_style(GVJ_t * job, char **s)
{
gvrender_engine_t *gvre = job->render.engine;
obj_state_t *obj = job->obj;
char *line, *p;
obj->rawstyle = s;
if (gvre) {
if (s)
while ((p = line = *s++)) {
if (streq(line, "solid"))
obj->pen = PEN_SOLID;
else if (streq(line, "dashed"))
obj->pen = PEN_DASHED;
else if (streq(line, "dotted"))
obj->pen = PEN_DOTTED;
else if (streq(line, "invis") || streq(line, "invisible"))
obj->pen = PEN_NONE;
else if (streq(line, "bold"))
obj->penwidth = PENWIDTH_BOLD;
else if (streq(line, "setlinewidth")) {
while (*p)
p++;
p++;
obj->penwidth = atof(p);
} else if (streq(line, "filled"))
obj->fill = FILL_SOLID;
else if (streq(line, "unfilled"))
obj->fill = FILL_NONE;
else if (streq(line, "tapered"));
else {
agerr(AGWARN,
"gvrender_set_style: unsupported style %s - ignoring\n",
line);
}
}
}
}
void gvrender_ellipse(GVJ_t * job, pointf * pf, int n, int filled)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->ellipse && job->obj->pen != PEN_NONE) {
pointf af[2];
/* center */
af[0].x = (pf[0].x + pf[1].x) / 2.;
af[0].y = (pf[0].y + pf[1].y) / 2.;
/* corner */
af[1] = pf[1];
if (!(job->flags & GVRENDER_DOES_TRANSFORM))
gvrender_ptf_A(job, af, af, 2);
gvre->ellipse(job, af, filled);
}
}
}
void gvrender_polygon(GVJ_t * job, pointf * af, int n, int filled)
{
int noPoly = 0;
gvcolor_t save_pencolor;
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->polygon && job->obj->pen != PEN_NONE) {
if (filled & NO_POLY) {
noPoly = 1;
filled &= ~NO_POLY;
save_pencolor = job->obj->pencolor;
job->obj->pencolor = job->obj->fillcolor;
}
if (job->flags & GVRENDER_DOES_TRANSFORM)
gvre->polygon(job, af, n, filled);
else {
if (sizeAF < n) {
sizeAF = n + 10;
AF = grealloc(AF, sizeAF * sizeof(pointf));
}
gvrender_ptf_A(job, af, AF, n);
gvre->polygon(job, AF, n, filled);
}
if (noPoly)
job->obj->pencolor = save_pencolor;
}
}
}
void gvrender_box(GVJ_t * job, boxf B, int filled)
{
pointf A[4];
A[0] = B.LL;
A[2] = B.UR;
A[1].x = A[0].x;
A[1].y = A[2].y;
A[3].x = A[2].x;
A[3].y = A[0].y;
gvrender_polygon(job, A, 4, filled);
}
void gvrender_beziercurve(GVJ_t * job, pointf * af, int n,
int arrow_at_start, int arrow_at_end,
boolean filled)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->beziercurve && job->obj->pen != PEN_NONE) {
if (job->flags & GVRENDER_DOES_TRANSFORM)
gvre->beziercurve(job, af, n, arrow_at_start, arrow_at_end,
filled);
else {
if (sizeAF < n) {
sizeAF = n + 10;
AF = grealloc(AF, sizeAF * sizeof(pointf));
}
gvrender_ptf_A(job, af, AF, n);
gvre->beziercurve(job, AF, n, arrow_at_start, arrow_at_end,
filled);
}
}
}
}
void gvrender_polyline(GVJ_t * job, pointf * af, int n)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->polyline && job->obj->pen != PEN_NONE) {
if (job->flags & GVRENDER_DOES_TRANSFORM)
gvre->polyline(job, af, n);
else {
if (sizeAF < n) {
sizeAF = n + 10;
AF = grealloc(AF, sizeAF * sizeof(pointf));
}
gvrender_ptf_A(job, af, AF, n);
gvre->polyline(job, AF, n);
}
}
}
}
void gvrender_comment(GVJ_t * job, char *str)
{
gvrender_engine_t *gvre = job->render.engine;
if (!str || !str[0])
return;
if (gvre) {
if (gvre->comment)
gvre->comment(job, str);
}
}
static imagescale_t get_imagescale(char *s)
{
if (*s == '\0')
return IMAGESCALE_FALSE;
if (!strcasecmp(s, "width"))
return IMAGESCALE_WIDTH;
if (!strcasecmp(s, "height"))
return IMAGESCALE_HEIGHT;
if (!strcasecmp(s, "both"))
return IMAGESCALE_BOTH;
if (mapbool(s))
return IMAGESCALE_TRUE;
return IMAGESCALE_FALSE;
}
/* gvrender_usershape:
* Scale image to fill polygon bounding box according to "imagescale"
*/
void gvrender_usershape(GVJ_t * job, char *name, pointf * a, int n,
boolean filled, char *imagescale)
{
gvrender_engine_t *gvre = job->render.engine;
usershape_t *us;
double iw, ih, pw, ph;
double scalex, scaley; /* scale factors */
boxf b; /* target box */
int i;
point isz;
assert(job);
assert(name);
assert(name[0]);
if (!(us = gvusershape_find(name))) {
if (find_user_shape(name)) {
if (gvre && gvre->library_shape)
gvre->library_shape(job, name, a, n, filled);
}
return;
}
isz = gvusershape_size_dpi(us, job->dpi);
if ((isz.x <= 0) && (isz.y <= 0))
return;
/* compute bb of polygon */
b.LL = b.UR = a[0];
for (i = 1; i < n; i++) {
EXPANDBP(b, a[i]);
}
pw = b.UR.x - b.LL.x;
ph = b.UR.y - b.LL.y;
ih = (double) isz.y;
iw = (double) isz.x;
scalex = pw / iw;
scaley = ph / ih;
switch (get_imagescale(imagescale)) {
case IMAGESCALE_TRUE:
/* keep aspect ratio fixed by just using the smaller scale */
if (scalex < scaley) {
iw *= scalex;
ih *= scalex;
} else {
iw *= scaley;
ih *= scaley;
}
break;
case IMAGESCALE_WIDTH:
iw *= scalex;
break;
case IMAGESCALE_HEIGHT:
ih *= scaley;
break;
case IMAGESCALE_BOTH:
iw *= scalex;
ih *= scaley;
break;
case IMAGESCALE_FALSE:
default:
break;
}
/* if image is smaller than target area then center it */
if (iw < pw) {
b.LL.x += (pw - iw) / 2.0;
b.UR.x -= (pw - iw) / 2.0;
}
if (ih < ph) {
b.LL.y += (ph - ih) / 2.0;
b.UR.y -= (ph - ih) / 2.0;
}
/* convert from graph to device coordinates */
if (!(job->flags & GVRENDER_DOES_TRANSFORM)) {
b.LL = gvrender_ptf(job, b.LL);
b.UR = gvrender_ptf(job, b.UR);
}
if (b.LL.x > b.UR.x) {
double d = b.LL.x;
b.LL.x = b.UR.x;
b.UR.x = d;
}
if (b.LL.y > b.UR.y) {
double d = b.LL.y;
b.LL.y = b.UR.y;
b.UR.y = d;
}
if (gvre) {
gvloadimage(job, us, b, filled, job->render.type);
}
}
void gvrender_set_penwidth(GVJ_t * job, double penwidth)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
job->obj->penwidth = penwidth;
/*if (gvre->set_penwidth) gvre->set_penwidth(job, penwidth); */
}
}
|
f5d01dcf4dd2ba95d0adde2a07654a820d0d39bd
|
35ae6922fbfe50390b37927ee2eaeab2469c3b46
|
/apps/c/udpserver/udpserver.c
|
cff15139c6cbadbc310fe9693acf4da27a318f21
|
[
"Apache-2.0",
"AGPL-3.0-only",
"LicenseRef-scancode-mulanpubl-2.0",
"AGPL-3.0-or-later",
"GPL-3.0-only",
"MulanPSL-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-mulanpsl-2.0-en"
] |
permissive
|
rcore-os/arceos
|
5a4fe111ed186941a0c8f420ae4165494d2bcd77
|
94eeaa3c2eb247f15f8403d5aa614f878077f48b
|
refs/heads/main
| 2023-08-30T21:07:40.133762
| 2023-08-27T14:21:04
| 2023-08-27T14:31:00
| 605,446,225
| 255
| 94
|
Apache-2.0
| 2023-09-13T11:39:29
| 2023-02-23T07:02:40
|
Rust
|
UTF-8
|
C
| false
| false
| 1,602
|
c
|
udpserver.c
|
#include <stdio.h>
#include <string.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
const char res_suffix[11] = "_response\n";
int main()
{
puts("Hello, ArceOS C UDP server!");
struct sockaddr_in local, remote;
int addr_len = sizeof(remote);
local.sin_family = AF_INET;
if (inet_pton(AF_INET, "0.0.0.0", &(local.sin_addr)) != 1) {
perror("inet_pton() error");
return -1;
}
local.sin_port = htons(5555);
int sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (sock == -1) {
perror("socket() error");
return -1;
}
if (bind(sock, (struct sockaddr *)&local, sizeof(local)) != 0) {
perror("bind() error");
return -1;
}
puts("listen on: 0.0.0.0:5555");
char buf[1024] = {};
for (;;) {
ssize_t l =
recvfrom(sock, buf, 1024, 0, (struct sockaddr *)&remote, (socklen_t *)&addr_len);
if (l == -1) {
perror("recvfrom() error");
return -1;
}
uint8_t *addr = (uint8_t *)&(remote.sin_addr);
printf("recv: %d Bytes from %d.%d.%d.%d:%d\n", l, addr[0], addr[1], addr[2], addr[3],
ntohs(remote.sin_port));
buf[l] = '\0';
printf("%s\n", buf);
if (l > 1024 - 10) {
puts("received message too long");
return 0;
}
strncpy(buf + l - 1, res_suffix, 10);
if (sendto(sock, buf, l + 10, 0, (struct sockaddr *)&remote, addr_len) == -1) {
perror("sendto() error");
return -1;
}
}
return 0;
}
|
2bbd21ab5950473e78cbdb06540bec1f7b6c12ee
|
8a51a96f61699f0318315ccc89cef39f6866f2b5
|
/src/backend/nodes/makefuncs.c
|
0e7e6e46d943b79c36825ee0f47fbad6eccd46d1
|
[
"PostgreSQL"
] |
permissive
|
postgres/postgres
|
979febf2b41c00090d1256228f768f33e7ef3b6f
|
b5934bfd6071fed3a38cea0cfaa93afda63d9c0c
|
refs/heads/master
| 2023-08-31T00:10:01.373472
| 2023-08-30T23:07:48
| 2023-08-30T23:07:48
| 927,442
| 13,691
| 4,807
|
NOASSERTION
| 2023-09-09T13:59:15
| 2010-09-21T11:35:45
|
C
|
UTF-8
|
C
| false
| false
| 20,507
|
c
|
makefuncs.c
|
/*-------------------------------------------------------------------------
*
* makefuncs.c
* creator functions for various nodes. The functions here are for the
* most frequently created nodes.
*
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* src/backend/nodes/makefuncs.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "catalog/pg_class.h"
#include "catalog/pg_type.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "utils/errcodes.h"
#include "utils/lsyscache.h"
/*
* makeA_Expr -
* makes an A_Expr node
*/
A_Expr *
makeA_Expr(A_Expr_Kind kind, List *name,
Node *lexpr, Node *rexpr, int location)
{
A_Expr *a = makeNode(A_Expr);
a->kind = kind;
a->name = name;
a->lexpr = lexpr;
a->rexpr = rexpr;
a->location = location;
return a;
}
/*
* makeSimpleA_Expr -
* As above, given a simple (unqualified) operator name
*/
A_Expr *
makeSimpleA_Expr(A_Expr_Kind kind, char *name,
Node *lexpr, Node *rexpr, int location)
{
A_Expr *a = makeNode(A_Expr);
a->kind = kind;
a->name = list_make1(makeString((char *) name));
a->lexpr = lexpr;
a->rexpr = rexpr;
a->location = location;
return a;
}
/*
* makeVar -
* creates a Var node
*/
Var *
makeVar(int varno,
AttrNumber varattno,
Oid vartype,
int32 vartypmod,
Oid varcollid,
Index varlevelsup)
{
Var *var = makeNode(Var);
var->varno = varno;
var->varattno = varattno;
var->vartype = vartype;
var->vartypmod = vartypmod;
var->varcollid = varcollid;
var->varlevelsup = varlevelsup;
/*
* Only a few callers need to make Var nodes with non-null varnullingrels,
* or with varnosyn/varattnosyn different from varno/varattno. We don't
* provide separate arguments for them, but just initialize them to NULL
* and the given varno/varattno. This reduces code clutter and chance of
* error for most callers.
*/
var->varnullingrels = NULL;
var->varnosyn = (Index) varno;
var->varattnosyn = varattno;
/* Likewise, we just set location to "unknown" here */
var->location = -1;
return var;
}
/*
* makeVarFromTargetEntry -
* convenience function to create a same-level Var node from a
* TargetEntry
*/
Var *
makeVarFromTargetEntry(int varno,
TargetEntry *tle)
{
return makeVar(varno,
tle->resno,
exprType((Node *) tle->expr),
exprTypmod((Node *) tle->expr),
exprCollation((Node *) tle->expr),
0);
}
/*
* makeWholeRowVar -
* creates a Var node representing a whole row of the specified RTE
*
* A whole-row reference is a Var with varno set to the correct range
* table entry, and varattno == 0 to signal that it references the whole
* tuple. (Use of zero here is unclean, since it could easily be confused
* with error cases, but it's not worth changing now.) The vartype indicates
* a rowtype; either a named composite type, or a domain over a named
* composite type (only possible if the RTE is a function returning that),
* or RECORD. This function encapsulates the logic for determining the
* correct rowtype OID to use.
*
* If allowScalar is true, then for the case where the RTE is a single function
* returning a non-composite result type, we produce a normal Var referencing
* the function's result directly, instead of the single-column composite
* value that the whole-row notation might otherwise suggest.
*/
Var *
makeWholeRowVar(RangeTblEntry *rte,
int varno,
Index varlevelsup,
bool allowScalar)
{
Var *result;
Oid toid;
Node *fexpr;
switch (rte->rtekind)
{
case RTE_RELATION:
/* relation: the rowtype is a named composite type */
toid = get_rel_type_id(rte->relid);
if (!OidIsValid(toid))
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("relation \"%s\" does not have a composite type",
get_rel_name(rte->relid))));
result = makeVar(varno,
InvalidAttrNumber,
toid,
-1,
InvalidOid,
varlevelsup);
break;
case RTE_FUNCTION:
/*
* If there's more than one function, or ordinality is requested,
* force a RECORD result, since there's certainly more than one
* column involved and it can't be a known named type.
*/
if (rte->funcordinality || list_length(rte->functions) != 1)
{
/* always produces an anonymous RECORD result */
result = makeVar(varno,
InvalidAttrNumber,
RECORDOID,
-1,
InvalidOid,
varlevelsup);
break;
}
fexpr = ((RangeTblFunction *) linitial(rte->functions))->funcexpr;
toid = exprType(fexpr);
if (type_is_rowtype(toid))
{
/* func returns composite; same as relation case */
result = makeVar(varno,
InvalidAttrNumber,
toid,
-1,
InvalidOid,
varlevelsup);
}
else if (allowScalar)
{
/* func returns scalar; just return its output as-is */
result = makeVar(varno,
1,
toid,
-1,
exprCollation(fexpr),
varlevelsup);
}
else
{
/* func returns scalar, but we want a composite result */
result = makeVar(varno,
InvalidAttrNumber,
RECORDOID,
-1,
InvalidOid,
varlevelsup);
}
break;
default:
/*
* RTE is a join, subselect, tablefunc, or VALUES. We represent
* this as a whole-row Var of RECORD type. (Note that in most
* cases the Var will be expanded to a RowExpr during planning,
* but that is not our concern here.)
*/
result = makeVar(varno,
InvalidAttrNumber,
RECORDOID,
-1,
InvalidOid,
varlevelsup);
break;
}
return result;
}
/*
* makeTargetEntry -
* creates a TargetEntry node
*/
TargetEntry *
makeTargetEntry(Expr *expr,
AttrNumber resno,
char *resname,
bool resjunk)
{
TargetEntry *tle = makeNode(TargetEntry);
tle->expr = expr;
tle->resno = resno;
tle->resname = resname;
/*
* We always set these fields to 0. If the caller wants to change them he
* must do so explicitly. Few callers do that, so omitting these
* arguments reduces the chance of error.
*/
tle->ressortgroupref = 0;
tle->resorigtbl = InvalidOid;
tle->resorigcol = 0;
tle->resjunk = resjunk;
return tle;
}
/*
* flatCopyTargetEntry -
* duplicate a TargetEntry, but don't copy substructure
*
* This is commonly used when we just want to modify the resno or substitute
* a new expression.
*/
TargetEntry *
flatCopyTargetEntry(TargetEntry *src_tle)
{
TargetEntry *tle = makeNode(TargetEntry);
Assert(IsA(src_tle, TargetEntry));
memcpy(tle, src_tle, sizeof(TargetEntry));
return tle;
}
/*
* makeFromExpr -
* creates a FromExpr node
*/
FromExpr *
makeFromExpr(List *fromlist, Node *quals)
{
FromExpr *f = makeNode(FromExpr);
f->fromlist = fromlist;
f->quals = quals;
return f;
}
/*
* makeConst -
* creates a Const node
*/
Const *
makeConst(Oid consttype,
int32 consttypmod,
Oid constcollid,
int constlen,
Datum constvalue,
bool constisnull,
bool constbyval)
{
Const *cnst = makeNode(Const);
/*
* If it's a varlena value, force it to be in non-expanded (non-toasted)
* format; this avoids any possible dependency on external values and
* improves consistency of representation, which is important for equal().
*/
if (!constisnull && constlen == -1)
constvalue = PointerGetDatum(PG_DETOAST_DATUM(constvalue));
cnst->consttype = consttype;
cnst->consttypmod = consttypmod;
cnst->constcollid = constcollid;
cnst->constlen = constlen;
cnst->constvalue = constvalue;
cnst->constisnull = constisnull;
cnst->constbyval = constbyval;
cnst->location = -1; /* "unknown" */
return cnst;
}
/*
* makeNullConst -
* creates a Const node representing a NULL of the specified type/typmod
*
* This is a convenience routine that just saves a lookup of the type's
* storage properties.
*/
Const *
makeNullConst(Oid consttype, int32 consttypmod, Oid constcollid)
{
int16 typLen;
bool typByVal;
get_typlenbyval(consttype, &typLen, &typByVal);
return makeConst(consttype,
consttypmod,
constcollid,
(int) typLen,
(Datum) 0,
true,
typByVal);
}
/*
* makeBoolConst -
* creates a Const node representing a boolean value (can be NULL too)
*/
Node *
makeBoolConst(bool value, bool isnull)
{
/* note that pg_type.h hardwires size of bool as 1 ... duplicate it */
return (Node *) makeConst(BOOLOID, -1, InvalidOid, 1,
BoolGetDatum(value), isnull, true);
}
/*
* makeBoolExpr -
* creates a BoolExpr node
*/
Expr *
makeBoolExpr(BoolExprType boolop, List *args, int location)
{
BoolExpr *b = makeNode(BoolExpr);
b->boolop = boolop;
b->args = args;
b->location = location;
return (Expr *) b;
}
/*
* makeAlias -
* creates an Alias node
*
* NOTE: the given name is copied, but the colnames list (if any) isn't.
*/
Alias *
makeAlias(const char *aliasname, List *colnames)
{
Alias *a = makeNode(Alias);
a->aliasname = pstrdup(aliasname);
a->colnames = colnames;
return a;
}
/*
* makeRelabelType -
* creates a RelabelType node
*/
RelabelType *
makeRelabelType(Expr *arg, Oid rtype, int32 rtypmod, Oid rcollid,
CoercionForm rformat)
{
RelabelType *r = makeNode(RelabelType);
r->arg = arg;
r->resulttype = rtype;
r->resulttypmod = rtypmod;
r->resultcollid = rcollid;
r->relabelformat = rformat;
r->location = -1;
return r;
}
/*
* makeRangeVar -
* creates a RangeVar node (rather oversimplified case)
*/
RangeVar *
makeRangeVar(char *schemaname, char *relname, int location)
{
RangeVar *r = makeNode(RangeVar);
r->catalogname = NULL;
r->schemaname = schemaname;
r->relname = relname;
r->inh = true;
r->relpersistence = RELPERSISTENCE_PERMANENT;
r->alias = NULL;
r->location = location;
return r;
}
/*
* makeTypeName -
* build a TypeName node for an unqualified name.
*
* typmod is defaulted, but can be changed later by caller.
*/
TypeName *
makeTypeName(char *typnam)
{
return makeTypeNameFromNameList(list_make1(makeString(typnam)));
}
/*
* makeTypeNameFromNameList -
* build a TypeName node for a String list representing a qualified name.
*
* typmod is defaulted, but can be changed later by caller.
*/
TypeName *
makeTypeNameFromNameList(List *names)
{
TypeName *n = makeNode(TypeName);
n->names = names;
n->typmods = NIL;
n->typemod = -1;
n->location = -1;
return n;
}
/*
* makeTypeNameFromOid -
* build a TypeName node to represent a type already known by OID/typmod.
*/
TypeName *
makeTypeNameFromOid(Oid typeOid, int32 typmod)
{
TypeName *n = makeNode(TypeName);
n->typeOid = typeOid;
n->typemod = typmod;
n->location = -1;
return n;
}
/*
* makeColumnDef -
* build a ColumnDef node to represent a simple column definition.
*
* Type and collation are specified by OID.
* Other properties are all basic to start with.
*/
ColumnDef *
makeColumnDef(const char *colname, Oid typeOid, int32 typmod, Oid collOid)
{
ColumnDef *n = makeNode(ColumnDef);
n->colname = pstrdup(colname);
n->typeName = makeTypeNameFromOid(typeOid, typmod);
n->inhcount = 0;
n->is_local = true;
n->is_not_null = false;
n->is_from_type = false;
n->storage = 0;
n->raw_default = NULL;
n->cooked_default = NULL;
n->collClause = NULL;
n->collOid = collOid;
n->constraints = NIL;
n->fdwoptions = NIL;
n->location = -1;
return n;
}
/*
* makeFuncExpr -
* build an expression tree representing a function call.
*
* The argument expressions must have been transformed already.
*/
FuncExpr *
makeFuncExpr(Oid funcid, Oid rettype, List *args,
Oid funccollid, Oid inputcollid, CoercionForm fformat)
{
FuncExpr *funcexpr;
funcexpr = makeNode(FuncExpr);
funcexpr->funcid = funcid;
funcexpr->funcresulttype = rettype;
funcexpr->funcretset = false; /* only allowed case here */
funcexpr->funcvariadic = false; /* only allowed case here */
funcexpr->funcformat = fformat;
funcexpr->funccollid = funccollid;
funcexpr->inputcollid = inputcollid;
funcexpr->args = args;
funcexpr->location = -1;
return funcexpr;
}
/*
* makeDefElem -
* build a DefElem node
*
* This is sufficient for the "typical" case with an unqualified option name
* and no special action.
*/
DefElem *
makeDefElem(char *name, Node *arg, int location)
{
DefElem *res = makeNode(DefElem);
res->defnamespace = NULL;
res->defname = name;
res->arg = arg;
res->defaction = DEFELEM_UNSPEC;
res->location = location;
return res;
}
/*
* makeDefElemExtended -
* build a DefElem node with all fields available to be specified
*/
DefElem *
makeDefElemExtended(char *nameSpace, char *name, Node *arg,
DefElemAction defaction, int location)
{
DefElem *res = makeNode(DefElem);
res->defnamespace = nameSpace;
res->defname = name;
res->arg = arg;
res->defaction = defaction;
res->location = location;
return res;
}
/*
* makeFuncCall -
*
* Initialize a FuncCall struct with the information every caller must
* supply. Any non-default parameters have to be inserted by the caller.
*/
FuncCall *
makeFuncCall(List *name, List *args, CoercionForm funcformat, int location)
{
FuncCall *n = makeNode(FuncCall);
n->funcname = name;
n->args = args;
n->agg_order = NIL;
n->agg_filter = NULL;
n->over = NULL;
n->agg_within_group = false;
n->agg_star = false;
n->agg_distinct = false;
n->func_variadic = false;
n->funcformat = funcformat;
n->location = location;
return n;
}
/*
* make_opclause
* Creates an operator clause given its operator info, left operand
* and right operand (pass NULL to create single-operand clause),
* and collation info.
*/
Expr *
make_opclause(Oid opno, Oid opresulttype, bool opretset,
Expr *leftop, Expr *rightop,
Oid opcollid, Oid inputcollid)
{
OpExpr *expr = makeNode(OpExpr);
expr->opno = opno;
expr->opfuncid = InvalidOid;
expr->opresulttype = opresulttype;
expr->opretset = opretset;
expr->opcollid = opcollid;
expr->inputcollid = inputcollid;
if (rightop)
expr->args = list_make2(leftop, rightop);
else
expr->args = list_make1(leftop);
expr->location = -1;
return (Expr *) expr;
}
/*
* make_andclause
*
* Creates an 'and' clause given a list of its subclauses.
*/
Expr *
make_andclause(List *andclauses)
{
BoolExpr *expr = makeNode(BoolExpr);
expr->boolop = AND_EXPR;
expr->args = andclauses;
expr->location = -1;
return (Expr *) expr;
}
/*
* make_orclause
*
* Creates an 'or' clause given a list of its subclauses.
*/
Expr *
make_orclause(List *orclauses)
{
BoolExpr *expr = makeNode(BoolExpr);
expr->boolop = OR_EXPR;
expr->args = orclauses;
expr->location = -1;
return (Expr *) expr;
}
/*
* make_notclause
*
* Create a 'not' clause given the expression to be negated.
*/
Expr *
make_notclause(Expr *notclause)
{
BoolExpr *expr = makeNode(BoolExpr);
expr->boolop = NOT_EXPR;
expr->args = list_make1(notclause);
expr->location = -1;
return (Expr *) expr;
}
/*
* make_and_qual
*
* Variant of make_andclause for ANDing two qual conditions together.
* Qual conditions have the property that a NULL nodetree is interpreted
* as 'true'.
*
* NB: this makes no attempt to preserve AND/OR flatness; so it should not
* be used on a qual that has already been run through prepqual.c.
*/
Node *
make_and_qual(Node *qual1, Node *qual2)
{
if (qual1 == NULL)
return qual2;
if (qual2 == NULL)
return qual1;
return (Node *) make_andclause(list_make2(qual1, qual2));
}
/*
* The planner and executor usually represent qualification expressions
* as lists of boolean expressions with implicit AND semantics.
*
* These functions convert between an AND-semantics expression list and the
* ordinary representation of a boolean expression.
*
* Note that an empty list is considered equivalent to TRUE.
*/
Expr *
make_ands_explicit(List *andclauses)
{
if (andclauses == NIL)
return (Expr *) makeBoolConst(true, false);
else if (list_length(andclauses) == 1)
return (Expr *) linitial(andclauses);
else
return make_andclause(andclauses);
}
List *
make_ands_implicit(Expr *clause)
{
/*
* NB: because the parser sets the qual field to NULL in a query that has
* no WHERE clause, we must consider a NULL input clause as TRUE, even
* though one might more reasonably think it FALSE.
*/
if (clause == NULL)
return NIL; /* NULL -> NIL list == TRUE */
else if (is_andclause(clause))
return ((BoolExpr *) clause)->args;
else if (IsA(clause, Const) &&
!((Const *) clause)->constisnull &&
DatumGetBool(((Const *) clause)->constvalue))
return NIL; /* constant TRUE input -> NIL list */
else
return list_make1(clause);
}
/*
* makeIndexInfo
* create an IndexInfo node
*/
IndexInfo *
makeIndexInfo(int numattrs, int numkeyattrs, Oid amoid, List *expressions,
List *predicates, bool unique, bool nulls_not_distinct,
bool isready, bool concurrent, bool summarizing)
{
IndexInfo *n = makeNode(IndexInfo);
n->ii_NumIndexAttrs = numattrs;
n->ii_NumIndexKeyAttrs = numkeyattrs;
Assert(n->ii_NumIndexKeyAttrs != 0);
Assert(n->ii_NumIndexKeyAttrs <= n->ii_NumIndexAttrs);
n->ii_Unique = unique;
n->ii_NullsNotDistinct = nulls_not_distinct;
n->ii_ReadyForInserts = isready;
n->ii_CheckedUnchanged = false;
n->ii_IndexUnchanged = false;
n->ii_Concurrent = concurrent;
n->ii_Summarizing = summarizing;
/* summarizing indexes cannot contain non-key attributes */
Assert(!summarizing || (numkeyattrs == numattrs));
/* expressions */
n->ii_Expressions = expressions;
n->ii_ExpressionsState = NIL;
/* predicates */
n->ii_Predicate = predicates;
n->ii_PredicateState = NULL;
/* exclusion constraints */
n->ii_ExclusionOps = NULL;
n->ii_ExclusionProcs = NULL;
n->ii_ExclusionStrats = NULL;
/* opclass options */
n->ii_OpclassOptions = NULL;
/* speculative inserts */
n->ii_UniqueOps = NULL;
n->ii_UniqueProcs = NULL;
n->ii_UniqueStrats = NULL;
/* initialize index-build state to default */
n->ii_BrokenHotChain = false;
n->ii_ParallelWorkers = 0;
/* set up for possible use by index AM */
n->ii_Am = amoid;
n->ii_AmCache = NULL;
n->ii_Context = CurrentMemoryContext;
return n;
}
/*
* makeGroupingSet
*
*/
GroupingSet *
makeGroupingSet(GroupingSetKind kind, List *content, int location)
{
GroupingSet *n = makeNode(GroupingSet);
n->kind = kind;
n->content = content;
n->location = location;
return n;
}
/*
* makeVacuumRelation -
* create a VacuumRelation node
*/
VacuumRelation *
makeVacuumRelation(RangeVar *relation, Oid oid, List *va_cols)
{
VacuumRelation *v = makeNode(VacuumRelation);
v->relation = relation;
v->oid = oid;
v->va_cols = va_cols;
return v;
}
/*
* makeJsonFormat -
* creates a JsonFormat node
*/
JsonFormat *
makeJsonFormat(JsonFormatType type, JsonEncoding encoding, int location)
{
JsonFormat *jf = makeNode(JsonFormat);
jf->format_type = type;
jf->encoding = encoding;
jf->location = location;
return jf;
}
/*
* makeJsonValueExpr -
* creates a JsonValueExpr node
*/
JsonValueExpr *
makeJsonValueExpr(Expr *raw_expr, Expr *formatted_expr,
JsonFormat *format)
{
JsonValueExpr *jve = makeNode(JsonValueExpr);
jve->raw_expr = raw_expr;
jve->formatted_expr = formatted_expr;
jve->format = format;
return jve;
}
/*
* makeJsonEncoding -
* converts JSON encoding name to enum JsonEncoding
*/
JsonEncoding
makeJsonEncoding(char *name)
{
if (!pg_strcasecmp(name, "utf8"))
return JS_ENC_UTF8;
if (!pg_strcasecmp(name, "utf16"))
return JS_ENC_UTF16;
if (!pg_strcasecmp(name, "utf32"))
return JS_ENC_UTF32;
ereport(ERROR,
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("unrecognized JSON encoding: %s", name));
return JS_ENC_DEFAULT;
}
/*
* makeJsonKeyValue -
* creates a JsonKeyValue node
*/
Node *
makeJsonKeyValue(Node *key, Node *value)
{
JsonKeyValue *n = makeNode(JsonKeyValue);
n->key = (Expr *) key;
n->value = castNode(JsonValueExpr, value);
return (Node *) n;
}
/*
* makeJsonIsPredicate -
* creates a JsonIsPredicate node
*/
Node *
makeJsonIsPredicate(Node *expr, JsonFormat *format, JsonValueType item_type,
bool unique_keys, int location)
{
JsonIsPredicate *n = makeNode(JsonIsPredicate);
n->expr = expr;
n->format = format;
n->item_type = item_type;
n->unique_keys = unique_keys;
n->location = location;
return (Node *) n;
}
|
667ba42e84cec39154c4648a7fb53cfb446183bb
|
65f3405e2d3deb0e5db9cb8b26644509ac96568e
|
/src/Fonts/GFXFF/FreeSans9pt7b.h
|
86ee3a61d4195bfa9f735dc5f1e985581ab2ca7c
|
[
"MIT",
"BSD-3-Clause",
"BSD-2-Clause"
] |
permissive
|
m5stack/M5Stack
|
9830600f925026c326af4fa23823d1c7f76df9fc
|
1e81176b2dd9cb7839f53f5a71a8143b04794de7
|
refs/heads/master
| 2023-09-03T17:50:59.532971
| 2023-08-28T06:50:34
| 2023-08-28T06:50:34
| 89,710,200
| 1,093
| 489
|
MIT
| 2023-07-10T06:40:53
| 2017-04-28T13:47:48
|
C
|
UTF-8
|
C
| false
| false
| 11,985
|
h
|
FreeSans9pt7b.h
|
const uint8_t FreeSans9pt7bBitmaps[] PROGMEM = {
0xFF, 0xFF, 0xF8, 0xC0, 0xDE, 0xF7, 0x20, 0x09, 0x86, 0x41, 0x91, 0xFF,
0x13, 0x04, 0xC3, 0x20, 0xC8, 0xFF, 0x89, 0x82, 0x61, 0x90, 0x10, 0x1F,
0x14, 0xDA, 0x3D, 0x1E, 0x83, 0x40, 0x78, 0x17, 0x08, 0xF4, 0x7A, 0x35,
0x33, 0xF0, 0x40, 0x20, 0x38, 0x10, 0xEC, 0x20, 0xC6, 0x20, 0xC6, 0x40,
0xC6, 0x40, 0x6C, 0x80, 0x39, 0x00, 0x01, 0x3C, 0x02, 0x77, 0x02, 0x63,
0x04, 0x63, 0x04, 0x77, 0x08, 0x3C, 0x0E, 0x06, 0x60, 0xCC, 0x19, 0x81,
0xE0, 0x18, 0x0F, 0x03, 0x36, 0xC2, 0xD8, 0x73, 0x06, 0x31, 0xE3, 0xC4,
0xFE, 0x13, 0x26, 0x6C, 0xCC, 0xCC, 0xC4, 0x66, 0x23, 0x10, 0x8C, 0x46,
0x63, 0x33, 0x33, 0x32, 0x66, 0x4C, 0x80, 0x25, 0x7E, 0xA5, 0x00, 0x30,
0xC3, 0x3F, 0x30, 0xC3, 0x0C, 0xD6, 0xF0, 0xC0, 0x08, 0x44, 0x21, 0x10,
0x84, 0x42, 0x11, 0x08, 0x00, 0x3C, 0x66, 0x42, 0xC3, 0xC3, 0xC3, 0xC3,
0xC3, 0xC3, 0xC3, 0x42, 0x66, 0x3C, 0x11, 0x3F, 0x33, 0x33, 0x33, 0x33,
0x30, 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x1C, 0x1C, 0x1C, 0x18, 0x18,
0x10, 0x08, 0x07, 0xF8, 0x3C, 0x66, 0xC3, 0xC3, 0x03, 0x06, 0x1C, 0x07,
0x03, 0xC3, 0xC3, 0x66, 0x3C, 0x0C, 0x18, 0x71, 0x62, 0xC9, 0xA3, 0x46,
0xFE, 0x18, 0x30, 0x60, 0xC0, 0x7F, 0x20, 0x10, 0x08, 0x08, 0x07, 0xF3,
0x8C, 0x03, 0x01, 0x80, 0xF0, 0x6C, 0x63, 0xE0, 0x1E, 0x31, 0x98, 0x78,
0x0C, 0x06, 0xF3, 0x8D, 0x83, 0xC1, 0xE0, 0xD0, 0x6C, 0x63, 0xE0, 0xFF,
0x03, 0x02, 0x06, 0x04, 0x0C, 0x08, 0x18, 0x18, 0x18, 0x10, 0x30, 0x30,
0x3E, 0x31, 0xB0, 0x78, 0x3C, 0x1B, 0x18, 0xF8, 0xC6, 0xC1, 0xE0, 0xF0,
0x6C, 0x63, 0xE0, 0x3C, 0x66, 0xC2, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03,
0x03, 0xC2, 0x66, 0x3C, 0xC0, 0x00, 0x30, 0xC0, 0x00, 0x00, 0x64, 0xA0,
0x00, 0x81, 0xC7, 0x8E, 0x0C, 0x07, 0x80, 0x70, 0x0E, 0x01, 0x80, 0xFF,
0x80, 0x00, 0x1F, 0xF0, 0x00, 0x70, 0x0E, 0x01, 0xC0, 0x18, 0x38, 0x71,
0xC0, 0x80, 0x00, 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x18, 0x38, 0x18,
0x18, 0x0C, 0x00, 0x00, 0x01, 0x80, 0x03, 0xF0, 0x06, 0x0E, 0x06, 0x01,
0x86, 0x00, 0x66, 0x1D, 0xBB, 0x31, 0xCF, 0x18, 0xC7, 0x98, 0x63, 0xCC,
0x31, 0xE6, 0x11, 0xB3, 0x99, 0xCC, 0xF7, 0x86, 0x00, 0x01, 0x80, 0x00,
0x70, 0x40, 0x0F, 0xE0, 0x06, 0x00, 0xF0, 0x0F, 0x00, 0x90, 0x19, 0x81,
0x98, 0x10, 0x83, 0x0C, 0x3F, 0xC2, 0x04, 0x60, 0x66, 0x06, 0xC0, 0x30,
0xFF, 0x18, 0x33, 0x03, 0x60, 0x6C, 0x0D, 0x83, 0x3F, 0xC6, 0x06, 0xC0,
0x78, 0x0F, 0x01, 0xE0, 0x6F, 0xF8, 0x1F, 0x86, 0x19, 0x81, 0xA0, 0x3C,
0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x68, 0x0D, 0x83, 0x18, 0x61, 0xF0,
0xFF, 0x18, 0x33, 0x03, 0x60, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0,
0x78, 0x0F, 0x03, 0x60, 0xCF, 0xF0, 0xFF, 0xE0, 0x30, 0x18, 0x0C, 0x06,
0x03, 0xFD, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0F, 0xF8, 0xFF, 0xC0, 0xC0,
0xC0, 0xC0, 0xC0, 0xFE, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x0F, 0x83,
0x0E, 0x60, 0x66, 0x03, 0xC0, 0x0C, 0x00, 0xC1, 0xFC, 0x03, 0xC0, 0x36,
0x03, 0x60, 0x73, 0x0F, 0x0F, 0x10, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C,
0x07, 0x80, 0xFF, 0xFE, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C, 0x06,
0xFF, 0xFF, 0xFF, 0xC0, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x07,
0x8F, 0x1E, 0x27, 0x80, 0xC0, 0xD8, 0x33, 0x0C, 0x63, 0x0C, 0xC1, 0xB8,
0x3F, 0x07, 0x30, 0xC3, 0x18, 0x63, 0x06, 0x60, 0x6C, 0x0C, 0xC0, 0xC0,
0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0xE0,
0x3F, 0x01, 0xFC, 0x1F, 0xE0, 0xFD, 0x05, 0xEC, 0x6F, 0x63, 0x79, 0x13,
0xCD, 0x9E, 0x6C, 0xF1, 0x47, 0x8E, 0x3C, 0x71, 0x80, 0xE0, 0x7C, 0x0F,
0xC1, 0xE8, 0x3D, 0x87, 0x98, 0xF1, 0x1E, 0x33, 0xC3, 0x78, 0x6F, 0x07,
0xE0, 0x7C, 0x0E, 0x0F, 0x81, 0x83, 0x18, 0x0C, 0xC0, 0x6C, 0x01, 0xE0,
0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1B, 0x01, 0x98, 0x0C, 0x60, 0xC0, 0xF8,
0x00, 0xFF, 0x30, 0x6C, 0x0F, 0x03, 0xC0, 0xF0, 0x6F, 0xF3, 0x00, 0xC0,
0x30, 0x0C, 0x03, 0x00, 0xC0, 0x00, 0x0F, 0x81, 0x83, 0x18, 0x0C, 0xC0,
0x6C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1B, 0x01, 0x98, 0x6C,
0x60, 0xC0, 0xFB, 0x00, 0x08, 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0,
0x6C, 0x0C, 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, 0x6C, 0x06, 0xC0,
0x70, 0x3F, 0x18, 0x6C, 0x0F, 0x03, 0xC0, 0x1E, 0x01, 0xF0, 0x0E, 0x00,
0xF0, 0x3C, 0x0D, 0x86, 0x3F, 0x00, 0xFF, 0x86, 0x03, 0x01, 0x80, 0xC0,
0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0, 0xC0, 0x78, 0x0F,
0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01,
0xB0, 0x61, 0xF0, 0xC0, 0x6C, 0x0D, 0x81, 0x10, 0x63, 0x0C, 0x61, 0x04,
0x60, 0xCC, 0x19, 0x01, 0x60, 0x3C, 0x07, 0x00, 0x60, 0xC1, 0x81, 0x30,
0xE1, 0x98, 0x70, 0xCC, 0x28, 0x66, 0x26, 0x21, 0x13, 0x30, 0xC8, 0x98,
0x6C, 0x4C, 0x14, 0x34, 0x0A, 0x1A, 0x07, 0x07, 0x03, 0x03, 0x80, 0x81,
0x80, 0x60, 0x63, 0x0C, 0x30, 0xC1, 0x98, 0x0F, 0x00, 0xE0, 0x06, 0x00,
0xF0, 0x19, 0x01, 0x98, 0x30, 0xC6, 0x0E, 0x60, 0x60, 0xC0, 0x36, 0x06,
0x30, 0xC3, 0x0C, 0x19, 0x81, 0xD8, 0x0F, 0x00, 0x60, 0x06, 0x00, 0x60,
0x06, 0x00, 0x60, 0x06, 0x00, 0xFF, 0xC0, 0x60, 0x30, 0x0C, 0x06, 0x03,
0x01, 0xC0, 0x60, 0x30, 0x18, 0x06, 0x03, 0x00, 0xFF, 0xC0, 0xFB, 0x6D,
0xB6, 0xDB, 0x6D, 0xB6, 0xE0, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84,
0x10, 0x80, 0xED, 0xB6, 0xDB, 0x6D, 0xB6, 0xDB, 0xE0, 0x30, 0x60, 0xA2,
0x44, 0xD8, 0xA1, 0x80, 0xFF, 0xC0, 0xC6, 0x30, 0x7E, 0x71, 0xB0, 0xC0,
0x60, 0xF3, 0xDB, 0x0D, 0x86, 0xC7, 0x3D, 0xC0, 0xC0, 0x60, 0x30, 0x1B,
0xCE, 0x36, 0x0F, 0x07, 0x83, 0xC1, 0xE0, 0xF0, 0x7C, 0x6D, 0xE0, 0x3C,
0x66, 0xC3, 0xC0, 0xC0, 0xC0, 0xC0, 0xC3, 0x66, 0x3C, 0x03, 0x03, 0x03,
0x3B, 0x67, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x3C, 0x66,
0xC3, 0xC3, 0xFF, 0xC0, 0xC0, 0xC3, 0x66, 0x3C, 0x36, 0x6F, 0x66, 0x66,
0x66, 0x66, 0x60, 0x3B, 0x67, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x67,
0x3B, 0x03, 0x03, 0xC6, 0x7C, 0xC0, 0xC0, 0xC0, 0xDE, 0xE3, 0xC3, 0xC3,
0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xFF, 0xFF, 0xC0, 0x30, 0x03,
0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0xE0, 0xC0, 0x60, 0x30, 0x18, 0x4C,
0x46, 0x63, 0x61, 0xF0, 0xEC, 0x62, 0x31, 0x98, 0x6C, 0x30, 0xFF, 0xFF,
0xFF, 0xC0, 0xDE, 0xF7, 0x1C, 0xF0, 0xC7, 0x86, 0x3C, 0x31, 0xE1, 0x8F,
0x0C, 0x78, 0x63, 0xC3, 0x1E, 0x18, 0xC0, 0xDE, 0xE3, 0xC3, 0xC3, 0xC3,
0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x3C, 0x66, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3,
0xC3, 0x66, 0x3C, 0xDE, 0x71, 0xB0, 0x78, 0x3C, 0x1E, 0x0F, 0x07, 0x83,
0xE3, 0x6F, 0x30, 0x18, 0x0C, 0x00, 0x3B, 0x67, 0xC3, 0xC3, 0xC3, 0xC3,
0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0x03, 0xDF, 0x31, 0x8C, 0x63, 0x18,
0xC6, 0x00, 0x3E, 0xE3, 0xC0, 0xC0, 0xE0, 0x3C, 0x07, 0xC3, 0xE3, 0x7E,
0x66, 0xF6, 0x66, 0x66, 0x66, 0x67, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3,
0xC3, 0xC3, 0xC7, 0x7B, 0xC1, 0xA0, 0x98, 0xCC, 0x42, 0x21, 0xB0, 0xD0,
0x28, 0x1C, 0x0C, 0x00, 0xC6, 0x1E, 0x38, 0x91, 0xC4, 0xCA, 0x66, 0xD3,
0x16, 0xD0, 0xA6, 0x87, 0x1C, 0x38, 0xC0, 0xC6, 0x00, 0x43, 0x62, 0x36,
0x1C, 0x18, 0x1C, 0x3C, 0x26, 0x62, 0x43, 0xC1, 0x21, 0x98, 0xCC, 0x42,
0x61, 0xB0, 0xD0, 0x38, 0x1C, 0x0C, 0x06, 0x03, 0x01, 0x03, 0x00, 0xFE,
0x0C, 0x30, 0xC1, 0x86, 0x18, 0x20, 0xC1, 0xFC, 0x36, 0x66, 0x66, 0x6E,
0xCE, 0x66, 0x66, 0x66, 0x30, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0xC6, 0x66,
0x66, 0x67, 0x37, 0x66, 0x66, 0x66, 0xC0, 0x61, 0x24, 0x38};
const GFXglyph FreeSans9pt7bGlyphs[] PROGMEM = {
{0, 0, 0, 5, 0, 1}, // 0x20 ' '
{0, 2, 13, 6, 2, -12}, // 0x21 '!'
{4, 5, 4, 6, 1, -12}, // 0x22 '"'
{7, 10, 12, 10, 0, -11}, // 0x23 '#'
{22, 9, 16, 10, 1, -13}, // 0x24 '$'
{40, 16, 13, 16, 1, -12}, // 0x25 '%'
{66, 11, 13, 12, 1, -12}, // 0x26 '&'
{84, 2, 4, 4, 1, -12}, // 0x27 '''
{85, 4, 17, 6, 1, -12}, // 0x28 '('
{94, 4, 17, 6, 1, -12}, // 0x29 ')'
{103, 5, 5, 7, 1, -12}, // 0x2A '*'
{107, 6, 8, 11, 3, -7}, // 0x2B '+'
{113, 2, 4, 5, 2, 0}, // 0x2C ','
{114, 4, 1, 6, 1, -4}, // 0x2D '-'
{115, 2, 1, 5, 1, 0}, // 0x2E '.'
{116, 5, 13, 5, 0, -12}, // 0x2F '/'
{125, 8, 13, 10, 1, -12}, // 0x30 '0'
{138, 4, 13, 10, 3, -12}, // 0x31 '1'
{145, 9, 13, 10, 1, -12}, // 0x32 '2'
{160, 8, 13, 10, 1, -12}, // 0x33 '3'
{173, 7, 13, 10, 2, -12}, // 0x34 '4'
{185, 9, 13, 10, 1, -12}, // 0x35 '5'
{200, 9, 13, 10, 1, -12}, // 0x36 '6'
{215, 8, 13, 10, 0, -12}, // 0x37 '7'
{228, 9, 13, 10, 1, -12}, // 0x38 '8'
{243, 8, 13, 10, 1, -12}, // 0x39 '9'
{256, 2, 10, 5, 1, -9}, // 0x3A ':'
{259, 3, 12, 5, 1, -8}, // 0x3B ';'
{264, 9, 9, 11, 1, -8}, // 0x3C '<'
{275, 9, 4, 11, 1, -5}, // 0x3D '='
{280, 9, 9, 11, 1, -8}, // 0x3E '>'
{291, 9, 13, 10, 1, -12}, // 0x3F '?'
{306, 17, 16, 18, 1, -12}, // 0x40 '@'
{340, 12, 13, 12, 0, -12}, // 0x41 'A'
{360, 11, 13, 12, 1, -12}, // 0x42 'B'
{378, 11, 13, 13, 1, -12}, // 0x43 'C'
{396, 11, 13, 13, 1, -12}, // 0x44 'D'
{414, 9, 13, 11, 1, -12}, // 0x45 'E'
{429, 8, 13, 11, 1, -12}, // 0x46 'F'
{442, 12, 13, 14, 1, -12}, // 0x47 'G'
{462, 11, 13, 13, 1, -12}, // 0x48 'H'
{480, 2, 13, 5, 2, -12}, // 0x49 'I'
{484, 7, 13, 10, 1, -12}, // 0x4A 'J'
{496, 11, 13, 12, 1, -12}, // 0x4B 'K'
{514, 8, 13, 10, 1, -12}, // 0x4C 'L'
{527, 13, 13, 15, 1, -12}, // 0x4D 'M'
{549, 11, 13, 13, 1, -12}, // 0x4E 'N'
{567, 13, 13, 14, 1, -12}, // 0x4F 'O'
{589, 10, 13, 12, 1, -12}, // 0x50 'P'
{606, 13, 14, 14, 1, -12}, // 0x51 'Q'
{629, 12, 13, 13, 1, -12}, // 0x52 'R'
{649, 10, 13, 12, 1, -12}, // 0x53 'S'
{666, 9, 13, 11, 1, -12}, // 0x54 'T'
{681, 11, 13, 13, 1, -12}, // 0x55 'U'
{699, 11, 13, 12, 0, -12}, // 0x56 'V'
{717, 17, 13, 17, 0, -12}, // 0x57 'W'
{745, 12, 13, 12, 0, -12}, // 0x58 'X'
{765, 12, 13, 12, 0, -12}, // 0x59 'Y'
{785, 10, 13, 11, 1, -12}, // 0x5A 'Z'
{802, 3, 17, 5, 1, -12}, // 0x5B '['
{809, 5, 13, 5, 0, -12}, // 0x5C '\'
{818, 3, 17, 5, 0, -12}, // 0x5D ']'
{825, 7, 7, 8, 1, -12}, // 0x5E '^'
{832, 10, 1, 10, 0, 3}, // 0x5F '_'
{834, 4, 3, 5, 0, -12}, // 0x60 '`'
{836, 9, 10, 10, 1, -9}, // 0x61 'a'
{848, 9, 13, 10, 1, -12}, // 0x62 'b'
{863, 8, 10, 9, 1, -9}, // 0x63 'c'
{873, 8, 13, 10, 1, -12}, // 0x64 'd'
{886, 8, 10, 10, 1, -9}, // 0x65 'e'
{896, 4, 13, 5, 1, -12}, // 0x66 'f'
{903, 8, 14, 10, 1, -9}, // 0x67 'g'
{917, 8, 13, 10, 1, -12}, // 0x68 'h'
{930, 2, 13, 4, 1, -12}, // 0x69 'i'
{934, 4, 17, 4, 0, -12}, // 0x6A 'j'
{943, 9, 13, 9, 1, -12}, // 0x6B 'k'
{958, 2, 13, 4, 1, -12}, // 0x6C 'l'
{962, 13, 10, 15, 1, -9}, // 0x6D 'm'
{979, 8, 10, 10, 1, -9}, // 0x6E 'n'
{989, 8, 10, 10, 1, -9}, // 0x6F 'o'
{999, 9, 13, 10, 1, -9}, // 0x70 'p'
{1014, 8, 13, 10, 1, -9}, // 0x71 'q'
{1027, 5, 10, 6, 1, -9}, // 0x72 'r'
{1034, 8, 10, 9, 1, -9}, // 0x73 's'
{1044, 4, 12, 5, 1, -11}, // 0x74 't'
{1050, 8, 10, 10, 1, -9}, // 0x75 'u'
{1060, 9, 10, 9, 0, -9}, // 0x76 'v'
{1072, 13, 10, 13, 0, -9}, // 0x77 'w'
{1089, 8, 10, 9, 0, -9}, // 0x78 'x'
{1099, 9, 14, 9, 0, -9}, // 0x79 'y'
{1115, 7, 10, 9, 1, -9}, // 0x7A 'z'
{1124, 4, 17, 6, 1, -12}, // 0x7B '{'
{1133, 2, 17, 4, 2, -12}, // 0x7C '|'
{1138, 4, 17, 6, 1, -12}, // 0x7D '}'
{1147, 7, 3, 9, 1, -7}}; // 0x7E '~'
const GFXfont FreeSans9pt7b PROGMEM = {(uint8_t *)FreeSans9pt7bBitmaps,
(GFXglyph *)FreeSans9pt7bGlyphs,
0x20,
0x7E,
22,
#ifdef USE_M5_FONT_CREATOR
0,
0
#endif
};
// Approx. 1822 bytes
|
cfcced6f60d8fb1dcbdf72e3ac724fddc5646e0c
|
a343c49b4d9e317025eb89d067426ee0d571d64a
|
/third_party/jsmn/test/tests.c
|
31761cd33bcc0c268de7deca4182811b0dd90e79
|
[
"MIT"
] |
permissive
|
polymonster/pmtech
|
b91eebbb9f393177f422c80f9f803f7d66968b75
|
b658b6febf673ebb9df6f85a4ada1884979a5cf6
|
refs/heads/master
| 2023-07-04T00:00:28.917899
| 2023-03-21T10:24:48
| 2023-03-21T10:24:48
| 84,652,338
| 855
| 49
|
MIT
| 2023-03-22T09:21:03
| 2017-03-11T13:36:04
|
C++
|
UTF-8
|
C
| false
| false
| 10,742
|
c
|
tests.c
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "test.h"
#include "testutil.h"
int test_empty(void) {
check(parse("{}", 1, 1,
JSMN_OBJECT, 0, 2, 0));
check(parse("[]", 1, 1,
JSMN_ARRAY, 0, 2, 0));
check(parse("[{},{}]", 3, 3,
JSMN_ARRAY, 0, 7, 2,
JSMN_OBJECT, 1, 3, 0,
JSMN_OBJECT, 4, 6, 0));
return 0;
}
int test_object(void) {
check(parse("{\"a\":0}", 3, 3,
JSMN_OBJECT, 0, 7, 1,
JSMN_STRING, "a", 1,
JSMN_PRIMITIVE, "0"));
check(parse("{\"a\":[]}", 3, 3,
JSMN_OBJECT, 0, 8, 1,
JSMN_STRING, "a", 1,
JSMN_ARRAY, 5, 7, 0));
check(parse("{\"a\":{},\"b\":{}}", 5, 5,
JSMN_OBJECT, -1, -1, 2,
JSMN_STRING, "a", 1,
JSMN_OBJECT, -1, -1, 0,
JSMN_STRING, "b", 1,
JSMN_OBJECT, -1, -1, 0));
check(parse("{\n \"Day\": 26,\n \"Month\": 9,\n \"Year\": 12\n }", 7, 7,
JSMN_OBJECT, -1, -1, 3,
JSMN_STRING, "Day", 1,
JSMN_PRIMITIVE, "26",
JSMN_STRING, "Month", 1,
JSMN_PRIMITIVE, "9",
JSMN_STRING, "Year", 1,
JSMN_PRIMITIVE, "12"));
check(parse("{\"a\": 0, \"b\": \"c\"}", 5, 5,
JSMN_OBJECT, -1, -1, 2,
JSMN_STRING, "a", 1,
JSMN_PRIMITIVE, "0",
JSMN_STRING, "b", 1,
JSMN_STRING, "c", 0));
#ifdef JSMN_STRICT
check(parse("{\"a\"\n0}", JSMN_ERROR_INVAL, 3));
check(parse("{\"a\", 0}", JSMN_ERROR_INVAL, 3));
check(parse("{\"a\": {2}}", JSMN_ERROR_INVAL, 3));
check(parse("{\"a\": {2: 3}}", JSMN_ERROR_INVAL, 3));
check(parse("{\"a\": {\"a\": 2 3}}", JSMN_ERROR_INVAL, 5));
/* FIXME */
/*check(parse("{\"a\"}", JSMN_ERROR_INVAL, 2));*/
/*check(parse("{\"a\": 1, \"b\"}", JSMN_ERROR_INVAL, 4));*/
/*check(parse("{\"a\",\"b\":1}", JSMN_ERROR_INVAL, 4));*/
/*check(parse("{\"a\":1,}", JSMN_ERROR_INVAL, 4));*/
/*check(parse("{\"a\":\"b\":\"c\"}", JSMN_ERROR_INVAL, 4));*/
/*check(parse("{,}", JSMN_ERROR_INVAL, 4));*/
#endif
return 0;
}
int test_array(void) {
/* FIXME */
/*check(parse("[10}", JSMN_ERROR_INVAL, 3));*/
/*check(parse("[1,,3]", JSMN_ERROR_INVAL, 3)*/
check(parse("[10]", 2, 2,
JSMN_ARRAY, -1, -1, 1,
JSMN_PRIMITIVE, "10"));
check(parse("{\"a\": 1]", JSMN_ERROR_INVAL, 3));
/* FIXME */
/*check(parse("[\"a\": 1]", JSMN_ERROR_INVAL, 3));*/
return 0;
}
int test_primitive(void) {
check(parse("{\"boolVar\" : true }", 3, 3,
JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "boolVar", 1,
JSMN_PRIMITIVE, "true"));
check(parse("{\"boolVar\" : false }", 3, 3,
JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "boolVar", 1,
JSMN_PRIMITIVE, "false"));
check(parse("{\"nullVar\" : null }", 3, 3,
JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "nullVar", 1,
JSMN_PRIMITIVE, "null"));
check(parse("{\"intVar\" : 12}", 3, 3,
JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "intVar", 1,
JSMN_PRIMITIVE, "12"));
check(parse("{\"floatVar\" : 12.345}", 3, 3,
JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "floatVar", 1,
JSMN_PRIMITIVE, "12.345"));
return 0;
}
int test_string(void) {
check(parse("{\"strVar\" : \"hello world\"}", 3, 3,
JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "strVar", 1,
JSMN_STRING, "hello world", 0));
check(parse("{\"strVar\" : \"escapes: \\/\\r\\n\\t\\b\\f\\\"\\\\\"}", 3, 3,
JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "strVar", 1,
JSMN_STRING, "escapes: \\/\\r\\n\\t\\b\\f\\\"\\\\", 0));
check(parse("{\"strVar\": \"\"}", 3, 3,
JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "strVar", 1,
JSMN_STRING, "", 0));
check(parse("{\"a\":\"\\uAbcD\"}", 3, 3,
JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "a", 1,
JSMN_STRING, "\\uAbcD", 0));
check(parse("{\"a\":\"str\\u0000\"}", 3, 3,
JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "a", 1,
JSMN_STRING, "str\\u0000", 0));
check(parse("{\"a\":\"\\uFFFFstr\"}", 3, 3,
JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "a", 1,
JSMN_STRING, "\\uFFFFstr", 0));
check(parse("{\"a\":[\"\\u0280\"]}", 4, 4,
JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "a", 1,
JSMN_ARRAY, -1, -1, 1,
JSMN_STRING, "\\u0280", 0));
check(parse("{\"a\":\"str\\uFFGFstr\"}", JSMN_ERROR_INVAL, 3));
check(parse("{\"a\":\"str\\u@FfF\"}", JSMN_ERROR_INVAL, 3));
check(parse("{{\"a\":[\"\\u028\"]}", JSMN_ERROR_INVAL, 4));
return 0;
}
int test_partial_string(void) {
int i;
int r;
jsmn_parser p;
jsmntok_t tok[5];
const char *js = "{\"x\": \"va\\\\ue\", \"y\": \"value y\"}";
jsmn_init(&p);
for (i = 1; i <= strlen(js); i++) {
r = jsmn_parse(&p, js, i, tok, sizeof(tok)/sizeof(tok[0]));
if (i == strlen(js)) {
check(r == 5);
check(tokeq(js, tok, 5,
JSMN_OBJECT, -1, -1, 2,
JSMN_STRING, "x", 1,
JSMN_STRING, "va\\\\ue", 0,
JSMN_STRING, "y", 1,
JSMN_STRING, "value y", 0));
} else {
check(r == JSMN_ERROR_PART);
}
}
return 0;
}
int test_partial_array(void) {
#ifdef JSMN_STRICT
int r;
int i;
jsmn_parser p;
jsmntok_t tok[10];
const char *js = "[ 1, true, [123, \"hello\"]]";
jsmn_init(&p);
for (i = 1; i <= strlen(js); i++) {
r = jsmn_parse(&p, js, i, tok, sizeof(tok)/sizeof(tok[0]));
if (i == strlen(js)) {
check(r == 6);
check(tokeq(js, tok, 6,
JSMN_ARRAY, -1, -1, 3,
JSMN_PRIMITIVE, "1",
JSMN_PRIMITIVE, "true",
JSMN_ARRAY, -1, -1, 2,
JSMN_PRIMITIVE, "123",
JSMN_STRING, "hello", 0));
} else {
check(r == JSMN_ERROR_PART);
}
}
#endif
return 0;
}
int test_array_nomem(void) {
int i;
int r;
jsmn_parser p;
jsmntok_t toksmall[10], toklarge[10];
const char *js;
js = " [ 1, true, [123, \"hello\"]]";
for (i = 0; i < 6; i++) {
jsmn_init(&p);
memset(toksmall, 0, sizeof(toksmall));
memset(toklarge, 0, sizeof(toklarge));
r = jsmn_parse(&p, js, strlen(js), toksmall, i);
check(r == JSMN_ERROR_NOMEM);
memcpy(toklarge, toksmall, sizeof(toksmall));
r = jsmn_parse(&p, js, strlen(js), toklarge, 10);
check(r >= 0);
check(tokeq(js, toklarge, 4,
JSMN_ARRAY, -1, -1, 3,
JSMN_PRIMITIVE, "1",
JSMN_PRIMITIVE, "true",
JSMN_ARRAY, -1, -1, 2,
JSMN_PRIMITIVE, "123",
JSMN_STRING, "hello", 0));
}
return 0;
}
int test_unquoted_keys(void) {
#ifndef JSMN_STRICT
int r;
jsmn_parser p;
jsmntok_t tok[10];
const char *js;
jsmn_init(&p);
js = "key1: \"value\"\nkey2 : 123";
r = jsmn_parse(&p, js, strlen(js), tok, 10);
check(r >= 0);
check(tokeq(js, tok, 4,
JSMN_PRIMITIVE, "key1",
JSMN_STRING, "value", 0,
JSMN_PRIMITIVE, "key2",
JSMN_PRIMITIVE, "123"));
#endif
return 0;
}
int test_issue_22(void) {
int r;
jsmn_parser p;
jsmntok_t tokens[128];
const char *js;
js = "{ \"height\":10, \"layers\":[ { \"data\":[6,6], \"height\":10, "
"\"name\":\"Calque de Tile 1\", \"opacity\":1, \"type\":\"tilelayer\", "
"\"visible\":true, \"width\":10, \"x\":0, \"y\":0 }], "
"\"orientation\":\"orthogonal\", \"properties\": { }, \"tileheight\":32, "
"\"tilesets\":[ { \"firstgid\":1, \"image\":\"..\\/images\\/tiles.png\", "
"\"imageheight\":64, \"imagewidth\":160, \"margin\":0, \"name\":\"Tiles\", "
"\"properties\":{}, \"spacing\":0, \"tileheight\":32, \"tilewidth\":32 }], "
"\"tilewidth\":32, \"version\":1, \"width\":10 }";
jsmn_init(&p);
r = jsmn_parse(&p, js, strlen(js), tokens, 128);
check(r >= 0);
return 0;
}
int test_issue_27(void) {
const char *js =
"{ \"name\" : \"Jack\", \"age\" : 27 } { \"name\" : \"Anna\", ";
check(parse(js, JSMN_ERROR_PART, 8));
return 0;
}
int test_input_length(void) {
const char *js;
int r;
jsmn_parser p;
jsmntok_t tokens[10];
js = "{\"a\": 0}garbage";
jsmn_init(&p);
r = jsmn_parse(&p, js, 8, tokens, 10);
check(r == 3);
check(tokeq(js, tokens, 3,
JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "a", 1,
JSMN_PRIMITIVE, "0"));
return 0;
}
int test_count(void) {
jsmn_parser p;
const char *js;
js = "{}";
jsmn_init(&p);
check(jsmn_parse(&p, js, strlen(js), NULL, 0) == 1);
js = "[]";
jsmn_init(&p);
check(jsmn_parse(&p, js, strlen(js), NULL, 0) == 1);
js = "[[]]";
jsmn_init(&p);
check(jsmn_parse(&p, js, strlen(js), NULL, 0) == 2);
js = "[[], []]";
jsmn_init(&p);
check(jsmn_parse(&p, js, strlen(js), NULL, 0) == 3);
js = "[[], []]";
jsmn_init(&p);
check(jsmn_parse(&p, js, strlen(js), NULL, 0) == 3);
js = "[[], [[]], [[], []]]";
jsmn_init(&p);
check(jsmn_parse(&p, js, strlen(js), NULL, 0) == 7);
js = "[\"a\", [[], []]]";
jsmn_init(&p);
check(jsmn_parse(&p, js, strlen(js), NULL, 0) == 5);
js = "[[], \"[], [[]]\", [[]]]";
jsmn_init(&p);
check(jsmn_parse(&p, js, strlen(js), NULL, 0) == 5);
js = "[1, 2, 3]";
jsmn_init(&p);
check(jsmn_parse(&p, js, strlen(js), NULL, 0) == 4);
js = "[1, 2, [3, \"a\"], null]";
jsmn_init(&p);
check(jsmn_parse(&p, js, strlen(js), NULL, 0) == 7);
return 0;
}
int test_nonstrict(void) {
#ifndef JSMN_STRICT
const char *js;
js = "a: 0garbage";
check(parse(js, 2, 2,
JSMN_PRIMITIVE, "a",
JSMN_PRIMITIVE, "0garbage"));
js = "Day : 26\nMonth : Sep\n\nYear: 12";
check(parse(js, 6, 6,
JSMN_PRIMITIVE, "Day",
JSMN_PRIMITIVE, "26",
JSMN_PRIMITIVE, "Month",
JSMN_PRIMITIVE, "Sep",
JSMN_PRIMITIVE, "Year",
JSMN_PRIMITIVE, "12"));
//nested {s don't cause a parse error.
js = "\"key {1\": 1234";
check(parse(js, 2, 2,
JSMN_STRING, "key {1", 1,
JSMN_PRIMITIVE, "1234"));
#endif
return 0;
}
int test_unmatched_brackets(void) {
const char *js;
js = "\"key 1\": 1234}";
check(parse(js, JSMN_ERROR_INVAL, 2));
js = "{\"key 1\": 1234";
check(parse(js, JSMN_ERROR_PART, 3));
js = "{\"key 1\": 1234}}";
check(parse(js, JSMN_ERROR_INVAL, 3));
js = "\"key 1\"}: 1234";
check(parse(js, JSMN_ERROR_INVAL, 3));
js = "{\"key {1\": 1234}";
check(parse(js, 3, 3,
JSMN_OBJECT, 0, 16, 1,
JSMN_STRING, "key {1", 1,
JSMN_PRIMITIVE, "1234"));
js = "{{\"key 1\": 1234}";
check(parse(js, JSMN_ERROR_PART, 4));
return 0;
}
int main(void) {
test(test_empty, "test for a empty JSON objects/arrays");
test(test_object, "test for a JSON objects");
test(test_array, "test for a JSON arrays");
test(test_primitive, "test primitive JSON data types");
test(test_string, "test string JSON data types");
test(test_partial_string, "test partial JSON string parsing");
test(test_partial_array, "test partial array reading");
test(test_array_nomem, "test array reading with a smaller number of tokens");
test(test_unquoted_keys, "test unquoted keys (like in JavaScript)");
test(test_input_length, "test strings that are not null-terminated");
test(test_issue_22, "test issue #22");
test(test_issue_27, "test issue #27");
test(test_count, "test tokens count estimation");
test(test_nonstrict, "test for non-strict mode");
test(test_unmatched_brackets, "test for unmatched brackets");
printf("\nPASSED: %d\nFAILED: %d\n", test_passed, test_failed);
return (test_failed > 0);
}
|
5f59e112501e064748aa984af24d5bdc5bb39686
|
91780c385021b09ca3feb47f91b8c89923be7b7e
|
/t/data/031-validate-include-graph/mid.h
|
222643c6d0302df449ab1243e8ade9c0afeb18b5
|
[
"Apache-2.0"
] |
permissive
|
bloomberg/clangmetatool
|
5888cd1ac761930495dfc8eca6d6d87da0ac0dde
|
2c40146272d667b0d50af223f2d1fc61f08e001b
|
refs/heads/master
| 2023-07-07T14:40:11.080663
| 2023-06-14T22:27:18
| 2023-06-14T22:27:18
| 138,797,550
| 123
| 28
|
Apache-2.0
| 2023-06-14T22:27:19
| 2018-06-26T21:51:44
|
C++
|
UTF-8
|
C
| false
| false
| 73
|
h
|
mid.h
|
#ifndef INCLUDED_MID_H
#define INCLUDED_MID_H
#include "def2.h"
#endif
|
ef2dd11273456d2861484bec291fc0d11d69ce31
|
5ef7f5ba06b98319a5406dfa3b25c985257713d4
|
/IGC/BiFModule/Headers/spirv.h
|
2f720ac0044f82d55ff49ff7735cc0e1422a1b72
|
[
"MIT"
] |
permissive
|
intel/intel-graphics-compiler
|
6a1ae1a84c541e967e70324492f22c941a02e38f
|
ea522543be6d042ec80e5db8e8878be31af68938
|
refs/heads/master
| 2023-09-03T20:31:55.215461
| 2023-08-29T18:31:52
| 2023-09-02T08:55:05
| 105,299,467
| 546
| 176
|
NOASSERTION
| 2023-08-23T08:57:03
| 2017-09-29T17:27:54
|
C++
|
UTF-8
|
C
| false
| false
| 522,215
|
h
|
spirv.h
|
/*========================== begin_copyright_notice ============================
Copyright (C) 2017-2021 Intel Corporation
SPDX-License-Identifier: MIT
============================= end_copyright_notice ===========================*/
#ifndef __SPIRV_H__
#define __SPIRV_H__
#include "spirv_macros.h"
#include "spirv_types.h"
/******
*
* Mangling Scheme:
*
* Type ::= Scalar | Vector | Pointer | Struct | Block | Opaque | Array
*
* Scalar ::= Integer | Float | Void
* Integer ::= i1 | i8 | i16 | i32 | i64
* Float ::= f16 | f32 | f64
* Void ::= 'v'
* Opaque ::= i64 // All opaque types are currently represented as i64.
* Array ::= 'a' + [0-9]+ + Type
*
* Vector ::= 'v' + Len + Scalar
* Len ::= 2 | 3 | 4 | 8 | 16
*
* Pointer ::= 'p' + Addrspace + Type
* Addrspace ::= 0 | 1 | 2 | 3 | 4
*
* Struct ::= 's' // We can make this more specific if necessary
*
* Block ::= 'fp' + Addrspace + Type + Type* + VarArg? // (return type + arg types + possible varargs '...')
* VarArg ::= 'x'
*
* All function args are mangled and the mangle for the return type is only added if necessary
* to distinguish between overloads.
*
******/
typedef enum
{
None = 0x0,
CmdExecTime = 0x1
} KernelProfilingInfo_t;
#include "spirv_atomics_common.h"
typedef enum
{
StorageUniformConstant = 0,
StorageWorkgroup = 4,
StorageCrossWorkgroup = 5,
StorageFunction = 7,
StorageGeneric = 8
} StorageClass_t;
typedef enum
{
GroupOperationReduce = 0,
GroupOperationInclusiveScan = 1,
GroupOperationExclusiveScan = 2,
GroupOperationClusteredReduce = 3
} GroupOperations_t;
typedef enum
{
rte = 0,
rtz = 1,
rtp = 2,
rtn = 3
};
typedef int RoundingMode_t;
// Note: Unify these defines in a common header that this and
// the cth include.
#if __32bit__ > 0
typedef uint size_t;
typedef uint3 size_t3;
typedef int ptrdiff_t;
#else
typedef ulong size_t;
typedef ulong3 size_t3;
typedef long ptrdiff_t;
#endif
typedef ptrdiff_t intptr_t;
typedef size_t uintptr_t;
#define NULL 0
#define HALF_DIG 3
#define HALF_MANT_DIG 11
#define HALF_MAX_10_EXP +4
#define HALF_MAX_EXP +16
#define HALF_MIN_10_EXP -4
#define HALF_MIN_EXP -13
#define HALF_RADIX 2
#define HALF_MAX ((0x1.ffcp15h))
#define HALF_MIN ((0x1.0p-14h))
#define HALF_EPSILON ((0x1.0p-10h))
#define HALF_MAX_SQRT ((0x1.0p+8h))
#define HALF_MIN_SQRT ((0x1.0p-8h))
#define M_E_H 2.71828182845904523536028747135266250h
#define M_LOG2E_H 1.44269504088896340735992468100189214h
#define M_LOG10E_H 0.434294481903251827651128918916605082h
#define M_LN2_H 0.693147180559945309417232121458176568h
#define M_LN10_H 2.30258509299404568401799145468436421h
#define M_PI_H 3.14159265358979323846264338327950288h
#define M_PI_2_H 1.57079632679489661923132169163975144h
#define M_PI_4_H 0.785398163397448309615660845819875721h
#define M_1_PI_H 0.318309886183790671537767526745028724h
#define M_2_PI_H 0.636619772367581343075535053490057448h
#define M_2_SQRTPI_H 1.12837916709551257389615890312154517h
#define M_SQRT2_H 1.41421356237309504880168872420969808h
#define M_SQRT1_2_H 0.707106781186547524400844362104849039h
#define DBL_DIG 15
#define DBL_MANT_DIG 53
#define DBL_MAX_10_EXP +308
#define DBL_MAX_EXP +1024
#define DBL_MIN_10_EXP -307
#define DBL_MIN_EXP -1021
#define DBL_RADIX 2
#define DBL_MAX 0x1.fffffffffffffp1023
#define DBL_MIN 0x1.0p-1022
#define DBL_EPSILON 0x1.0p-52
#define M_E 0x1.5bf0a8b145769p+1
#define M_LOG2E 0x1.71547652b82fep+0
#define M_LOG10E 0x1.bcb7b1526e50ep-2
#define M_LN2 0x1.62e42fefa39efp-1
#define M_LN10 0x1.26bb1bbb55516p+1
#define M_PI 0x1.921fb54442d18p+1
#define M_PI_2 0x1.921fb54442d18p+0
#define M_PI_4 0x1.921fb54442d18p-1
#define M_1_PI 0x1.45f306dc9c883p-2
#define M_2_PI 0x1.45f306dc9c883p-1
#define M_2_SQRTPI 0x1.20dd750429b6dp+0
#define M_SQRT2 0x1.6a09e667f3bcdp+0
#define M_SQRT1_2 0x1.6a09e667f3bcdp-1
#if defined(cl_khr_fp64)
#define cl_fp64_basic_ops
#endif // cl_fp64_basic_ops
typedef char __bool2 __attribute__((ext_vector_type(2)));
typedef char __bool3 __attribute__((ext_vector_type(3)));
typedef char __bool4 __attribute__((ext_vector_type(4)));
typedef char __bool8 __attribute__((ext_vector_type(8)));
typedef char __bool16 __attribute__((ext_vector_type(16)));
#define INTEL_PIPE_RESERVE_ID_VALID_BIT (1U << 30)
#define CLK_NULL_RESERVE_ID (__builtin_astype(((void*)(~INTEL_PIPE_RESERVE_ID_VALID_BIT)), __spirv_ReserveId))
#define IMAGETYPE_SAMPLED_SHIFT 62
#define IMAGETYPE_DIM_SHIFT 59
#define IMAGETYPE_DEPTH_SHIFT 58
#define IMAGETYPE_ARRAYED_SHIFT 57
#define IMAGETYPE_MULTISAMPLED_SHIFT 56
#define IMAGETYPE_ACCESSQUALIFER_SHIFT 54
// Keep track of SaturatedConversion
// Work-item functions
#if !defined(__USE_KHRONOS_SPIRV_TRANSLATOR__)
size_t3 __builtin_spirv_BuiltInNumWorkgroups(void);
size_t3 __builtin_spirv_BuiltInWorkgroupSize(void);
size_t3 __builtin_spirv_BuiltInWorkgroupId(void);
size_t3 __builtin_spirv_BuiltInLocalInvocationId(void);
size_t3 __builtin_spirv_BuiltInGlobalInvocationId(void);
size_t3 __builtin_spirv_BuiltInGlobalSize(void);
size_t3 __builtin_spirv_BuiltInEnqueuedWorkgroupSize(void);
size_t3 __builtin_spirv_BuiltInGlobalOffset(void);
#else // defined(__USE_KHRONOS_SPIRV_TRANSLATOR__)
size_t __attribute__((overloadable)) __spirv_BuiltInNumWorkgroups(int dimindx);
size_t __attribute__((overloadable)) __spirv_BuiltInWorkgroupSize(int dimindx);
size_t __attribute__((overloadable)) __spirv_BuiltInWorkgroupId(int dimindx);
size_t __attribute__((overloadable)) __spirv_BuiltInLocalInvocationId(int dimindx);
size_t __attribute__((overloadable)) __spirv_BuiltInGlobalInvocationId(int dimindx);
size_t __attribute__((overloadable)) __spirv_BuiltInGlobalSize(int dimindx);
size_t __attribute__((overloadable)) __spirv_BuiltInEnqueuedWorkgroupSize(int dimindx);
size_t __attribute__((overloadable)) __spirv_BuiltInGlobalOffset(int dimindx);
#endif
size_t SPIRV_OVERLOADABLE SPIRV_BUILTIN_NO_OP(BuiltInLocalInvocationIndex, , )(void);
size_t SPIRV_OVERLOADABLE SPIRV_BUILTIN_NO_OP(BuiltInGlobalLinearId, , )(void);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN_NO_OP(BuiltInWorkDim, , )(void);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN_NO_OP(BuiltInSubgroupMaxSize, , )(void);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN_NO_OP(BuiltInSubgroupId, , )(void);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN_NO_OP(BuiltInNumSubgroups, , )(void);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN_NO_OP(BuiltInSubgroupSize, , )(void);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN_NO_OP(BuiltInNumEnqueuedSubgroups, , )(void);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN_NO_OP(BuiltInSubgroupLocalInvocationId, , )(void);
// Image Instructions
//
__spirv_SampledImage_1D SPIRV_OVERLOADABLE SPIRV_BUILTIN(SampledImage, _img1d_ro_i64, )(global Img1d_ro* Image, __spirv_Sampler Sampler);
__spirv_SampledImage_2D SPIRV_OVERLOADABLE SPIRV_BUILTIN(SampledImage, _img2d_ro_i64, )(global Img2d_ro* Image, __spirv_Sampler Sampler);
__spirv_SampledImage_3D SPIRV_OVERLOADABLE SPIRV_BUILTIN(SampledImage, _img3d_ro_i64, )(global Img3d_ro* Image, __spirv_Sampler Sampler);
__spirv_SampledImage_1D_array SPIRV_OVERLOADABLE SPIRV_BUILTIN(SampledImage, _img1d_array_ro_i64, )(global Img1d_array_ro* Image, __spirv_Sampler Sampler);
__spirv_SampledImage_2D_array SPIRV_OVERLOADABLE SPIRV_BUILTIN(SampledImage, _img2d_array_ro_i64, )(global Img2d_array_ro* Image, __spirv_Sampler Sampler);
__spirv_SampledImage_2D_depth SPIRV_OVERLOADABLE SPIRV_BUILTIN(SampledImage, _img2d_depth_ro_i64, )(global Img2d_depth_ro* Image, __spirv_Sampler Sampler);
__spirv_SampledImage_2D_array_depth SPIRV_OVERLOADABLE SPIRV_BUILTIN(SampledImage, _img2d_array_depth_ro_i64, )(global Img2d_array_depth_ro* Image, __spirv_Sampler Sampler);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img2d_ro_v2f32_i32_f32, _Rfloat4)(__spirv_SampledImage_2D SampledImage, float2 Coordinate, int ImageOperands, float Lod);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img2d_ro_v2i32_i32_f32, _Rfloat4)(__spirv_SampledImage_2D SampledImage, int2 Coordinate, int ImageOperands, float Lod);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4i32_img2d_ro_v2f32_i32_f32, _Rint4)(__spirv_SampledImage_2D SampledImage, float2 Coordinate, int ImageOperands, float Lod);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4i32_img2d_ro_v2i32_i32_f32, _Rint4)(__spirv_SampledImage_2D SampledImage, int2 Coordinate, int ImageOperands, float Lod);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img3d_ro_v4f32_i32_f32, _Rfloat4)(__spirv_SampledImage_3D SampledImage, float4 Coordinate, int ImageOperands, float Lod);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img3d_ro_v4i32_i32_f32, _Rfloat4)(__spirv_SampledImage_3D SampledImage, int4 Coordinate, int ImageOperands, float Lod);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4i32_img3d_ro_v4f32_i32_f32, _Rint4)(__spirv_SampledImage_3D SampledImage, float4 Coordinate, int ImageOperands, float Lod);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4i32_img3d_ro_v4i32_i32_f32, _Rint4)(__spirv_SampledImage_3D SampledImage, int4 Coordinate, int ImageOperands, float Lod);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img2d_array_ro_v4f32_i32_f32, _Rfloat4)(__spirv_SampledImage_2D_array SampledImage, float4 Coordinate, int ImageOperands, float Lod);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img2d_array_ro_v4i32_i32_f32, _Rfloat4)(__spirv_SampledImage_2D_array SampledImage, int4 Coordinate, int ImageOperands, float Lod);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4i32_img2d_array_ro_v4f32_i32_f32, _Rint4)(__spirv_SampledImage_2D_array SampledImage, float4 Coordinate, int ImageOperands, float Lod);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4i32_img2d_array_ro_v4i32_i32_f32, _Rint4)(__spirv_SampledImage_2D_array SampledImage, int4 Coordinate, int ImageOperands, float Lod);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img1d_ro_f32_i32_f32, _Rfloat4)(__spirv_SampledImage_1D SampledImage, float Coordinate, int ImageOperands, float Lod);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img1d_ro_i32_i32_f32, _Rfloat4)(__spirv_SampledImage_1D SampledImage, int Coordinate, int ImageOperands, float Lod);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4i32_img1d_ro_f32_i32_f32, _Rint4)(__spirv_SampledImage_1D SampledImage, float Coordinate, int ImageOperands, float Lod);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4i32_img1d_ro_i32_i32_f32, _Rint4)(__spirv_SampledImage_1D SampledImage, int Coordinate, int ImageOperands, float Lod);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img1d_array_ro_v2f32_i32_f32, _Rfloat4)(__spirv_SampledImage_1D_array SampledImage, float2 Coordinate, int ImageOperands, float Lod);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img1d_array_ro_v2i32_i32_f32, _Rfloat4)(__spirv_SampledImage_1D_array SampledImage, int2 Coordinate, int ImageOperands, float Lod);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4i32_img1d_array_ro_v2f32_i32_f32, _Rint4)(__spirv_SampledImage_1D_array SampledImage, float2 Coordinate, int ImageOperands, float Lod);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4i32_img1d_array_ro_v2i32_i32_f32, _Rint4)(__spirv_SampledImage_1D_array SampledImage, int2 Coordinate, int ImageOperands, float Lod);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img2d_depth_ro_v2f32_i32_f32, _Rfloat4)(__spirv_SampledImage_2D_depth SampledImage, float2 Coordinate, int ImageOperands, float Lod);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img2d_depth_ro_v2i32_i32_f32, _Rfloat4)(__spirv_SampledImage_2D_depth SampledImage, int2 Coordinate, int ImageOperands, float Lod);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img2d_array_depth_ro_v4f32_i32_f32, _Rfloat4)(__spirv_SampledImage_2D_array_depth SampledImage, float4 Coordinate, int ImageOperands, float Lod);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img2d_array_depth_ro_v4i32_i32_f32, _Rfloat4)(__spirv_SampledImage_2D_array_depth SampledImage, int4 Coordinate, int ImageOperands, float Lod);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img2d_ro_v2f32_i32_v2f32_v2f32, _Rfloat4)(__spirv_SampledImage_2D SampledImage, float2 Coordinate, int ImageOperands, float2 dx, float2 dy);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4i32_img2d_ro_v2f32_i32_v2f32_v2f32, _Rint4)(__spirv_SampledImage_2D SampledImage, float2 Coordinate, int ImageOperands, float2 dx, float2 dy);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img3d_ro_v4f32_i32_v4f32_v4f32, _Rfloat4)(__spirv_SampledImage_3D SampledImage, float4 Coordinate, int ImageOperands, float4 dx, float4 dy);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4i32_img3d_ro_v4f32_i32_v4f32_v4f32, _Rint4)(__spirv_SampledImage_3D SampledImage, float4 Coordinate, int ImageOperands, float4 dx, float4 dy);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img2d_array_ro_v4f32_i32_v2f32_v2f32, _Rfloat4)(__spirv_SampledImage_2D SampledImage, float4 Coordinate, int ImageOperands, float2 dx, float2 dy);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4i32_img2d_array_ro_v4f32_i32_v2f32_v2f32, _Rint4)(__spirv_SampledImage_2D SampledImage, float4 Coordinate, int ImageOperands, float2 dx, float2 dy);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img1d_ro_f32_i32_f32_f32, _Rfloat4)(__spirv_SampledImage_1D SampledImage, float Coordinate, int ImageOperands, float dx, float dy);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4i32_img1d_ro_f32_i32_f32_f32, _Rint4)(__spirv_SampledImage_1D SampledImage, float Coordinate, int ImageOperands, float dx, float dy);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img1d_array_ro_v2f32_i32_f32_f32, _Rfloat4)(__spirv_SampledImage_1D_array SampledImage, float2 Coordinate, int ImageOperands, float dx, float dy);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4i32_img1d_array_ro_v2f32_i32_f32_f32, _Rint4)(__spirv_SampledImage_1D_array SampledImage, float2 Coordinate, int ImageOperands, float dx, float dy);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img2d_depth_ro_v2f32_i32_v2f32_v2f32, _Rfloat4)(__spirv_SampledImage_2D_depth SampledImage, float2 Coordinate, int ImageOperands, float2 dx, float2 dy);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f32_img2d_array_depth_ro_v4f32_i32_v2f32_v2f32, _Rfloat4)(__spirv_SampledImage_2D_array_depth SampledImage, float4 Coordinate, int ImageOperands, float2 dx, float2 dy);
#ifdef cl_khr_fp16
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f16_img2d_ro_v2f32_i32_f32, _Rhalf4)(__spirv_SampledImage_2D SampledImage, float2 Coordinate, int ImageOperands, float Lod);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f16_img2d_ro_v2i32_i32_f32, _Rhalf4)(__spirv_SampledImage_2D SampledImage, int2 Coordinate, int ImageOperands, float Lod);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f16_img3d_ro_v4f32_i32_f32, _Rhalf4)(__spirv_SampledImage_3D SampledImage, float4 Coordinate, int ImageOperands, float Lod);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f16_img3d_ro_v4i32_i32_f32, _Rhalf4)(__spirv_SampledImage_3D SampledImage, int4 Coordinate, int ImageOperands, float Lod);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f16_img2d_array_ro_v4f32_i32_f32, _Rhalf4)(__spirv_SampledImage_2D_array SampledImage, float4 Coordinate, int ImageOperands, float Lod);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f16_img2d_array_ro_v4i32_i32_f32, _Rhalf4)(__spirv_SampledImage_2D_array SampledImage, int4 Coordinate, int ImageOperands, float Lod);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f16_img1d_array_ro_v2f32_i32_f32, _Rhalf4)(__spirv_SampledImage_1D_array SampledImage, float2 Coordinate, int ImageOperands, float Lod);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageSampleExplicitLod, _v4f16_img1d_array_ro_v2i32_i32_f32, _Rhalf4)(__spirv_SampledImage_1D_array SampledImage, int2 Coordinate, int ImageOperands, float Lod);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_wo_v2i32_v4f16, )(global Img2d_wo* Image, int2 Coordinate, half4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_rw_v2i32_v4f16, )(global Img2d_rw* Image, int2 Coordinate, half4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img3d_wo_v4i32_v4f16, )(global Img3d_wo* Image, int4 Coordinate, half4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img3d_rw_v4i32_v4f16, )(global Img3d_rw* Image, int4 Coordinate, half4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_array_wo_v4i32_v4f16, )(global Img2d_array_wo* Image, int4 Coordinate, half4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_array_rw_v4i32_v4f16, )(global Img2d_array_rw* Image, int4 Coordinate, half4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_wo_i32_v4f16, )(global Img1d_wo* Image, int Coordinate, half4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_rw_i32_v4f16, )(global Img1d_rw* Image, int Coordinate, half4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_buffer_wo_i32_v4f16, )(global Img1d_buffer_wo* Image, int Coordinate, half4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_buffer_rw_i32_v4f16, )(global Img1d_buffer_rw* Image, int Coordinate, half4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_array_wo_v2i32_v4f16, )(global Img1d_array_wo* Image, int2 Coordinate, half4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_array_rw_v2i32_v4f16, )(global Img1d_array_rw* Image, int2 Coordinate, half4 Texel);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f16_img2d_ro_v2i32, _Rhalf4)(global Img2d_ro* Image, int2 Coordinate);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f16_img2d_rw_v2i32, _Rhalf4)(global Img2d_rw* Image, int2 Coordinate);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f16_img3d_ro_v4i32, _Rhalf4)(global Img3d_ro* Image, int4 Coordinate);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f16_img3d_rw_v4i32, _Rhalf4)(global Img3d_rw* Image, int4 Coordinate);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f16_img2d_array_ro_v4i32, _Rhalf4)(global Img2d_array_ro* Image, int4 Coordinate);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f16_img2d_array_rw_v4i32, _Rhalf4)(global Img2d_array_rw* Image, int4 Coordinate);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f16_img1d_ro_i32, _Rhalf4)(global Img1d_ro* Image, int Coordinate);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f16_img1d_rw_i32, _Rhalf4)(global Img1d_rw* Image, int Coordinate);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f16_img1d_buffer_ro_i32, _Rhalf4)(global Img1d_buffer_ro* Image, int Coordinate);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f16_img1d_buffer_rw_i32, _Rhalf4)(global Img1d_buffer_rw* Image, int Coordinate);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f16_img1d_array_ro_v2i32, _Rhalf4)(global Img1d_array_ro* Image, int2 Coordinate);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f16_img1d_array_rw_v2i32, _Rhalf4)(global Img1d_array_rw* Image, int2 Coordinate);
#endif // cl_khr_fp16
// Pipe in image type information.
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img2d_ro_v2i32, _Rint4)(global Img2d_ro* Image, int2 Coordinate);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img2d_ro_v2i32, _Rfloat4)(global Img2d_ro* Image, int2 Coordinate);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img2d_rw_v2i32, _Rint4)(global Img2d_rw* Image, int2 Coordinate);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img2d_rw_v2i32, _Rfloat4)(global Img2d_rw* Image, int2 Coordinate);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img3d_ro_v4i32, _Rint4)(global Img3d_ro* Image, int4 Coordinate);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img3d_ro_v4i32, _Rfloat4)(global Img3d_ro* Image, int4 Coordinate);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img3d_rw_v4i32, _Rint4)(global Img3d_rw* Image, int4 Coordinate);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img3d_rw_v4i32, _Rfloat4)(global Img3d_rw* Image, int4 Coordinate);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img2d_array_ro_v4i32, _Rint4)(global Img2d_array_ro* Image, int4 Coordinate);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img2d_array_ro_v4i32, _Rfloat4)(global Img2d_array_ro* Image, int4 Coordinate);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img2d_array_rw_v4i32, _Rint4)(global Img2d_array_rw* Image, int4 Coordinate);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img2d_array_rw_v4i32, _Rfloat4)(global Img2d_array_rw* Image, int4 Coordinate);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img1d_ro_i32, _Rint4)(global Img1d_ro* Image, int Coordinate);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img1d_ro_i32, _Rfloat4)(global Img1d_ro* Image, int Coordinate);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img1d_rw_i32, _Rint4)(global Img1d_rw* Image, int Coordinate);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img1d_rw_i32, _Rfloat4)(global Img1d_rw* Image, int Coordinate);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img1d_buffer_ro_i32, _Rint4)(global Img1d_buffer_ro* Image, int Coordinate);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img1d_buffer_ro_i32, _Rfloat4)(global Img1d_buffer_ro* Image, int Coordinate);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img1d_buffer_rw_i32, _Rint4)(global Img1d_buffer_rw* Image, int Coordinate);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img1d_buffer_rw_i32, _Rfloat4)(global Img1d_buffer_rw* Image, int Coordinate);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img1d_array_ro_v2i32, _Rint4)(global Img1d_array_ro* Image, int2 Coordinate);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img1d_array_ro_v2i32, _Rfloat4)(global Img1d_array_ro* Image, int2 Coordinate);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img1d_array_rw_v2i32, _Rint4)(global Img1d_array_rw* Image, int2 Coordinate);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img1d_array_rw_v2i32, _Rfloat4)(global Img1d_array_rw* Image, int2 Coordinate);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _f32_img2d_depth_ro_v2i32, _Rfloat)(global Img2d_depth_ro* Image, int2 Coordinate);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _f32_img2d_depth_rw_v2i32, _Rfloat)(global Img2d_depth_rw* Image, int2 Coordinate);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _f32_img2d_array_depth_ro_v4i32, _Rfloat)(global Img2d_array_depth_ro* Image, int4 Coordinate);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _f32_img2d_array_depth_rw_v4i32, _Rfloat)(global Img2d_array_depth_rw* Image, int4 Coordinate);
// Image Read MSAA
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img2d_msaa_ro_v2i32_i32_i32, _Rint4)(global Img2d_msaa_ro* Image, int2 Coordinate, int ImageOperands, int Sample);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img2d_msaa_ro_v2i32_i32_i32, _Rfloat4)(global Img2d_msaa_ro* Image, int2 Coordinate, int ImageOperands, int Sample);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img2d_array_msaa_ro_v4i32_i32_i32, _Rint4)(global Img2d_array_msaa_ro* Image, int4 Coordinate, int ImageOperands, int Sample);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img2d_array_msaa_ro_v4i32_i32_i32, _Rfloat4)(global Img2d_array_msaa_ro* Image, int4 Coordinate, int ImageOperands, int Sample);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _f32_img2d_msaa_depth_ro_v2i32_i32_i32, _Rfloat)(global Img2d_msaa_depth_ro* Image, int2 Coordinate, int ImageOperands, int Sample);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _f32_img2d_array_msaa_depth_ro_v4i32_i32_i32, _Rfloat)(global Img2d_array_msaa_depth_ro* Image, int4 Coordinate, int ImageOperands, int Sample);
// Image Read with unused ImageOperands
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img2d_ro_v2i32_i32, _Rint4)(global Img2d_ro* Image, int2 Coordinate, int ImageOperands);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img2d_ro_v2i32_i32, _Rfloat4)(global Img2d_ro* Image, int2 Coordinate, int ImageOperands);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img3d_ro_v4i32_i32, _Rint4)(global Img3d_ro* Image, int4 Coordinate, int ImageOperands);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img3d_ro_v4i32_i32, _Rfloat4)(global Img3d_ro* Image, int4 Coordinate, int ImageOperands);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img1d_ro_i32_i32, _Rint4)(global Img1d_ro* Image, int Coordinate, int ImageOperands);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img1d_ro_i32_i32, _Rfloat4)(global Img1d_ro* Image, int Coordinate, int ImageOperands);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img2d_array_ro_v4i32_i32, _Rint4)(global Img2d_array_ro* Image, int4 Coordinate, int ImageOperands);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img2d_array_ro_v4i32_i32, _Rfloat4)(global Img2d_array_ro* Image, int4 Coordinate, int ImageOperands);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img1d_array_ro_v2i32_i32, _Rint4)(global Img1d_array_ro* Image, int2 Coordinate, int ImageOperands);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img1d_array_ro_v2i32_i32, _Rfloat4)(global Img1d_array_ro* Image, int2 Coordinate, int ImageOperands);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img1d_buffer_ro_i32_i32, _Rint4)(global Img1d_buffer_ro* Image, int Coordinate, int ImageOperands);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img1d_buffer_ro_i32_i32, _Rfloat4)(global Img1d_buffer_ro* Image, int Coordinate, int ImageOperands);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img2d_rw_v2i32_i32, _Rint4)(global Img2d_rw* Image, int2 Coordinate, int ImageOperands);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img2d_rw_v2i32_i32, _Rfloat4)(global Img2d_rw* Image, int2 Coordinate, int ImageOperands);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img3d_rw_v4i32_i32, _Rint4)(global Img3d_rw* Image, int4 Coordinate, int ImageOperands);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img3d_rw_v4i32_i32, _Rfloat4)(global Img3d_rw* Image, int4 Coordinate, int ImageOperands);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img1d_rw_i32_i32, _Rint4)(global Img1d_rw* Image, int Coordinate, int ImageOperands);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img1d_rw_i32_i32, _Rfloat4)(global Img1d_rw* Image, int Coordinate, int ImageOperands);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img2d_array_rw_v4i32_i32, _Rint4)(global Img2d_array_rw* Image, int4 Coordinate, int ImageOperands);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img2d_array_rw_v4i32_i32, _Rfloat4)(global Img2d_array_rw* Image, int4 Coordinate, int ImageOperands);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img1d_array_rw_v2i32_i32, _Rint4)(global Img1d_array_rw* Image, int2 Coordinate, int ImageOperands);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img1d_array_rw_v2i32_i32, _Rfloat4)(global Img1d_array_rw* Image, int2 Coordinate, int ImageOperands);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4i32_img1d_buffer_rw_i32_i32, _Rint4)(global Img1d_buffer_rw* Image, int Coordinate, int ImageOperands);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageRead, _v4f32_img1d_buffer_rw_i32_i32, _Rfloat4)(global Img1d_buffer_rw* Image, int Coordinate, int ImageOperands);
// Image Write
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_wo_v2i32_v4i32, )(global Img2d_wo* Image, int2 Coordinate, int4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_wo_v2i32_v4f32, )(global Img2d_wo* Image, int2 Coordinate, float4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_rw_v2i32_v4i32, )(global Img2d_rw* Image, int2 Coordinate, int4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_rw_v2i32_v4f32, )(global Img2d_rw* Image, int2 Coordinate, float4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_array_wo_v4i32_v4i32, )(global Img2d_array_wo* Image, int4 Coordinate, int4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_array_wo_v4i32_v4f32, )(global Img2d_array_wo* Image, int4 Coordinate, float4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_array_rw_v4i32_v4i32, )(global Img2d_array_rw* Image, int4 Coordinate, int4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_array_rw_v4i32_v4f32, )(global Img2d_array_rw* Image, int4 Coordinate, float4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_wo_i32_v4i32, )(global Img1d_wo* Image, int Coordinate, int4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_wo_i32_v4f32, )(global Img1d_wo* Image, int Coordinate, float4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_rw_i32_v4i32, )(global Img1d_rw* Image, int Coordinate, int4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_rw_i32_v4f32, )(global Img1d_rw* Image, int Coordinate, float4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_buffer_wo_i32_v4i32, )(global Img1d_buffer_wo* Image, int Coordinate, int4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_buffer_wo_i32_v4f32, )(global Img1d_buffer_wo* Image, int Coordinate, float4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_buffer_rw_i32_v4i32, )(global Img1d_buffer_rw* Image, int Coordinate, int4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_buffer_rw_i32_v4f32, )(global Img1d_buffer_rw* Image, int Coordinate, float4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_array_wo_v2i32_v4i32, )(global Img1d_array_wo* Image, int2 Coordinate, int4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_array_wo_v2i32_v4f32, )(global Img1d_array_wo* Image, int2 Coordinate, float4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_array_rw_v2i32_v4i32, )(global Img1d_array_rw* Image, int2 Coordinate, int4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_array_rw_v2i32_v4f32, )(global Img1d_array_rw* Image, int2 Coordinate, float4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_depth_wo_v2i32_f32, )(global Img2d_depth_wo* Image, int2 Coordinate, float Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_depth_rw_v2i32_f32, )(global Img2d_depth_rw* Image, int2 Coordinate, float Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_array_depth_wo_v4i32_f32, )(global Img2d_array_depth_wo* Image, int4 Coordinate, float Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_array_depth_rw_v4i32_f32, )(global Img2d_array_depth_rw* Image, int4 Coordinate, float Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img3d_wo_v4i32_v4i32, )(global Img3d_wo* Image, int4 Coordinate, int4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img3d_wo_v4i32_v4f32, )(global Img3d_wo* Image, int4 Coordinate, float4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img3d_rw_v4i32_v4i32, )(global Img3d_rw* Image, int4 Coordinate, int4 Texel);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img3d_rw_v4i32_v4f32, )(global Img3d_rw* Image, int4 Coordinate, float4 Texel);
// Image Write with unused ImageOperands
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_wo_v2i32_v4i32_i32, )(global Img2d_wo* Image, int2 Coordinate, int4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_wo_v2i32_v4f32_i32, )(global Img2d_wo* Image, int2 Coordinate, float4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_depth_wo_v2i32_f32_i32, )(global Img2d_depth_wo* Image, int2 Coordinate, float Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_wo_i32_v4i32_i32, )(global Img1d_wo* Image, int Coordinate, int4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_wo_i32_v4f32_i32, )(global Img1d_wo* Image, int Coordinate, float4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_array_wo_v2i32_v4i32_i32, )(global Img1d_array_wo* Image, int2 Coordinate, int4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_array_wo_v2i32_v4f32_i32, )(global Img1d_array_wo* Image, int2 Coordinate, float4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_buffer_wo_i32_v4i32_i32, )(global Img1d_buffer_wo* Image, int Coordinate, int4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_buffer_wo_i32_v4f32_i32, )(global Img1d_buffer_wo* Image, int Coordinate, float4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_array_wo_v4i32_v4i32_i32, )(global Img2d_array_wo* Image, int4 Coordinate, int4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_array_wo_v4i32_v4f32_i32, )(global Img2d_array_wo* Image, int4 Coordinate, float4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_array_depth_wo_v4i32_f32_i32, )(global Img2d_array_depth_wo* Image, int4 Coordinate, float Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img3d_wo_v4i32_v4i32_i32, )(global Img3d_wo* Image, int4 Coordinate, int4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img3d_wo_v4i32_v4f32_i32, )(global Img3d_wo* Image, int4 Coordinate, float4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_rw_v2i32_v4i32_i32, )(global Img2d_rw* Image, int2 Coordinate, int4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_rw_v2i32_v4f32_i32, )(global Img2d_rw* Image, int2 Coordinate, float4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_depth_rw_v2i32_f32_i32, )(global Img2d_depth_rw* Image, int2 Coordinate, float Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_rw_i32_v4i32_i32, )(global Img1d_rw* Image, int Coordinate, int4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_rw_i32_v4f32_i32, )(global Img1d_rw* Image, int Coordinate, float4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_array_rw_v2i32_v4i32_i32, )(global Img1d_array_rw* Image, int2 Coordinate, int4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_array_rw_v2i32_v4f32_i32, )(global Img1d_array_rw* Image, int2 Coordinate, float4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_buffer_rw_i32_v4i32_i32, )(global Img1d_buffer_rw* Image, int Coordinate, int4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_buffer_rw_i32_v4f32_i32, )(global Img1d_buffer_rw* Image, int Coordinate, float4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_array_rw_v4i32_v4i32_i32, )(global Img2d_array_rw* Image, int4 Coordinate, int4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_array_rw_v4i32_v4f32_i32, )(global Img2d_array_rw* Image, int4 Coordinate, float4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_array_depth_rw_v4i32_f32_i32, )(global Img2d_array_depth_rw* Image, int4 Coordinate, float Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img3d_rw_v4i32_v4i32_i32, )(global Img3d_rw* Image, int4 Coordinate, int4 Texel, int ImageOperands);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img3d_rw_v4i32_v4f32_i32, )(global Img3d_rw* Image, int4 Coordinate, float4 Texel, int ImageOperands);
// Image Write LoD
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_wo_v2i32_v4i32_i32_i32, )(global Img2d_wo* Image, int2 Coordinate, int4 Texel, int ImageOperands, int Lod);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_wo_v2i32_v4f32_i32_i32, )(global Img2d_wo* Image, int2 Coordinate, float4 Texel, int ImageOperands, int Lod);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_depth_wo_v2i32_f32_i32_i32, )(global Img2d_depth_wo* Image, int2 Coordinate, float Texel, int ImageOperands, int Lod);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_wo_i32_v4i32_i32_i32, )(global Img1d_wo* Image, int Coordinate, int4 Texel, int ImageOperands, int Lod);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_wo_i32_v4f32_i32_i32, )(global Img1d_wo* Image, int Coordinate, float4 Texel, int ImageOperands, int Lod);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_array_wo_v2i32_v4i32_i32_i32, )(global Img1d_array_wo* Image, int2 Coordinate, int4 Texel, int ImageOperands, int Lod);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img1d_array_wo_v2i32_v4f32_i32_i32, )(global Img1d_array_wo* Image, int2 Coordinate, float4 Texel, int ImageOperands, int Lod);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_array_wo_v4i32_v4i32_i32_i32, )(global Img2d_array_wo* Image, int4 Coordinate, int4 Texel, int ImageOperands, int Lod);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_array_wo_v4i32_v4f32_i32_i32, )(global Img2d_array_wo* Image, int4 Coordinate, float4 Texel, int ImageOperands, int Lod);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img2d_array_depth_wo_v4i32_f32_i32_i32, )(global Img2d_array_depth_wo* Image, int4 Coordinate, float Texel, int ImageOperands, int Lod);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img3d_wo_v4i32_v4i32_i32_i32, )(global Img3d_wo* Image, int4 Coordinate, int4 Texel, int ImageOperands, int Lod);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageWrite, _img3d_wo_v4i32_v4f32_i32_i32, )(global Img3d_wo* Image, int4 Coordinate, float4 Texel, int ImageOperands, int Lod);
// Image Query Format
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img2d_ro, )(global Img2d_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img2d_wo, )(global Img2d_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img2d_rw, )(global Img2d_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img3d_ro, )(global Img3d_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img3d_wo, )(global Img3d_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img3d_rw, )(global Img3d_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img1d_ro, )(global Img1d_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img1d_wo, )(global Img1d_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img1d_rw, )(global Img1d_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img1d_buffer_ro, )(global Img1d_buffer_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img1d_buffer_wo, )(global Img1d_buffer_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img1d_buffer_rw, )(global Img1d_buffer_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img1d_array_ro, )(global Img1d_array_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img1d_array_wo, )(global Img1d_array_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img1d_array_rw, )(global Img1d_array_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img2d_array_ro, )(global Img2d_array_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img2d_array_wo, )(global Img2d_array_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img2d_array_rw, )(global Img2d_array_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img2d_depth_ro, )(global Img2d_depth_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img2d_depth_wo, )(global Img2d_depth_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img2d_depth_rw, )(global Img2d_depth_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img2d_array_depth_ro, )(global Img2d_array_depth_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img2d_array_depth_wo, )(global Img2d_array_depth_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img2d_array_depth_rw, )(global Img2d_array_depth_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img2d_msaa_ro, )(global Img2d_msaa_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img2d_array_msaa_ro, )(global Img2d_array_msaa_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img2d_msaa_depth_ro, )(global Img2d_msaa_depth_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryFormat, _img2d_array_msaa_depth_ro, )(global Img2d_array_msaa_depth_ro* Image);
// Image Query Order
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img2d_ro, )(global Img2d_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img2d_wo, )(global Img2d_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img2d_rw, )(global Img2d_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img3d_ro, )(global Img3d_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img3d_wo, )(global Img3d_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img3d_rw, )(global Img3d_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img1d_ro, )(global Img1d_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img1d_wo, )(global Img1d_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img1d_rw, )(global Img1d_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img1d_buffer_ro, )(global Img1d_buffer_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img1d_buffer_wo, )(global Img1d_buffer_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img1d_buffer_rw, )(global Img1d_buffer_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img1d_array_ro, )(global Img1d_array_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img1d_array_wo, )(global Img1d_array_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img1d_array_rw, )(global Img1d_array_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img2d_array_ro, )(global Img2d_array_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img2d_array_wo, )(global Img2d_array_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img2d_array_rw, )(global Img2d_array_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img2d_depth_ro, )(global Img2d_depth_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img2d_depth_wo, )(global Img2d_depth_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img2d_depth_rw, )(global Img2d_depth_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img2d_array_depth_ro, )(global Img2d_array_depth_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img2d_array_depth_wo, )(global Img2d_array_depth_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img2d_array_depth_rw, )(global Img2d_array_depth_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img2d_msaa_ro, )(global Img2d_msaa_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img2d_array_msaa_ro, )(global Img2d_array_msaa_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img2d_msaa_depth_ro, )(global Img2d_msaa_depth_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryOrder, _img2d_array_msaa_depth_ro, )(global Img2d_array_msaa_depth_ro* Image);
// Image Query Size
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _i32_img1d_ro, _Rint)(global Img1d_ro* Image);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _i32_img1d_wo, _Rint)(global Img1d_wo* Image);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _i32_img1d_rw, _Rint)(global Img1d_rw* Image);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _i32_img1d_buffer_ro, _Rint)(global Img1d_buffer_ro* Image);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _i32_img1d_buffer_wo, _Rint)(global Img1d_buffer_wo* Image);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _i32_img1d_buffer_rw, _Rint)(global Img1d_buffer_rw* Image);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i32_img1d_array_ro, _Rint2)(global Img1d_array_ro* Image);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i32_img1d_array_wo, _Rint2)(global Img1d_array_wo* Image);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i32_img1d_array_rw, _Rint2)(global Img1d_array_rw* Image);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i32_img2d_ro, _Rint2)(global Img2d_ro* Image);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i32_img2d_wo, _Rint2)(global Img2d_wo* Image);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i32_img2d_rw, _Rint2)(global Img2d_rw* Image);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i32_img2d_depth_ro, _Rint2)(global Img2d_depth_ro* Image);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i32_img2d_depth_wo, _Rint2)(global Img2d_depth_wo* Image);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i32_img2d_depth_rw, _Rint2)(global Img2d_depth_rw* Image);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i32_img2d_array_ro, _Rint3)(global Img2d_array_ro* Image);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i32_img2d_array_wo, _Rint3)(global Img2d_array_wo* Image);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i32_img2d_array_rw, _Rint3)(global Img2d_array_rw* Image);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i32_img2d_array_depth_ro, _Rint3)(global Img2d_array_depth_ro* Image);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i32_img2d_array_depth_wo, _Rint3)(global Img2d_array_depth_wo* Image);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i32_img2d_array_depth_rw, _Rint3)(global Img2d_array_depth_rw* Image);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i32_img3d_ro, _Rint3)(global Img3d_ro* Image);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i32_img3d_wo, _Rint3)(global Img3d_wo* Image);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i32_img3d_rw, _Rint3)(global Img3d_rw* Image);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i32_img2d_msaa_ro, _Rint2)(global Img2d_msaa_ro* Image);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i32_img2d_msaa_depth_ro, _Rint2)(global Img2d_msaa_depth_ro* Image);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i32_img2d_array_msaa_ro, _Rint3)(global Img2d_array_msaa_ro* Image);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i32_img2d_array_msaa_depth_ro, _Rint3)(global Img2d_array_msaa_depth_ro* Image);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _i64_img1d_ro, _Rlong)(global Img1d_ro* Image);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _i64_img1d_wo, _Rlong)(global Img1d_wo* Image);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _i64_img1d_rw, _Rlong)(global Img1d_rw* Image);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _i64_img1d_buffer_ro, _Rlong)(global Img1d_buffer_ro* Image);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _i64_img1d_buffer_wo, _Rlong)(global Img1d_buffer_wo* Image);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _i64_img1d_buffer_rw, _Rlong)(global Img1d_buffer_rw* Image);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i64_img1d_array_ro, _Rlong2)(global Img1d_array_ro* Image);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i64_img1d_array_wo, _Rlong2)(global Img1d_array_wo* Image);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i64_img1d_array_rw, _Rlong2)(global Img1d_array_rw* Image);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i64_img2d_ro, _Rlong2)(global Img2d_ro* Image);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i64_img2d_wo, _Rlong2)(global Img2d_wo* Image);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i64_img2d_rw, _Rlong2)(global Img2d_rw* Image);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i64_img2d_depth_ro, _Rlong2)(global Img2d_depth_ro* Image);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i64_img2d_depth_wo, _Rlong2)(global Img2d_depth_wo* Image);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i64_img2d_depth_rw, _Rlong2)(global Img2d_depth_rw* Image);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i64_img2d_array_ro, _Rlong3)(global Img2d_array_ro* Image);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i64_img2d_array_wo, _Rlong3)(global Img2d_array_wo* Image);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i64_img2d_array_rw, _Rlong3)(global Img2d_array_rw* Image);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i64_img2d_array_depth_ro, _Rlong3)(global Img2d_array_depth_ro* Image);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i64_img2d_array_depth_wo, _Rlong3)(global Img2d_array_depth_wo* Image);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i64_img2d_array_depth_rw, _Rlong3)(global Img2d_array_depth_rw* Image);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i64_img3d_ro, _Rlong3)(global Img3d_ro* Image);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i64_img3d_wo, _Rlong3)(global Img3d_wo* Image);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i64_img3d_rw, _Rlong3)(global Img3d_rw* Image);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i64_img2d_msaa_ro, _Rlong2)(global Img2d_msaa_ro* Image);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v2i64_img2d_msaa_depth_ro, _Rlong2)(global Img2d_msaa_depth_ro* Image);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i64_img2d_array_msaa_ro, _Rlong3)(global Img2d_array_msaa_ro* Image);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySize, _v3i64_img2d_array_msaa_depth_ro, _Rlong3)(global Img2d_array_msaa_depth_ro* Image);
// Image Query Size Lod
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _i32_img1d_ro_i32, _Rint)(global Img1d_ro* Image, int Lod);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _i32_img1d_wo_i32, _Rint)(global Img1d_wo* Image, int Lod);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _i32_img1d_rw_i32, _Rint)(global Img1d_rw* Image, int Lod);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _i32_img1d_buffer_ro_i32, _Rint)(global Img1d_buffer_ro* Image, int Lod);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _i32_img1d_buffer_wo_i32, _Rint)(global Img1d_buffer_wo* Image, int Lod);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _i32_img1d_buffer_rw_i32, _Rint)(global Img1d_buffer_rw* Image, int Lod);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i32_img1d_array_ro_i32, _Rint2)(global Img1d_array_ro* Image, int Lod);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i32_img1d_array_wo_i32, _Rint2)(global Img1d_array_wo* Image, int Lod);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i32_img1d_array_rw_i32, _Rint2)(global Img1d_array_rw* Image, int Lod);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i32_img2d_ro_i32, _Rint2)(global Img2d_ro* Image, int Lod);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i32_img2d_wo_i32, _Rint2)(global Img2d_wo* Image, int Lod);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i32_img2d_rw_i32, _Rint2)(global Img2d_rw* Image, int Lod);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i32_img2d_depth_ro_i32, _Rint2)(global Img2d_depth_ro* Image, int Lod);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i32_img2d_depth_wo_i32, _Rint2)(global Img2d_depth_wo* Image, int Lod);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i32_img2d_depth_rw_i32, _Rint2)(global Img2d_depth_rw* Image, int Lod);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i32_img2d_array_ro_i32, _Rint3)(global Img2d_array_ro* Image, int Lod);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i32_img2d_array_wo_i32, _Rint3)(global Img2d_array_wo* Image, int Lod);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i32_img2d_array_rw_i32, _Rint3)(global Img2d_array_rw* Image, int Lod);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i32_img2d_array_depth_ro_i32, _Rint3)(global Img2d_array_depth_ro* Image, int Lod);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i32_img2d_array_depth_wo_i32, _Rint3)(global Img2d_array_depth_wo* Image, int Lod);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i32_img2d_array_depth_rw_i32, _Rint3)(global Img2d_array_depth_rw* Image, int Lod);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i32_img3d_ro_i32, _Rint3)(global Img3d_ro* Image, int Lod);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i32_img3d_wo_i32, _Rint3)(global Img3d_wo* Image, int Lod);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i32_img3d_rw_i32, _Rint3)(global Img3d_rw* Image, int Lod);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i32_img2d_msaa_ro_i32, _Rint2)(global Img2d_msaa_ro* Image, int Lod);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i32_img2d_msaa_depth_ro_i32, _Rint2)(global Img2d_msaa_depth_ro* Image, int Lod);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i32_img2d_array_msaa_ro_i32, _Rint3)(global Img2d_array_msaa_ro* Image, int Lod);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i32_img2d_array_msaa_depth_ro_i32, _Rint3)(global Img2d_array_msaa_depth_ro* Image, int Lod);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _i64_img1d_ro_i32, _Rlong)(global Img1d_ro* Image, int Lod);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _i64_img1d_wo_i32, _Rlong)(global Img1d_wo* Image, int Lod);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _i64_img1d_rw_i32, _Rlong)(global Img1d_rw* Image, int Lod);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _i64_img1d_buffer_ro_i32, _Rlong)(global Img1d_buffer_ro* Image, int Lod);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _i64_img1d_buffer_wo_i32, _Rlong)(global Img1d_buffer_wo* Image, int Lod);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _i64_img1d_buffer_rw_i32, _Rlong)(global Img1d_buffer_rw* Image, int Lod);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i64_img1d_array_ro_i32, _Rlong2)(global Img1d_array_ro* Image, int Lod);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i64_img1d_array_wo_i32, _Rlong2)(global Img1d_array_wo* Image, int Lod);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i64_img1d_array_rw_i32, _Rlong2)(global Img1d_array_rw* Image, int Lod);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i64_img2d_ro_i32, _Rlong2)(global Img2d_ro* Image, int Lod);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i64_img2d_wo_i32, _Rlong2)(global Img2d_wo* Image, int Lod);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i64_img2d_rw_i32, _Rlong2)(global Img2d_rw* Image, int Lod);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i64_img2d_depth_ro_i32, _Rlong2)(global Img2d_depth_ro* Image, int Lod);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i64_img2d_depth_wo_i32, _Rlong2)(global Img2d_depth_wo* Image, int Lod);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i64_img2d_depth_rw_i32, _Rlong2)(global Img2d_depth_rw* Image, int Lod);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i64_img2d_array_ro_i32, _Rlong3)(global Img2d_array_ro* Image, int Lod);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i64_img2d_array_wo_i32, _Rlong3)(global Img2d_array_wo* Image, int Lod);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i64_img2d_array_rw_i32, _Rlong3)(global Img2d_array_rw* Image, int Lod);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i64_img2d_array_depth_ro_i32, _Rlong3)(global Img2d_array_depth_ro* Image, int Lod);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i64_img2d_array_depth_wo_i32, _Rlong3)(global Img2d_array_depth_wo* Image, int Lod);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i64_img2d_array_depth_rw_i32, _Rlong3)(global Img2d_array_depth_rw* Image, int Lod);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i64_img3d_ro_i32, _Rlong3)(global Img3d_ro* Image, int Lod);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i64_img3d_wo_i32, _Rlong3)(global Img3d_wo* Image, int Lod);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i64_img3d_rw_i32, _Rlong3)(global Img3d_rw* Image, int Lod);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i64_img2d_msaa_ro_i32, _Rlong2)(global Img2d_msaa_ro* Image, int Lod);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v2i64_img2d_msaa_depth_ro_i32, _Rlong2)(global Img2d_msaa_depth_ro* Image, int Lod);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i64_img2d_array_msaa_ro_i32, _Rlong3)(global Img2d_array_msaa_ro* Image, int Lod);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySizeLod, _v3i64_img2d_array_msaa_depth_ro_i32, _Rlong3)(global Img2d_array_msaa_depth_ro* Image, int Lod);
// Image Query Levels
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img1d_ro, )(global Img1d_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img1d_wo, )(global Img1d_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img1d_rw, )(global Img1d_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img2d_ro, )(global Img2d_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img2d_wo, )(global Img2d_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img2d_rw, )(global Img2d_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img3d_ro, )(global Img3d_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img3d_wo, )(global Img3d_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img3d_rw, )(global Img3d_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img1d_array_ro, )(global Img1d_array_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img1d_array_wo, )(global Img1d_array_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img1d_array_rw, )(global Img1d_array_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img2d_array_ro, )(global Img2d_array_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img2d_array_wo, )(global Img2d_array_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img2d_array_rw, )(global Img2d_array_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img2d_depth_ro, )(global Img2d_depth_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img2d_depth_wo, )(global Img2d_depth_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img2d_depth_rw, )(global Img2d_depth_rw* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img2d_array_depth_ro, )(global Img2d_array_depth_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img2d_array_depth_wo, )(global Img2d_array_depth_wo* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQueryLevels, _img2d_array_depth_rw, )(global Img2d_array_depth_rw* Image);
// Image Query Samples
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySamples, _img2d_msaa_ro, )(global Img2d_msaa_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySamples, _img2d_array_msaa_ro, )(global Img2d_array_msaa_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySamples, _img2d_msaa_depth_ro, )(global Img2d_msaa_depth_ro* Image);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ImageQuerySamples, _img2d_array_msaa_depth_ro, )(global Img2d_array_msaa_depth_ro* Image);
// Conversion Instructions
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _i8_f16, _Ruchar)(half FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _i16_f16, _Rushort)(half FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _i32_f16, _Ruint)(half FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _i64_f16, _Rulong)(half FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _i8_f32, _Ruchar)(float FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _i16_f32, _Rushort)(float FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _i32_f32, _Ruint)(float FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _i64_f32, _Rulong)(float FloatValue);
#if defined(cl_khr_fp64)
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _i8_f64, _Ruchar)(double FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _i16_f64, _Rushort)(double FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _i32_f64, _Ruint)(double FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _i64_f64, _Rulong)(double FloatValue);
#endif // defined(cl_khr_fp64)
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _i8_f16, _Rchar)(half FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _i16_f16, _Rshort)(half FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _i32_f16, _Rint)(half FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _i64_f16, _Rlong)(half FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _i8_f32, _Rchar)(float FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _i16_f32, _Rshort)(float FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _i32_f32, _Rint)(float FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _i64_f32, _Rlong)(float FloatValue);
#if defined(cl_khr_fp64)
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _i8_f64, _Rchar)(double FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _i16_f64, _Rshort)(double FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _i32_f64, _Rint)(double FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _i64_f64, _Rlong)(double FloatValue);
#endif // defined(cl_khr_fp64)
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _f16_i8, _Rhalf)(char SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _f32_i8, _Rfloat)(char SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _f16_i16, _Rhalf)(short SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _f32_i16, _Rfloat)(short SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _f16_i32, _Rhalf)(int SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _f32_i32, _Rfloat)(int SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _f16_i64, _Rhalf)(long SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _f32_i64, _Rfloat)(long SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _f16_i8, _Rhalf)(uchar UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _f32_i8, _Rfloat)(uchar UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _f16_i16, _Rhalf)(ushort UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _f32_i16, _Rfloat)(ushort UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _f16_i32, _Rhalf)(uint UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _f32_i32, _Rfloat)(uint UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _f16_i64, _Rhalf)(ulong UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _f32_i64, _Rfloat)(ulong UnsignedValue);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _f64_i8, _Rdouble)(char SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _f64_i16, _Rdouble)(short SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _f64_i32, _Rdouble)(int SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _f64_i64, _Rdouble)(long SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _f64_i8, _Rdouble)(uchar UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _f64_i16, _Rdouble)(ushort UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _f64_i32, _Rdouble)(uint UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _f64_i64, _Rdouble)(ulong UnsignedValue);
#endif // defined(cl_khr_fp64)
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _i8_i8, _Ruchar)(uchar UnsignedValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _i16_i8, _Rushort)(uchar UnsignedValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _i32_i8, _Ruint)(uchar UnsignedValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _i64_i8, _Rulong)(uchar UnsignedValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _i8_i16, _Ruchar)(ushort UnsignedValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _i16_i16, _Rushort)(ushort UnsignedValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _i32_i16, _Ruint)(ushort UnsignedValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _i64_i16, _Rulong)(ushort UnsignedValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _i8_i32, _Ruchar)(uint UnsignedValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _i16_i32, _Rushort)(uint UnsignedValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _i32_i32, _Ruint)(uint UnsignedValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _i64_i32, _Rulong)(uint UnsignedValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _i8_i64, _Ruchar)(ulong UnsignedValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _i16_i64, _Rushort)(ulong UnsignedValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _i32_i64, _Ruint)(ulong UnsignedValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _i64_i64, _Rulong)(ulong UnsignedValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _i8_i8, _Rchar)(char SignedValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _i16_i8, _Rshort)(char SignedValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _i32_i8, _Rint)(char SignedValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _i64_i8, _Rlong)(char SignedValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _i8_i16, _Rchar)(short SignedValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _i16_i16, _Rshort)(short SignedValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _i32_i16, _Rint)(short SignedValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _i64_i16, _Rlong)(short SignedValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _i8_i32, _Rchar)(int SignedValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _i16_i32, _Rshort)(int SignedValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _i32_i32, _Rint)(int SignedValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _i64_i32, _Rlong)(int SignedValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _i8_i64, _Rchar)(long SignedValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _i16_i64, _Rshort)(long SignedValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _i32_i64, _Rint)(long SignedValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _i64_i64, _Rlong)(long SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _f16_f16, _Rhalf)(half FloatValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _f32_f16, _Rfloat)(half FloatValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _f16_f32, _Rhalf)(float FloatValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _f32_f32, _Rfloat)(float FloatValue);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _f64_f16, _Rdouble)(half FloatValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _f64_f32, _Rdouble)(float FloatValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _f16_f64, _Rhalf)(double FloatValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _f32_f64, _Rfloat)(double FloatValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _f64_f64, _Rdouble)(double FloatValue);
#endif // defined(cl_khr_fp64)
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _i8_i8, _Ruchar)(char SignedValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _i16_i8, _Rushort)(char SignedValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _i32_i8, _Ruint)(char SignedValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _i64_i8, _Rulong)(char SignedValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _i8_i16, _Ruchar)(short SignedValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _i16_i16, _Rushort)(short SignedValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _i32_i16, _Ruint)(short SignedValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _i64_i16, _Rulong)(short SignedValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _i8_i32, _Ruchar)(int SignedValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _i16_i32, _Rushort)(int SignedValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _i32_i32, _Ruint)(int SignedValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _i64_i32, _Rulong)(int SignedValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _i8_i64, _Ruchar)(long SignedValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _i16_i64, _Rushort)(long SignedValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _i32_i64, _Ruint)(long SignedValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _i64_i64, _Rulong)(long SignedValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _i8_i8, _Rchar)(uchar UnsignedValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _i16_i8, _Rshort)(uchar UnsignedValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _i32_i8, _Rint)(uchar UnsignedValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _i64_i8, _Rlong)(uchar UnsignedValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _i8_i16, _Rchar)(ushort UnsignedValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _i16_i16, _Rshort)(ushort UnsignedValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _i32_i16, _Rint)(ushort UnsignedValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _i64_i16, _Rlong)(ushort UnsignedValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _i8_i32, _Rchar)(uint UnsignedValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _i16_i32, _Rshort)(uint UnsignedValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _i32_i32, _Rint)(uint UnsignedValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _i64_i32, _Rlong)(uint UnsignedValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _i8_i64, _Rchar)(ulong UnsignedValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _i16_i64, _Rshort)(ulong UnsignedValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _i32_i64, _Rint)(ulong UnsignedValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _i64_i64, _Rlong)(ulong UnsignedValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_i8_f16, _Ruchar_rte)(half FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_i8_f16, _Ruchar_rtz)(half FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_i8_f16, _Ruchar_rtp)(half FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_i8_f16, _Ruchar_rtn)(half FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_i8_f16, _Ruchar_sat)(half FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_i8_f16, _Ruchar_sat_rte)(half FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_i8_f16, _Ruchar_sat_rtz)(half FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_i8_f16, _Ruchar_sat_rtp)(half FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_i8_f16, _Ruchar_sat_rtn)(half FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_i16_f16, _Rushort_rte)(half FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_i16_f16, _Rushort_rtz)(half FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_i16_f16, _Rushort_rtp)(half FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_i16_f16, _Rushort_rtn)(half FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_i16_f16, _Rushort_sat)(half FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_i16_f16, _Rushort_sat_rte)(half FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_i16_f16, _Rushort_sat_rtz)(half FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_i16_f16, _Rushort_sat_rtp)(half FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_i16_f16, _Rushort_sat_rtn)(half FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_i32_f16, _Ruint_rte)(half FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_i32_f16, _Ruint_rtz)(half FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_i32_f16, _Ruint_rtp)(half FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_i32_f16, _Ruint_rtn)(half FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_i32_f16, _Ruint_sat)(half FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_i32_f16, _Ruint_sat_rte)(half FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_i32_f16, _Ruint_sat_rtz)(half FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_i32_f16, _Ruint_sat_rtp)(half FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_i32_f16, _Ruint_sat_rtn)(half FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_i64_f16, _Rulong_rte)(half FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_i64_f16, _Rulong_rtz)(half FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_i64_f16, _Rulong_rtp)(half FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_i64_f16, _Rulong_rtn)(half FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_i64_f16, _Rulong_sat)(half FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_i64_f16, _Rulong_sat_rte)(half FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_i64_f16, _Rulong_sat_rtz)(half FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_i64_f16, _Rulong_sat_rtp)(half FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_i64_f16, _Rulong_sat_rtn)(half FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_i8_f32, _Ruchar_rte)(float FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_i8_f32, _Ruchar_rtz)(float FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_i8_f32, _Ruchar_rtp)(float FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_i8_f32, _Ruchar_rtn)(float FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_i8_f32, _Ruchar_sat)(float FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_i8_f32, _Ruchar_sat_rte)(float FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_i8_f32, _Ruchar_sat_rtz)(float FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_i8_f32, _Ruchar_sat_rtp)(float FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_i8_f32, _Ruchar_sat_rtn)(float FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_i16_f32, _Rushort_rte)(float FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_i16_f32, _Rushort_rtz)(float FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_i16_f32, _Rushort_rtp)(float FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_i16_f32, _Rushort_rtn)(float FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_i16_f32, _Rushort_sat)(float FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_i16_f32, _Rushort_sat_rte)(float FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_i16_f32, _Rushort_sat_rtz)(float FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_i16_f32, _Rushort_sat_rtp)(float FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_i16_f32, _Rushort_sat_rtn)(float FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_i32_f32, _Ruint_rte)(float FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_i32_f32, _Ruint_rtz)(float FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_i32_f32, _Ruint_rtp)(float FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_i32_f32, _Ruint_rtn)(float FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_i32_f32, _Ruint_sat)(float FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_i32_f32, _Ruint_sat_rte)(float FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_i32_f32, _Ruint_sat_rtz)(float FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_i32_f32, _Ruint_sat_rtp)(float FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_i32_f32, _Ruint_sat_rtn)(float FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_i64_f32, _Rulong_rte)(float FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_i64_f32, _Rulong_rtz)(float FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_i64_f32, _Rulong_rtp)(float FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_i64_f32, _Rulong_rtn)(float FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_i64_f32, _Rulong_sat)(float FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_i64_f32, _Rulong_sat_rte)(float FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_i64_f32, _Rulong_sat_rtz)(float FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_i64_f32, _Rulong_sat_rtp)(float FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_i64_f32, _Rulong_sat_rtn)(float FloatValue);
#if defined(cl_khr_fp64)
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_i8_f64, _Ruchar_rte)(double FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_i8_f64, _Ruchar_rtz)(double FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_i8_f64, _Ruchar_rtp)(double FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_i8_f64, _Ruchar_rtn)(double FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_i8_f64, _Ruchar_sat)(double FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_i8_f64, _Ruchar_sat_rte)(double FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_i8_f64, _Ruchar_sat_rtz)(double FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_i8_f64, _Ruchar_sat_rtp)(double FloatValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_i8_f64, _Ruchar_sat_rtn)(double FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_i16_f64, _Rushort_rte)(double FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_i16_f64, _Rushort_rtz)(double FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_i16_f64, _Rushort_rtp)(double FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_i16_f64, _Rushort_rtn)(double FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_i16_f64, _Rushort_sat)(double FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_i16_f64, _Rushort_sat_rte)(double FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_i16_f64, _Rushort_sat_rtz)(double FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_i16_f64, _Rushort_sat_rtp)(double FloatValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_i16_f64, _Rushort_sat_rtn)(double FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_i32_f64, _Ruint_rte)(double FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_i32_f64, _Ruint_rtz)(double FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_i32_f64, _Ruint_rtp)(double FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_i32_f64, _Ruint_rtn)(double FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_i32_f64, _Ruint_sat)(double FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_i32_f64, _Ruint_sat_rte)(double FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_i32_f64, _Ruint_sat_rtz)(double FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_i32_f64, _Ruint_sat_rtp)(double FloatValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_i32_f64, _Ruint_sat_rtn)(double FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_i64_f64, _Rulong_rte)(double FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_i64_f64, _Rulong_rtz)(double FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_i64_f64, _Rulong_rtp)(double FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_i64_f64, _Rulong_rtn)(double FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_i64_f64, _Rulong_sat)(double FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_i64_f64, _Rulong_sat_rte)(double FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_i64_f64, _Rulong_sat_rtz)(double FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_i64_f64, _Rulong_sat_rtp)(double FloatValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_i64_f64, _Rulong_sat_rtn)(double FloatValue);
#endif // defined(cl_khr_fp64)
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_i8_f16, _Rchar_rte)(half FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_i8_f16, _Rchar_rtz)(half FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_i8_f16, _Rchar_rtp)(half FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_i8_f16, _Rchar_rtn)(half FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_i8_f16, _Rchar_sat)(half FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_i8_f16, _Rchar_sat_rte)(half FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_i8_f16, _Rchar_sat_rtz)(half FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_i8_f16, _Rchar_sat_rtp)(half FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_i8_f16, _Rchar_sat_rtn)(half FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_i16_f16, _Rshort_rte)(half FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_i16_f16, _Rshort_rtz)(half FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_i16_f16, _Rshort_rtp)(half FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_i16_f16, _Rshort_rtn)(half FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_i16_f16, _Rshort_sat)(half FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_i16_f16, _Rshort_sat_rte)(half FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_i16_f16, _Rshort_sat_rtz)(half FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_i16_f16, _Rshort_sat_rtp)(half FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_i16_f16, _Rshort_sat_rtn)(half FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_i32_f16, _Rint_rte)(half FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_i32_f16, _Rint_rtz)(half FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_i32_f16, _Rint_rtp)(half FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_i32_f16, _Rint_rtn)(half FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_i32_f16, _Rint_sat)(half FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_i32_f16, _Rint_sat_rte)(half FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_i32_f16, _Rint_sat_rtz)(half FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_i32_f16, _Rint_sat_rtp)(half FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_i32_f16, _Rint_sat_rtn)(half FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_i64_f16, _Rlong_rte)(half FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_i64_f16, _Rlong_rtz)(half FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_i64_f16, _Rlong_rtp)(half FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_i64_f16, _Rlong_rtn)(half FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_i64_f16, _Rlong_sat)(half FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_i64_f16, _Rlong_sat_rte)(half FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_i64_f16, _Rlong_sat_rtz)(half FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_i64_f16, _Rlong_sat_rtp)(half FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_i64_f16, _Rlong_sat_rtn)(half FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_i8_f32, _Rchar_rte)(float FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_i8_f32, _Rchar_rtz)(float FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_i8_f32, _Rchar_rtp)(float FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_i8_f32, _Rchar_rtn)(float FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_i8_f32, _Rchar_sat)(float FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_i8_f32, _Rchar_sat_rte)(float FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_i8_f32, _Rchar_sat_rtz)(float FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_i8_f32, _Rchar_sat_rtp)(float FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_i8_f32, _Rchar_sat_rtn)(float FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_i16_f32, _Rshort_rte)(float FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_i16_f32, _Rshort_rtz)(float FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_i16_f32, _Rshort_rtp)(float FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_i16_f32, _Rshort_rtn)(float FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_i16_f32, _Rshort_sat)(float FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_i16_f32, _Rshort_sat_rte)(float FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_i16_f32, _Rshort_sat_rtz)(float FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_i16_f32, _Rshort_sat_rtp)(float FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_i16_f32, _Rshort_sat_rtn)(float FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_i32_f32, _Rint_rte)(float FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_i32_f32, _Rint_rtz)(float FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_i32_f32, _Rint_rtp)(float FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_i32_f32, _Rint_rtn)(float FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_i32_f32, _Rint_sat)(float FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_i32_f32, _Rint_sat_rte)(float FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_i32_f32, _Rint_sat_rtz)(float FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_i32_f32, _Rint_sat_rtp)(float FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_i32_f32, _Rint_sat_rtn)(float FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_i64_f32, _Rlong_rte)(float FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_i64_f32, _Rlong_rtz)(float FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_i64_f32, _Rlong_rtp)(float FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_i64_f32, _Rlong_rtn)(float FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_i64_f32, _Rlong_sat)(float FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_i64_f32, _Rlong_sat_rte)(float FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_i64_f32, _Rlong_sat_rtz)(float FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_i64_f32, _Rlong_sat_rtp)(float FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_i64_f32, _Rlong_sat_rtn)(float FloatValue);
#if defined(cl_khr_fp64)
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_i8_f64, _Rchar_rte)(double FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_i8_f64, _Rchar_rtz)(double FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_i8_f64, _Rchar_rtp)(double FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_i8_f64, _Rchar_rtn)(double FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_i8_f64, _Rchar_sat)(double FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_i8_f64, _Rchar_sat_rte)(double FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_i8_f64, _Rchar_sat_rtz)(double FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_i8_f64, _Rchar_sat_rtp)(double FloatValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_i8_f64, _Rchar_sat_rtn)(double FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_i16_f64, _Rshort_rte)(double FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_i16_f64, _Rshort_rtz)(double FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_i16_f64, _Rshort_rtp)(double FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_i16_f64, _Rshort_rtn)(double FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_i16_f64, _Rshort_sat)(double FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_i16_f64, _Rshort_sat_rte)(double FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_i16_f64, _Rshort_sat_rtz)(double FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_i16_f64, _Rshort_sat_rtp)(double FloatValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_i16_f64, _Rshort_sat_rtn)(double FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_i32_f64, _Rint_rte)(double FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_i32_f64, _Rint_rtz)(double FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_i32_f64, _Rint_rtp)(double FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_i32_f64, _Rint_rtn)(double FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_i32_f64, _Rint_sat)(double FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_i32_f64, _Rint_sat_rte)(double FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_i32_f64, _Rint_sat_rtz)(double FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_i32_f64, _Rint_sat_rtp)(double FloatValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_i32_f64, _Rint_sat_rtn)(double FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_i64_f64, _Rlong_rte)(double FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_i64_f64, _Rlong_rtz)(double FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_i64_f64, _Rlong_rtp)(double FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_i64_f64, _Rlong_rtn)(double FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_i64_f64, _Rlong_sat)(double FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_i64_f64, _Rlong_sat_rte)(double FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_i64_f64, _Rlong_sat_rtz)(double FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_i64_f64, _Rlong_sat_rtp)(double FloatValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_i64_f64, _Rlong_sat_rtn)(double FloatValue);
#endif // defined(cl_khr_fp64)
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_f16_i8, _Rhalf_rte)(char SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_f16_i8, _Rhalf_rtz)(char SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_f16_i8, _Rhalf_rtp)(char SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_f16_i8, _Rhalf_rtn)(char SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_f32_i8, _Rfloat_rte)(char SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_f32_i8, _Rfloat_rtz)(char SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_f32_i8, _Rfloat_rtp)(char SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_f32_i8, _Rfloat_rtn)(char SignedValue);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_f64_i8, _Rdouble_rte)(char SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_f64_i8, _Rdouble_rtz)(char SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_f64_i8, _Rdouble_rtp)(char SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_f64_i8, _Rdouble_rtn)(char SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_f64_i16, _Rdouble_rte)(short SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_f64_i16, _Rdouble_rtz)(short SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_f64_i16, _Rdouble_rtp)(short SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_f64_i16, _Rdouble_rtn)(short SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_f64_i32, _Rdouble_rte)(int SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_f64_i32, _Rdouble_rtz)(int SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_f64_i32, _Rdouble_rtp)(int SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_f64_i32, _Rdouble_rtn)(int SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_f64_i64, _Rdouble_rte)(long SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_f64_i64, _Rdouble_rtz)(long SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_f64_i64, _Rdouble_rtp)(long SignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_f64_i64, _Rdouble_rtn)(long SignedValue);
#endif // defined(cl_khr_fp64)
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_f16_i16, _Rhalf_rte)(short SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_f16_i16, _Rhalf_rtz)(short SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_f16_i16, _Rhalf_rtp)(short SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_f16_i16, _Rhalf_rtn)(short SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_f32_i16, _Rfloat_rte)(short SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_f32_i16, _Rfloat_rtz)(short SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_f32_i16, _Rfloat_rtp)(short SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_f32_i16, _Rfloat_rtn)(short SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_f16_i32, _Rhalf_rte)(int SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_f16_i32, _Rhalf_rtz)(int SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_f16_i32, _Rhalf_rtp)(int SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_f16_i32, _Rhalf_rtn)(int SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_f32_i32, _Rfloat_rte)(int SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_f32_i32, _Rfloat_rtz)(int SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_f32_i32, _Rfloat_rtp)(int SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_f32_i32, _Rfloat_rtn)(int SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_f16_i64, _Rhalf_rte)(long SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_f16_i64, _Rhalf_rtz)(long SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_f16_i64, _Rhalf_rtp)(long SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_f16_i64, _Rhalf_rtn)(long SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_f32_i64, _Rfloat_rte)(long SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_f32_i64, _Rfloat_rtz)(long SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_f32_i64, _Rfloat_rtp)(long SignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_f32_i64, _Rfloat_rtn)(long SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_f16_i8, _Rhalf_rte)(uchar UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_f16_i8, _Rhalf_rtz)(uchar UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_f16_i8, _Rhalf_rtp)(uchar UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_f16_i8, _Rhalf_rtn)(uchar UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_f32_i8, _Rfloat_rte)(uchar UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_f32_i8, _Rfloat_rtz)(uchar UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_f32_i8, _Rfloat_rtp)(uchar UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_f32_i8, _Rfloat_rtn)(uchar UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_f16_i16, _Rhalf_rte)(ushort UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_f16_i16, _Rhalf_rtz)(ushort UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_f16_i16, _Rhalf_rtp)(ushort UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_f16_i16, _Rhalf_rtn)(ushort UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_f32_i16, _Rfloat_rte)(ushort UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_f32_i16, _Rfloat_rtz)(ushort UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_f32_i16, _Rfloat_rtp)(ushort UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_f32_i16, _Rfloat_rtn)(ushort UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_f16_i32, _Rhalf_rte)(uint UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_f16_i32, _Rhalf_rtz)(uint UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_f16_i32, _Rhalf_rtp)(uint UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_f16_i32, _Rhalf_rtn)(uint UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_f32_i32, _Rfloat_rte)(uint UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_f32_i32, _Rfloat_rtz)(uint UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_f32_i32, _Rfloat_rtp)(uint UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_f32_i32, _Rfloat_rtn)(uint UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_f16_i64, _Rhalf_rte)(ulong UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_f16_i64, _Rhalf_rtz)(ulong UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_f16_i64, _Rhalf_rtp)(ulong UnsignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_f16_i64, _Rhalf_rtn)(ulong UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_f32_i64, _Rfloat_rte)(ulong UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_f32_i64, _Rfloat_rtz)(ulong UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_f32_i64, _Rfloat_rtp)(ulong UnsignedValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_f32_i64, _Rfloat_rtn)(ulong UnsignedValue);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_f64_i8, _Rdouble_rte)(uchar UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_f64_i8, _Rdouble_rtz)(uchar UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_f64_i8, _Rdouble_rtp)(uchar UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_f64_i8, _Rdouble_rtn)(uchar UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_f64_i16, _Rdouble_rte)(ushort UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_f64_i16, _Rdouble_rtz)(ushort UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_f64_i16, _Rdouble_rtp)(ushort UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_f64_i16, _Rdouble_rtn)(ushort UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_f64_i32, _Rdouble_rte)(uint UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_f64_i32, _Rdouble_rtz)(uint UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_f64_i32, _Rdouble_rtp)(uint UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_f64_i32, _Rdouble_rtn)(uint UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_f64_i64, _Rdouble_rte)(ulong UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_f64_i64, _Rdouble_rtz)(ulong UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_f64_i64, _Rdouble_rtp)(ulong UnsignedValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_f64_i64, _Rdouble_rtn)(ulong UnsignedValue);
#endif // defined(cl_khr_fp64)
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_i8_i8, _Ruchar_sat)(uchar UnsignedValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_i16_i8, _Rushort_sat)(uchar UnsignedValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_i32_i8, _Ruint_sat)(uchar UnsignedValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_i64_i8, _Rulong_sat)(uchar UnsignedValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_i8_i16, _Ruchar_sat)(ushort UnsignedValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_i16_i16, _Rushort_sat)(ushort UnsignedValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_i32_i16, _Ruint_sat)(ushort UnsignedValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_i64_i16, _Rulong_sat)(ushort UnsignedValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_i8_i32, _Ruchar_sat)(uint UnsignedValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_i16_i32, _Rushort_sat)(uint UnsignedValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_i32_i32, _Ruint_sat)(uint UnsignedValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_i64_i32, _Rulong_sat)(uint UnsignedValue);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_i8_i64, _Ruchar_sat)(ulong UnsignedValue);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_i16_i64, _Rushort_sat)(ulong UnsignedValue);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_i32_i64, _Ruint_sat)(ulong UnsignedValue);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_i64_i64, _Rulong_sat)(ulong UnsignedValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_i8_i8, _Rchar_sat)(char SignedValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_i16_i8, _Rshort_sat)(char SignedValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_i32_i8, _Rint_sat)(char SignedValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_i64_i8, _Rlong_sat)(char SignedValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_i8_i16, _Rchar_sat)(short SignedValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_i16_i16, _Rshort_sat)(short SignedValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_i32_i16, _Rint_sat)(short SignedValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_i64_i16, _Rlong_sat)(short SignedValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_i8_i32, _Rchar_sat)(int SignedValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_i16_i32, _Rshort_sat)(int SignedValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_i32_i32, _Rint_sat)(int SignedValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_i64_i32, _Rlong_sat)(int SignedValue);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_i8_i64, _Rchar_sat)(long SignedValue);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_i16_i64, _Rshort_sat)(long SignedValue);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_i32_i64, _Rint_sat)(long SignedValue);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_i64_i64, _Rlong_sat)(long SignedValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_f16_f16, _Rhalf_rte)(half FloatValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_f16_f16, _Rhalf_rtz)(half FloatValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_f16_f16, _Rhalf_rtp)(half FloatValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_f16_f16, _Rhalf_rtn)(half FloatValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_f32_f16, _Rfloat_rte)(half FloatValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_f32_f16, _Rfloat_rtz)(half FloatValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_f32_f16, _Rfloat_rtp)(half FloatValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_f32_f16, _Rfloat_rtn)(half FloatValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_f16_f32, _Rhalf_rte)(float FloatValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_f16_f32, _Rhalf_rtz)(float FloatValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_f16_f32, _Rhalf_rtp)(float FloatValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_f16_f32, _Rhalf_rtn)(float FloatValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_f32_f32, _Rfloat_rte)(float FloatValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_f32_f32, _Rfloat_rtz)(float FloatValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_f32_f32, _Rfloat_rtp)(float FloatValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_f32_f32, _Rfloat_rtn)(float FloatValue);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_f64_f16, _Rdouble_rte)(half FloatValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_f64_f16, _Rdouble_rtz)(half FloatValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_f64_f16, _Rdouble_rtp)(half FloatValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_f64_f16, _Rdouble_rtn)(half FloatValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_f64_f32, _Rdouble_rte)(float FloatValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_f64_f32, _Rdouble_rtz)(float FloatValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_f64_f32, _Rdouble_rtp)(float FloatValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_f64_f32, _Rdouble_rtn)(float FloatValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_f16_f64, _Rhalf_rte)(double FloatValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_f16_f64, _Rhalf_rtz)(double FloatValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_f16_f64, _Rhalf_rtp)(double FloatValue);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_f16_f64, _Rhalf_rtn)(double FloatValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_f32_f64, _Rfloat_rte)(double FloatValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_f32_f64, _Rfloat_rtz)(double FloatValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_f32_f64, _Rfloat_rtp)(double FloatValue);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_f32_f64, _Rfloat_rtn)(double FloatValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_f64_f64, _Rdouble_rte)(double FloatValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_f64_f64, _Rdouble_rtz)(double FloatValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_f64_f64, _Rdouble_rtp)(double FloatValue);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_f64_f64, _Rdouble_rtn)(double FloatValue);
#endif // defined(cl_khr_fp64)
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v2f16_v2i8, _Rhalf2)(char2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v3f16_v3i8, _Rhalf3)(char3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v4f16_v4i8, _Rhalf4)(char4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v8f16_v8i8, _Rhalf8)(char8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v16f16_v16i8, _Rhalf16)(char16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v2f16_v2i8, _Rhalf2_rte)(char2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v3f16_v3i8, _Rhalf3_rte)(char3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v4f16_v4i8, _Rhalf4_rte)(char4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v8f16_v8i8, _Rhalf8_rte)(char8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v16f16_v16i8, _Rhalf16_rte)(char16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v2f16_v2i8, _Rhalf2_rtz)(char2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v3f16_v3i8, _Rhalf3_rtz)(char3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v4f16_v4i8, _Rhalf4_rtz)(char4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v8f16_v8i8, _Rhalf8_rtz)(char8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v16f16_v16i8, _Rhalf16_rtz)(char16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v2f16_v2i8, _Rhalf2_rtp)(char2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v3f16_v3i8, _Rhalf3_rtp)(char3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v4f16_v4i8, _Rhalf4_rtp)(char4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v8f16_v8i8, _Rhalf8_rtp)(char8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v16f16_v16i8, _Rhalf16_rtp)(char16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v2f16_v2i8, _Rhalf2_rtn)(char2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v3f16_v3i8, _Rhalf3_rtn)(char3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v4f16_v4i8, _Rhalf4_rtn)(char4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v8f16_v8i8, _Rhalf8_rtn)(char8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v16f16_v16i8, _Rhalf16_rtn)(char16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v2f16_v2i16, _Rhalf2)(short2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v3f16_v3i16, _Rhalf3)(short3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v4f16_v4i16, _Rhalf4)(short4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v8f16_v8i16, _Rhalf8)(short8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v16f16_v16i16, _Rhalf16)(short16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v2f16_v2i16, _Rhalf2_rte)(short2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v3f16_v3i16, _Rhalf3_rte)(short3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v4f16_v4i16, _Rhalf4_rte)(short4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v8f16_v8i16, _Rhalf8_rte)(short8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v16f16_v16i16, _Rhalf16_rte)(short16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v2f16_v2i16, _Rhalf2_rtz)(short2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v3f16_v3i16, _Rhalf3_rtz)(short3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v4f16_v4i16, _Rhalf4_rtz)(short4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v8f16_v8i16, _Rhalf8_rtz)(short8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v16f16_v16i16, _Rhalf16_rtz)(short16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v2f16_v2i16, _Rhalf2_rtp)(short2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v3f16_v3i16, _Rhalf3_rtp)(short3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v4f16_v4i16, _Rhalf4_rtp)(short4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v8f16_v8i16, _Rhalf8_rtp)(short8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v16f16_v16i16, _Rhalf16_rtp)(short16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v2f16_v2i16, _Rhalf2_rtn)(short2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v3f16_v3i16, _Rhalf3_rtn)(short3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v4f16_v4i16, _Rhalf4_rtn)(short4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v8f16_v8i16, _Rhalf8_rtn)(short8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v16f16_v16i16, _Rhalf16_rtn)(short16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v2f16_v2i32, _Rhalf2)(int2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v3f16_v3i32, _Rhalf3)(int3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v4f16_v4i32, _Rhalf4)(int4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v8f16_v8i32, _Rhalf8)(int8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v16f16_v16i32, _Rhalf16)(int16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v2f16_v2i32, _Rhalf2_rte)(int2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v3f16_v3i32, _Rhalf3_rte)(int3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v4f16_v4i32, _Rhalf4_rte)(int4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v8f16_v8i32, _Rhalf8_rte)(int8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v16f16_v16i32, _Rhalf16_rte)(int16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v2f16_v2i32, _Rhalf2_rtz)(int2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v3f16_v3i32, _Rhalf3_rtz)(int3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v4f16_v4i32, _Rhalf4_rtz)(int4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v8f16_v8i32, _Rhalf8_rtz)(int8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v16f16_v16i32, _Rhalf16_rtz)(int16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v2f16_v2i32, _Rhalf2_rtp)(int2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v3f16_v3i32, _Rhalf3_rtp)(int3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v4f16_v4i32, _Rhalf4_rtp)(int4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v8f16_v8i32, _Rhalf8_rtp)(int8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v16f16_v16i32, _Rhalf16_rtp)(int16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v2f16_v2i32, _Rhalf2_rtn)(int2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v3f16_v3i32, _Rhalf3_rtn)(int3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v4f16_v4i32, _Rhalf4_rtn)(int4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v8f16_v8i32, _Rhalf8_rtn)(int8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v16f16_v16i32, _Rhalf16_rtn)(int16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v2f16_v2i64, _Rhalf2)(long2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v3f16_v3i64, _Rhalf3)(long3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v4f16_v4i64, _Rhalf4)(long4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v8f16_v8i64, _Rhalf8)(long8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v16f16_v16i64, _Rhalf16)(long16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v2f16_v2i64, _Rhalf2_rte)(long2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v3f16_v3i64, _Rhalf3_rte)(long3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v4f16_v4i64, _Rhalf4_rte)(long4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v8f16_v8i64, _Rhalf8_rte)(long8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v16f16_v16i64, _Rhalf16_rte)(long16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v2f16_v2i64, _Rhalf2_rtz)(long2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v3f16_v3i64, _Rhalf3_rtz)(long3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v4f16_v4i64, _Rhalf4_rtz)(long4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v8f16_v8i64, _Rhalf8_rtz)(long8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v16f16_v16i64, _Rhalf16_rtz)(long16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v2f16_v2i64, _Rhalf2_rtp)(long2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v3f16_v3i64, _Rhalf3_rtp)(long3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v4f16_v4i64, _Rhalf4_rtp)(long4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v8f16_v8i64, _Rhalf8_rtp)(long8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v16f16_v16i64, _Rhalf16_rtp)(long16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v2f16_v2i64, _Rhalf2_rtn)(long2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v3f16_v3i64, _Rhalf3_rtn)(long3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v4f16_v4i64, _Rhalf4_rtn)(long4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v8f16_v8i64, _Rhalf8_rtn)(long8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v16f16_v16i64, _Rhalf16_rtn)(long16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v2f32_v2i8, _Rfloat2)(char2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v3f32_v3i8, _Rfloat3)(char3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v4f32_v4i8, _Rfloat4)(char4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v8f32_v8i8, _Rfloat8)(char8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v16f32_v16i8, _Rfloat16)(char16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v2f32_v2i8, _Rfloat2_rte)(char2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v3f32_v3i8, _Rfloat3_rte)(char3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v4f32_v4i8, _Rfloat4_rte)(char4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v8f32_v8i8, _Rfloat8_rte)(char8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v16f32_v16i8, _Rfloat16_rte)(char16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v2f32_v2i8, _Rfloat2_rtz)(char2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v3f32_v3i8, _Rfloat3_rtz)(char3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v4f32_v4i8, _Rfloat4_rtz)(char4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v8f32_v8i8, _Rfloat8_rtz)(char8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v16f32_v16i8, _Rfloat16_rtz)(char16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v2f32_v2i8, _Rfloat2_rtp)(char2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v3f32_v3i8, _Rfloat3_rtp)(char3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v4f32_v4i8, _Rfloat4_rtp)(char4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v8f32_v8i8, _Rfloat8_rtp)(char8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v16f32_v16i8, _Rfloat16_rtp)(char16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v2f32_v2i8, _Rfloat2_rtn)(char2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v3f32_v3i8, _Rfloat3_rtn)(char3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v4f32_v4i8, _Rfloat4_rtn)(char4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v8f32_v8i8, _Rfloat8_rtn)(char8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v16f32_v16i8, _Rfloat16_rtn)(char16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v2f32_v2i16, _Rfloat2)(short2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v3f32_v3i16, _Rfloat3)(short3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v4f32_v4i16, _Rfloat4)(short4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v8f32_v8i16, _Rfloat8)(short8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v16f32_v16i16, _Rfloat16)(short16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v2f32_v2i16, _Rfloat2_rte)(short2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v3f32_v3i16, _Rfloat3_rte)(short3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v4f32_v4i16, _Rfloat4_rte)(short4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v8f32_v8i16, _Rfloat8_rte)(short8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v16f32_v16i16, _Rfloat16_rte)(short16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v2f32_v2i16, _Rfloat2_rtz)(short2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v3f32_v3i16, _Rfloat3_rtz)(short3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v4f32_v4i16, _Rfloat4_rtz)(short4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v8f32_v8i16, _Rfloat8_rtz)(short8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v16f32_v16i16, _Rfloat16_rtz)(short16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v2f32_v2i16, _Rfloat2_rtp)(short2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v3f32_v3i16, _Rfloat3_rtp)(short3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v4f32_v4i16, _Rfloat4_rtp)(short4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v8f32_v8i16, _Rfloat8_rtp)(short8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v16f32_v16i16, _Rfloat16_rtp)(short16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v2f32_v2i16, _Rfloat2_rtn)(short2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v3f32_v3i16, _Rfloat3_rtn)(short3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v4f32_v4i16, _Rfloat4_rtn)(short4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v8f32_v8i16, _Rfloat8_rtn)(short8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v16f32_v16i16, _Rfloat16_rtn)(short16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v2f32_v2i32, _Rfloat2)(int2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v3f32_v3i32, _Rfloat3)(int3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v4f32_v4i32, _Rfloat4)(int4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v8f32_v8i32, _Rfloat8)(int8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v16f32_v16i32, _Rfloat16)(int16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v2f32_v2i32, _Rfloat2_rte)(int2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v3f32_v3i32, _Rfloat3_rte)(int3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v4f32_v4i32, _Rfloat4_rte)(int4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v8f32_v8i32, _Rfloat8_rte)(int8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v16f32_v16i32, _Rfloat16_rte)(int16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v2f32_v2i32, _Rfloat2_rtz)(int2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v3f32_v3i32, _Rfloat3_rtz)(int3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v4f32_v4i32, _Rfloat4_rtz)(int4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v8f32_v8i32, _Rfloat8_rtz)(int8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v16f32_v16i32, _Rfloat16_rtz)(int16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v2f32_v2i32, _Rfloat2_rtp)(int2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v3f32_v3i32, _Rfloat3_rtp)(int3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v4f32_v4i32, _Rfloat4_rtp)(int4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v8f32_v8i32, _Rfloat8_rtp)(int8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v16f32_v16i32, _Rfloat16_rtp)(int16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v2f32_v2i32, _Rfloat2_rtn)(int2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v3f32_v3i32, _Rfloat3_rtn)(int3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v4f32_v4i32, _Rfloat4_rtn)(int4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v8f32_v8i32, _Rfloat8_rtn)(int8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v16f32_v16i32, _Rfloat16_rtn)(int16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v2f32_v2i64, _Rfloat2)(long2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v3f32_v3i64, _Rfloat3)(long3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v4f32_v4i64, _Rfloat4)(long4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v8f32_v8i64, _Rfloat8)(long8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v16f32_v16i64, _Rfloat16)(long16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v2f32_v2i64, _Rfloat2_rte)(long2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v3f32_v3i64, _Rfloat3_rte)(long3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v4f32_v4i64, _Rfloat4_rte)(long4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v8f32_v8i64, _Rfloat8_rte)(long8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v16f32_v16i64, _Rfloat16_rte)(long16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v2f32_v2i64, _Rfloat2_rtz)(long2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v3f32_v3i64, _Rfloat3_rtz)(long3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v4f32_v4i64, _Rfloat4_rtz)(long4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v8f32_v8i64, _Rfloat8_rtz)(long8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v16f32_v16i64, _Rfloat16_rtz)(long16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v2f32_v2i64, _Rfloat2_rtp)(long2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v3f32_v3i64, _Rfloat3_rtp)(long3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v4f32_v4i64, _Rfloat4_rtp)(long4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v8f32_v8i64, _Rfloat8_rtp)(long8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v16f32_v16i64, _Rfloat16_rtp)(long16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v2f32_v2i64, _Rfloat2_rtn)(long2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v3f32_v3i64, _Rfloat3_rtn)(long3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v4f32_v4i64, _Rfloat4_rtn)(long4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v8f32_v8i64, _Rfloat8_rtn)(long8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v16f32_v16i64, _Rfloat16_rtn)(long16 x);
#if defined(cl_khr_fp64)
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v2f64_v2i8, _Rdouble2)(char2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v3f64_v3i8, _Rdouble3)(char3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v4f64_v4i8, _Rdouble4)(char4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v8f64_v8i8, _Rdouble8)(char8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v16f64_v16i8, _Rdouble16)(char16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v2f64_v2i8, _Rdouble2_rte)(char2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v3f64_v3i8, _Rdouble3_rte)(char3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v4f64_v4i8, _Rdouble4_rte)(char4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v8f64_v8i8, _Rdouble8_rte)(char8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v16f64_v16i8, _Rdouble16_rte)(char16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v2f64_v2i8, _Rdouble2_rtz)(char2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v3f64_v3i8, _Rdouble3_rtz)(char3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v4f64_v4i8, _Rdouble4_rtz)(char4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v8f64_v8i8, _Rdouble8_rtz)(char8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v16f64_v16i8, _Rdouble16_rtz)(char16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v2f64_v2i8, _Rdouble2_rtp)(char2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v3f64_v3i8, _Rdouble3_rtp)(char3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v4f64_v4i8, _Rdouble4_rtp)(char4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v8f64_v8i8, _Rdouble8_rtp)(char8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v16f64_v16i8, _Rdouble16_rtp)(char16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v2f64_v2i8, _Rdouble2_rtn)(char2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v3f64_v3i8, _Rdouble3_rtn)(char3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v4f64_v4i8, _Rdouble4_rtn)(char4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v8f64_v8i8, _Rdouble8_rtn)(char8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v16f64_v16i8, _Rdouble16_rtn)(char16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v2f64_v2i16, _Rdouble2)(short2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v3f64_v3i16, _Rdouble3)(short3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v4f64_v4i16, _Rdouble4)(short4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v8f64_v8i16, _Rdouble8)(short8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v16f64_v16i16, _Rdouble16)(short16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v2f64_v2i16, _Rdouble2_rte)(short2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v3f64_v3i16, _Rdouble3_rte)(short3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v4f64_v4i16, _Rdouble4_rte)(short4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v8f64_v8i16, _Rdouble8_rte)(short8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v16f64_v16i16, _Rdouble16_rte)(short16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v2f64_v2i16, _Rdouble2_rtz)(short2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v3f64_v3i16, _Rdouble3_rtz)(short3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v4f64_v4i16, _Rdouble4_rtz)(short4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v8f64_v8i16, _Rdouble8_rtz)(short8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v16f64_v16i16, _Rdouble16_rtz)(short16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v2f64_v2i16, _Rdouble2_rtp)(short2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v3f64_v3i16, _Rdouble3_rtp)(short3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v4f64_v4i16, _Rdouble4_rtp)(short4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v8f64_v8i16, _Rdouble8_rtp)(short8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v16f64_v16i16, _Rdouble16_rtp)(short16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v2f64_v2i16, _Rdouble2_rtn)(short2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v3f64_v3i16, _Rdouble3_rtn)(short3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v4f64_v4i16, _Rdouble4_rtn)(short4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v8f64_v8i16, _Rdouble8_rtn)(short8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v16f64_v16i16, _Rdouble16_rtn)(short16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v2f64_v2i32, _Rdouble2)(int2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v3f64_v3i32, _Rdouble3)(int3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v4f64_v4i32, _Rdouble4)(int4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v8f64_v8i32, _Rdouble8)(int8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v16f64_v16i32, _Rdouble16)(int16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v2f64_v2i32, _Rdouble2_rte)(int2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v3f64_v3i32, _Rdouble3_rte)(int3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v4f64_v4i32, _Rdouble4_rte)(int4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v8f64_v8i32, _Rdouble8_rte)(int8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v16f64_v16i32, _Rdouble16_rte)(int16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v2f64_v2i32, _Rdouble2_rtz)(int2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v3f64_v3i32, _Rdouble3_rtz)(int3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v4f64_v4i32, _Rdouble4_rtz)(int4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v8f64_v8i32, _Rdouble8_rtz)(int8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v16f64_v16i32, _Rdouble16_rtz)(int16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v2f64_v2i32, _Rdouble2_rtp)(int2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v3f64_v3i32, _Rdouble3_rtp)(int3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v4f64_v4i32, _Rdouble4_rtp)(int4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v8f64_v8i32, _Rdouble8_rtp)(int8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v16f64_v16i32, _Rdouble16_rtp)(int16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v2f64_v2i32, _Rdouble2_rtn)(int2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v3f64_v3i32, _Rdouble3_rtn)(int3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v4f64_v4i32, _Rdouble4_rtn)(int4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v8f64_v8i32, _Rdouble8_rtn)(int8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v16f64_v16i32, _Rdouble16_rtn)(int16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v2f64_v2i64, _Rdouble2)(long2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v3f64_v3i64, _Rdouble3)(long3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v4f64_v4i64, _Rdouble4)(long4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v8f64_v8i64, _Rdouble8)(long8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _v16f64_v16i64, _Rdouble16)(long16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v2f64_v2i64, _Rdouble2_rte)(long2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v3f64_v3i64, _Rdouble3_rte)(long3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v4f64_v4i64, _Rdouble4_rte)(long4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v8f64_v8i64, _Rdouble8_rte)(long8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTE_v16f64_v16i64, _Rdouble16_rte)(long16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v2f64_v2i64, _Rdouble2_rtz)(long2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v3f64_v3i64, _Rdouble3_rtz)(long3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v4f64_v4i64, _Rdouble4_rtz)(long4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v8f64_v8i64, _Rdouble8_rtz)(long8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTZ_v16f64_v16i64, _Rdouble16_rtz)(long16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v2f64_v2i64, _Rdouble2_rtp)(long2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v3f64_v3i64, _Rdouble3_rtp)(long3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v4f64_v4i64, _Rdouble4_rtp)(long4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v8f64_v8i64, _Rdouble8_rtp)(long8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTP_v16f64_v16i64, _Rdouble16_rtp)(long16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v2f64_v2i64, _Rdouble2_rtn)(long2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v3f64_v3i64, _Rdouble3_rtn)(long3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v4f64_v4i64, _Rdouble4_rtn)(long4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v8f64_v8i64, _Rdouble8_rtn)(long8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertSToF, _RTN_v16f64_v16i64, _Rdouble16_rtn)(long16 x);
#endif // defined(cl_khr_fp64)
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v2f16_v2i8, _Rhalf2)(uchar2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v3f16_v3i8, _Rhalf3)(uchar3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v4f16_v4i8, _Rhalf4)(uchar4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v8f16_v8i8, _Rhalf8)(uchar8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v16f16_v16i8, _Rhalf16)(uchar16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v2f16_v2i8, _Rhalf2_rte)(uchar2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v3f16_v3i8, _Rhalf3_rte)(uchar3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v4f16_v4i8, _Rhalf4_rte)(uchar4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v8f16_v8i8, _Rhalf8_rte)(uchar8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v16f16_v16i8, _Rhalf16_rte)(uchar16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v2f16_v2i8, _Rhalf2_rtz)(uchar2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v3f16_v3i8, _Rhalf3_rtz)(uchar3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v4f16_v4i8, _Rhalf4_rtz)(uchar4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v8f16_v8i8, _Rhalf8_rtz)(uchar8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v16f16_v16i8, _Rhalf16_rtz)(uchar16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v2f16_v2i8, _Rhalf2_rtp)(uchar2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v3f16_v3i8, _Rhalf3_rtp)(uchar3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v4f16_v4i8, _Rhalf4_rtp)(uchar4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v8f16_v8i8, _Rhalf8_rtp)(uchar8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v16f16_v16i8, _Rhalf16_rtp)(uchar16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v2f16_v2i8, _Rhalf2_rtn)(uchar2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v3f16_v3i8, _Rhalf3_rtn)(uchar3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v4f16_v4i8, _Rhalf4_rtn)(uchar4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v8f16_v8i8, _Rhalf8_rtn)(uchar8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v16f16_v16i8, _Rhalf16_rtn)(uchar16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v2f16_v2i16, _Rhalf2)(ushort2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v3f16_v3i16, _Rhalf3)(ushort3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v4f16_v4i16, _Rhalf4)(ushort4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v8f16_v8i16, _Rhalf8)(ushort8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v16f16_v16i16, _Rhalf16)(ushort16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v2f16_v2i16, _Rhalf2_rte)(ushort2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v3f16_v3i16, _Rhalf3_rte)(ushort3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v4f16_v4i16, _Rhalf4_rte)(ushort4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v8f16_v8i16, _Rhalf8_rte)(ushort8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v16f16_v16i16, _Rhalf16_rte)(ushort16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v2f16_v2i16, _Rhalf2_rtz)(ushort2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v3f16_v3i16, _Rhalf3_rtz)(ushort3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v4f16_v4i16, _Rhalf4_rtz)(ushort4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v8f16_v8i16, _Rhalf8_rtz)(ushort8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v16f16_v16i16, _Rhalf16_rtz)(ushort16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v2f16_v2i16, _Rhalf2_rtp)(ushort2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v3f16_v3i16, _Rhalf3_rtp)(ushort3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v4f16_v4i16, _Rhalf4_rtp)(ushort4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v8f16_v8i16, _Rhalf8_rtp)(ushort8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v16f16_v16i16, _Rhalf16_rtp)(ushort16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v2f16_v2i16, _Rhalf2_rtn)(ushort2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v3f16_v3i16, _Rhalf3_rtn)(ushort3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v4f16_v4i16, _Rhalf4_rtn)(ushort4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v8f16_v8i16, _Rhalf8_rtn)(ushort8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v16f16_v16i16, _Rhalf16_rtn)(ushort16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v2f16_v2i32, _Rhalf2)(uint2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v3f16_v3i32, _Rhalf3)(uint3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v4f16_v4i32, _Rhalf4)(uint4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v8f16_v8i32, _Rhalf8)(uint8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v16f16_v16i32, _Rhalf16)(uint16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v2f16_v2i32, _Rhalf2_rte)(uint2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v3f16_v3i32, _Rhalf3_rte)(uint3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v4f16_v4i32, _Rhalf4_rte)(uint4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v8f16_v8i32, _Rhalf8_rte)(uint8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v16f16_v16i32, _Rhalf16_rte)(uint16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v2f16_v2i32, _Rhalf2_rtz)(uint2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v3f16_v3i32, _Rhalf3_rtz)(uint3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v4f16_v4i32, _Rhalf4_rtz)(uint4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v8f16_v8i32, _Rhalf8_rtz)(uint8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v16f16_v16i32, _Rhalf16_rtz)(uint16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v2f16_v2i32, _Rhalf2_rtp)(uint2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v3f16_v3i32, _Rhalf3_rtp)(uint3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v4f16_v4i32, _Rhalf4_rtp)(uint4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v8f16_v8i32, _Rhalf8_rtp)(uint8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v16f16_v16i32, _Rhalf16_rtp)(uint16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v2f16_v2i32, _Rhalf2_rtn)(uint2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v3f16_v3i32, _Rhalf3_rtn)(uint3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v4f16_v4i32, _Rhalf4_rtn)(uint4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v8f16_v8i32, _Rhalf8_rtn)(uint8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v16f16_v16i32, _Rhalf16_rtn)(uint16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v2f16_v2i64, _Rhalf2)(ulong2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v3f16_v3i64, _Rhalf3)(ulong3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v4f16_v4i64, _Rhalf4)(ulong4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v8f16_v8i64, _Rhalf8)(ulong8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v16f16_v16i64, _Rhalf16)(ulong16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v2f16_v2i64, _Rhalf2_rte)(ulong2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v3f16_v3i64, _Rhalf3_rte)(ulong3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v4f16_v4i64, _Rhalf4_rte)(ulong4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v8f16_v8i64, _Rhalf8_rte)(ulong8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v16f16_v16i64, _Rhalf16_rte)(ulong16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v2f16_v2i64, _Rhalf2_rtz)(ulong2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v3f16_v3i64, _Rhalf3_rtz)(ulong3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v4f16_v4i64, _Rhalf4_rtz)(ulong4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v8f16_v8i64, _Rhalf8_rtz)(ulong8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v16f16_v16i64, _Rhalf16_rtz)(ulong16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v2f16_v2i64, _Rhalf2_rtp)(ulong2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v3f16_v3i64, _Rhalf3_rtp)(ulong3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v4f16_v4i64, _Rhalf4_rtp)(ulong4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v8f16_v8i64, _Rhalf8_rtp)(ulong8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v16f16_v16i64, _Rhalf16_rtp)(ulong16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v2f16_v2i64, _Rhalf2_rtn)(ulong2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v3f16_v3i64, _Rhalf3_rtn)(ulong3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v4f16_v4i64, _Rhalf4_rtn)(ulong4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v8f16_v8i64, _Rhalf8_rtn)(ulong8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v16f16_v16i64, _Rhalf16_rtn)(ulong16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v2f32_v2i8, _Rfloat2)(uchar2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v3f32_v3i8, _Rfloat3)(uchar3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v4f32_v4i8, _Rfloat4)(uchar4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v8f32_v8i8, _Rfloat8)(uchar8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v16f32_v16i8, _Rfloat16)(uchar16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v2f32_v2i8, _Rfloat2_rte)(uchar2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v3f32_v3i8, _Rfloat3_rte)(uchar3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v4f32_v4i8, _Rfloat4_rte)(uchar4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v8f32_v8i8, _Rfloat8_rte)(uchar8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v16f32_v16i8, _Rfloat16_rte)(uchar16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v2f32_v2i8, _Rfloat2_rtz)(uchar2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v3f32_v3i8, _Rfloat3_rtz)(uchar3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v4f32_v4i8, _Rfloat4_rtz)(uchar4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v8f32_v8i8, _Rfloat8_rtz)(uchar8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v16f32_v16i8, _Rfloat16_rtz)(uchar16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v2f32_v2i8, _Rfloat2_rtp)(uchar2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v3f32_v3i8, _Rfloat3_rtp)(uchar3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v4f32_v4i8, _Rfloat4_rtp)(uchar4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v8f32_v8i8, _Rfloat8_rtp)(uchar8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v16f32_v16i8, _Rfloat16_rtp)(uchar16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v2f32_v2i8, _Rfloat2_rtn)(uchar2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v3f32_v3i8, _Rfloat3_rtn)(uchar3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v4f32_v4i8, _Rfloat4_rtn)(uchar4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v8f32_v8i8, _Rfloat8_rtn)(uchar8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v16f32_v16i8, _Rfloat16_rtn)(uchar16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v2f32_v2i16, _Rfloat2)(ushort2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v3f32_v3i16, _Rfloat3)(ushort3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v4f32_v4i16, _Rfloat4)(ushort4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v8f32_v8i16, _Rfloat8)(ushort8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v16f32_v16i16, _Rfloat16)(ushort16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v2f32_v2i16, _Rfloat2_rte)(ushort2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v3f32_v3i16, _Rfloat3_rte)(ushort3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v4f32_v4i16, _Rfloat4_rte)(ushort4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v8f32_v8i16, _Rfloat8_rte)(ushort8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v16f32_v16i16, _Rfloat16_rte)(ushort16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v2f32_v2i16, _Rfloat2_rtz)(ushort2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v3f32_v3i16, _Rfloat3_rtz)(ushort3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v4f32_v4i16, _Rfloat4_rtz)(ushort4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v8f32_v8i16, _Rfloat8_rtz)(ushort8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v16f32_v16i16, _Rfloat16_rtz)(ushort16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v2f32_v2i16, _Rfloat2_rtp)(ushort2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v3f32_v3i16, _Rfloat3_rtp)(ushort3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v4f32_v4i16, _Rfloat4_rtp)(ushort4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v8f32_v8i16, _Rfloat8_rtp)(ushort8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v16f32_v16i16, _Rfloat16_rtp)(ushort16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v2f32_v2i16, _Rfloat2_rtn)(ushort2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v3f32_v3i16, _Rfloat3_rtn)(ushort3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v4f32_v4i16, _Rfloat4_rtn)(ushort4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v8f32_v8i16, _Rfloat8_rtn)(ushort8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v16f32_v16i16, _Rfloat16_rtn)(ushort16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v2f32_v2i32, _Rfloat2)(uint2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v3f32_v3i32, _Rfloat3)(uint3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v4f32_v4i32, _Rfloat4)(uint4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v8f32_v8i32, _Rfloat8)(uint8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v16f32_v16i32, _Rfloat16)(uint16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v2f32_v2i32, _Rfloat2_rte)(uint2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v3f32_v3i32, _Rfloat3_rte)(uint3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v4f32_v4i32, _Rfloat4_rte)(uint4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v8f32_v8i32, _Rfloat8_rte)(uint8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v16f32_v16i32, _Rfloat16_rte)(uint16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v2f32_v2i32, _Rfloat2_rtz)(uint2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v3f32_v3i32, _Rfloat3_rtz)(uint3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v4f32_v4i32, _Rfloat4_rtz)(uint4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v8f32_v8i32, _Rfloat8_rtz)(uint8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v16f32_v16i32, _Rfloat16_rtz)(uint16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v2f32_v2i32, _Rfloat2_rtp)(uint2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v3f32_v3i32, _Rfloat3_rtp)(uint3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v4f32_v4i32, _Rfloat4_rtp)(uint4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v8f32_v8i32, _Rfloat8_rtp)(uint8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v16f32_v16i32, _Rfloat16_rtp)(uint16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v2f32_v2i32, _Rfloat2_rtn)(uint2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v3f32_v3i32, _Rfloat3_rtn)(uint3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v4f32_v4i32, _Rfloat4_rtn)(uint4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v8f32_v8i32, _Rfloat8_rtn)(uint8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v16f32_v16i32, _Rfloat16_rtn)(uint16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v2f32_v2i64, _Rfloat2)(ulong2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v3f32_v3i64, _Rfloat3)(ulong3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v4f32_v4i64, _Rfloat4)(ulong4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v8f32_v8i64, _Rfloat8)(ulong8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v16f32_v16i64, _Rfloat16)(ulong16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v2f32_v2i64, _Rfloat2_rte)(ulong2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v3f32_v3i64, _Rfloat3_rte)(ulong3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v4f32_v4i64, _Rfloat4_rte)(ulong4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v8f32_v8i64, _Rfloat8_rte)(ulong8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v16f32_v16i64, _Rfloat16_rte)(ulong16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v2f32_v2i64, _Rfloat2_rtz)(ulong2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v3f32_v3i64, _Rfloat3_rtz)(ulong3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v4f32_v4i64, _Rfloat4_rtz)(ulong4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v8f32_v8i64, _Rfloat8_rtz)(ulong8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v16f32_v16i64, _Rfloat16_rtz)(ulong16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v2f32_v2i64, _Rfloat2_rtp)(ulong2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v3f32_v3i64, _Rfloat3_rtp)(ulong3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v4f32_v4i64, _Rfloat4_rtp)(ulong4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v8f32_v8i64, _Rfloat8_rtp)(ulong8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v16f32_v16i64, _Rfloat16_rtp)(ulong16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v2f32_v2i64, _Rfloat2_rtn)(ulong2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v3f32_v3i64, _Rfloat3_rtn)(ulong3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v4f32_v4i64, _Rfloat4_rtn)(ulong4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v8f32_v8i64, _Rfloat8_rtn)(ulong8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v16f32_v16i64, _Rfloat16_rtn)(ulong16 x);
#if defined(cl_khr_fp64)
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v2f64_v2i8, _Rdouble2)(uchar2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v3f64_v3i8, _Rdouble3)(uchar3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v4f64_v4i8, _Rdouble4)(uchar4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v8f64_v8i8, _Rdouble8)(uchar8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v16f64_v16i8, _Rdouble16)(uchar16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v2f64_v2i8, _Rdouble2_rte)(uchar2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v3f64_v3i8, _Rdouble3_rte)(uchar3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v4f64_v4i8, _Rdouble4_rte)(uchar4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v8f64_v8i8, _Rdouble8_rte)(uchar8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v16f64_v16i8, _Rdouble16_rte)(uchar16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v2f64_v2i8, _Rdouble2_rtz)(uchar2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v3f64_v3i8, _Rdouble3_rtz)(uchar3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v4f64_v4i8, _Rdouble4_rtz)(uchar4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v8f64_v8i8, _Rdouble8_rtz)(uchar8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v16f64_v16i8, _Rdouble16_rtz)(uchar16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v2f64_v2i8, _Rdouble2_rtp)(uchar2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v3f64_v3i8, _Rdouble3_rtp)(uchar3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v4f64_v4i8, _Rdouble4_rtp)(uchar4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v8f64_v8i8, _Rdouble8_rtp)(uchar8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v16f64_v16i8, _Rdouble16_rtp)(uchar16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v2f64_v2i8, _Rdouble2_rtn)(uchar2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v3f64_v3i8, _Rdouble3_rtn)(uchar3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v4f64_v4i8, _Rdouble4_rtn)(uchar4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v8f64_v8i8, _Rdouble8_rtn)(uchar8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v16f64_v16i8, _Rdouble16_rtn)(uchar16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v2f64_v2i16, _Rdouble2)(ushort2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v3f64_v3i16, _Rdouble3)(ushort3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v4f64_v4i16, _Rdouble4)(ushort4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v8f64_v8i16, _Rdouble8)(ushort8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v16f64_v16i16, _Rdouble16)(ushort16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v2f64_v2i16, _Rdouble2_rte)(ushort2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v3f64_v3i16, _Rdouble3_rte)(ushort3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v4f64_v4i16, _Rdouble4_rte)(ushort4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v8f64_v8i16, _Rdouble8_rte)(ushort8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v16f64_v16i16, _Rdouble16_rte)(ushort16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v2f64_v2i16, _Rdouble2_rtz)(ushort2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v3f64_v3i16, _Rdouble3_rtz)(ushort3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v4f64_v4i16, _Rdouble4_rtz)(ushort4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v8f64_v8i16, _Rdouble8_rtz)(ushort8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v16f64_v16i16, _Rdouble16_rtz)(ushort16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v2f64_v2i16, _Rdouble2_rtp)(ushort2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v3f64_v3i16, _Rdouble3_rtp)(ushort3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v4f64_v4i16, _Rdouble4_rtp)(ushort4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v8f64_v8i16, _Rdouble8_rtp)(ushort8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v16f64_v16i16, _Rdouble16_rtp)(ushort16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v2f64_v2i16, _Rdouble2_rtn)(ushort2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v3f64_v3i16, _Rdouble3_rtn)(ushort3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v4f64_v4i16, _Rdouble4_rtn)(ushort4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v8f64_v8i16, _Rdouble8_rtn)(ushort8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v16f64_v16i16, _Rdouble16_rtn)(ushort16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v2f64_v2i32, _Rdouble2)(uint2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v3f64_v3i32, _Rdouble3)(uint3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v4f64_v4i32, _Rdouble4)(uint4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v8f64_v8i32, _Rdouble8)(uint8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v16f64_v16i32, _Rdouble16)(uint16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v2f64_v2i32, _Rdouble2_rte)(uint2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v3f64_v3i32, _Rdouble3_rte)(uint3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v4f64_v4i32, _Rdouble4_rte)(uint4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v8f64_v8i32, _Rdouble8_rte)(uint8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v16f64_v16i32, _Rdouble16_rte)(uint16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v2f64_v2i32, _Rdouble2_rtz)(uint2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v3f64_v3i32, _Rdouble3_rtz)(uint3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v4f64_v4i32, _Rdouble4_rtz)(uint4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v8f64_v8i32, _Rdouble8_rtz)(uint8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v16f64_v16i32, _Rdouble16_rtz)(uint16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v2f64_v2i32, _Rdouble2_rtp)(uint2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v3f64_v3i32, _Rdouble3_rtp)(uint3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v4f64_v4i32, _Rdouble4_rtp)(uint4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v8f64_v8i32, _Rdouble8_rtp)(uint8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v16f64_v16i32, _Rdouble16_rtp)(uint16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v2f64_v2i32, _Rdouble2_rtn)(uint2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v3f64_v3i32, _Rdouble3_rtn)(uint3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v4f64_v4i32, _Rdouble4_rtn)(uint4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v8f64_v8i32, _Rdouble8_rtn)(uint8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v16f64_v16i32, _Rdouble16_rtn)(uint16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v2f64_v2i64, _Rdouble2)(ulong2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v3f64_v3i64, _Rdouble3)(ulong3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v4f64_v4i64, _Rdouble4)(ulong4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v8f64_v8i64, _Rdouble8)(ulong8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _v16f64_v16i64, _Rdouble16)(ulong16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v2f64_v2i64, _Rdouble2_rte)(ulong2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v3f64_v3i64, _Rdouble3_rte)(ulong3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v4f64_v4i64, _Rdouble4_rte)(ulong4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v8f64_v8i64, _Rdouble8_rte)(ulong8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTE_v16f64_v16i64, _Rdouble16_rte)(ulong16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v2f64_v2i64, _Rdouble2_rtz)(ulong2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v3f64_v3i64, _Rdouble3_rtz)(ulong3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v4f64_v4i64, _Rdouble4_rtz)(ulong4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v8f64_v8i64, _Rdouble8_rtz)(ulong8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTZ_v16f64_v16i64, _Rdouble16_rtz)(ulong16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v2f64_v2i64, _Rdouble2_rtp)(ulong2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v3f64_v3i64, _Rdouble3_rtp)(ulong3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v4f64_v4i64, _Rdouble4_rtp)(ulong4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v8f64_v8i64, _Rdouble8_rtp)(ulong8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTP_v16f64_v16i64, _Rdouble16_rtp)(ulong16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v2f64_v2i64, _Rdouble2_rtn)(ulong2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v3f64_v3i64, _Rdouble3_rtn)(ulong3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v4f64_v4i64, _Rdouble4_rtn)(ulong4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v8f64_v8i64, _Rdouble8_rtn)(ulong8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertUToF, _RTN_v16f64_v16i64, _Rdouble16_rtn)(ulong16 x);
#endif // defined(cl_khr_fp64)
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v2f16_v2f32, _Rhalf2)(float2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v3f16_v3f32, _Rhalf3)(float3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v4f16_v4f32, _Rhalf4)(float4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v8f16_v8f32, _Rhalf8)(float8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v16f16_v16f32, _Rhalf16)(float16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v2f16_v2f32, _Rhalf2_rte)(float2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v3f16_v3f32, _Rhalf3_rte)(float3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v4f16_v4f32, _Rhalf4_rte)(float4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v8f16_v8f32, _Rhalf8_rte)(float8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v16f16_v16f32, _Rhalf16_rte)(float16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v2f16_v2f32, _Rhalf2_rtz)(float2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v3f16_v3f32, _Rhalf3_rtz)(float3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v4f16_v4f32, _Rhalf4_rtz)(float4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v8f16_v8f32, _Rhalf8_rtz)(float8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v16f16_v16f32, _Rhalf16_rtz)(float16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v2f16_v2f32, _Rhalf2_rtp)(float2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v3f16_v3f32, _Rhalf3_rtp)(float3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v4f16_v4f32, _Rhalf4_rtp)(float4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v8f16_v8f32, _Rhalf8_rtp)(float8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v16f16_v16f32, _Rhalf16_rtp)(float16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v2f16_v2f32, _Rhalf2_rtn)(float2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v3f16_v3f32, _Rhalf3_rtn)(float3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v4f16_v4f32, _Rhalf4_rtn)(float4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v8f16_v8f32, _Rhalf8_rtn)(float8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v16f16_v16f32, _Rhalf16_rtn)(float16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v2f16_v2f16, _Rhalf2)(half2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v3f16_v3f16, _Rhalf3)(half3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v4f16_v4f16, _Rhalf4)(half4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v8f16_v8f16, _Rhalf8)(half8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v16f16_v16f16, _Rhalf16)(half16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v2f16_v2f16, _Rhalf2_rte)(half2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v3f16_v3f16, _Rhalf3_rte)(half3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v4f16_v4f16, _Rhalf4_rte)(half4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v8f16_v8f16, _Rhalf8_rte)(half8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v16f16_v16f16, _Rhalf16_rte)(half16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v2f16_v2f16, _Rhalf2_rtz)(half2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v3f16_v3f16, _Rhalf3_rtz)(half3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v4f16_v4f16, _Rhalf4_rtz)(half4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v8f16_v8f16, _Rhalf8_rtz)(half8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v16f16_v16f16, _Rhalf16_rtz)(half16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v2f16_v2f16, _Rhalf2_rtp)(half2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v3f16_v3f16, _Rhalf3_rtp)(half3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v4f16_v4f16, _Rhalf4_rtp)(half4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v8f16_v8f16, _Rhalf8_rtp)(half8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v16f16_v16f16, _Rhalf16_rtp)(half16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v2f16_v2f16, _Rhalf2_rtn)(half2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v3f16_v3f16, _Rhalf3_rtn)(half3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v4f16_v4f16, _Rhalf4_rtn)(half4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v8f16_v8f16, _Rhalf8_rtn)(half8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v16f16_v16f16, _Rhalf16_rtn)(half16 x);
#if defined(cl_khr_fp64)
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v2f16_v2f64, _Rhalf2)(double2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v3f16_v3f64, _Rhalf3)(double3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v4f16_v4f64, _Rhalf4)(double4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v8f16_v8f64, _Rhalf8)(double8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v16f16_v16f64, _Rhalf16)(double16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v2f16_v2f64, _Rhalf2_rte)(double2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v3f16_v3f64, _Rhalf3_rte)(double3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v4f16_v4f64, _Rhalf4_rte)(double4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v8f16_v8f64, _Rhalf8_rte)(double8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v16f16_v16f64, _Rhalf16_rte)(double16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v2f16_v2f64, _Rhalf2_rtz)(double2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v3f16_v3f64, _Rhalf3_rtz)(double3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v4f16_v4f64, _Rhalf4_rtz)(double4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v8f16_v8f64, _Rhalf8_rtz)(double8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v16f16_v16f64, _Rhalf16_rtz)(double16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v2f16_v2f64, _Rhalf2_rtp)(double2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v3f16_v3f64, _Rhalf3_rtp)(double3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v4f16_v4f64, _Rhalf4_rtp)(double4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v8f16_v8f64, _Rhalf8_rtp)(double8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v16f16_v16f64, _Rhalf16_rtp)(double16 x);
half2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v2f16_v2f64, _Rhalf2_rtn)(double2 x);
half3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v3f16_v3f64, _Rhalf3_rtn)(double3 x);
half4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v4f16_v4f64, _Rhalf4_rtn)(double4 x);
half8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v8f16_v8f64, _Rhalf8_rtn)(double8 x);
half16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v16f16_v16f64, _Rhalf16_rtn)(double16 x);
#endif // defined(cl_khr_fp64)
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v2f32_v2f32, _Rfloat2)(float2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v3f32_v3f32, _Rfloat3)(float3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v4f32_v4f32, _Rfloat4)(float4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v8f32_v8f32, _Rfloat8)(float8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v16f32_v16f32, _Rfloat16)(float16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v2f32_v2f32, _Rfloat2_rte)(float2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v3f32_v3f32, _Rfloat3_rte)(float3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v4f32_v4f32, _Rfloat4_rte)(float4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v8f32_v8f32, _Rfloat8_rte)(float8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v16f32_v16f32, _Rfloat16_rte)(float16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v2f32_v2f32, _Rfloat2_rtz)(float2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v3f32_v3f32, _Rfloat3_rtz)(float3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v4f32_v4f32, _Rfloat4_rtz)(float4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v8f32_v8f32, _Rfloat8_rtz)(float8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v16f32_v16f32, _Rfloat16_rtz)(float16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v2f32_v2f32, _Rfloat2_rtp)(float2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v3f32_v3f32, _Rfloat3_rtp)(float3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v4f32_v4f32, _Rfloat4_rtp)(float4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v8f32_v8f32, _Rfloat8_rtp)(float8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v16f32_v16f32, _Rfloat16_rtp)(float16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v2f32_v2f32, _Rfloat2_rtn)(float2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v3f32_v3f32, _Rfloat3_rtn)(float3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v4f32_v4f32, _Rfloat4_rtn)(float4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v8f32_v8f32, _Rfloat8_rtn)(float8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v16f32_v16f32, _Rfloat16_rtn)(float16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v2f32_v2f16, _Rfloat2)(half2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v3f32_v3f16, _Rfloat3)(half3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v4f32_v4f16, _Rfloat4)(half4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v8f32_v8f16, _Rfloat8)(half8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v16f32_v16f16, _Rfloat16)(half16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v2f32_v2f16, _Rfloat2_rte)(half2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v3f32_v3f16, _Rfloat3_rte)(half3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v4f32_v4f16, _Rfloat4_rte)(half4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v8f32_v8f16, _Rfloat8_rte)(half8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v16f32_v16f16, _Rfloat16_rte)(half16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v2f32_v2f16, _Rfloat2_rtz)(half2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v3f32_v3f16, _Rfloat3_rtz)(half3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v4f32_v4f16, _Rfloat4_rtz)(half4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v8f32_v8f16, _Rfloat8_rtz)(half8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v16f32_v16f16, _Rfloat16_rtz)(half16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v2f32_v2f16, _Rfloat2_rtp)(half2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v3f32_v3f16, _Rfloat3_rtp)(half3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v4f32_v4f16, _Rfloat4_rtp)(half4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v8f32_v8f16, _Rfloat8_rtp)(half8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v16f32_v16f16, _Rfloat16_rtp)(half16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v2f32_v2f16, _Rfloat2_rtn)(half2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v3f32_v3f16, _Rfloat3_rtn)(half3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v4f32_v4f16, _Rfloat4_rtn)(half4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v8f32_v8f16, _Rfloat8_rtn)(half8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v16f32_v16f16, _Rfloat16_rtn)(half16 x);
#if defined(cl_khr_fp64)
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v2f32_v2f64, _Rfloat2)(double2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v3f32_v3f64, _Rfloat3)(double3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v4f32_v4f64, _Rfloat4)(double4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v8f32_v8f64, _Rfloat8)(double8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v16f32_v16f64, _Rfloat16)(double16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v2f32_v2f64, _Rfloat2_rte)(double2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v3f32_v3f64, _Rfloat3_rte)(double3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v4f32_v4f64, _Rfloat4_rte)(double4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v8f32_v8f64, _Rfloat8_rte)(double8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v16f32_v16f64, _Rfloat16_rte)(double16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v2f32_v2f64, _Rfloat2_rtz)(double2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v3f32_v3f64, _Rfloat3_rtz)(double3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v4f32_v4f64, _Rfloat4_rtz)(double4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v8f32_v8f64, _Rfloat8_rtz)(double8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v16f32_v16f64, _Rfloat16_rtz)(double16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v2f32_v2f64, _Rfloat2_rtp)(double2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v3f32_v3f64, _Rfloat3_rtp)(double3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v4f32_v4f64, _Rfloat4_rtp)(double4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v8f32_v8f64, _Rfloat8_rtp)(double8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v16f32_v16f64, _Rfloat16_rtp)(double16 x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v2f32_v2f64, _Rfloat2_rtn)(double2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v3f32_v3f64, _Rfloat3_rtn)(double3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v4f32_v4f64, _Rfloat4_rtn)(double4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v8f32_v8f64, _Rfloat8_rtn)(double8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v16f32_v16f64, _Rfloat16_rtn)(double16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v2f64_v2f32, _Rdouble2)(float2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v3f64_v3f32, _Rdouble3)(float3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v4f64_v4f32, _Rdouble4)(float4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v8f64_v8f32, _Rdouble8)(float8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v16f64_v16f32, _Rdouble16)(float16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v2f64_v2f32, _Rdouble2_rte)(float2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v3f64_v3f32, _Rdouble3_rte)(float3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v4f64_v4f32, _Rdouble4_rte)(float4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v8f64_v8f32, _Rdouble8_rte)(float8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v16f64_v16f32, _Rdouble16_rte)(float16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v2f64_v2f32, _Rdouble2_rtz)(float2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v3f64_v3f32, _Rdouble3_rtz)(float3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v4f64_v4f32, _Rdouble4_rtz)(float4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v8f64_v8f32, _Rdouble8_rtz)(float8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v16f64_v16f32, _Rdouble16_rtz)(float16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v2f64_v2f32, _Rdouble2_rtp)(float2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v3f64_v3f32, _Rdouble3_rtp)(float3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v4f64_v4f32, _Rdouble4_rtp)(float4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v8f64_v8f32, _Rdouble8_rtp)(float8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v16f64_v16f32, _Rdouble16_rtp)(float16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v2f64_v2f32, _Rdouble2_rtn)(float2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v3f64_v3f32, _Rdouble3_rtn)(float3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v4f64_v4f32, _Rdouble4_rtn)(float4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v8f64_v8f32, _Rdouble8_rtn)(float8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v16f64_v16f32, _Rdouble16_rtn)(float16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v2f64_v2f16, _Rdouble2)(half2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v3f64_v3f16, _Rdouble3)(half3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v4f64_v4f16, _Rdouble4)(half4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v8f64_v8f16, _Rdouble8)(half8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v16f64_v16f16, _Rdouble16)(half16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v2f64_v2f16, _Rdouble2_rte)(half2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v3f64_v3f16, _Rdouble3_rte)(half3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v4f64_v4f16, _Rdouble4_rte)(half4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v8f64_v8f16, _Rdouble8_rte)(half8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v16f64_v16f16, _Rdouble16_rte)(half16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v2f64_v2f16, _Rdouble2_rtz)(half2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v3f64_v3f16, _Rdouble3_rtz)(half3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v4f64_v4f16, _Rdouble4_rtz)(half4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v8f64_v8f16, _Rdouble8_rtz)(half8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v16f64_v16f16, _Rdouble16_rtz)(half16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v2f64_v2f16, _Rdouble2_rtp)(half2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v3f64_v3f16, _Rdouble3_rtp)(half3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v4f64_v4f16, _Rdouble4_rtp)(half4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v8f64_v8f16, _Rdouble8_rtp)(half8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v16f64_v16f16, _Rdouble16_rtp)(half16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v2f64_v2f16, _Rdouble2_rtn)(half2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v3f64_v3f16, _Rdouble3_rtn)(half3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v4f64_v4f16, _Rdouble4_rtn)(half4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v8f64_v8f16, _Rdouble8_rtn)(half8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v16f64_v16f16, _Rdouble16_rtn)(half16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v2f64_v2f64, _Rdouble2)(double2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v3f64_v3f64, _Rdouble3)(double3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v4f64_v4f64, _Rdouble4)(double4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v8f64_v8f64, _Rdouble8)(double8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _v16f64_v16f64, _Rdouble16)(double16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v2f64_v2f64, _Rdouble2_rte)(double2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v3f64_v3f64, _Rdouble3_rte)(double3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v4f64_v4f64, _Rdouble4_rte)(double4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v8f64_v8f64, _Rdouble8_rte)(double8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTE_v16f64_v16f64, _Rdouble16_rte)(double16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v2f64_v2f64, _Rdouble2_rtz)(double2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v3f64_v3f64, _Rdouble3_rtz)(double3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v4f64_v4f64, _Rdouble4_rtz)(double4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v8f64_v8f64, _Rdouble8_rtz)(double8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTZ_v16f64_v16f64, _Rdouble16_rtz)(double16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v2f64_v2f64, _Rdouble2_rtp)(double2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v3f64_v3f64, _Rdouble3_rtp)(double3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v4f64_v4f64, _Rdouble4_rtp)(double4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v8f64_v8f64, _Rdouble8_rtp)(double8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTP_v16f64_v16f64, _Rdouble16_rtp)(double16 x);
double2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v2f64_v2f64, _Rdouble2_rtn)(double2 x);
double3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v3f64_v3f64, _Rdouble3_rtn)(double3 x);
double4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v4f64_v4f64, _Rdouble4_rtn)(double4 x);
double8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v8f64_v8f64, _Rdouble8_rtn)(double8 x);
double16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(FConvert, _RTN_v16f64_v16f64, _Rdouble16_rtn)(double16 x);
#endif // defined(cl_khr_fp64)
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v2i8_v2i8, _Rchar2)(char2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v3i8_v3i8, _Rchar3)(char3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v4i8_v4i8, _Rchar4)(char4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v8i8_v8i8, _Rchar8)(char8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v16i8_v16i8, _Rchar16)(char16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v2i8_v2i8, _Rchar2_sat)(char2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v3i8_v3i8, _Rchar3_sat)(char3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v4i8_v4i8, _Rchar4_sat)(char4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v8i8_v8i8, _Rchar8_sat)(char8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v16i8_v16i8, _Rchar16_sat)(char16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v2i8_v2i16, _Rchar2)(short2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v3i8_v3i16, _Rchar3)(short3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v4i8_v4i16, _Rchar4)(short4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v8i8_v8i16, _Rchar8)(short8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v16i8_v16i16, _Rchar16)(short16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v2i8_v2i16, _Rchar2_sat)(short2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v3i8_v3i16, _Rchar3_sat)(short3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v4i8_v4i16, _Rchar4_sat)(short4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v8i8_v8i16, _Rchar8_sat)(short8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v16i8_v16i16, _Rchar16_sat)(short16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v2i8_v2i32, _Rchar2)(int2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v3i8_v3i32, _Rchar3)(int3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v4i8_v4i32, _Rchar4)(int4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v8i8_v8i32, _Rchar8)(int8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v16i8_v16i32, _Rchar16)(int16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v2i8_v2i32, _Rchar2_sat)(int2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v3i8_v3i32, _Rchar3_sat)(int3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v4i8_v4i32, _Rchar4_sat)(int4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v8i8_v8i32, _Rchar8_sat)(int8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v16i8_v16i32, _Rchar16_sat)(int16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v2i8_v2i64, _Rchar2)(long2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v3i8_v3i64, _Rchar3)(long3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v4i8_v4i64, _Rchar4)(long4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v8i8_v8i64, _Rchar8)(long8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v16i8_v16i64, _Rchar16)(long16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v2i8_v2i64, _Rchar2_sat)(long2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v3i8_v3i64, _Rchar3_sat)(long3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v4i8_v4i64, _Rchar4_sat)(long4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v8i8_v8i64, _Rchar8_sat)(long8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v16i8_v16i64, _Rchar16_sat)(long16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v2i16_v2i8, _Rshort2)(char2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v3i16_v3i8, _Rshort3)(char3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v4i16_v4i8, _Rshort4)(char4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v8i16_v8i8, _Rshort8)(char8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v16i16_v16i8, _Rshort16)(char16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v2i16_v2i8, _Rshort2_sat)(char2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v3i16_v3i8, _Rshort3_sat)(char3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v4i16_v4i8, _Rshort4_sat)(char4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v8i16_v8i8, _Rshort8_sat)(char8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v16i16_v16i8, _Rshort16_sat)(char16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v2i16_v2i16, _Rshort2)(short2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v3i16_v3i16, _Rshort3)(short3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v4i16_v4i16, _Rshort4)(short4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v8i16_v8i16, _Rshort8)(short8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v16i16_v16i16, _Rshort16)(short16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v2i16_v2i16, _Rshort2_sat)(short2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v3i16_v3i16, _Rshort3_sat)(short3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v4i16_v4i16, _Rshort4_sat)(short4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v8i16_v8i16, _Rshort8_sat)(short8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v16i16_v16i16, _Rshort16_sat)(short16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v2i16_v2i32, _Rshort2)(int2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v3i16_v3i32, _Rshort3)(int3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v4i16_v4i32, _Rshort4)(int4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v8i16_v8i32, _Rshort8)(int8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v16i16_v16i32, _Rshort16)(int16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v2i16_v2i32, _Rshort2_sat)(int2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v3i16_v3i32, _Rshort3_sat)(int3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v4i16_v4i32, _Rshort4_sat)(int4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v8i16_v8i32, _Rshort8_sat)(int8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v16i16_v16i32, _Rshort16_sat)(int16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v2i16_v2i64, _Rshort2)(long2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v3i16_v3i64, _Rshort3)(long3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v4i16_v4i64, _Rshort4)(long4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v8i16_v8i64, _Rshort8)(long8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v16i16_v16i64, _Rshort16)(long16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v2i16_v2i64, _Rshort2_sat)(long2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v3i16_v3i64, _Rshort3_sat)(long3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v4i16_v4i64, _Rshort4_sat)(long4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v8i16_v8i64, _Rshort8_sat)(long8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v16i16_v16i64, _Rshort16_sat)(long16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v2i32_v2i8, _Rint2)(char2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v3i32_v3i8, _Rint3)(char3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v4i32_v4i8, _Rint4)(char4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v8i32_v8i8, _Rint8)(char8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v16i32_v16i8, _Rint16)(char16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v2i32_v2i8, _Rint2_sat)(char2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v3i32_v3i8, _Rint3_sat)(char3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v4i32_v4i8, _Rint4_sat)(char4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v8i32_v8i8, _Rint8_sat)(char8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v16i32_v16i8, _Rint16_sat)(char16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v2i32_v2i16, _Rint2)(short2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v3i32_v3i16, _Rint3)(short3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v4i32_v4i16, _Rint4)(short4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v8i32_v8i16, _Rint8)(short8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v16i32_v16i16, _Rint16)(short16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v2i32_v2i16, _Rint2_sat)(short2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v3i32_v3i16, _Rint3_sat)(short3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v4i32_v4i16, _Rint4_sat)(short4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v8i32_v8i16, _Rint8_sat)(short8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v16i32_v16i16, _Rint16_sat)(short16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v2i32_v2i32, _Rint2)(int2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v3i32_v3i32, _Rint3)(int3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v4i32_v4i32, _Rint4)(int4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v8i32_v8i32, _Rint8)(int8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v16i32_v16i32, _Rint16)(int16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v2i32_v2i32, _Rint2_sat)(int2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v3i32_v3i32, _Rint3_sat)(int3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v4i32_v4i32, _Rint4_sat)(int4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v8i32_v8i32, _Rint8_sat)(int8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v16i32_v16i32, _Rint16_sat)(int16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v2i32_v2i64, _Rint2)(long2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v3i32_v3i64, _Rint3)(long3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v4i32_v4i64, _Rint4)(long4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v8i32_v8i64, _Rint8)(long8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v16i32_v16i64, _Rint16)(long16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v2i32_v2i64, _Rint2_sat)(long2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v3i32_v3i64, _Rint3_sat)(long3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v4i32_v4i64, _Rint4_sat)(long4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v8i32_v8i64, _Rint8_sat)(long8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v16i32_v16i64, _Rint16_sat)(long16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v2i64_v2i8, _Rlong2)(char2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v3i64_v3i8, _Rlong3)(char3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v4i64_v4i8, _Rlong4)(char4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v8i64_v8i8, _Rlong8)(char8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v16i64_v16i8, _Rlong16)(char16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v2i64_v2i8, _Rlong2_sat)(char2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v3i64_v3i8, _Rlong3_sat)(char3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v4i64_v4i8, _Rlong4_sat)(char4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v8i64_v8i8, _Rlong8_sat)(char8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v16i64_v16i8, _Rlong16_sat)(char16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v2i64_v2i16, _Rlong2)(short2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v3i64_v3i16, _Rlong3)(short3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v4i64_v4i16, _Rlong4)(short4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v8i64_v8i16, _Rlong8)(short8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v16i64_v16i16, _Rlong16)(short16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v2i64_v2i16, _Rlong2_sat)(short2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v3i64_v3i16, _Rlong3_sat)(short3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v4i64_v4i16, _Rlong4_sat)(short4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v8i64_v8i16, _Rlong8_sat)(short8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v16i64_v16i16, _Rlong16_sat)(short16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v2i64_v2i32, _Rlong2)(int2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v3i64_v3i32, _Rlong3)(int3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v4i64_v4i32, _Rlong4)(int4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v8i64_v8i32, _Rlong8)(int8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v16i64_v16i32, _Rlong16)(int16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v2i64_v2i32, _Rlong2_sat)(int2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v3i64_v3i32, _Rlong3_sat)(int3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v4i64_v4i32, _Rlong4_sat)(int4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v8i64_v8i32, _Rlong8_sat)(int8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v16i64_v16i32, _Rlong16_sat)(int16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v2i64_v2i64, _Rlong2)(long2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v3i64_v3i64, _Rlong3)(long3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v4i64_v4i64, _Rlong4)(long4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v8i64_v8i64, _Rlong8)(long8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _v16i64_v16i64, _Rlong16)(long16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v2i64_v2i64, _Rlong2_sat)(long2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v3i64_v3i64, _Rlong3_sat)(long3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v4i64_v4i64, _Rlong4_sat)(long4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v8i64_v8i64, _Rlong8_sat)(long8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SConvert, _Sat_v16i64_v16i64, _Rlong16_sat)(long16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v2i8_v2i8, _Ruchar2)(uchar2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v3i8_v3i8, _Ruchar3)(uchar3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v4i8_v4i8, _Ruchar4)(uchar4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v8i8_v8i8, _Ruchar8)(uchar8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v16i8_v16i8, _Ruchar16)(uchar16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v2i8_v2i8, _Ruchar2_sat)(uchar2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v3i8_v3i8, _Ruchar3_sat)(uchar3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v4i8_v4i8, _Ruchar4_sat)(uchar4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v8i8_v8i8, _Ruchar8_sat)(uchar8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v16i8_v16i8, _Ruchar16_sat)(uchar16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v2i8_v2i16, _Ruchar2)(ushort2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v3i8_v3i16, _Ruchar3)(ushort3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v4i8_v4i16, _Ruchar4)(ushort4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v8i8_v8i16, _Ruchar8)(ushort8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v16i8_v16i16, _Ruchar16)(ushort16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v2i8_v2i16, _Ruchar2_sat)(ushort2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v3i8_v3i16, _Ruchar3_sat)(ushort3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v4i8_v4i16, _Ruchar4_sat)(ushort4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v8i8_v8i16, _Ruchar8_sat)(ushort8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v16i8_v16i16, _Ruchar16_sat)(ushort16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v2i8_v2i32, _Ruchar2)(uint2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v3i8_v3i32, _Ruchar3)(uint3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v4i8_v4i32, _Ruchar4)(uint4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v8i8_v8i32, _Ruchar8)(uint8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v16i8_v16i32, _Ruchar16)(uint16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v2i8_v2i32, _Ruchar2_sat)(uint2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v3i8_v3i32, _Ruchar3_sat)(uint3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v4i8_v4i32, _Ruchar4_sat)(uint4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v8i8_v8i32, _Ruchar8_sat)(uint8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v16i8_v16i32, _Ruchar16_sat)(uint16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v2i8_v2i64, _Ruchar2)(ulong2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v3i8_v3i64, _Ruchar3)(ulong3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v4i8_v4i64, _Ruchar4)(ulong4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v8i8_v8i64, _Ruchar8)(ulong8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v16i8_v16i64, _Ruchar16)(ulong16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v2i8_v2i64, _Ruchar2_sat)(ulong2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v3i8_v3i64, _Ruchar3_sat)(ulong3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v4i8_v4i64, _Ruchar4_sat)(ulong4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v8i8_v8i64, _Ruchar8_sat)(ulong8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v16i8_v16i64, _Ruchar16_sat)(ulong16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v2i16_v2i8, _Rushort2)(uchar2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v3i16_v3i8, _Rushort3)(uchar3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v4i16_v4i8, _Rushort4)(uchar4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v8i16_v8i8, _Rushort8)(uchar8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v16i16_v16i8, _Rushort16)(uchar16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v2i16_v2i8, _Rushort2_sat)(uchar2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v3i16_v3i8, _Rushort3_sat)(uchar3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v4i16_v4i8, _Rushort4_sat)(uchar4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v8i16_v8i8, _Rushort8_sat)(uchar8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v16i16_v16i8, _Rushort16_sat)(uchar16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v2i16_v2i16, _Rushort2)(ushort2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v3i16_v3i16, _Rushort3)(ushort3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v4i16_v4i16, _Rushort4)(ushort4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v8i16_v8i16, _Rushort8)(ushort8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v16i16_v16i16, _Rushort16)(ushort16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v2i16_v2i16, _Rushort2_sat)(ushort2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v3i16_v3i16, _Rushort3_sat)(ushort3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v4i16_v4i16, _Rushort4_sat)(ushort4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v8i16_v8i16, _Rushort8_sat)(ushort8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v16i16_v16i16, _Rushort16_sat)(ushort16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v2i16_v2i32, _Rushort2)(uint2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v3i16_v3i32, _Rushort3)(uint3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v4i16_v4i32, _Rushort4)(uint4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v8i16_v8i32, _Rushort8)(uint8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v16i16_v16i32, _Rushort16)(uint16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v2i16_v2i32, _Rushort2_sat)(uint2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v3i16_v3i32, _Rushort3_sat)(uint3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v4i16_v4i32, _Rushort4_sat)(uint4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v8i16_v8i32, _Rushort8_sat)(uint8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v16i16_v16i32, _Rushort16_sat)(uint16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v2i16_v2i64, _Rushort2)(ulong2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v3i16_v3i64, _Rushort3)(ulong3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v4i16_v4i64, _Rushort4)(ulong4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v8i16_v8i64, _Rushort8)(ulong8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v16i16_v16i64, _Rushort16)(ulong16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v2i16_v2i64, _Rushort2_sat)(ulong2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v3i16_v3i64, _Rushort3_sat)(ulong3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v4i16_v4i64, _Rushort4_sat)(ulong4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v8i16_v8i64, _Rushort8_sat)(ulong8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v16i16_v16i64, _Rushort16_sat)(ulong16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v2i32_v2i8, _Ruint2)(uchar2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v3i32_v3i8, _Ruint3)(uchar3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v4i32_v4i8, _Ruint4)(uchar4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v8i32_v8i8, _Ruint8)(uchar8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v16i32_v16i8, _Ruint16)(uchar16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v2i32_v2i8, _Ruint2_sat)(uchar2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v3i32_v3i8, _Ruint3_sat)(uchar3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v4i32_v4i8, _Ruint4_sat)(uchar4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v8i32_v8i8, _Ruint8_sat)(uchar8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v16i32_v16i8, _Ruint16_sat)(uchar16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v2i32_v2i16, _Ruint2)(ushort2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v3i32_v3i16, _Ruint3)(ushort3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v4i32_v4i16, _Ruint4)(ushort4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v8i32_v8i16, _Ruint8)(ushort8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v16i32_v16i16, _Ruint16)(ushort16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v2i32_v2i16, _Ruint2_sat)(ushort2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v3i32_v3i16, _Ruint3_sat)(ushort3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v4i32_v4i16, _Ruint4_sat)(ushort4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v8i32_v8i16, _Ruint8_sat)(ushort8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v16i32_v16i16, _Ruint16_sat)(ushort16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v2i32_v2i32, _Ruint2)(uint2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v3i32_v3i32, _Ruint3)(uint3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v4i32_v4i32, _Ruint4)(uint4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v8i32_v8i32, _Ruint8)(uint8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v16i32_v16i32, _Ruint16)(uint16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v2i32_v2i32, _Ruint2_sat)(uint2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v3i32_v3i32, _Ruint3_sat)(uint3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v4i32_v4i32, _Ruint4_sat)(uint4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v8i32_v8i32, _Ruint8_sat)(uint8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v16i32_v16i32, _Ruint16_sat)(uint16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v2i32_v2i64, _Ruint2)(ulong2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v3i32_v3i64, _Ruint3)(ulong3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v4i32_v4i64, _Ruint4)(ulong4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v8i32_v8i64, _Ruint8)(ulong8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v16i32_v16i64, _Ruint16)(ulong16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v2i32_v2i64, _Ruint2_sat)(ulong2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v3i32_v3i64, _Ruint3_sat)(ulong3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v4i32_v4i64, _Ruint4_sat)(ulong4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v8i32_v8i64, _Ruint8_sat)(ulong8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v16i32_v16i64, _Ruint16_sat)(ulong16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v2i64_v2i8, _Rulong2)(uchar2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v3i64_v3i8, _Rulong3)(uchar3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v4i64_v4i8, _Rulong4)(uchar4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v8i64_v8i8, _Rulong8)(uchar8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v16i64_v16i8, _Rulong16)(uchar16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v2i64_v2i8, _Rulong2_sat)(uchar2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v3i64_v3i8, _Rulong3_sat)(uchar3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v4i64_v4i8, _Rulong4_sat)(uchar4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v8i64_v8i8, _Rulong8_sat)(uchar8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v16i64_v16i8, _Rulong16_sat)(uchar16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v2i64_v2i16, _Rulong2)(ushort2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v3i64_v3i16, _Rulong3)(ushort3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v4i64_v4i16, _Rulong4)(ushort4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v8i64_v8i16, _Rulong8)(ushort8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v16i64_v16i16, _Rulong16)(ushort16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v2i64_v2i16, _Rulong2_sat)(ushort2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v3i64_v3i16, _Rulong3_sat)(ushort3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v4i64_v4i16, _Rulong4_sat)(ushort4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v8i64_v8i16, _Rulong8_sat)(ushort8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v16i64_v16i16, _Rulong16_sat)(ushort16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v2i64_v2i32, _Rulong2)(uint2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v3i64_v3i32, _Rulong3)(uint3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v4i64_v4i32, _Rulong4)(uint4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v8i64_v8i32, _Rulong8)(uint8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v16i64_v16i32, _Rulong16)(uint16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v2i64_v2i32, _Rulong2_sat)(uint2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v3i64_v3i32, _Rulong3_sat)(uint3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v4i64_v4i32, _Rulong4_sat)(uint4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v8i64_v8i32, _Rulong8_sat)(uint8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v16i64_v16i32, _Rulong16_sat)(uint16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v2i64_v2i64, _Rulong2)(ulong2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v3i64_v3i64, _Rulong3)(ulong3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v4i64_v4i64, _Rulong4)(ulong4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v8i64_v8i64, _Rulong8)(ulong8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _v16i64_v16i64, _Rulong16)(ulong16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v2i64_v2i64, _Rulong2_sat)(ulong2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v3i64_v3i64, _Rulong3_sat)(ulong3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v4i64_v4i64, _Rulong4_sat)(ulong4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v8i64_v8i64, _Rulong8_sat)(ulong8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UConvert, _Sat_v16i64_v16i64, _Rulong16_sat)(ulong16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v2i8_v2f32, _Rchar2)(float2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v3i8_v3f32, _Rchar3)(float3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v4i8_v4f32, _Rchar4)(float4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v8i8_v8f32, _Rchar8)(float8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v16i8_v16f32, _Rchar16)(float16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v2i8_v2f32, _Rchar2_sat)(float2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v3i8_v3f32, _Rchar3_sat)(float3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v4i8_v4f32, _Rchar4_sat)(float4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v8i8_v8f32, _Rchar8_sat)(float8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v16i8_v16f32, _Rchar16_sat)(float16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v2i8_v2f32, _Rchar2_rte)(float2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v3i8_v3f32, _Rchar3_rte)(float3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v4i8_v4f32, _Rchar4_rte)(float4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v8i8_v8f32, _Rchar8_rte)(float8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v16i8_v16f32, _Rchar16_rte)(float16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v2i8_v2f32, _Rchar2_rtz)(float2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v3i8_v3f32, _Rchar3_rtz)(float3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v4i8_v4f32, _Rchar4_rtz)(float4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v8i8_v8f32, _Rchar8_rtz)(float8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v16i8_v16f32, _Rchar16_rtz)(float16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v2i8_v2f32, _Rchar2_rtp)(float2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v3i8_v3f32, _Rchar3_rtp)(float3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v4i8_v4f32, _Rchar4_rtp)(float4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v8i8_v8f32, _Rchar8_rtp)(float8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v16i8_v16f32, _Rchar16_rtp)(float16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v2i8_v2f32, _Rchar2_rtn)(float2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v3i8_v3f32, _Rchar3_rtn)(float3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v4i8_v4f32, _Rchar4_rtn)(float4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v8i8_v8f32, _Rchar8_rtn)(float8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v16i8_v16f32, _Rchar16_rtn)(float16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v2i8_v2f32, _Rchar2_sat_rte)(float2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v3i8_v3f32, _Rchar3_sat_rte)(float3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v4i8_v4f32, _Rchar4_sat_rte)(float4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v8i8_v8f32, _Rchar8_sat_rte)(float8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v16i8_v16f32, _Rchar16_sat_rte)(float16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v2i8_v2f32, _Rchar2_sat_rtz)(float2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v3i8_v3f32, _Rchar3_sat_rtz)(float3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v4i8_v4f32, _Rchar4_sat_rtz)(float4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v8i8_v8f32, _Rchar8_sat_rtz)(float8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v16i8_v16f32, _Rchar16_sat_rtz)(float16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v2i8_v2f32, _Rchar2_sat_rtp)(float2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v3i8_v3f32, _Rchar3_sat_rtp)(float3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v4i8_v4f32, _Rchar4_sat_rtp)(float4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v8i8_v8f32, _Rchar8_sat_rtp)(float8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v16i8_v16f32, _Rchar16_sat_rtp)(float16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v2i8_v2f32, _Rchar2_sat_rtn)(float2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v3i8_v3f32, _Rchar3_sat_rtn)(float3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v4i8_v4f32, _Rchar4_sat_rtn)(float4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v8i8_v8f32, _Rchar8_sat_rtn)(float8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v16i8_v16f32, _Rchar16_sat_rtn)(float16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v2i8_v2f16, _Rchar2)(half2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v3i8_v3f16, _Rchar3)(half3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v4i8_v4f16, _Rchar4)(half4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v8i8_v8f16, _Rchar8)(half8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v16i8_v16f16, _Rchar16)(half16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v2i8_v2f16, _Rchar2_sat)(half2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v3i8_v3f16, _Rchar3_sat)(half3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v4i8_v4f16, _Rchar4_sat)(half4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v8i8_v8f16, _Rchar8_sat)(half8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v16i8_v16f16, _Rchar16_sat)(half16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v2i8_v2f16, _Rchar2_rte)(half2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v3i8_v3f16, _Rchar3_rte)(half3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v4i8_v4f16, _Rchar4_rte)(half4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v8i8_v8f16, _Rchar8_rte)(half8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v16i8_v16f16, _Rchar16_rte)(half16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v2i8_v2f16, _Rchar2_rtz)(half2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v3i8_v3f16, _Rchar3_rtz)(half3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v4i8_v4f16, _Rchar4_rtz)(half4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v8i8_v8f16, _Rchar8_rtz)(half8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v16i8_v16f16, _Rchar16_rtz)(half16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v2i8_v2f16, _Rchar2_rtp)(half2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v3i8_v3f16, _Rchar3_rtp)(half3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v4i8_v4f16, _Rchar4_rtp)(half4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v8i8_v8f16, _Rchar8_rtp)(half8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v16i8_v16f16, _Rchar16_rtp)(half16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v2i8_v2f16, _Rchar2_rtn)(half2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v3i8_v3f16, _Rchar3_rtn)(half3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v4i8_v4f16, _Rchar4_rtn)(half4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v8i8_v8f16, _Rchar8_rtn)(half8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v16i8_v16f16, _Rchar16_rtn)(half16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v2i8_v2f16, _Rchar2_sat_rte)(half2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v3i8_v3f16, _Rchar3_sat_rte)(half3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v4i8_v4f16, _Rchar4_sat_rte)(half4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v8i8_v8f16, _Rchar8_sat_rte)(half8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v16i8_v16f16, _Rchar16_sat_rte)(half16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v2i8_v2f16, _Rchar2_sat_rtz)(half2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v3i8_v3f16, _Rchar3_sat_rtz)(half3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v4i8_v4f16, _Rchar4_sat_rtz)(half4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v8i8_v8f16, _Rchar8_sat_rtz)(half8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v16i8_v16f16, _Rchar16_sat_rtz)(half16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v2i8_v2f16, _Rchar2_sat_rtp)(half2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v3i8_v3f16, _Rchar3_sat_rtp)(half3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v4i8_v4f16, _Rchar4_sat_rtp)(half4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v8i8_v8f16, _Rchar8_sat_rtp)(half8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v16i8_v16f16, _Rchar16_sat_rtp)(half16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v2i8_v2f16, _Rchar2_sat_rtn)(half2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v3i8_v3f16, _Rchar3_sat_rtn)(half3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v4i8_v4f16, _Rchar4_sat_rtn)(half4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v8i8_v8f16, _Rchar8_sat_rtn)(half8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v16i8_v16f16, _Rchar16_sat_rtn)(half16 x);
#if defined(cl_khr_fp64)
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v2i8_v2f64, _Rchar2)(double2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v3i8_v3f64, _Rchar3)(double3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v4i8_v4f64, _Rchar4)(double4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v8i8_v8f64, _Rchar8)(double8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v16i8_v16f64, _Rchar16)(double16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v2i8_v2f64, _Rchar2_sat)(double2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v3i8_v3f64, _Rchar3_sat)(double3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v4i8_v4f64, _Rchar4_sat)(double4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v8i8_v8f64, _Rchar8_sat)(double8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v16i8_v16f64, _Rchar16_sat)(double16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v2i8_v2f64, _Rchar2_rte)(double2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v3i8_v3f64, _Rchar3_rte)(double3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v4i8_v4f64, _Rchar4_rte)(double4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v8i8_v8f64, _Rchar8_rte)(double8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v16i8_v16f64, _Rchar16_rte)(double16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v2i8_v2f64, _Rchar2_rtz)(double2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v3i8_v3f64, _Rchar3_rtz)(double3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v4i8_v4f64, _Rchar4_rtz)(double4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v8i8_v8f64, _Rchar8_rtz)(double8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v16i8_v16f64, _Rchar16_rtz)(double16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v2i8_v2f64, _Rchar2_rtp)(double2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v3i8_v3f64, _Rchar3_rtp)(double3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v4i8_v4f64, _Rchar4_rtp)(double4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v8i8_v8f64, _Rchar8_rtp)(double8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v16i8_v16f64, _Rchar16_rtp)(double16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v2i8_v2f64, _Rchar2_rtn)(double2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v3i8_v3f64, _Rchar3_rtn)(double3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v4i8_v4f64, _Rchar4_rtn)(double4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v8i8_v8f64, _Rchar8_rtn)(double8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v16i8_v16f64, _Rchar16_rtn)(double16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v2i8_v2f64, _Rchar2_sat_rte)(double2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v3i8_v3f64, _Rchar3_sat_rte)(double3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v4i8_v4f64, _Rchar4_sat_rte)(double4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v8i8_v8f64, _Rchar8_sat_rte)(double8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v16i8_v16f64, _Rchar16_sat_rte)(double16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v2i8_v2f64, _Rchar2_sat_rtz)(double2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v3i8_v3f64, _Rchar3_sat_rtz)(double3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v4i8_v4f64, _Rchar4_sat_rtz)(double4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v8i8_v8f64, _Rchar8_sat_rtz)(double8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v16i8_v16f64, _Rchar16_sat_rtz)(double16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v2i8_v2f64, _Rchar2_sat_rtp)(double2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v3i8_v3f64, _Rchar3_sat_rtp)(double3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v4i8_v4f64, _Rchar4_sat_rtp)(double4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v8i8_v8f64, _Rchar8_sat_rtp)(double8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v16i8_v16f64, _Rchar16_sat_rtp)(double16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v2i8_v2f64, _Rchar2_sat_rtn)(double2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v3i8_v3f64, _Rchar3_sat_rtn)(double3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v4i8_v4f64, _Rchar4_sat_rtn)(double4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v8i8_v8f64, _Rchar8_sat_rtn)(double8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v16i8_v16f64, _Rchar16_sat_rtn)(double16 x);
#endif // defined(cl_khr_fp64)
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v2i16_v2f32, _Rshort2)(float2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v3i16_v3f32, _Rshort3)(float3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v4i16_v4f32, _Rshort4)(float4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v8i16_v8f32, _Rshort8)(float8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v16i16_v16f32, _Rshort16)(float16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v2i16_v2f32, _Rshort2_sat)(float2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v3i16_v3f32, _Rshort3_sat)(float3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v4i16_v4f32, _Rshort4_sat)(float4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v8i16_v8f32, _Rshort8_sat)(float8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v16i16_v16f32, _Rshort16_sat)(float16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v2i16_v2f32, _Rshort2_rte)(float2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v3i16_v3f32, _Rshort3_rte)(float3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v4i16_v4f32, _Rshort4_rte)(float4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v8i16_v8f32, _Rshort8_rte)(float8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v16i16_v16f32, _Rshort16_rte)(float16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v2i16_v2f32, _Rshort2_rtz)(float2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v3i16_v3f32, _Rshort3_rtz)(float3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v4i16_v4f32, _Rshort4_rtz)(float4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v8i16_v8f32, _Rshort8_rtz)(float8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v16i16_v16f32, _Rshort16_rtz)(float16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v2i16_v2f32, _Rshort2_rtp)(float2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v3i16_v3f32, _Rshort3_rtp)(float3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v4i16_v4f32, _Rshort4_rtp)(float4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v8i16_v8f32, _Rshort8_rtp)(float8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v16i16_v16f32, _Rshort16_rtp)(float16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v2i16_v2f32, _Rshort2_rtn)(float2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v3i16_v3f32, _Rshort3_rtn)(float3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v4i16_v4f32, _Rshort4_rtn)(float4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v8i16_v8f32, _Rshort8_rtn)(float8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v16i16_v16f32, _Rshort16_rtn)(float16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v2i16_v2f32, _Rshort2_sat_rte)(float2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v3i16_v3f32, _Rshort3_sat_rte)(float3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v4i16_v4f32, _Rshort4_sat_rte)(float4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v8i16_v8f32, _Rshort8_sat_rte)(float8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v16i16_v16f32, _Rshort16_sat_rte)(float16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v2i16_v2f32, _Rshort2_sat_rtz)(float2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v3i16_v3f32, _Rshort3_sat_rtz)(float3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v4i16_v4f32, _Rshort4_sat_rtz)(float4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v8i16_v8f32, _Rshort8_sat_rtz)(float8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v16i16_v16f32, _Rshort16_sat_rtz)(float16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v2i16_v2f32, _Rshort2_sat_rtp)(float2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v3i16_v3f32, _Rshort3_sat_rtp)(float3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v4i16_v4f32, _Rshort4_sat_rtp)(float4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v8i16_v8f32, _Rshort8_sat_rtp)(float8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v16i16_v16f32, _Rshort16_sat_rtp)(float16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v2i16_v2f32, _Rshort2_sat_rtn)(float2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v3i16_v3f32, _Rshort3_sat_rtn)(float3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v4i16_v4f32, _Rshort4_sat_rtn)(float4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v8i16_v8f32, _Rshort8_sat_rtn)(float8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v16i16_v16f32, _Rshort16_sat_rtn)(float16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v2i16_v2f16, _Rshort2)(half2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v3i16_v3f16, _Rshort3)(half3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v4i16_v4f16, _Rshort4)(half4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v8i16_v8f16, _Rshort8)(half8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v16i16_v16f16, _Rshort16)(half16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v2i16_v2f16, _Rshort2_sat)(half2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v3i16_v3f16, _Rshort3_sat)(half3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v4i16_v4f16, _Rshort4_sat)(half4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v8i16_v8f16, _Rshort8_sat)(half8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v16i16_v16f16, _Rshort16_sat)(half16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v2i16_v2f16, _Rshort2_rte)(half2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v3i16_v3f16, _Rshort3_rte)(half3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v4i16_v4f16, _Rshort4_rte)(half4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v8i16_v8f16, _Rshort8_rte)(half8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v16i16_v16f16, _Rshort16_rte)(half16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v2i16_v2f16, _Rshort2_rtz)(half2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v3i16_v3f16, _Rshort3_rtz)(half3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v4i16_v4f16, _Rshort4_rtz)(half4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v8i16_v8f16, _Rshort8_rtz)(half8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v16i16_v16f16, _Rshort16_rtz)(half16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v2i16_v2f16, _Rshort2_rtp)(half2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v3i16_v3f16, _Rshort3_rtp)(half3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v4i16_v4f16, _Rshort4_rtp)(half4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v8i16_v8f16, _Rshort8_rtp)(half8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v16i16_v16f16, _Rshort16_rtp)(half16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v2i16_v2f16, _Rshort2_rtn)(half2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v3i16_v3f16, _Rshort3_rtn)(half3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v4i16_v4f16, _Rshort4_rtn)(half4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v8i16_v8f16, _Rshort8_rtn)(half8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v16i16_v16f16, _Rshort16_rtn)(half16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v2i16_v2f16, _Rshort2_sat_rte)(half2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v3i16_v3f16, _Rshort3_sat_rte)(half3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v4i16_v4f16, _Rshort4_sat_rte)(half4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v8i16_v8f16, _Rshort8_sat_rte)(half8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v16i16_v16f16, _Rshort16_sat_rte)(half16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v2i16_v2f16, _Rshort2_sat_rtz)(half2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v3i16_v3f16, _Rshort3_sat_rtz)(half3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v4i16_v4f16, _Rshort4_sat_rtz)(half4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v8i16_v8f16, _Rshort8_sat_rtz)(half8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v16i16_v16f16, _Rshort16_sat_rtz)(half16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v2i16_v2f16, _Rshort2_sat_rtp)(half2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v3i16_v3f16, _Rshort3_sat_rtp)(half3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v4i16_v4f16, _Rshort4_sat_rtp)(half4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v8i16_v8f16, _Rshort8_sat_rtp)(half8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v16i16_v16f16, _Rshort16_sat_rtp)(half16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v2i16_v2f16, _Rshort2_sat_rtn)(half2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v3i16_v3f16, _Rshort3_sat_rtn)(half3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v4i16_v4f16, _Rshort4_sat_rtn)(half4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v8i16_v8f16, _Rshort8_sat_rtn)(half8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v16i16_v16f16, _Rshort16_sat_rtn)(half16 x);
#if defined(cl_khr_fp64)
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v2i16_v2f64, _Rshort2)(double2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v3i16_v3f64, _Rshort3)(double3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v4i16_v4f64, _Rshort4)(double4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v8i16_v8f64, _Rshort8)(double8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v16i16_v16f64, _Rshort16)(double16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v2i16_v2f64, _Rshort2_sat)(double2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v3i16_v3f64, _Rshort3_sat)(double3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v4i16_v4f64, _Rshort4_sat)(double4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v8i16_v8f64, _Rshort8_sat)(double8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v16i16_v16f64, _Rshort16_sat)(double16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v2i16_v2f64, _Rshort2_rte)(double2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v3i16_v3f64, _Rshort3_rte)(double3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v4i16_v4f64, _Rshort4_rte)(double4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v8i16_v8f64, _Rshort8_rte)(double8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v16i16_v16f64, _Rshort16_rte)(double16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v2i16_v2f64, _Rshort2_rtz)(double2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v3i16_v3f64, _Rshort3_rtz)(double3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v4i16_v4f64, _Rshort4_rtz)(double4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v8i16_v8f64, _Rshort8_rtz)(double8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v16i16_v16f64, _Rshort16_rtz)(double16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v2i16_v2f64, _Rshort2_rtp)(double2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v3i16_v3f64, _Rshort3_rtp)(double3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v4i16_v4f64, _Rshort4_rtp)(double4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v8i16_v8f64, _Rshort8_rtp)(double8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v16i16_v16f64, _Rshort16_rtp)(double16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v2i16_v2f64, _Rshort2_rtn)(double2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v3i16_v3f64, _Rshort3_rtn)(double3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v4i16_v4f64, _Rshort4_rtn)(double4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v8i16_v8f64, _Rshort8_rtn)(double8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v16i16_v16f64, _Rshort16_rtn)(double16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v2i16_v2f64, _Rshort2_sat_rte)(double2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v3i16_v3f64, _Rshort3_sat_rte)(double3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v4i16_v4f64, _Rshort4_sat_rte)(double4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v8i16_v8f64, _Rshort8_sat_rte)(double8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v16i16_v16f64, _Rshort16_sat_rte)(double16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v2i16_v2f64, _Rshort2_sat_rtz)(double2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v3i16_v3f64, _Rshort3_sat_rtz)(double3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v4i16_v4f64, _Rshort4_sat_rtz)(double4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v8i16_v8f64, _Rshort8_sat_rtz)(double8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v16i16_v16f64, _Rshort16_sat_rtz)(double16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v2i16_v2f64, _Rshort2_sat_rtp)(double2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v3i16_v3f64, _Rshort3_sat_rtp)(double3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v4i16_v4f64, _Rshort4_sat_rtp)(double4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v8i16_v8f64, _Rshort8_sat_rtp)(double8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v16i16_v16f64, _Rshort16_sat_rtp)(double16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v2i16_v2f64, _Rshort2_sat_rtn)(double2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v3i16_v3f64, _Rshort3_sat_rtn)(double3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v4i16_v4f64, _Rshort4_sat_rtn)(double4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v8i16_v8f64, _Rshort8_sat_rtn)(double8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v16i16_v16f64, _Rshort16_sat_rtn)(double16 x);
#endif // defined(cl_khr_fp64)
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v2i32_v2f32, _Rint2)(float2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v3i32_v3f32, _Rint3)(float3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v4i32_v4f32, _Rint4)(float4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v8i32_v8f32, _Rint8)(float8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v16i32_v16f32, _Rint16)(float16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v2i32_v2f32, _Rint2_sat)(float2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v3i32_v3f32, _Rint3_sat)(float3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v4i32_v4f32, _Rint4_sat)(float4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v8i32_v8f32, _Rint8_sat)(float8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v16i32_v16f32, _Rint16_sat)(float16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v2i32_v2f32, _Rint2_rte)(float2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v3i32_v3f32, _Rint3_rte)(float3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v4i32_v4f32, _Rint4_rte)(float4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v8i32_v8f32, _Rint8_rte)(float8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v16i32_v16f32, _Rint16_rte)(float16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v2i32_v2f32, _Rint2_rtz)(float2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v3i32_v3f32, _Rint3_rtz)(float3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v4i32_v4f32, _Rint4_rtz)(float4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v8i32_v8f32, _Rint8_rtz)(float8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v16i32_v16f32, _Rint16_rtz)(float16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v2i32_v2f32, _Rint2_rtp)(float2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v3i32_v3f32, _Rint3_rtp)(float3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v4i32_v4f32, _Rint4_rtp)(float4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v8i32_v8f32, _Rint8_rtp)(float8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v16i32_v16f32, _Rint16_rtp)(float16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v2i32_v2f32, _Rint2_rtn)(float2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v3i32_v3f32, _Rint3_rtn)(float3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v4i32_v4f32, _Rint4_rtn)(float4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v8i32_v8f32, _Rint8_rtn)(float8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v16i32_v16f32, _Rint16_rtn)(float16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v2i32_v2f32, _Rint2_sat_rte)(float2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v3i32_v3f32, _Rint3_sat_rte)(float3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v4i32_v4f32, _Rint4_sat_rte)(float4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v8i32_v8f32, _Rint8_sat_rte)(float8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v16i32_v16f32, _Rint16_sat_rte)(float16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v2i32_v2f32, _Rint2_sat_rtz)(float2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v3i32_v3f32, _Rint3_sat_rtz)(float3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v4i32_v4f32, _Rint4_sat_rtz)(float4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v8i32_v8f32, _Rint8_sat_rtz)(float8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v16i32_v16f32, _Rint16_sat_rtz)(float16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v2i32_v2f32, _Rint2_sat_rtp)(float2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v3i32_v3f32, _Rint3_sat_rtp)(float3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v4i32_v4f32, _Rint4_sat_rtp)(float4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v8i32_v8f32, _Rint8_sat_rtp)(float8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v16i32_v16f32, _Rint16_sat_rtp)(float16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v2i32_v2f32, _Rint2_sat_rtn)(float2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v3i32_v3f32, _Rint3_sat_rtn)(float3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v4i32_v4f32, _Rint4_sat_rtn)(float4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v8i32_v8f32, _Rint8_sat_rtn)(float8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v16i32_v16f32, _Rint16_sat_rtn)(float16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v2i32_v2f16, _Rint2)(half2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v3i32_v3f16, _Rint3)(half3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v4i32_v4f16, _Rint4)(half4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v8i32_v8f16, _Rint8)(half8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v16i32_v16f16, _Rint16)(half16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v2i32_v2f16, _Rint2_sat)(half2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v3i32_v3f16, _Rint3_sat)(half3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v4i32_v4f16, _Rint4_sat)(half4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v8i32_v8f16, _Rint8_sat)(half8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v16i32_v16f16, _Rint16_sat)(half16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v2i32_v2f16, _Rint2_rte)(half2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v3i32_v3f16, _Rint3_rte)(half3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v4i32_v4f16, _Rint4_rte)(half4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v8i32_v8f16, _Rint8_rte)(half8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v16i32_v16f16, _Rint16_rte)(half16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v2i32_v2f16, _Rint2_rtz)(half2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v3i32_v3f16, _Rint3_rtz)(half3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v4i32_v4f16, _Rint4_rtz)(half4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v8i32_v8f16, _Rint8_rtz)(half8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v16i32_v16f16, _Rint16_rtz)(half16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v2i32_v2f16, _Rint2_rtp)(half2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v3i32_v3f16, _Rint3_rtp)(half3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v4i32_v4f16, _Rint4_rtp)(half4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v8i32_v8f16, _Rint8_rtp)(half8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v16i32_v16f16, _Rint16_rtp)(half16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v2i32_v2f16, _Rint2_rtn)(half2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v3i32_v3f16, _Rint3_rtn)(half3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v4i32_v4f16, _Rint4_rtn)(half4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v8i32_v8f16, _Rint8_rtn)(half8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v16i32_v16f16, _Rint16_rtn)(half16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v2i32_v2f16, _Rint2_sat_rte)(half2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v3i32_v3f16, _Rint3_sat_rte)(half3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v4i32_v4f16, _Rint4_sat_rte)(half4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v8i32_v8f16, _Rint8_sat_rte)(half8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v16i32_v16f16, _Rint16_sat_rte)(half16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v2i32_v2f16, _Rint2_sat_rtz)(half2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v3i32_v3f16, _Rint3_sat_rtz)(half3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v4i32_v4f16, _Rint4_sat_rtz)(half4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v8i32_v8f16, _Rint8_sat_rtz)(half8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v16i32_v16f16, _Rint16_sat_rtz)(half16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v2i32_v2f16, _Rint2_sat_rtp)(half2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v3i32_v3f16, _Rint3_sat_rtp)(half3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v4i32_v4f16, _Rint4_sat_rtp)(half4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v8i32_v8f16, _Rint8_sat_rtp)(half8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v16i32_v16f16, _Rint16_sat_rtp)(half16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v2i32_v2f16, _Rint2_sat_rtn)(half2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v3i32_v3f16, _Rint3_sat_rtn)(half3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v4i32_v4f16, _Rint4_sat_rtn)(half4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v8i32_v8f16, _Rint8_sat_rtn)(half8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v16i32_v16f16, _Rint16_sat_rtn)(half16 x);
#if defined(cl_khr_fp64)
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v2i32_v2f64, _Rint2)(double2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v3i32_v3f64, _Rint3)(double3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v4i32_v4f64, _Rint4)(double4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v8i32_v8f64, _Rint8)(double8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v16i32_v16f64, _Rint16)(double16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v2i32_v2f64, _Rint2_sat)(double2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v3i32_v3f64, _Rint3_sat)(double3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v4i32_v4f64, _Rint4_sat)(double4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v8i32_v8f64, _Rint8_sat)(double8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v16i32_v16f64, _Rint16_sat)(double16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v2i32_v2f64, _Rint2_rte)(double2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v3i32_v3f64, _Rint3_rte)(double3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v4i32_v4f64, _Rint4_rte)(double4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v8i32_v8f64, _Rint8_rte)(double8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v16i32_v16f64, _Rint16_rte)(double16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v2i32_v2f64, _Rint2_rtz)(double2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v3i32_v3f64, _Rint3_rtz)(double3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v4i32_v4f64, _Rint4_rtz)(double4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v8i32_v8f64, _Rint8_rtz)(double8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v16i32_v16f64, _Rint16_rtz)(double16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v2i32_v2f64, _Rint2_rtp)(double2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v3i32_v3f64, _Rint3_rtp)(double3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v4i32_v4f64, _Rint4_rtp)(double4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v8i32_v8f64, _Rint8_rtp)(double8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v16i32_v16f64, _Rint16_rtp)(double16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v2i32_v2f64, _Rint2_rtn)(double2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v3i32_v3f64, _Rint3_rtn)(double3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v4i32_v4f64, _Rint4_rtn)(double4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v8i32_v8f64, _Rint8_rtn)(double8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v16i32_v16f64, _Rint16_rtn)(double16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v2i32_v2f64, _Rint2_sat_rte)(double2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v3i32_v3f64, _Rint3_sat_rte)(double3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v4i32_v4f64, _Rint4_sat_rte)(double4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v8i32_v8f64, _Rint8_sat_rte)(double8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v16i32_v16f64, _Rint16_sat_rte)(double16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v2i32_v2f64, _Rint2_sat_rtz)(double2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v3i32_v3f64, _Rint3_sat_rtz)(double3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v4i32_v4f64, _Rint4_sat_rtz)(double4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v8i32_v8f64, _Rint8_sat_rtz)(double8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v16i32_v16f64, _Rint16_sat_rtz)(double16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v2i32_v2f64, _Rint2_sat_rtp)(double2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v3i32_v3f64, _Rint3_sat_rtp)(double3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v4i32_v4f64, _Rint4_sat_rtp)(double4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v8i32_v8f64, _Rint8_sat_rtp)(double8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v16i32_v16f64, _Rint16_sat_rtp)(double16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v2i32_v2f64, _Rint2_sat_rtn)(double2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v3i32_v3f64, _Rint3_sat_rtn)(double3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v4i32_v4f64, _Rint4_sat_rtn)(double4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v8i32_v8f64, _Rint8_sat_rtn)(double8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v16i32_v16f64, _Rint16_sat_rtn)(double16 x);
#endif // defined(cl_khr_fp64)
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v2i64_v2f32, _Rlong2)(float2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v3i64_v3f32, _Rlong3)(float3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v4i64_v4f32, _Rlong4)(float4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v8i64_v8f32, _Rlong8)(float8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v16i64_v16f32, _Rlong16)(float16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v2i64_v2f32, _Rlong2_sat)(float2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v3i64_v3f32, _Rlong3_sat)(float3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v4i64_v4f32, _Rlong4_sat)(float4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v8i64_v8f32, _Rlong8_sat)(float8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v16i64_v16f32, _Rlong16_sat)(float16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v2i64_v2f32, _Rlong2_rte)(float2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v3i64_v3f32, _Rlong3_rte)(float3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v4i64_v4f32, _Rlong4_rte)(float4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v8i64_v8f32, _Rlong8_rte)(float8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v16i64_v16f32, _Rlong16_rte)(float16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v2i64_v2f32, _Rlong2_rtz)(float2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v3i64_v3f32, _Rlong3_rtz)(float3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v4i64_v4f32, _Rlong4_rtz)(float4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v8i64_v8f32, _Rlong8_rtz)(float8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v16i64_v16f32, _Rlong16_rtz)(float16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v2i64_v2f32, _Rlong2_rtp)(float2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v3i64_v3f32, _Rlong3_rtp)(float3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v4i64_v4f32, _Rlong4_rtp)(float4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v8i64_v8f32, _Rlong8_rtp)(float8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v16i64_v16f32, _Rlong16_rtp)(float16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v2i64_v2f32, _Rlong2_rtn)(float2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v3i64_v3f32, _Rlong3_rtn)(float3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v4i64_v4f32, _Rlong4_rtn)(float4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v8i64_v8f32, _Rlong8_rtn)(float8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v16i64_v16f32, _Rlong16_rtn)(float16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v2i64_v2f32, _Rlong2_sat_rte)(float2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v3i64_v3f32, _Rlong3_sat_rte)(float3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v4i64_v4f32, _Rlong4_sat_rte)(float4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v8i64_v8f32, _Rlong8_sat_rte)(float8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v16i64_v16f32, _Rlong16_sat_rte)(float16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v2i64_v2f32, _Rlong2_sat_rtz)(float2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v3i64_v3f32, _Rlong3_sat_rtz)(float3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v4i64_v4f32, _Rlong4_sat_rtz)(float4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v8i64_v8f32, _Rlong8_sat_rtz)(float8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v16i64_v16f32, _Rlong16_sat_rtz)(float16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v2i64_v2f32, _Rlong2_sat_rtp)(float2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v3i64_v3f32, _Rlong3_sat_rtp)(float3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v4i64_v4f32, _Rlong4_sat_rtp)(float4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v8i64_v8f32, _Rlong8_sat_rtp)(float8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v16i64_v16f32, _Rlong16_sat_rtp)(float16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v2i64_v2f32, _Rlong2_sat_rtn)(float2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v3i64_v3f32, _Rlong3_sat_rtn)(float3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v4i64_v4f32, _Rlong4_sat_rtn)(float4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v8i64_v8f32, _Rlong8_sat_rtn)(float8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v16i64_v16f32, _Rlong16_sat_rtn)(float16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v2i64_v2f16, _Rlong2)(half2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v3i64_v3f16, _Rlong3)(half3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v4i64_v4f16, _Rlong4)(half4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v8i64_v8f16, _Rlong8)(half8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v16i64_v16f16, _Rlong16)(half16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v2i64_v2f16, _Rlong2_sat)(half2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v3i64_v3f16, _Rlong3_sat)(half3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v4i64_v4f16, _Rlong4_sat)(half4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v8i64_v8f16, _Rlong8_sat)(half8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v16i64_v16f16, _Rlong16_sat)(half16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v2i64_v2f16, _Rlong2_rte)(half2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v3i64_v3f16, _Rlong3_rte)(half3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v4i64_v4f16, _Rlong4_rte)(half4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v8i64_v8f16, _Rlong8_rte)(half8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v16i64_v16f16, _Rlong16_rte)(half16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v2i64_v2f16, _Rlong2_rtz)(half2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v3i64_v3f16, _Rlong3_rtz)(half3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v4i64_v4f16, _Rlong4_rtz)(half4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v8i64_v8f16, _Rlong8_rtz)(half8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v16i64_v16f16, _Rlong16_rtz)(half16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v2i64_v2f16, _Rlong2_rtp)(half2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v3i64_v3f16, _Rlong3_rtp)(half3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v4i64_v4f16, _Rlong4_rtp)(half4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v8i64_v8f16, _Rlong8_rtp)(half8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v16i64_v16f16, _Rlong16_rtp)(half16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v2i64_v2f16, _Rlong2_rtn)(half2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v3i64_v3f16, _Rlong3_rtn)(half3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v4i64_v4f16, _Rlong4_rtn)(half4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v8i64_v8f16, _Rlong8_rtn)(half8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v16i64_v16f16, _Rlong16_rtn)(half16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v2i64_v2f16, _Rlong2_sat_rte)(half2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v3i64_v3f16, _Rlong3_sat_rte)(half3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v4i64_v4f16, _Rlong4_sat_rte)(half4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v8i64_v8f16, _Rlong8_sat_rte)(half8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v16i64_v16f16, _Rlong16_sat_rte)(half16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v2i64_v2f16, _Rlong2_sat_rtz)(half2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v3i64_v3f16, _Rlong3_sat_rtz)(half3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v4i64_v4f16, _Rlong4_sat_rtz)(half4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v8i64_v8f16, _Rlong8_sat_rtz)(half8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v16i64_v16f16, _Rlong16_sat_rtz)(half16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v2i64_v2f16, _Rlong2_sat_rtp)(half2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v3i64_v3f16, _Rlong3_sat_rtp)(half3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v4i64_v4f16, _Rlong4_sat_rtp)(half4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v8i64_v8f16, _Rlong8_sat_rtp)(half8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v16i64_v16f16, _Rlong16_sat_rtp)(half16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v2i64_v2f16, _Rlong2_sat_rtn)(half2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v3i64_v3f16, _Rlong3_sat_rtn)(half3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v4i64_v4f16, _Rlong4_sat_rtn)(half4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v8i64_v8f16, _Rlong8_sat_rtn)(half8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v16i64_v16f16, _Rlong16_sat_rtn)(half16 x);
#if defined(cl_khr_fp64)
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v2i64_v2f64, _Rlong2)(double2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v3i64_v3f64, _Rlong3)(double3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v4i64_v4f64, _Rlong4)(double4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v8i64_v8f64, _Rlong8)(double8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _v16i64_v16f64, _Rlong16)(double16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v2i64_v2f64, _Rlong2_sat)(double2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v3i64_v3f64, _Rlong3_sat)(double3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v4i64_v4f64, _Rlong4_sat)(double4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v8i64_v8f64, _Rlong8_sat)(double8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_v16i64_v16f64, _Rlong16_sat)(double16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v2i64_v2f64, _Rlong2_rte)(double2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v3i64_v3f64, _Rlong3_rte)(double3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v4i64_v4f64, _Rlong4_rte)(double4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v8i64_v8f64, _Rlong8_rte)(double8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTE_v16i64_v16f64, _Rlong16_rte)(double16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v2i64_v2f64, _Rlong2_rtz)(double2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v3i64_v3f64, _Rlong3_rtz)(double3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v4i64_v4f64, _Rlong4_rtz)(double4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v8i64_v8f64, _Rlong8_rtz)(double8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTZ_v16i64_v16f64, _Rlong16_rtz)(double16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v2i64_v2f64, _Rlong2_rtp)(double2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v3i64_v3f64, _Rlong3_rtp)(double3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v4i64_v4f64, _Rlong4_rtp)(double4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v8i64_v8f64, _Rlong8_rtp)(double8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTP_v16i64_v16f64, _Rlong16_rtp)(double16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v2i64_v2f64, _Rlong2_rtn)(double2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v3i64_v3f64, _Rlong3_rtn)(double3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v4i64_v4f64, _Rlong4_rtn)(double4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v8i64_v8f64, _Rlong8_rtn)(double8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _RTN_v16i64_v16f64, _Rlong16_rtn)(double16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v2i64_v2f64, _Rlong2_sat_rte)(double2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v3i64_v3f64, _Rlong3_sat_rte)(double3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v4i64_v4f64, _Rlong4_sat_rte)(double4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v8i64_v8f64, _Rlong8_sat_rte)(double8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTE_v16i64_v16f64, _Rlong16_sat_rte)(double16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v2i64_v2f64, _Rlong2_sat_rtz)(double2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v3i64_v3f64, _Rlong3_sat_rtz)(double3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v4i64_v4f64, _Rlong4_sat_rtz)(double4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v8i64_v8f64, _Rlong8_sat_rtz)(double8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTZ_v16i64_v16f64, _Rlong16_sat_rtz)(double16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v2i64_v2f64, _Rlong2_sat_rtp)(double2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v3i64_v3f64, _Rlong3_sat_rtp)(double3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v4i64_v4f64, _Rlong4_sat_rtp)(double4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v8i64_v8f64, _Rlong8_sat_rtp)(double8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTP_v16i64_v16f64, _Rlong16_sat_rtp)(double16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v2i64_v2f64, _Rlong2_sat_rtn)(double2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v3i64_v3f64, _Rlong3_sat_rtn)(double3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v4i64_v4f64, _Rlong4_sat_rtn)(double4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v8i64_v8f64, _Rlong8_sat_rtn)(double8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToS, _Sat_RTN_v16i64_v16f64, _Rlong16_sat_rtn)(double16 x);
#endif // defined(cl_khr_fp64)
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v2i8_v2f32, _Ruchar2)(float2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v3i8_v3f32, _Ruchar3)(float3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v4i8_v4f32, _Ruchar4)(float4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v8i8_v8f32, _Ruchar8)(float8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v16i8_v16f32, _Ruchar16)(float16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v2i8_v2f32, _Ruchar2_sat)(float2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v3i8_v3f32, _Ruchar3_sat)(float3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v4i8_v4f32, _Ruchar4_sat)(float4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v8i8_v8f32, _Ruchar8_sat)(float8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v16i8_v16f32, _Ruchar16_sat)(float16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v2i8_v2f32, _Ruchar2_rte)(float2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v3i8_v3f32, _Ruchar3_rte)(float3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v4i8_v4f32, _Ruchar4_rte)(float4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v8i8_v8f32, _Ruchar8_rte)(float8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v16i8_v16f32, _Ruchar16_rte)(float16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v2i8_v2f32, _Ruchar2_rtz)(float2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v3i8_v3f32, _Ruchar3_rtz)(float3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v4i8_v4f32, _Ruchar4_rtz)(float4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v8i8_v8f32, _Ruchar8_rtz)(float8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v16i8_v16f32, _Ruchar16_rtz)(float16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v2i8_v2f32, _Ruchar2_rtp)(float2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v3i8_v3f32, _Ruchar3_rtp)(float3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v4i8_v4f32, _Ruchar4_rtp)(float4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v8i8_v8f32, _Ruchar8_rtp)(float8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v16i8_v16f32, _Ruchar16_rtp)(float16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v2i8_v2f32, _Ruchar2_rtn)(float2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v3i8_v3f32, _Ruchar3_rtn)(float3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v4i8_v4f32, _Ruchar4_rtn)(float4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v8i8_v8f32, _Ruchar8_rtn)(float8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v16i8_v16f32, _Ruchar16_rtn)(float16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v2i8_v2f32, _Ruchar2_sat_rte)(float2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v3i8_v3f32, _Ruchar3_sat_rte)(float3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v4i8_v4f32, _Ruchar4_sat_rte)(float4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v8i8_v8f32, _Ruchar8_sat_rte)(float8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v16i8_v16f32, _Ruchar16_sat_rte)(float16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v2i8_v2f32, _Ruchar2_sat_rtz)(float2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v3i8_v3f32, _Ruchar3_sat_rtz)(float3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v4i8_v4f32, _Ruchar4_sat_rtz)(float4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v8i8_v8f32, _Ruchar8_sat_rtz)(float8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v16i8_v16f32, _Ruchar16_sat_rtz)(float16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v2i8_v2f32, _Ruchar2_sat_rtp)(float2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v3i8_v3f32, _Ruchar3_sat_rtp)(float3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v4i8_v4f32, _Ruchar4_sat_rtp)(float4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v8i8_v8f32, _Ruchar8_sat_rtp)(float8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v16i8_v16f32, _Ruchar16_sat_rtp)(float16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v2i8_v2f32, _Ruchar2_sat_rtn)(float2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v3i8_v3f32, _Ruchar3_sat_rtn)(float3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v4i8_v4f32, _Ruchar4_sat_rtn)(float4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v8i8_v8f32, _Ruchar8_sat_rtn)(float8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v16i8_v16f32, _Ruchar16_sat_rtn)(float16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v2i8_v2f16, _Ruchar2)(half2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v3i8_v3f16, _Ruchar3)(half3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v4i8_v4f16, _Ruchar4)(half4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v8i8_v8f16, _Ruchar8)(half8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v16i8_v16f16, _Ruchar16)(half16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v2i8_v2f16, _Ruchar2_sat)(half2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v3i8_v3f16, _Ruchar3_sat)(half3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v4i8_v4f16, _Ruchar4_sat)(half4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v8i8_v8f16, _Ruchar8_sat)(half8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v16i8_v16f16, _Ruchar16_sat)(half16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v2i8_v2f16, _Ruchar2_rte)(half2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v3i8_v3f16, _Ruchar3_rte)(half3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v4i8_v4f16, _Ruchar4_rte)(half4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v8i8_v8f16, _Ruchar8_rte)(half8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v16i8_v16f16, _Ruchar16_rte)(half16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v2i8_v2f16, _Ruchar2_rtz)(half2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v3i8_v3f16, _Ruchar3_rtz)(half3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v4i8_v4f16, _Ruchar4_rtz)(half4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v8i8_v8f16, _Ruchar8_rtz)(half8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v16i8_v16f16, _Ruchar16_rtz)(half16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v2i8_v2f16, _Ruchar2_rtp)(half2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v3i8_v3f16, _Ruchar3_rtp)(half3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v4i8_v4f16, _Ruchar4_rtp)(half4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v8i8_v8f16, _Ruchar8_rtp)(half8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v16i8_v16f16, _Ruchar16_rtp)(half16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v2i8_v2f16, _Ruchar2_rtn)(half2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v3i8_v3f16, _Ruchar3_rtn)(half3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v4i8_v4f16, _Ruchar4_rtn)(half4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v8i8_v8f16, _Ruchar8_rtn)(half8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v16i8_v16f16, _Ruchar16_rtn)(half16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v2i8_v2f16, _Ruchar2_sat_rte)(half2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v3i8_v3f16, _Ruchar3_sat_rte)(half3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v4i8_v4f16, _Ruchar4_sat_rte)(half4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v8i8_v8f16, _Ruchar8_sat_rte)(half8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v16i8_v16f16, _Ruchar16_sat_rte)(half16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v2i8_v2f16, _Ruchar2_sat_rtz)(half2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v3i8_v3f16, _Ruchar3_sat_rtz)(half3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v4i8_v4f16, _Ruchar4_sat_rtz)(half4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v8i8_v8f16, _Ruchar8_sat_rtz)(half8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v16i8_v16f16, _Ruchar16_sat_rtz)(half16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v2i8_v2f16, _Ruchar2_sat_rtp)(half2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v3i8_v3f16, _Ruchar3_sat_rtp)(half3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v4i8_v4f16, _Ruchar4_sat_rtp)(half4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v8i8_v8f16, _Ruchar8_sat_rtp)(half8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v16i8_v16f16, _Ruchar16_sat_rtp)(half16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v2i8_v2f16, _Ruchar2_sat_rtn)(half2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v3i8_v3f16, _Ruchar3_sat_rtn)(half3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v4i8_v4f16, _Ruchar4_sat_rtn)(half4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v8i8_v8f16, _Ruchar8_sat_rtn)(half8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v16i8_v16f16, _Ruchar16_sat_rtn)(half16 x);
#if defined(cl_khr_fp64)
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v2i8_v2f64, _Ruchar2)(double2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v3i8_v3f64, _Ruchar3)(double3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v4i8_v4f64, _Ruchar4)(double4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v8i8_v8f64, _Ruchar8)(double8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v16i8_v16f64, _Ruchar16)(double16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v2i8_v2f64, _Ruchar2_sat)(double2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v3i8_v3f64, _Ruchar3_sat)(double3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v4i8_v4f64, _Ruchar4_sat)(double4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v8i8_v8f64, _Ruchar8_sat)(double8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v16i8_v16f64, _Ruchar16_sat)(double16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v2i8_v2f64, _Ruchar2_rte)(double2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v3i8_v3f64, _Ruchar3_rte)(double3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v4i8_v4f64, _Ruchar4_rte)(double4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v8i8_v8f64, _Ruchar8_rte)(double8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v16i8_v16f64, _Ruchar16_rte)(double16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v2i8_v2f64, _Ruchar2_rtz)(double2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v3i8_v3f64, _Ruchar3_rtz)(double3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v4i8_v4f64, _Ruchar4_rtz)(double4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v8i8_v8f64, _Ruchar8_rtz)(double8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v16i8_v16f64, _Ruchar16_rtz)(double16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v2i8_v2f64, _Ruchar2_rtp)(double2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v3i8_v3f64, _Ruchar3_rtp)(double3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v4i8_v4f64, _Ruchar4_rtp)(double4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v8i8_v8f64, _Ruchar8_rtp)(double8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v16i8_v16f64, _Ruchar16_rtp)(double16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v2i8_v2f64, _Ruchar2_rtn)(double2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v3i8_v3f64, _Ruchar3_rtn)(double3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v4i8_v4f64, _Ruchar4_rtn)(double4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v8i8_v8f64, _Ruchar8_rtn)(double8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v16i8_v16f64, _Ruchar16_rtn)(double16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v2i8_v2f64, _Ruchar2_sat_rte)(double2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v3i8_v3f64, _Ruchar3_sat_rte)(double3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v4i8_v4f64, _Ruchar4_sat_rte)(double4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v8i8_v8f64, _Ruchar8_sat_rte)(double8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v16i8_v16f64, _Ruchar16_sat_rte)(double16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v2i8_v2f64, _Ruchar2_sat_rtz)(double2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v3i8_v3f64, _Ruchar3_sat_rtz)(double3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v4i8_v4f64, _Ruchar4_sat_rtz)(double4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v8i8_v8f64, _Ruchar8_sat_rtz)(double8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v16i8_v16f64, _Ruchar16_sat_rtz)(double16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v2i8_v2f64, _Ruchar2_sat_rtp)(double2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v3i8_v3f64, _Ruchar3_sat_rtp)(double3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v4i8_v4f64, _Ruchar4_sat_rtp)(double4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v8i8_v8f64, _Ruchar8_sat_rtp)(double8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v16i8_v16f64, _Ruchar16_sat_rtp)(double16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v2i8_v2f64, _Ruchar2_sat_rtn)(double2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v3i8_v3f64, _Ruchar3_sat_rtn)(double3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v4i8_v4f64, _Ruchar4_sat_rtn)(double4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v8i8_v8f64, _Ruchar8_sat_rtn)(double8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v16i8_v16f64, _Ruchar16_sat_rtn)(double16 x);
#endif // defined(cl_khr_fp64)
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v2i16_v2f32, _Rushort2)(float2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v3i16_v3f32, _Rushort3)(float3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v4i16_v4f32, _Rushort4)(float4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v8i16_v8f32, _Rushort8)(float8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v16i16_v16f32, _Rushort16)(float16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v2i16_v2f32, _Rushort2_sat)(float2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v3i16_v3f32, _Rushort3_sat)(float3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v4i16_v4f32, _Rushort4_sat)(float4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v8i16_v8f32, _Rushort8_sat)(float8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v16i16_v16f32, _Rushort16_sat)(float16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v2i16_v2f32, _Rushort2_rte)(float2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v3i16_v3f32, _Rushort3_rte)(float3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v4i16_v4f32, _Rushort4_rte)(float4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v8i16_v8f32, _Rushort8_rte)(float8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v16i16_v16f32, _Rushort16_rte)(float16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v2i16_v2f32, _Rushort2_rtz)(float2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v3i16_v3f32, _Rushort3_rtz)(float3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v4i16_v4f32, _Rushort4_rtz)(float4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v8i16_v8f32, _Rushort8_rtz)(float8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v16i16_v16f32, _Rushort16_rtz)(float16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v2i16_v2f32, _Rushort2_rtp)(float2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v3i16_v3f32, _Rushort3_rtp)(float3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v4i16_v4f32, _Rushort4_rtp)(float4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v8i16_v8f32, _Rushort8_rtp)(float8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v16i16_v16f32, _Rushort16_rtp)(float16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v2i16_v2f32, _Rushort2_rtn)(float2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v3i16_v3f32, _Rushort3_rtn)(float3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v4i16_v4f32, _Rushort4_rtn)(float4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v8i16_v8f32, _Rushort8_rtn)(float8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v16i16_v16f32, _Rushort16_rtn)(float16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v2i16_v2f32, _Rushort2_sat_rte)(float2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v3i16_v3f32, _Rushort3_sat_rte)(float3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v4i16_v4f32, _Rushort4_sat_rte)(float4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v8i16_v8f32, _Rushort8_sat_rte)(float8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v16i16_v16f32, _Rushort16_sat_rte)(float16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v2i16_v2f32, _Rushort2_sat_rtz)(float2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v3i16_v3f32, _Rushort3_sat_rtz)(float3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v4i16_v4f32, _Rushort4_sat_rtz)(float4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v8i16_v8f32, _Rushort8_sat_rtz)(float8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v16i16_v16f32, _Rushort16_sat_rtz)(float16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v2i16_v2f32, _Rushort2_sat_rtp)(float2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v3i16_v3f32, _Rushort3_sat_rtp)(float3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v4i16_v4f32, _Rushort4_sat_rtp)(float4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v8i16_v8f32, _Rushort8_sat_rtp)(float8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v16i16_v16f32, _Rushort16_sat_rtp)(float16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v2i16_v2f32, _Rushort2_sat_rtn)(float2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v3i16_v3f32, _Rushort3_sat_rtn)(float3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v4i16_v4f32, _Rushort4_sat_rtn)(float4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v8i16_v8f32, _Rushort8_sat_rtn)(float8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v16i16_v16f32, _Rushort16_sat_rtn)(float16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v2i16_v2f16, _Rushort2)(half2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v3i16_v3f16, _Rushort3)(half3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v4i16_v4f16, _Rushort4)(half4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v8i16_v8f16, _Rushort8)(half8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v16i16_v16f16, _Rushort16)(half16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v2i16_v2f16, _Rushort2_sat)(half2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v3i16_v3f16, _Rushort3_sat)(half3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v4i16_v4f16, _Rushort4_sat)(half4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v8i16_v8f16, _Rushort8_sat)(half8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v16i16_v16f16, _Rushort16_sat)(half16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v2i16_v2f16, _Rushort2_rte)(half2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v3i16_v3f16, _Rushort3_rte)(half3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v4i16_v4f16, _Rushort4_rte)(half4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v8i16_v8f16, _Rushort8_rte)(half8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v16i16_v16f16, _Rushort16_rte)(half16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v2i16_v2f16, _Rushort2_rtz)(half2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v3i16_v3f16, _Rushort3_rtz)(half3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v4i16_v4f16, _Rushort4_rtz)(half4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v8i16_v8f16, _Rushort8_rtz)(half8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v16i16_v16f16, _Rushort16_rtz)(half16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v2i16_v2f16, _Rushort2_rtp)(half2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v3i16_v3f16, _Rushort3_rtp)(half3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v4i16_v4f16, _Rushort4_rtp)(half4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v8i16_v8f16, _Rushort8_rtp)(half8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v16i16_v16f16, _Rushort16_rtp)(half16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v2i16_v2f16, _Rushort2_rtn)(half2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v3i16_v3f16, _Rushort3_rtn)(half3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v4i16_v4f16, _Rushort4_rtn)(half4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v8i16_v8f16, _Rushort8_rtn)(half8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v16i16_v16f16, _Rushort16_rtn)(half16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v2i16_v2f16, _Rushort2_sat_rte)(half2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v3i16_v3f16, _Rushort3_sat_rte)(half3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v4i16_v4f16, _Rushort4_sat_rte)(half4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v8i16_v8f16, _Rushort8_sat_rte)(half8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v16i16_v16f16, _Rushort16_sat_rte)(half16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v2i16_v2f16, _Rushort2_sat_rtz)(half2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v3i16_v3f16, _Rushort3_sat_rtz)(half3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v4i16_v4f16, _Rushort4_sat_rtz)(half4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v8i16_v8f16, _Rushort8_sat_rtz)(half8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v16i16_v16f16, _Rushort16_sat_rtz)(half16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v2i16_v2f16, _Rushort2_sat_rtp)(half2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v3i16_v3f16, _Rushort3_sat_rtp)(half3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v4i16_v4f16, _Rushort4_sat_rtp)(half4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v8i16_v8f16, _Rushort8_sat_rtp)(half8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v16i16_v16f16, _Rushort16_sat_rtp)(half16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v2i16_v2f16, _Rushort2_sat_rtn)(half2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v3i16_v3f16, _Rushort3_sat_rtn)(half3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v4i16_v4f16, _Rushort4_sat_rtn)(half4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v8i16_v8f16, _Rushort8_sat_rtn)(half8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v16i16_v16f16, _Rushort16_sat_rtn)(half16 x);
#if defined(cl_khr_fp64)
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v2i16_v2f64, _Rushort2)(double2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v3i16_v3f64, _Rushort3)(double3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v4i16_v4f64, _Rushort4)(double4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v8i16_v8f64, _Rushort8)(double8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v16i16_v16f64, _Rushort16)(double16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v2i16_v2f64, _Rushort2_sat)(double2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v3i16_v3f64, _Rushort3_sat)(double3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v4i16_v4f64, _Rushort4_sat)(double4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v8i16_v8f64, _Rushort8_sat)(double8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v16i16_v16f64, _Rushort16_sat)(double16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v2i16_v2f64, _Rushort2_rte)(double2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v3i16_v3f64, _Rushort3_rte)(double3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v4i16_v4f64, _Rushort4_rte)(double4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v8i16_v8f64, _Rushort8_rte)(double8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v16i16_v16f64, _Rushort16_rte)(double16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v2i16_v2f64, _Rushort2_rtz)(double2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v3i16_v3f64, _Rushort3_rtz)(double3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v4i16_v4f64, _Rushort4_rtz)(double4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v8i16_v8f64, _Rushort8_rtz)(double8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v16i16_v16f64, _Rushort16_rtz)(double16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v2i16_v2f64, _Rushort2_rtp)(double2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v3i16_v3f64, _Rushort3_rtp)(double3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v4i16_v4f64, _Rushort4_rtp)(double4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v8i16_v8f64, _Rushort8_rtp)(double8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v16i16_v16f64, _Rushort16_rtp)(double16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v2i16_v2f64, _Rushort2_rtn)(double2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v3i16_v3f64, _Rushort3_rtn)(double3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v4i16_v4f64, _Rushort4_rtn)(double4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v8i16_v8f64, _Rushort8_rtn)(double8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v16i16_v16f64, _Rushort16_rtn)(double16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v2i16_v2f64, _Rushort2_sat_rte)(double2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v3i16_v3f64, _Rushort3_sat_rte)(double3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v4i16_v4f64, _Rushort4_sat_rte)(double4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v8i16_v8f64, _Rushort8_sat_rte)(double8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v16i16_v16f64, _Rushort16_sat_rte)(double16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v2i16_v2f64, _Rushort2_sat_rtz)(double2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v3i16_v3f64, _Rushort3_sat_rtz)(double3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v4i16_v4f64, _Rushort4_sat_rtz)(double4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v8i16_v8f64, _Rushort8_sat_rtz)(double8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v16i16_v16f64, _Rushort16_sat_rtz)(double16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v2i16_v2f64, _Rushort2_sat_rtp)(double2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v3i16_v3f64, _Rushort3_sat_rtp)(double3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v4i16_v4f64, _Rushort4_sat_rtp)(double4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v8i16_v8f64, _Rushort8_sat_rtp)(double8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v16i16_v16f64, _Rushort16_sat_rtp)(double16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v2i16_v2f64, _Rushort2_sat_rtn)(double2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v3i16_v3f64, _Rushort3_sat_rtn)(double3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v4i16_v4f64, _Rushort4_sat_rtn)(double4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v8i16_v8f64, _Rushort8_sat_rtn)(double8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v16i16_v16f64, _Rushort16_sat_rtn)(double16 x);
#endif // defined(cl_khr_fp64)
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v2i32_v2f32, _Ruint2)(float2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v3i32_v3f32, _Ruint3)(float3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v4i32_v4f32, _Ruint4)(float4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v8i32_v8f32, _Ruint8)(float8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v16i32_v16f32, _Ruint16)(float16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v2i32_v2f32, _Ruint2_sat)(float2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v3i32_v3f32, _Ruint3_sat)(float3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v4i32_v4f32, _Ruint4_sat)(float4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v8i32_v8f32, _Ruint8_sat)(float8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v16i32_v16f32, _Ruint16_sat)(float16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v2i32_v2f32, _Ruint2_rte)(float2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v3i32_v3f32, _Ruint3_rte)(float3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v4i32_v4f32, _Ruint4_rte)(float4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v8i32_v8f32, _Ruint8_rte)(float8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v16i32_v16f32, _Ruint16_rte)(float16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v2i32_v2f32, _Ruint2_rtz)(float2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v3i32_v3f32, _Ruint3_rtz)(float3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v4i32_v4f32, _Ruint4_rtz)(float4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v8i32_v8f32, _Ruint8_rtz)(float8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v16i32_v16f32, _Ruint16_rtz)(float16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v2i32_v2f32, _Ruint2_rtp)(float2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v3i32_v3f32, _Ruint3_rtp)(float3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v4i32_v4f32, _Ruint4_rtp)(float4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v8i32_v8f32, _Ruint8_rtp)(float8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v16i32_v16f32, _Ruint16_rtp)(float16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v2i32_v2f32, _Ruint2_rtn)(float2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v3i32_v3f32, _Ruint3_rtn)(float3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v4i32_v4f32, _Ruint4_rtn)(float4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v8i32_v8f32, _Ruint8_rtn)(float8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v16i32_v16f32, _Ruint16_rtn)(float16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v2i32_v2f32, _Ruint2_sat_rte)(float2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v3i32_v3f32, _Ruint3_sat_rte)(float3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v4i32_v4f32, _Ruint4_sat_rte)(float4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v8i32_v8f32, _Ruint8_sat_rte)(float8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v16i32_v16f32, _Ruint16_sat_rte)(float16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v2i32_v2f32, _Ruint2_sat_rtz)(float2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v3i32_v3f32, _Ruint3_sat_rtz)(float3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v4i32_v4f32, _Ruint4_sat_rtz)(float4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v8i32_v8f32, _Ruint8_sat_rtz)(float8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v16i32_v16f32, _Ruint16_sat_rtz)(float16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v2i32_v2f32, _Ruint2_sat_rtp)(float2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v3i32_v3f32, _Ruint3_sat_rtp)(float3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v4i32_v4f32, _Ruint4_sat_rtp)(float4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v8i32_v8f32, _Ruint8_sat_rtp)(float8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v16i32_v16f32, _Ruint16_sat_rtp)(float16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v2i32_v2f32, _Ruint2_sat_rtn)(float2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v3i32_v3f32, _Ruint3_sat_rtn)(float3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v4i32_v4f32, _Ruint4_sat_rtn)(float4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v8i32_v8f32, _Ruint8_sat_rtn)(float8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v16i32_v16f32, _Ruint16_sat_rtn)(float16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v2i32_v2f16, _Ruint2)(half2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v3i32_v3f16, _Ruint3)(half3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v4i32_v4f16, _Ruint4)(half4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v8i32_v8f16, _Ruint8)(half8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v16i32_v16f16, _Ruint16)(half16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v2i32_v2f16, _Ruint2_sat)(half2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v3i32_v3f16, _Ruint3_sat)(half3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v4i32_v4f16, _Ruint4_sat)(half4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v8i32_v8f16, _Ruint8_sat)(half8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v16i32_v16f16, _Ruint16_sat)(half16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v2i32_v2f16, _Ruint2_rte)(half2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v3i32_v3f16, _Ruint3_rte)(half3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v4i32_v4f16, _Ruint4_rte)(half4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v8i32_v8f16, _Ruint8_rte)(half8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v16i32_v16f16, _Ruint16_rte)(half16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v2i32_v2f16, _Ruint2_rtz)(half2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v3i32_v3f16, _Ruint3_rtz)(half3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v4i32_v4f16, _Ruint4_rtz)(half4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v8i32_v8f16, _Ruint8_rtz)(half8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v16i32_v16f16, _Ruint16_rtz)(half16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v2i32_v2f16, _Ruint2_rtp)(half2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v3i32_v3f16, _Ruint3_rtp)(half3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v4i32_v4f16, _Ruint4_rtp)(half4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v8i32_v8f16, _Ruint8_rtp)(half8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v16i32_v16f16, _Ruint16_rtp)(half16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v2i32_v2f16, _Ruint2_rtn)(half2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v3i32_v3f16, _Ruint3_rtn)(half3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v4i32_v4f16, _Ruint4_rtn)(half4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v8i32_v8f16, _Ruint8_rtn)(half8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v16i32_v16f16, _Ruint16_rtn)(half16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v2i32_v2f16, _Ruint2_sat_rte)(half2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v3i32_v3f16, _Ruint3_sat_rte)(half3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v4i32_v4f16, _Ruint4_sat_rte)(half4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v8i32_v8f16, _Ruint8_sat_rte)(half8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v16i32_v16f16, _Ruint16_sat_rte)(half16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v2i32_v2f16, _Ruint2_sat_rtz)(half2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v3i32_v3f16, _Ruint3_sat_rtz)(half3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v4i32_v4f16, _Ruint4_sat_rtz)(half4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v8i32_v8f16, _Ruint8_sat_rtz)(half8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v16i32_v16f16, _Ruint16_sat_rtz)(half16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v2i32_v2f16, _Ruint2_sat_rtp)(half2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v3i32_v3f16, _Ruint3_sat_rtp)(half3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v4i32_v4f16, _Ruint4_sat_rtp)(half4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v8i32_v8f16, _Ruint8_sat_rtp)(half8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v16i32_v16f16, _Ruint16_sat_rtp)(half16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v2i32_v2f16, _Ruint2_sat_rtn)(half2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v3i32_v3f16, _Ruint3_sat_rtn)(half3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v4i32_v4f16, _Ruint4_sat_rtn)(half4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v8i32_v8f16, _Ruint8_sat_rtn)(half8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v16i32_v16f16, _Ruint16_sat_rtn)(half16 x);
#if defined(cl_khr_fp64)
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v2i32_v2f64, _Ruint2)(double2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v3i32_v3f64, _Ruint3)(double3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v4i32_v4f64, _Ruint4)(double4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v8i32_v8f64, _Ruint8)(double8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v16i32_v16f64, _Ruint16)(double16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v2i32_v2f64, _Ruint2_sat)(double2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v3i32_v3f64, _Ruint3_sat)(double3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v4i32_v4f64, _Ruint4_sat)(double4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v8i32_v8f64, _Ruint8_sat)(double8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v16i32_v16f64, _Ruint16_sat)(double16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v2i32_v2f64, _Ruint2_rte)(double2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v3i32_v3f64, _Ruint3_rte)(double3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v4i32_v4f64, _Ruint4_rte)(double4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v8i32_v8f64, _Ruint8_rte)(double8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v16i32_v16f64, _Ruint16_rte)(double16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v2i32_v2f64, _Ruint2_rtz)(double2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v3i32_v3f64, _Ruint3_rtz)(double3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v4i32_v4f64, _Ruint4_rtz)(double4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v8i32_v8f64, _Ruint8_rtz)(double8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v16i32_v16f64, _Ruint16_rtz)(double16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v2i32_v2f64, _Ruint2_rtp)(double2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v3i32_v3f64, _Ruint3_rtp)(double3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v4i32_v4f64, _Ruint4_rtp)(double4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v8i32_v8f64, _Ruint8_rtp)(double8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v16i32_v16f64, _Ruint16_rtp)(double16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v2i32_v2f64, _Ruint2_rtn)(double2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v3i32_v3f64, _Ruint3_rtn)(double3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v4i32_v4f64, _Ruint4_rtn)(double4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v8i32_v8f64, _Ruint8_rtn)(double8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v16i32_v16f64, _Ruint16_rtn)(double16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v2i32_v2f64, _Ruint2_sat_rte)(double2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v3i32_v3f64, _Ruint3_sat_rte)(double3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v4i32_v4f64, _Ruint4_sat_rte)(double4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v8i32_v8f64, _Ruint8_sat_rte)(double8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v16i32_v16f64, _Ruint16_sat_rte)(double16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v2i32_v2f64, _Ruint2_sat_rtz)(double2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v3i32_v3f64, _Ruint3_sat_rtz)(double3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v4i32_v4f64, _Ruint4_sat_rtz)(double4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v8i32_v8f64, _Ruint8_sat_rtz)(double8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v16i32_v16f64, _Ruint16_sat_rtz)(double16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v2i32_v2f64, _Ruint2_sat_rtp)(double2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v3i32_v3f64, _Ruint3_sat_rtp)(double3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v4i32_v4f64, _Ruint4_sat_rtp)(double4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v8i32_v8f64, _Ruint8_sat_rtp)(double8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v16i32_v16f64, _Ruint16_sat_rtp)(double16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v2i32_v2f64, _Ruint2_sat_rtn)(double2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v3i32_v3f64, _Ruint3_sat_rtn)(double3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v4i32_v4f64, _Ruint4_sat_rtn)(double4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v8i32_v8f64, _Ruint8_sat_rtn)(double8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v16i32_v16f64, _Ruint16_sat_rtn)(double16 x);
#endif // defined(cl_khr_fp64)
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v2i64_v2f32, _Rulong2)(float2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v3i64_v3f32, _Rulong3)(float3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v4i64_v4f32, _Rulong4)(float4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v8i64_v8f32, _Rulong8)(float8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v16i64_v16f32, _Rulong16)(float16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v2i64_v2f32, _Rulong2_sat)(float2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v3i64_v3f32, _Rulong3_sat)(float3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v4i64_v4f32, _Rulong4_sat)(float4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v8i64_v8f32, _Rulong8_sat)(float8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v16i64_v16f32, _Rulong16_sat)(float16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v2i64_v2f32, _Rulong2_rte)(float2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v3i64_v3f32, _Rulong3_rte)(float3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v4i64_v4f32, _Rulong4_rte)(float4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v8i64_v8f32, _Rulong8_rte)(float8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v16i64_v16f32, _Rulong16_rte)(float16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v2i64_v2f32, _Rulong2_rtz)(float2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v3i64_v3f32, _Rulong3_rtz)(float3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v4i64_v4f32, _Rulong4_rtz)(float4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v8i64_v8f32, _Rulong8_rtz)(float8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v16i64_v16f32, _Rulong16_rtz)(float16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v2i64_v2f32, _Rulong2_rtp)(float2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v3i64_v3f32, _Rulong3_rtp)(float3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v4i64_v4f32, _Rulong4_rtp)(float4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v8i64_v8f32, _Rulong8_rtp)(float8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v16i64_v16f32, _Rulong16_rtp)(float16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v2i64_v2f32, _Rulong2_rtn)(float2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v3i64_v3f32, _Rulong3_rtn)(float3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v4i64_v4f32, _Rulong4_rtn)(float4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v8i64_v8f32, _Rulong8_rtn)(float8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v16i64_v16f32, _Rulong16_rtn)(float16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v2i64_v2f32, _Rulong2_sat_rte)(float2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v3i64_v3f32, _Rulong3_sat_rte)(float3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v4i64_v4f32, _Rulong4_sat_rte)(float4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v8i64_v8f32, _Rulong8_sat_rte)(float8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v16i64_v16f32, _Rulong16_sat_rte)(float16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v2i64_v2f32, _Rulong2_sat_rtz)(float2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v3i64_v3f32, _Rulong3_sat_rtz)(float3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v4i64_v4f32, _Rulong4_sat_rtz)(float4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v8i64_v8f32, _Rulong8_sat_rtz)(float8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v16i64_v16f32, _Rulong16_sat_rtz)(float16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v2i64_v2f32, _Rulong2_sat_rtp)(float2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v3i64_v3f32, _Rulong3_sat_rtp)(float3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v4i64_v4f32, _Rulong4_sat_rtp)(float4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v8i64_v8f32, _Rulong8_sat_rtp)(float8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v16i64_v16f32, _Rulong16_sat_rtp)(float16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v2i64_v2f32, _Rulong2_sat_rtn)(float2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v3i64_v3f32, _Rulong3_sat_rtn)(float3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v4i64_v4f32, _Rulong4_sat_rtn)(float4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v8i64_v8f32, _Rulong8_sat_rtn)(float8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v16i64_v16f32, _Rulong16_sat_rtn)(float16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v2i64_v2f16, _Rulong2)(half2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v3i64_v3f16, _Rulong3)(half3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v4i64_v4f16, _Rulong4)(half4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v8i64_v8f16, _Rulong8)(half8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v16i64_v16f16, _Rulong16)(half16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v2i64_v2f16, _Rulong2_sat)(half2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v3i64_v3f16, _Rulong3_sat)(half3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v4i64_v4f16, _Rulong4_sat)(half4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v8i64_v8f16, _Rulong8_sat)(half8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v16i64_v16f16, _Rulong16_sat)(half16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v2i64_v2f16, _Rulong2_rte)(half2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v3i64_v3f16, _Rulong3_rte)(half3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v4i64_v4f16, _Rulong4_rte)(half4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v8i64_v8f16, _Rulong8_rte)(half8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v16i64_v16f16, _Rulong16_rte)(half16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v2i64_v2f16, _Rulong2_rtz)(half2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v3i64_v3f16, _Rulong3_rtz)(half3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v4i64_v4f16, _Rulong4_rtz)(half4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v8i64_v8f16, _Rulong8_rtz)(half8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v16i64_v16f16, _Rulong16_rtz)(half16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v2i64_v2f16, _Rulong2_rtp)(half2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v3i64_v3f16, _Rulong3_rtp)(half3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v4i64_v4f16, _Rulong4_rtp)(half4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v8i64_v8f16, _Rulong8_rtp)(half8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v16i64_v16f16, _Rulong16_rtp)(half16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v2i64_v2f16, _Rulong2_rtn)(half2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v3i64_v3f16, _Rulong3_rtn)(half3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v4i64_v4f16, _Rulong4_rtn)(half4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v8i64_v8f16, _Rulong8_rtn)(half8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v16i64_v16f16, _Rulong16_rtn)(half16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v2i64_v2f16, _Rulong2_sat_rte)(half2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v3i64_v3f16, _Rulong3_sat_rte)(half3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v4i64_v4f16, _Rulong4_sat_rte)(half4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v8i64_v8f16, _Rulong8_sat_rte)(half8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v16i64_v16f16, _Rulong16_sat_rte)(half16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v2i64_v2f16, _Rulong2_sat_rtz)(half2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v3i64_v3f16, _Rulong3_sat_rtz)(half3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v4i64_v4f16, _Rulong4_sat_rtz)(half4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v8i64_v8f16, _Rulong8_sat_rtz)(half8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v16i64_v16f16, _Rulong16_sat_rtz)(half16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v2i64_v2f16, _Rulong2_sat_rtp)(half2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v3i64_v3f16, _Rulong3_sat_rtp)(half3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v4i64_v4f16, _Rulong4_sat_rtp)(half4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v8i64_v8f16, _Rulong8_sat_rtp)(half8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v16i64_v16f16, _Rulong16_sat_rtp)(half16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v2i64_v2f16, _Rulong2_sat_rtn)(half2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v3i64_v3f16, _Rulong3_sat_rtn)(half3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v4i64_v4f16, _Rulong4_sat_rtn)(half4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v8i64_v8f16, _Rulong8_sat_rtn)(half8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v16i64_v16f16, _Rulong16_sat_rtn)(half16 x);
#if defined(cl_khr_fp64)
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v2i64_v2f64, _Rulong2)(double2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v3i64_v3f64, _Rulong3)(double3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v4i64_v4f64, _Rulong4)(double4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v8i64_v8f64, _Rulong8)(double8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _v16i64_v16f64, _Rulong16)(double16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v2i64_v2f64, _Rulong2_sat)(double2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v3i64_v3f64, _Rulong3_sat)(double3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v4i64_v4f64, _Rulong4_sat)(double4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v8i64_v8f64, _Rulong8_sat)(double8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_v16i64_v16f64, _Rulong16_sat)(double16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v2i64_v2f64, _Rulong2_rte)(double2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v3i64_v3f64, _Rulong3_rte)(double3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v4i64_v4f64, _Rulong4_rte)(double4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v8i64_v8f64, _Rulong8_rte)(double8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTE_v16i64_v16f64, _Rulong16_rte)(double16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v2i64_v2f64, _Rulong2_rtz)(double2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v3i64_v3f64, _Rulong3_rtz)(double3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v4i64_v4f64, _Rulong4_rtz)(double4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v8i64_v8f64, _Rulong8_rtz)(double8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTZ_v16i64_v16f64, _Rulong16_rtz)(double16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v2i64_v2f64, _Rulong2_rtp)(double2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v3i64_v3f64, _Rulong3_rtp)(double3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v4i64_v4f64, _Rulong4_rtp)(double4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v8i64_v8f64, _Rulong8_rtp)(double8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTP_v16i64_v16f64, _Rulong16_rtp)(double16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v2i64_v2f64, _Rulong2_rtn)(double2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v3i64_v3f64, _Rulong3_rtn)(double3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v4i64_v4f64, _Rulong4_rtn)(double4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v8i64_v8f64, _Rulong8_rtn)(double8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _RTN_v16i64_v16f64, _Rulong16_rtn)(double16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v2i64_v2f64, _Rulong2_sat_rte)(double2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v3i64_v3f64, _Rulong3_sat_rte)(double3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v4i64_v4f64, _Rulong4_sat_rte)(double4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v8i64_v8f64, _Rulong8_sat_rte)(double8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTE_v16i64_v16f64, _Rulong16_sat_rte)(double16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v2i64_v2f64, _Rulong2_sat_rtz)(double2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v3i64_v3f64, _Rulong3_sat_rtz)(double3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v4i64_v4f64, _Rulong4_sat_rtz)(double4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v8i64_v8f64, _Rulong8_sat_rtz)(double8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTZ_v16i64_v16f64, _Rulong16_sat_rtz)(double16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v2i64_v2f64, _Rulong2_sat_rtp)(double2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v3i64_v3f64, _Rulong3_sat_rtp)(double3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v4i64_v4f64, _Rulong4_sat_rtp)(double4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v8i64_v8f64, _Rulong8_sat_rtp)(double8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTP_v16i64_v16f64, _Rulong16_sat_rtp)(double16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v2i64_v2f64, _Rulong2_sat_rtn)(double2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v3i64_v3f64, _Rulong3_sat_rtn)(double3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v4i64_v4f64, _Rulong4_sat_rtn)(double4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v8i64_v8f64, _Rulong8_sat_rtn)(double8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToU, _Sat_RTN_v16i64_v16f64, _Rulong16_sat_rtn)(double16 x);
#endif // defined(cl_khr_fp64)
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v2i8_v2i8, _Ruchar2)(char2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v3i8_v3i8, _Ruchar3)(char3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v4i8_v4i8, _Ruchar4)(char4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v8i8_v8i8, _Ruchar8)(char8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v16i8_v16i8, _Ruchar16)(char16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v2i8_v2i16, _Ruchar2)(short2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v3i8_v3i16, _Ruchar3)(short3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v4i8_v4i16, _Ruchar4)(short4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v8i8_v8i16, _Ruchar8)(short8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v16i8_v16i16, _Ruchar16)(short16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v2i8_v2i32, _Ruchar2)(int2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v3i8_v3i32, _Ruchar3)(int3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v4i8_v4i32, _Ruchar4)(int4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v8i8_v8i32, _Ruchar8)(int8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v16i8_v16i32, _Ruchar16)(int16 x);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v2i8_v2i64, _Ruchar2)(long2 x);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v3i8_v3i64, _Ruchar3)(long3 x);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v4i8_v4i64, _Ruchar4)(long4 x);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v8i8_v8i64, _Ruchar8)(long8 x);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v16i8_v16i64, _Ruchar16)(long16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v2i16_v2i8, _Rushort2)(char2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v3i16_v3i8, _Rushort3)(char3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v4i16_v4i8, _Rushort4)(char4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v8i16_v8i8, _Rushort8)(char8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v16i16_v16i8, _Rushort16)(char16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v2i16_v2i16, _Rushort2)(short2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v3i16_v3i16, _Rushort3)(short3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v4i16_v4i16, _Rushort4)(short4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v8i16_v8i16, _Rushort8)(short8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v16i16_v16i16, _Rushort16)(short16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v2i16_v2i32, _Rushort2)(int2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v3i16_v3i32, _Rushort3)(int3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v4i16_v4i32, _Rushort4)(int4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v8i16_v8i32, _Rushort8)(int8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v16i16_v16i32, _Rushort16)(int16 x);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v2i16_v2i64, _Rushort2)(long2 x);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v3i16_v3i64, _Rushort3)(long3 x);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v4i16_v4i64, _Rushort4)(long4 x);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v8i16_v8i64, _Rushort8)(long8 x);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v16i16_v16i64, _Rushort16)(long16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v2i32_v2i8, _Ruint2)(char2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v3i32_v3i8, _Ruint3)(char3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v4i32_v4i8, _Ruint4)(char4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v8i32_v8i8, _Ruint8)(char8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v16i32_v16i8, _Ruint16)(char16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v2i32_v2i16, _Ruint2)(short2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v3i32_v3i16, _Ruint3)(short3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v4i32_v4i16, _Ruint4)(short4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v8i32_v8i16, _Ruint8)(short8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v16i32_v16i16, _Ruint16)(short16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v2i32_v2i32, _Ruint2)(int2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v3i32_v3i32, _Ruint3)(int3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v4i32_v4i32, _Ruint4)(int4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v8i32_v8i32, _Ruint8)(int8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v16i32_v16i32, _Ruint16)(int16 x);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v2i32_v2i64, _Ruint2)(long2 x);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v3i32_v3i64, _Ruint3)(long3 x);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v4i32_v4i64, _Ruint4)(long4 x);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v8i32_v8i64, _Ruint8)(long8 x);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v16i32_v16i64, _Ruint16)(long16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v2i64_v2i8, _Rulong2)(char2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v3i64_v3i8, _Rulong3)(char3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v4i64_v4i8, _Rulong4)(char4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v8i64_v8i8, _Rulong8)(char8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v16i64_v16i8, _Rulong16)(char16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v2i64_v2i16, _Rulong2)(short2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v3i64_v3i16, _Rulong3)(short3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v4i64_v4i16, _Rulong4)(short4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v8i64_v8i16, _Rulong8)(short8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v16i64_v16i16, _Rulong16)(short16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v2i64_v2i32, _Rulong2)(int2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v3i64_v3i32, _Rulong3)(int3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v4i64_v4i32, _Rulong4)(int4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v8i64_v8i32, _Rulong8)(int8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v16i64_v16i32, _Rulong16)(int16 x);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v2i64_v2i64, _Rulong2)(long2 x);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v3i64_v3i64, _Rulong3)(long3 x);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v4i64_v4i64, _Rulong4)(long4 x);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v8i64_v8i64, _Rulong8)(long8 x);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertSToU, _v16i64_v16i64, _Rulong16)(long16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v2i8_v2i8, _Rchar2)(uchar2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v3i8_v3i8, _Rchar3)(uchar3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v4i8_v4i8, _Rchar4)(uchar4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v8i8_v8i8, _Rchar8)(uchar8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v16i8_v16i8, _Rchar16)(uchar16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v2i8_v2i16, _Rchar2)(ushort2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v3i8_v3i16, _Rchar3)(ushort3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v4i8_v4i16, _Rchar4)(ushort4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v8i8_v8i16, _Rchar8)(ushort8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v16i8_v16i16, _Rchar16)(ushort16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v2i8_v2i32, _Rchar2)(uint2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v3i8_v3i32, _Rchar3)(uint3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v4i8_v4i32, _Rchar4)(uint4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v8i8_v8i32, _Rchar8)(uint8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v16i8_v16i32, _Rchar16)(uint16 x);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v2i8_v2i64, _Rchar2)(ulong2 x);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v3i8_v3i64, _Rchar3)(ulong3 x);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v4i8_v4i64, _Rchar4)(ulong4 x);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v8i8_v8i64, _Rchar8)(ulong8 x);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v16i8_v16i64, _Rchar16)(ulong16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v2i16_v2i8, _Rshort2)(uchar2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v3i16_v3i8, _Rshort3)(uchar3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v4i16_v4i8, _Rshort4)(uchar4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v8i16_v8i8, _Rshort8)(uchar8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v16i16_v16i8, _Rshort16)(uchar16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v2i16_v2i16, _Rshort2)(ushort2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v3i16_v3i16, _Rshort3)(ushort3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v4i16_v4i16, _Rshort4)(ushort4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v8i16_v8i16, _Rshort8)(ushort8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v16i16_v16i16, _Rshort16)(ushort16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v2i16_v2i32, _Rshort2)(uint2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v3i16_v3i32, _Rshort3)(uint3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v4i16_v4i32, _Rshort4)(uint4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v8i16_v8i32, _Rshort8)(uint8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v16i16_v16i32, _Rshort16)(uint16 x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v2i16_v2i64, _Rshort2)(ulong2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v3i16_v3i64, _Rshort3)(ulong3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v4i16_v4i64, _Rshort4)(ulong4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v8i16_v8i64, _Rshort8)(ulong8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v16i16_v16i64, _Rshort16)(ulong16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v2i32_v2i8, _Rint2)(uchar2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v3i32_v3i8, _Rint3)(uchar3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v4i32_v4i8, _Rint4)(uchar4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v8i32_v8i8, _Rint8)(uchar8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v16i32_v16i8, _Rint16)(uchar16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v2i32_v2i16, _Rint2)(ushort2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v3i32_v3i16, _Rint3)(ushort3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v4i32_v4i16, _Rint4)(ushort4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v8i32_v8i16, _Rint8)(ushort8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v16i32_v16i16, _Rint16)(ushort16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v2i32_v2i32, _Rint2)(uint2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v3i32_v3i32, _Rint3)(uint3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v4i32_v4i32, _Rint4)(uint4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v8i32_v8i32, _Rint8)(uint8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v16i32_v16i32, _Rint16)(uint16 x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v2i32_v2i64, _Rint2)(ulong2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v3i32_v3i64, _Rint3)(ulong3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v4i32_v4i64, _Rint4)(ulong4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v8i32_v8i64, _Rint8)(ulong8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v16i32_v16i64, _Rint16)(ulong16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v2i64_v2i8, _Rlong2)(uchar2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v3i64_v3i8, _Rlong3)(uchar3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v4i64_v4i8, _Rlong4)(uchar4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v8i64_v8i8, _Rlong8)(uchar8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v16i64_v16i8, _Rlong16)(uchar16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v2i64_v2i16, _Rlong2)(ushort2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v3i64_v3i16, _Rlong3)(ushort3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v4i64_v4i16, _Rlong4)(ushort4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v8i64_v8i16, _Rlong8)(ushort8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v16i64_v16i16, _Rlong16)(ushort16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v2i64_v2i32, _Rlong2)(uint2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v3i64_v3i32, _Rlong3)(uint3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v4i64_v4i32, _Rlong4)(uint4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v8i64_v8i32, _Rlong8)(uint8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v16i64_v16i32, _Rlong16)(uint16 x);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v2i64_v2i64, _Rlong2)(ulong2 x);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v3i64_v3i64, _Rlong3)(ulong3 x);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v4i64_v4i64, _Rlong4)(ulong4 x);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v8i64_v8i64, _Rlong8)(ulong8 x);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SatConvertUToS, _v16i64_v16i64, _Rlong16)(ulong16 x);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToBF16INTEL, _f32, )(float x);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToBF16INTEL, _v2f32, )(float2 x);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToBF16INTEL, _v3f32, )(float3 x);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToBF16INTEL, _v4f32, )(float4 x);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToBF16INTEL, _v8f32, )(float8 x);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertFToBF16INTEL, _v16f32, )(float16 x);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertBF16ToFINTEL, _i16, )(short x);
float2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertBF16ToFINTEL, _v2i16, )(short2 x);
float3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertBF16ToFINTEL, _v3i16, )(short3 x);
float4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertBF16ToFINTEL, _v4i16, )(short4 x);
float8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertBF16ToFINTEL, _v8i16, )(short8 x);
float16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(ConvertBF16ToFINTEL, _v16i16, )(short16 x);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(RoundFToTF32INTEL, _f32, )(float x);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(RoundFToTF32INTEL, _v2f32, )(float2 x);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(RoundFToTF32INTEL, _v3f32, )(float3 x);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(RoundFToTF32INTEL, _v4f32, )(float4 x);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(RoundFToTF32INTEL, _v8f32, )(float8 x);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(RoundFToTF32INTEL, _v16f32, )(float16 x);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
private void* SPIRV_OVERLOADABLE SPIRV_BUILTIN(GenericCastToPtrExplicit, _p0i8_p4i8_i32, _ToPrivate)(generic char *Pointer, int Storage);
local void* SPIRV_OVERLOADABLE SPIRV_BUILTIN(GenericCastToPtrExplicit, _p3i8_p4i8_i32, _ToLocal)(generic char *Pointer, int Storage);
global void* SPIRV_OVERLOADABLE SPIRV_BUILTIN(GenericCastToPtrExplicit, _p1i8_p4i8_i32, _ToGlobal)(generic char *Pointer, int Storage);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(GenericPtrMemSemantics, _p4i8, )(generic char *Pointer);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
// Arithmetic Instructions
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(Dot, _v2f16_v2f16, )(half2 Vector1, half2 Vector2);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(Dot, _v3f16_v3f16, )(half3 Vector1, half3 Vector2);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(Dot, _v4f16_v4f16, )(half4 Vector1, half4 Vector2);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(Dot, _v8f16_v8f16, )(half8 Vector1, half8 Vector2);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(Dot, _v16f16_v16f16, )(half16 Vector1, half16 Vector2);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(Dot, _v2f32_v2f32, )(float2 Vector1, float2 Vector2);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(Dot, _v3f32_v3f32, )(float3 Vector1, float3 Vector2);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(Dot, _v4f32_v4f32, )(float4 Vector1, float4 Vector2);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(Dot, _v8f32_v8f32, )(float8 Vector1, float8 Vector2);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(Dot, _v16f32_v16f32, )(float16 Vector1, float16 Vector2);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(Dot, _v2f64_v2f64, )(double2 Vector1, double2 Vector2);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(Dot, _v3f64_v3f64, )(double3 Vector1, double3 Vector2);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(Dot, _v4f64_v4f64, )(double4 Vector1, double4 Vector2);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(Dot, _v8f64_v8f64, )(double8 Vector1, double8 Vector2);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(Dot, _v16f64_v16f64, )(double16 Vector1, double16 Vector2);
#endif // defined(cl_khr_fp64)
typedef struct { uchar a; uchar b; } TwoOp_i8;
typedef struct { uchar2 a; uchar2 b; } TwoOp_v2i8;
typedef struct { uchar3 a; uchar3 b; } TwoOp_v3i8;
typedef struct { uchar4 a; uchar4 b; } TwoOp_v4i8;
typedef struct { uchar8 a; uchar8 b; } TwoOp_v8i8;
typedef struct { uchar16 a; uchar16 b; } TwoOp_v16i8;
typedef struct { ushort a; ushort b; } TwoOp_i16;
typedef struct { ushort2 a; ushort2 b; } TwoOp_v2i16;
typedef struct { ushort3 a; ushort3 b; } TwoOp_v3i16;
typedef struct { ushort4 a; ushort4 b; } TwoOp_v4i16;
typedef struct { ushort8 a; ushort8 b; } TwoOp_v8i16;
typedef struct { ushort16 a; ushort16 b; } TwoOp_v16i16;
typedef struct { uint a; uint b; } TwoOp_i32;
typedef struct { uint2 a; uint2 b; } TwoOp_v2i32;
typedef struct { uint3 a; uint3 b; } TwoOp_v3i32;
typedef struct { uint4 a; uint4 b; } TwoOp_v4i32;
typedef struct { uint8 a; uint8 b; } TwoOp_v8i32;
typedef struct { uint16 a; uint16 b; } TwoOp_v16i32;
typedef struct { ulong a; ulong b; } TwoOp_i64;
typedef struct { ulong2 a; ulong2 b; } TwoOp_v2i64;
typedef struct { ulong3 a; ulong3 b; } TwoOp_v3i64;
typedef struct { ulong4 a; ulong4 b; } TwoOp_v4i64;
typedef struct { ulong8 a; ulong8 b; } TwoOp_v8i64;
typedef struct { ulong16 a; ulong16 b; } TwoOp_v16i64;
TwoOp_i8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _i8_i8, )(uchar Operand1, uchar Operand2);
TwoOp_v2i8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v2i8_v2i8, )(uchar2 Operand1, uchar2 Operand2);
TwoOp_v3i8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v3i8_v3i8, )(uchar3 Operand1, uchar3 Operand2);
TwoOp_v4i8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v4i8_v4i8, )(uchar4 Operand1, uchar4 Operand2);
TwoOp_v8i8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v8i8_v8i8, )(uchar8 Operand1, uchar8 Operand2);
TwoOp_v16i8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v16i8_v16i8, )(uchar16 Operand1, uchar16 Operand2);
TwoOp_i16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _i16_i16, )(ushort Operand1, ushort Operand2);
TwoOp_v2i16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v2i16_v2i16, )(ushort2 Operand1, ushort2 Operand2);
TwoOp_v3i16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v3i16_v3i16, )(ushort3 Operand1, ushort3 Operand2);
TwoOp_v4i16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v4i16_v4i16, )(ushort4 Operand1, ushort4 Operand2);
TwoOp_v8i16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v8i16_v8i16, )(ushort8 Operand1, ushort8 Operand2);
TwoOp_v16i16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v16i16_v16i16, )(ushort16 Operand1, ushort16 Operand2);
TwoOp_i32 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _i32_i32, )(uint Operand1, uint Operand2);
TwoOp_v2i32 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v2i32_v2i32, )(uint2 Operand1, uint2 Operand2);
TwoOp_v3i32 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v3i32_v3i32, )(uint3 Operand1, uint3 Operand2);
TwoOp_v4i32 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v4i32_v4i32, )(uint4 Operand1, uint4 Operand2);
TwoOp_v8i32 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v8i32_v8i32, )(uint8 Operand1, uint8 Operand2);
TwoOp_v16i32 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v16i32_v16i32, )(uint16 Operand1, uint16 Operand2);
TwoOp_i64 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _i64_i64, )(ulong Operand1, ulong Operand2);
TwoOp_v2i64 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v2i64_v2i64, )(ulong2 Operand1, ulong2 Operand2);
TwoOp_v3i64 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v3i64_v3i64, )(ulong3 Operand1, ulong3 Operand2);
TwoOp_v4i64 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v4i64_v4i64, )(ulong4 Operand1, ulong4 Operand2);
TwoOp_v8i64 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v8i64_v8i64, )(ulong8 Operand1, ulong8 Operand2);
TwoOp_v16i64 SPIRV_OVERLOADABLE SPIRV_BUILTIN(UMulExtended, _v16i64_v16i64, )(ulong16 Operand1, ulong16 Operand2);
TwoOp_i8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _i8_i8, )(char Operand1, char Operand2);
TwoOp_v2i8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v2i8_v2i8, )(char2 Operand1, char2 Operand2);
TwoOp_v3i8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v3i8_v3i8, )(char3 Operand1, char3 Operand2);
TwoOp_v4i8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v4i8_v4i8, )(char4 Operand1, char4 Operand2);
TwoOp_v8i8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v8i8_v8i8, )(char8 Operand1, char8 Operand2);
TwoOp_v16i8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v16i8_v16i8, )(char16 Operand1, char16 Operand2);
TwoOp_i16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _i16_i16, )(short Operand1, short Operand2);
TwoOp_v2i16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v2i16_v2i16, )(short2 Operand1, short2 Operand2);
TwoOp_v3i16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v3i16_v3i16, )(short3 Operand1, short3 Operand2);
TwoOp_v4i16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v4i16_v4i16, )(short4 Operand1, short4 Operand2);
TwoOp_v8i16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v8i16_v8i16, )(short8 Operand1, short8 Operand2);
TwoOp_v16i16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v16i16_v16i16, )(short16 Operand1, short16 Operand2);
TwoOp_i32 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _i32_i32, )(int Operand1, int Operand2);
TwoOp_v2i32 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v2i32_v2i32, )(int2 Operand1, int2 Operand2);
TwoOp_v3i32 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v3i32_v3i32, )(int3 Operand1, int3 Operand2);
TwoOp_v4i32 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v4i32_v4i32, )(int4 Operand1, int4 Operand2);
TwoOp_v8i32 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v8i32_v8i32, )(int8 Operand1, int8 Operand2);
TwoOp_v16i32 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v16i32_v16i32, )(int16 Operand1, int16 Operand2);
TwoOp_i64 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _i64_i64, )(long Operand1, long Operand2);
TwoOp_v2i64 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v2i64_v2i64, )(long2 Operand1, long2 Operand2);
TwoOp_v3i64 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v3i64_v3i64, )(long3 Operand1, long3 Operand2);
TwoOp_v4i64 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v4i64_v4i64, )(long4 Operand1, long4 Operand2);
TwoOp_v8i64 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v8i64_v8i64, )(long8 Operand1, long8 Operand2);
TwoOp_v16i64 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SMulExtended, _v16i64_v16i64, )(long16 Operand1, long16 Operand2);
// Bit Instructions
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _i8_i8_i32_i32, ) (char Base, char Insert, uint Offset, uint Count);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v2i8_v2i8_i32_i32, ) (char2 Base, char2 Insert, uint Offset, uint Count);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v3i8_v3i8_i32_i32, ) (char3 Base, char3 Insert, uint Offset, uint Count);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v4i8_v4i8_i32_i32, ) (char4 Base, char4 Insert, uint Offset, uint Count);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v8i8_v8i8_i32_i32, ) (char8 Base, char8 Insert, uint Offset, uint Count);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v16i8_v16i8_i32_i32, )(char16 Base, char16 Insert, uint Offset, uint Count);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _i16_i16_i32_i32, ) (short Base, short Insert, uint Offset, uint Count);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v2i16_v2i16_i32_i32, ) (short2 Base, short2 Insert, uint Offset, uint Count);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v3i16_v3i16_i32_i32, ) (short3 Base, short3 Insert, uint Offset, uint Count);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v4i16_v4i16_i32_i32, ) (short4 Base, short4 Insert, uint Offset, uint Count);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v8i16_v8i16_i32_i32, ) (short8 Base, short8 Insert, uint Offset, uint Count);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v16i16_v16i16_i32_i32, )(short16 Base, short16 Insert, uint Offset, uint Count);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _i32_i32_i32_i32, ) (int Base, int Insert, uint Offset, uint Count);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v2i32_v2i32_i32_i32, ) (int2 Base, int2 Insert, uint Offset, uint Count);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v3i32_v3i32_i32_i32, ) (int3 Base, int3 Insert, uint Offset, uint Count);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v4i32_v4i32_i32_i32, ) (int4 Base, int4 Insert, uint Offset, uint Count);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v8i32_v8i32_i32_i32, ) (int8 Base, int8 Insert, uint Offset, uint Count);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v16i32_v16i32_i32_i32, )(int16 Base, int16 Insert, uint Offset, uint Count);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _i64_i64_i32_i32, ) (long Base, long Insert, uint Offset, uint Count);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v2i64_v2i64_i32_i32, ) (long2 Base, long2 Insert, uint Offset, uint Count);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v3i64_v3i64_i32_i32, ) (long3 Base, long3 Insert, uint Offset, uint Count);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v4i64_v4i64_i32_i32, ) (long4 Base, long4 Insert, uint Offset, uint Count);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v8i64_v8i64_i32_i32, ) (long8 Base, long8 Insert, uint Offset, uint Count);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldInsert, _v16i64_v16i64_i32_i32, )(long16 Base, long16 Insert, uint Offset, uint Count);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _i8_i32_i32, ) (char Base, uint Offset, uint Count);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v2i8_i32_i32, ) (char2 Base, uint Offset, uint Count);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v3i8_i32_i32, ) (char3 Base, uint Offset, uint Count);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v4i8_i32_i32, ) (char4 Base, uint Offset, uint Count);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v8i8_i32_i32, ) (char8 Base, uint Offset, uint Count);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v16i8_i32_i32, )(char16 Base, uint Offset, uint Count);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _i16_i32_i32, ) (short Base, uint Offset, uint Count);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v2i16_i32_i32, ) (short2 Base, uint Offset, uint Count);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v3i16_i32_i32, ) (short3 Base, uint Offset, uint Count);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v4i16_i32_i32, ) (short4 Base, uint Offset, uint Count);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v8i16_i32_i32, ) (short8 Base, uint Offset, uint Count);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v16i16_i32_i32, )(short16 Base, uint Offset, uint Count);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _i32_i32_i32, ) (int Base, uint Offset, uint Count);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v2i32_i32_i32, ) (int2 Base, uint Offset, uint Count);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v3i32_i32_i32, ) (int3 Base, uint Offset, uint Count);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v4i32_i32_i32, ) (int4 Base, uint Offset, uint Count);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v8i32_i32_i32, ) (int8 Base, uint Offset, uint Count);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v16i32_i32_i32, )(int16 Base, uint Offset, uint Count);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _i64_i32_i32, ) (long Base, uint Offset, uint Count);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v2i64_i32_i32, ) (long2 Base, uint Offset, uint Count);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v3i64_i32_i32, ) (long3 Base, uint Offset, uint Count);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v4i64_i32_i32, ) (long4 Base, uint Offset, uint Count);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v8i64_i32_i32, ) (long8 Base, uint Offset, uint Count);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldSExtract, _v16i64_i32_i32, )(long16 Base, uint Offset, uint Count);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _i8_i32_i32, ) (uchar Base, uint Offset, uint Count);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v2i8_i32_i32, ) (uchar2 Base, uint Offset, uint Count);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v3i8_i32_i32, ) (uchar3 Base, uint Offset, uint Count);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v4i8_i32_i32, ) (uchar4 Base, uint Offset, uint Count);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v8i8_i32_i32, ) (uchar8 Base, uint Offset, uint Count);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v16i8_i32_i32, )(uchar16 Base, uint Offset, uint Count);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _i16_i32_i32, ) (ushort Base, uint Offset, uint Count);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v2i16_i32_i32, ) (ushort2 Base, uint Offset, uint Count);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v3i16_i32_i32, ) (ushort3 Base, uint Offset, uint Count);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v4i16_i32_i32, ) (ushort4 Base, uint Offset, uint Count);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v8i16_i32_i32, ) (ushort8 Base, uint Offset, uint Count);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v16i16_i32_i32, )(ushort16 Base, uint Offset, uint Count);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _i32_i32_i32, ) (uint Base, uint Offset, uint Count);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v2i32_i32_i32, ) (uint2 Base, uint Offset, uint Count);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v3i32_i32_i32, ) (uint3 Base, uint Offset, uint Count);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v4i32_i32_i32, ) (uint4 Base, uint Offset, uint Count);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v8i32_i32_i32, ) (uint8 Base, uint Offset, uint Count);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v16i32_i32_i32, )(uint16 Base, uint Offset, uint Count);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _i64_i32_i32, ) (ulong Base, uint Offset, uint Count);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v2i64_i32_i32, ) (ulong2 Base, uint Offset, uint Count);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v3i64_i32_i32, ) (ulong3 Base, uint Offset, uint Count);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v4i64_i32_i32, ) (ulong4 Base, uint Offset, uint Count);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v8i64_i32_i32, ) (ulong8 Base, uint Offset, uint Count);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitFieldUExtract, _v16i64_i32_i32, )(ulong16 Base, uint Offset, uint Count);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _i8, )(char Base);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v2i8, )(char2 Base);
char3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v3i8, )(char3 Base);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v4i8, )(char4 Base);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v8i8, )(char8 Base);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v16i8, )(char16 Base);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _i16, )(short Base);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v2i16, )(short2 Base);
short3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v3i16, )(short3 Base);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v4i16, )(short4 Base);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v8i16, )(short8 Base);
short16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v16i16, )(short16 Base);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _i32, )(int Base);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v2i32, )(int2 Base);
int3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v3i32, )(int3 Base);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v4i32, )(int4 Base);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v8i32, )(int8 Base);
int16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v16i32, )(int16 Base);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _i64, )(long Base);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v2i64, )(long2 Base);
long3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v3i64, )(long3 Base);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v4i64, )(long4 Base);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v8i64, )(long8 Base);
long16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitReverse, _v16i64, )(long16 Base);
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _i8, )(char Base);
uchar2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v2i8, )(char2 Base);
uchar3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v3i8, )(char3 Base);
uchar4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v4i8, )(char4 Base);
uchar8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v8i8, )(char8 Base);
uchar16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v16i8, )(char16 Base);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _i16, )(short Base);
ushort2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v2i16, )(short2 Base);
ushort3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v3i16, )(short3 Base);
ushort4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v4i16, )(short4 Base);
ushort8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v8i16, )(short8 Base);
ushort16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v16i16, )(short16 Base);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _i32, )(int Base);
uint2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v2i32, )(int2 Base);
uint3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v3i32, )(int3 Base);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v4i32, )(int4 Base);
uint8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v8i32, )(int8 Base);
uint16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v16i32, )(int16 Base);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _i64, )(long Base);
ulong2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v2i64, )(long2 Base);
ulong3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v3i64, )(long3 Base);
ulong4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v4i64, )(long4 Base);
ulong8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v8i64, )(long8 Base);
ulong16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(BitCount, _v16i64, )(long16 Base);
// Relational and Logical Instructions
// Our OpenCL C builtins currently do not call this
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(Any, _v2i1, )(__bool2 Vector);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(Any, _v3i1, )(__bool3 Vector);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(Any, _v4i1, )(__bool4 Vector);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(Any, _v8i1, )(__bool8 Vector);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(Any, _v16i1, )(__bool16 Vector);
// Our OpenCL C builtins currently do not call this
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(All, _v2i1, )(__bool2 Vector);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(All, _v3i1, )(__bool3 Vector);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(All, _v4i1, )(__bool4 Vector);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(All, _v8i1, )(__bool8 Vector);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(All, _v16i1, )(__bool16 Vector);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _f16, )(half x);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _f32, )(float x);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _v2f16, )(half2 x);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _v2f32, )(float2 x);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _v3f16, )(half3 x);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _v3f32, )(float3 x);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _v4f16, )(half4 x);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _v4f32, )(float4 x);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _v8f16, )(half8 x);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _v8f32, )(float8 x);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _v16f16, )(half16 x);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _v16f32, )(float16 x);
#if defined(cl_khr_fp64)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _f64, )(double x);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _v2f64, )(double2 x);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _v3f64, )(double3 x);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _v4f64, )(double4 x);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _v8f64, )(double8 x);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNan, _v16f64, )(double16 x);
#endif // defined(cl_khr_fp64)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _f16, )(half x);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _f32, )(float x);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _v2f16, )(half2 x);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _v2f32, )(float2 x);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _v3f16, )(half3 x);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _v3f32, )(float3 x);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _v4f16, )(half4 x);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _v4f32, )(float4 x);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _v8f16, )(half8 x);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _v8f32, )(float8 x);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _v16f16, )(half16 x);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _v16f32, )(float16 x);
#if defined(cl_khr_fp64)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _f64, )(double x);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _v2f64, )(double2 x);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _v3f64, )(double3 x);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _v4f64, )(double4 x);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _v8f64, )(double8 x);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsInf, _v16f64, )(double16 x);
#endif // defined(cl_khr_fp64)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _f16, )(half x);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _f32, )(float x);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _v2f16, )(half2 x);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _v2f32, )(float2 x);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _v3f16, )(half3 x);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _v3f32, )(float3 x);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _v4f16, )(half4 x);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _v4f32, )(float4 x);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _v8f16, )(half8 x);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _v8f32, )(float8 x);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _v16f16, )(half16 x);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _v16f32, )(float16 x);
#if defined(cl_khr_fp64)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _f64, )(double x);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _v2f64, )(double2 x);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _v3f64, )(double3 x);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _v4f64, )(double4 x);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _v8f64, )(double8 x);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsFinite, _v16f64, )(double16 x);
#endif // defined(cl_khr_fp64)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _f16, )(half x);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _f32, )(float x);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _v2f16, )(half2 x);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _v2f32, )(float2 x);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _v3f16, )(half3 x);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _v3f32, )(float3 x);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _v4f16, )(half4 x);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _v4f32, )(float4 x);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _v8f16, )(half8 x);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _v8f32, )(float8 x);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _v16f16, )(half16 x);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _v16f32, )(float16 x);
#if defined(cl_khr_fp64)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _f64, )(double x);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _v2f64, )(double2 x);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _v3f64, )(double3 x);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _v4f64, )(double4 x);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _v8f64, )(double8 x);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsNormal, _v16f64, )(double16 x);
#endif // defined(cl_khr_fp64)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _f16, )(half x);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _f32, )(float x);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _v2f16, )(half2 x);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _v2f32, )(float2 x);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _v3f16, )(half3 x);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _v3f32, )(float3 x);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _v4f16, )(half4 x);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _v4f32, )(float4 x);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _v8f16, )(half8 x);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _v8f32, )(float8 x);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _v16f16, )(half16 x);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _v16f32, )(float16 x);
#if defined(cl_khr_fp64)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _f64, )(double x);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _v2f64, )(double2 x);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _v3f64, )(double3 x);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _v4f64, )(double4 x);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _v8f64, )(double8 x);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SignBitSet, _v16f64, )(double16 x);
#endif // defined(cl_khr_fp64)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _f16_f16, )(half x, half y);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _f32_f32, )(float x, float y);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _v2f16_v2f16, )(half2 x, half2 y);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _v2f32_v2f32, )(float2 x, float2 y);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _v3f16_v3f16, )(half3 x, half3 y);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _v3f32_v3f32, )(float3 x, float3 y);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _v4f16_v4f16, )(half4 x, half4 y);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _v4f32_v4f32, )(float4 x, float4 y);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _v8f16_v8f16, )(half8 x, half8 y);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _v8f32_v8f32, )(float8 x, float8 y);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _v16f16_v16f16, )(half16 x, half16 y);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _v16f32_v16f32, )(float16 x, float16 y);
#if defined(cl_khr_fp64)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _f64_f64, )(double x, double y);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _v2f64_v2f64, )(double2 x, double2 y);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _v3f64_v3f64, )(double3 x, double3 y);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _v4f64_v4f64, )(double4 x, double4 y);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _v8f64_v8f64, )(double8 x, double8 y);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(LessOrGreater, _v16f64_v16f64, )(double16 x, double16 y);
#endif // defined(cl_khr_fp64)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _f16_f16, )(half x, half y);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _f32_f32, )(float x, float y);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _v2f16_v2f16, )(half2 x, half2 y);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _v2f32_v2f32, )(float2 x, float2 y);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _v3f16_v3f16, )(half3 x, half3 y);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _v3f32_v3f32, )(float3 x, float3 y);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _v4f16_v4f16, )(half4 x, half4 y);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _v4f32_v4f32, )(float4 x, float4 y);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _v8f16_v8f16, )(half8 x, half8 y);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _v8f32_v8f32, )(float8 x, float8 y);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _v16f16_v16f16, )(half16 x, half16 y);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _v16f32_v16f32, )(float16 x, float16 y);
#if defined(cl_khr_fp64)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _f64_f64, )(double x, double y);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _v2f64_v2f64, )(double2 x, double2 y);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _v3f64_v3f64, )(double3 x, double3 y);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _v4f64_v4f64, )(double4 x, double4 y);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _v8f64_v8f64, )(double8 x, double8 y);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Ordered, _v16f64_v16f64, )(double16 x, double16 y);
#endif // defined(cl_khr_fp64)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _f16_f16, )(half x, half y);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _f32_f32, )(float x, float y);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _v2f16_v2f16, )(half2 x, half2 y);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _v2f32_v2f32, )(float2 x, float2 y);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _v3f16_v3f16, )(half3 x, half3 y);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _v3f32_v3f32, )(float3 x, float3 y);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _v4f16_v4f16, )(half4 x, half4 y);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _v4f32_v4f32, )(float4 x, float4 y);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _v8f16_v8f16, )(half8 x, half8 y);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _v8f32_v8f32, )(float8 x, float8 y);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _v16f16_v16f16, )(half16 x, half16 y);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _v16f32_v16f32, )(float16 x, float16 y);
#if defined(cl_khr_fp64)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _f64_f64, )(double x, double y);
__bool2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _v2f64_v2f64, )(double2 x, double2 y);
__bool3 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _v3f64_v3f64, )(double3 x, double3 y);
__bool4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _v4f64_v4f64, )(double4 x, double4 y);
__bool8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _v8f64_v8f64, )(double8 x, double8 y);
__bool16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(Unordered, _v16f64_v16f64, )(double16 x, double16 y);
#endif // defined(cl_khr_fp64)
// Atomic Instructions
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p0i32_i32_i32, )(private int *Pointer, int Scope, int Semantics);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p1i32_i32_i32, )(global int *Pointer, int Scope, int Semantics);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p3i32_i32_i32, )(local int *Pointer, int Scope, int Semantics);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p4i32_i32_i32, )(generic int *Pointer, int Scope, int Semantics);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_int64_base_atomics) || defined(cl_khr_int64_extended_atomics)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p0i64_i32_i32, )(private long *Pointer, int Scope, int Semantics);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p1i64_i32_i32, )(global long *Pointer, int Scope, int Semantics);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p3i64_i32_i32, )(local long *Pointer, int Scope, int Semantics);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p4i64_i32_i32, )(generic long *Pointer, int Scope, int Semantics);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_base_atomics) || defined(cl_khr_int64_extended_atomics)
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p0f32_i32_i32, )(private float *Pointer, int Scope, int Semantics);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p1f32_i32_i32, )(global float *Pointer, int Scope, int Semantics);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p3f32_i32_i32, )(local float *Pointer, int Scope, int Semantics);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p4f32_i32_i32, )(generic float *Pointer, int Scope, int Semantics);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_fp64)
#if defined(cl_khr_int64_base_atomics)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p0f64_i32_i32, )(private double *Pointer, int Scope, int Semantics);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p1f64_i32_i32, )(global double *Pointer, int Scope, int Semantics);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p3f64_i32_i32, )(local double *Pointer, int Scope, int Semantics);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p4f64_i32_i32, )(generic double *Pointer, int Scope, int Semantics);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_base_atomics)
#endif // defined(cl_khr_fp64)
#if defined(cl_khr_fp16)
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p0f16_i32_i32, )(private half* Pointer, int Scope, int Semantics);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p1f16_i32_i32, )(global half* Pointer, int Scope, int Semantics);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p3f16_i32_i32, )(local half* Pointer, int Scope, int Semantics);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicLoad, _p4f16_i32_i32, )(generic half* Pointer, int Scope, int Semantics);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_fp16)
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p0i32_i32_i32_i32, )(private int *Pointer, int Scope, int Semantics, int Value);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p1i32_i32_i32_i32, )(global int *Pointer, int Scope, int Semantics, int Value);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p3i32_i32_i32_i32, )(local int *Pointer, int Scope, int Semantics, int Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p4i32_i32_i32_i32, )(generic int *Pointer, int Scope, int Semantics, int Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_int64_base_atomics) || defined(cl_khr_int64_extended_atomics)
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p0i64_i32_i32_i64, )(private long *Pointer, int Scope, int Semantics, long Value);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p1i64_i32_i32_i64, )(global long *Pointer, int Scope, int Semantics, long Value);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p3i64_i32_i32_i64, )(local long *Pointer, int Scope, int Semantics, long Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p4i64_i32_i32_i64, )(generic long *Pointer, int Scope, int Semantics, long Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_base_atomics) || defined(cl_khr_int64_extended_atomics)
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p0f32_i32_i32_f32, )(private float *Pointer, int Scope, int Semantics, float Value);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p1f32_i32_i32_f32, )(global float *Pointer, int Scope, int Semantics, float Value);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p3f32_i32_i32_f32, )(local float *Pointer, int Scope, int Semantics, float Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p4f32_i32_i32_f32, )(generic float *Pointer, int Scope, int Semantics, float Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_fp64)
#if defined(cl_khr_int64_base_atomics) || defined(cl_khr_int64_extended_atomics)
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p0f64_i32_i32_f64, )(private double *Pointer, int Scope, int Semantics, double Value);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p1f64_i32_i32_f64, )(global double *Pointer, int Scope, int Semantics, double Value);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p3f64_i32_i32_f64, )(local double *Pointer, int Scope, int Semantics, double Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p4f64_i32_i32_f64, )(generic double *Pointer, int Scope, int Semantics, double Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_base_atomics) || defined(cl_khr_int64_extended_atomics)
#endif // defined(cl_khr_fp64)
#if defined(cl_khr_fp16)
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p0f16_i32_i32_f16, )(private half* Pointer, int Scope, int Semantics, half Value);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p1f16_i32_i32_f16, )(global half* Pointer, int Scope, int Semantics, half Value);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p3f16_i32_i32_f16, )(local half* Pointer, int Scope, int Semantics, half Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicStore, _p4f16_i32_i32_f16, )(generic half* Pointer, int Scope, int Semantics, half Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_fp16)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p0i32_i32_i32_i32, )(private int *Pointer, int Scope, int Semantics, int Value);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p1i32_i32_i32_i32, )(global int *Pointer, int Scope, int Semantics, int Value);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p3i32_i32_i32_i32, )(local int *Pointer, int Scope, int Semantics, int Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p4i32_i32_i32_i32, )(generic int *Pointer, int Scope, int Semantics, int Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_int64_base_atomics)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p0i64_i32_i32_i64, )(private long *Pointer, int Scope, int Semantics, long Value);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p1i64_i32_i32_i64, )(global long *Pointer, int Scope, int Semantics, long Value);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p3i64_i32_i32_i64, )(local long *Pointer, int Scope, int Semantics, long Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p4i64_i32_i32_i64, )(generic long *Pointer, int Scope, int Semantics, long Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_base_atomics)
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p0f32_i32_i32_f32, )(private float *Pointer, int Scope, int Semantics, float Value);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p1f32_i32_i32_f32, )(global float *Pointer, int Scope, int Semantics, float Value);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p3f32_i32_i32_f32, )(local float *Pointer, int Scope, int Semantics, float Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p4f32_i32_i32_f32, )(generic float *Pointer, int Scope, int Semantics, float Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_fp64)
#if defined(cl_khr_int64_base_atomics)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p0f64_i32_i32_f64, )(private double *Pointer, int Scope, int Semantics, double Value);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p1f64_i32_i32_f64, )(global double *Pointer, int Scope, int Semantics, double Value);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p3f64_i32_i32_f64, )(local double *Pointer, int Scope, int Semantics, double Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p4f64_i32_i32_f64, )(generic double *Pointer, int Scope, int Semantics, double Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_base_atomics)
#endif // defined(cl_khr_fp64)
#if defined(cl_khr_fp16)
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p0f16_i32_i32_f16, )(__private half* Pointer, int Scope, int Semantics, half Value);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p1f16_i32_i32_f16, )(__global half* Pointer, int Scope, int Semantics, half Value);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p3f16_i32_i32_f16, )(__local half* Pointer, int Scope, int Semantics, half Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicExchange, _p4f16_i32_i32_f16, )(__generic half* Pointer, int Scope, int Semantics, half Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_fp16)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchange, _p0i32_i32_i32_i32_i32_i32, )(private int *Pointer, int Scope, int Equal, int Unequal, int Value, int Comparator);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchange, _p1i32_i32_i32_i32_i32_i32, )(global int *Pointer, int Scope, int Equal, int Unequal, int Value, int Comparator);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchange, _p3i32_i32_i32_i32_i32_i32, )(local int *Pointer, int Scope, int Equal, int Unequal, int Value, int Comparator);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchange, _p4i32_i32_i32_i32_i32_i32, )(generic int *Pointer, int Scope, int Equal, int Unequal, int Value, int Comparator);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_int64_base_atomics)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchange, _p0i64_i32_i32_i32_i64_i64, )(private long *Pointer, int Scope, int Equal, int Unequal, long Value, long Comparator);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchange, _p1i64_i32_i32_i32_i64_i64, )(global long *Pointer, int Scope, int Equal, int Unequal, long Value, long Comparator);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchange, _p3i64_i32_i32_i32_i64_i64, )(local long *Pointer, int Scope, int Equal, int Unequal, long Value, long Comparator);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchange, _p4i64_i32_i32_i32_i64_i64, )(generic long *Pointer, int Scope, int Equal, int Unequal, long Value, long Comparator);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_base_atomics)
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchange, _p0f32_i32_i32_i32_f32_f32, )(private float *Pointer, int Scope, int Equal, int Unequal, float Value, float Comparator);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchange, _p1f32_i32_i32_i32_f32_f32, )(global float *Pointer, int Scope, int Equal, int Unequal, float Value, float Comparator);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchange, _p3f32_i32_i32_i32_f32_f32, )(local float *Pointer, int Scope, int Equal, int Unequal, float Value, float Comparator);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchange, _p4f32_i32_i32_i32_f32_f32, )(generic float *Pointer, int Scope, int Equal, int Unequal, float Value, float Comparator);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchangeWeak, _p0i32_i32_i32_i32_i32_i32, )(private int *Pointer, int Scope, int Equal, int Unequal, int Value, int Comparator);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchangeWeak, _p1i32_i32_i32_i32_i32_i32, )(global int *Pointer, int Scope, int Equal, int Unequal, int Value, int Comparator);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchangeWeak, _p3i32_i32_i32_i32_i32_i32, )(local int *Pointer, int Scope, int Equal, int Unequal, int Value, int Comparator);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchangeWeak, _p4i32_i32_i32_i32_i32_i32, )(generic int *Pointer, int Scope, int Equal, int Unequal, int Value, int Comparator);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_int64_base_atomics)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchangeWeak, _p0i64_i32_i32_i32_i64_i64, )(private long *Pointer, int Scope, int Equal, int Unequal, long Value, long Comparator);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchangeWeak, _p1i64_i32_i32_i32_i64_i64, )(global long *Pointer, int Scope, int Equal, int Unequal, long Value, long Comparator);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchangeWeak, _p3i64_i32_i32_i32_i64_i64, )(local long *Pointer, int Scope, int Equal, int Unequal, long Value, long Comparator);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicCompareExchangeWeak, _p4i64_i32_i32_i32_i64_i64, )(generic long *Pointer, int Scope, int Equal, int Unequal, long Value, long Comparator);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_base_atomics)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIIncrement, _p0i32_i32_i32, )(private int *Pointer, int Scope, int Semantics);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIIncrement, _p1i32_i32_i32, )(global int *Pointer, int Scope, int Semantics);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIIncrement, _p3i32_i32_i32, )(local int *Pointer, int Scope, int Semantics);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIIncrement, _p4i32_i32_i32, )(generic int *Pointer, int Scope, int Semantics);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_int64_base_atomics)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIIncrement, _p0i64_i32_i32, )(private long *Pointer, int Scope, int Semantics);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIIncrement, _p1i64_i32_i32, )(global long *Pointer, int Scope, int Semantics);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIIncrement, _p3i64_i32_i32, )(local long *Pointer, int Scope, int Semantics);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIIncrement, _p4i64_i32_i32, )(generic long *Pointer, int Scope, int Semantics);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_base_atomics)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIDecrement, _p0i32_i32_i32, )(private int *Pointer, int Scope, int Semantics);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIDecrement, _p1i32_i32_i32, )(global int *Pointer, int Scope, int Semantics);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIDecrement, _p3i32_i32_i32, )(local int *Pointer, int Scope, int Semantics);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIDecrement, _p4i32_i32_i32, )(generic int *Pointer, int Scope, int Semantics);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_int64_base_atomics)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIDecrement, _p0i64_i32_i32, )(private long *Pointer, int Scope, int Semantics);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIDecrement, _p1i64_i32_i32, )(global long *Pointer, int Scope, int Semantics);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIDecrement, _p3i64_i32_i32, )(local long *Pointer, int Scope, int Semantics);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIDecrement, _p4i64_i32_i32, )(generic long *Pointer, int Scope, int Semantics);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_base_atomics)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIAdd, _p0i32_i32_i32_i32, )(private int *Pointer, int Scope, int Semantics, int Value);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIAdd, _p1i32_i32_i32_i32, )(global int *Pointer, int Scope, int Semantics, int Value);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIAdd, _p3i32_i32_i32_i32, )(local int *Pointer, int Scope, int Semantics, int Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIAdd, _p4i32_i32_i32_i32, )(generic int *Pointer, int Scope, int Semantics, int Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_int64_base_atomics)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIAdd, _p0i64_i32_i32_i64, )(private long *Pointer, int Scope, int Semantics, long Value);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIAdd, _p1i64_i32_i32_i64, )(global long *Pointer, int Scope, int Semantics, long Value);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIAdd, _p3i64_i32_i32_i64, )(local long *Pointer, int Scope, int Semantics, long Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicIAdd, _p4i64_i32_i32_i64, )(generic long *Pointer, int Scope, int Semantics, long Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_base_atomics)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicISub, _p0i32_i32_i32_i32, )(private int *Pointer, int Scope, int Semantics, int Value);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicISub, _p1i32_i32_i32_i32, )(global int *Pointer, int Scope, int Semantics, int Value);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicISub, _p3i32_i32_i32_i32, )(local int *Pointer, int Scope, int Semantics, int Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicISub, _p4i32_i32_i32_i32, )(generic int *Pointer, int Scope, int Semantics, int Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_int64_base_atomics)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicISub, _p0i64_i32_i32_i64, )(private long *Pointer, int Scope, int Semantics, long Value);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicISub, _p1i64_i32_i32_i64, )(global long *Pointer, int Scope, int Semantics, long Value);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicISub, _p3i64_i32_i32_i64, )(local long *Pointer, int Scope, int Semantics, long Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicISub, _p4i64_i32_i32_i64, )(generic long *Pointer, int Scope, int Semantics, long Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_base_atomics)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicSMin, _p0i32_i32_i32_i32, )(private int *Pointer, int Scope, int Semantics, int Value);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicSMin, _p1i32_i32_i32_i32, )(global int *Pointer, int Scope, int Semantics, int Value);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicSMin, _p3i32_i32_i32_i32, )(local int *Pointer, int Scope, int Semantics, int Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicSMin, _p4i32_i32_i32_i32, )(generic int *Pointer, int Scope, int Semantics, int Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_int64_extended_atomics)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicSMin, _p0i64_i32_i32_i64, )(private long *Pointer, int Scope, int Semantics, long Value);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicSMin, _p1i64_i32_i32_i64, )(global long *Pointer, int Scope, int Semantics, long Value);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicSMin, _p3i64_i32_i32_i64, )(local long *Pointer, int Scope, int Semantics, long Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicSMin, _p4i64_i32_i32_i64, )(generic long *Pointer, int Scope, int Semantics, long Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_extended_atomics)
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicUMin, _p0i32_i32_i32_i32, )(private uint *Pointer, int Scope, int Semantics, uint Value);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicUMin, _p1i32_i32_i32_i32, )(global uint *Pointer, int Scope, int Semantics, uint Value);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicUMin, _p3i32_i32_i32_i32, )(local uint *Pointer, int Scope, int Semantics, uint Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicUMin, _p4i32_i32_i32_i32, )(generic uint *Pointer, int Scope, int Semantics, uint Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_int64_extended_atomics)
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicUMin, _p0i64_i32_i32_i64, )(private ulong *Pointer, int Scope, int Semantics, ulong Value);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicUMin, _p1i64_i32_i32_i64, )(global ulong *Pointer, int Scope, int Semantics, ulong Value);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicUMin, _p3i64_i32_i32_i64, )(local ulong *Pointer, int Scope, int Semantics, ulong Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicUMin, _p4i64_i32_i32_i64, )(generic ulong *Pointer, int Scope, int Semantics, ulong Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_extended_atomics)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicSMax, _p0i32_i32_i32_i32, )(private int *Pointer, int Scope, int Semantics, int Value);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicSMax, _p1i32_i32_i32_i32, )(global int *Pointer, int Scope, int Semantics, int Value);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicSMax, _p3i32_i32_i32_i32, )(local int *Pointer, int Scope, int Semantics, int Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicSMax, _p4i32_i32_i32_i32, )(generic int *Pointer, int Scope, int Semantics, int Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_int64_extended_atomics)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicSMax, _p0i64_i32_i32_i64, )(private long *Pointer, int Scope, int Semantics, long Value);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicSMax, _p1i64_i32_i32_i64, )(global long *Pointer, int Scope, int Semantics, long Value);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicSMax, _p3i64_i32_i32_i64, )(local long *Pointer, int Scope, int Semantics, long Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicSMax, _p4i64_i32_i32_i64, )(generic long *Pointer, int Scope, int Semantics, long Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_extended_atomics)
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicUMax, _p0i32_i32_i32_i32, )(private uint *Pointer, int Scope, int Semantics, uint Value);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicUMax, _p1i32_i32_i32_i32, )(global uint *Pointer, int Scope, int Semantics, uint Value);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicUMax, _p3i32_i32_i32_i32, )(local uint *Pointer, int Scope, int Semantics, uint Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicUMax, _p4i32_i32_i32_i32, )(generic uint *Pointer, int Scope, int Semantics, uint Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_int64_extended_atomics)
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicUMax, _p0i64_i32_i32_i64, )(private ulong *Pointer, int Scope, int Semantics, ulong Value);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicUMax, _p1i64_i32_i32_i64, )(global ulong *Pointer, int Scope, int Semantics, ulong Value);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicUMax, _p3i64_i32_i32_i64, )(local ulong *Pointer, int Scope, int Semantics, ulong Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicUMax, _p4i64_i32_i32_i64, )(generic ulong *Pointer, int Scope, int Semantics, ulong Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_extended_atomics)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicAnd, _p0i32_i32_i32_i32, )(private int *Pointer, int Scope, int Semantics, int Value);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicAnd, _p1i32_i32_i32_i32, )(global int *Pointer, int Scope, int Semantics, int Value);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicAnd, _p3i32_i32_i32_i32, )(local int *Pointer, int Scope, int Semantics, int Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicAnd, _p4i32_i32_i32_i32, )(generic int *Pointer, int Scope, int Semantics, int Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_int64_extended_atomics)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicAnd, _p0i64_i32_i32_i64, )(private long *Pointer, int Scope, int Semantics, long Value);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicAnd, _p1i64_i32_i32_i64, )(global long *Pointer, int Scope, int Semantics, long Value);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicAnd, _p3i64_i32_i32_i64, )(local long *Pointer, int Scope, int Semantics, long Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicAnd, _p4i64_i32_i32_i64, )(generic long *Pointer, int Scope, int Semantics, long Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_extended_atomics)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicOr, _p0i32_i32_i32_i32, )(private int *Pointer, int Scope, int Semantics, int Value);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicOr, _p1i32_i32_i32_i32, )(global int *Pointer, int Scope, int Semantics, int Value);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicOr, _p3i32_i32_i32_i32, )(local int *Pointer, int Scope, int Semantics, int Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicOr, _p4i32_i32_i32_i32, )(generic int *Pointer, int Scope, int Semantics, int Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_int64_extended_atomics)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicOr, _p0i64_i32_i32_i64, )(private long *Pointer, int Scope, int Semantics, long Value);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicOr, _p1i64_i32_i32_i64, )(global long *Pointer, int Scope, int Semantics, long Value);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicOr, _p3i64_i32_i32_i64, )(local long *Pointer, int Scope, int Semantics, long Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicOr, _p4i64_i32_i32_i64, )(generic long *Pointer, int Scope, int Semantics, long Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_extended_atomics)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicXor, _p0i32_i32_i32_i32, )(private int *Pointer, int Scope, int Semantics, int Value);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicXor, _p1i32_i32_i32_i32, )(global int *Pointer, int Scope, int Semantics, int Value);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicXor, _p3i32_i32_i32_i32, )(local int *Pointer, int Scope, int Semantics, int Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicXor, _p4i32_i32_i32_i32, )(generic int *Pointer, int Scope, int Semantics, int Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_int64_extended_atomics)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicXor, _p0i64_i32_i32_i64, )(private long *Pointer, int Scope, int Semantics, long Value);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicXor, _p1i64_i32_i32_i64, )(global long *Pointer, int Scope, int Semantics, long Value);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicXor, _p3i64_i32_i32_i64, )(local long *Pointer, int Scope, int Semantics, long Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicXor, _p4i64_i32_i32_i64, )(generic long *Pointer, int Scope, int Semantics, long Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_int64_extended_atomics)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFlagTestAndSet, _p0i32_i32_i32, )(private int *Pointer, int Scope, int Semantics);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFlagTestAndSet, _p1i32_i32_i32, )(global int *Pointer, int Scope, int Semantics);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFlagTestAndSet, _p3i32_i32_i32, )(local int *Pointer, int Scope, int Semantics);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFlagTestAndSet, _p4i32_i32_i32, )(generic int *Pointer, int Scope, int Semantics);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFlagClear, _p0i32_i32_i32, )(private int *Pointer, int Scope, int Semantics);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFlagClear, _p1i32_i32_i32, )(global int *Pointer, int Scope, int Semantics);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFlagClear, _p3i32_i32_i32, )(local int *Pointer, int Scope, int Semantics);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFlagClear, _p4i32_i32_i32, )(generic int *Pointer, int Scope, int Semantics);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFAdd, _p1f32_i32_i32_f32, )(global float *Pointer, int Scope, int Semantics, float Value);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFSub, _p1f32_i32_i32_f32, )(global float *Pointer, int Scope, int Semantics, float Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
// SPV_EXT_shader_atomic_float_add
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFAddEXT, _p0f32_i32_i32_f32, )(private float *Pointer, int Scope, int Semantics, float Value);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFAddEXT, _p1f32_i32_i32_f32, )(global float *Pointer, int Scope, int Semantics, float Value);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFAddEXT, _p3f32_i32_i32_f32, )(local float *Pointer, int Scope, int Semantics, float Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFAddEXT, _p4f32_i32_i32_f32, )(generic float *Pointer, int Scope, int Semantics, float Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFAddEXT, _p0f64_i32_i32_f64, )(private double *Pointer, int Scope, int Semantics, double Value);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFAddEXT, _p1f64_i32_i32_f64, )(global double *Pointer, int Scope, int Semantics, double Value);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFAddEXT, _p3f64_i32_i32_f64, )(local double *Pointer, int Scope, int Semantics, double Value);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFAddEXT, _p4f64_i32_i32_f64, )(generic double *Pointer, int Scope, int Semantics, double Value);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#endif // defined(cl_khr_fp64)
// SPV_EXT_shader_atomic_float_min_max
#if defined(cl_khr_fp16)
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMinEXT, _p0f16_i32_i32_f16, )(private half* Pointer, int Scope, int Semantics, half Value);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMinEXT, _p1f16_i32_i32_f16, )(global half* Pointer, int Scope, int Semantics, half Value);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMinEXT, _p3f16_i32_i32_f16, )(local half* Pointer, int Scope, int Semantics, half Value);
#endif // defined(cl_khr_fp16)
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMinEXT, _p0f32_i32_i32_f32, )(private float* Pointer, int Scope, int Semantics, float Value);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMinEXT, _p1f32_i32_i32_f32, )(global float* Pointer, int Scope, int Semantics, float Value);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMinEXT, _p3f32_i32_i32_f32, )(local float* Pointer, int Scope, int Semantics, float Value);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMinEXT, _p0f64_i32_i32_f64, )(private double* Pointer, int Scope, int Semantics, double Value);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMinEXT, _p1f64_i32_i32_f64, )(global double* Pointer, int Scope, int Semantics, double Value);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMinEXT, _p3f64_i32_i32_f64, )(local double* Pointer, int Scope, int Semantics, double Value);
#endif // defined(cl_khr_fp64)
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
#if defined(cl_khr_fp16)
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMinEXT, _p4f16_i32_i32_f16, )(generic half* Pointer, int Scope, int Semantics, half Value);
#endif // defined(cl_khr_fp16)
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMinEXT, _p4f32_i32_i32_f32, )(generic float* Pointer, int Scope, int Semantics, float Value);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMinEXT, _p4f64_i32_i32_f64, )(generic double* Pointer, int Scope, int Semantics, double Value);
#endif // defined(cl_khr_fp64)
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_fp16)
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMaxEXT, _p0f16_i32_i32_f16, )(private half *Pointer, int Scope, int Semantics, half Value);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMaxEXT, _p1f16_i32_i32_f16, )(global half *Pointer, int Scope, int Semantics, half Value);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMaxEXT, _p3f16_i32_i32_f16, )(local half *Pointer, int Scope, int Semantics, half Value);
#endif // defined(cl_khr_fp16)
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMaxEXT, _p0f32_i32_i32_f32, )(private float* Pointer, int Scope, int Semantics, float Value);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMaxEXT, _p1f32_i32_i32_f32, )(global float* Pointer, int Scope, int Semantics, float Value);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMaxEXT, _p3f32_i32_i32_f32, )(local float* Pointer, int Scope, int Semantics, float Value);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMaxEXT, _p0f64_i32_i32_f64, )(private double* Pointer, int Scope, int Semantics, double Value);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMaxEXT, _p1f64_i32_i32_f64, )(global double* Pointer, int Scope, int Semantics, double Value);
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMaxEXT, _p3f64_i32_i32_f64, )(local double* Pointer, int Scope, int Semantics, double Value);
#endif // defined(cl_khr_fp64)
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
#if defined(cl_khr_fp16)
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMaxEXT, _p4f16_i32_i32_f16, )(generic half *Pointer, int Scope, int Semantics, half Value);
#endif // defined(cl_khr_fp16)
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMaxEXT, _p4f32_i32_i32_f32, )(generic float* Pointer, int Scope, int Semantics, float Value);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(AtomicFMaxEXT, _p4f64_i32_i32_f64, )(generic double* Pointer, int Scope, int Semantics, double Value);
#endif // defined(cl_khr_fp64)
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
// Barrier Instructions
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ControlBarrier, _i32_i32_i32, )(int Execution, int Memory, int Semantics);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(MemoryBarrier, _i32_i32, )(int Memory, int Semantics);
#ifndef NAMED_BARRIER_STRUCT_TYPE
#define NAMED_BARRIER_STRUCT_TYPE
typedef struct
{
int count;
int orig_count;
int inc;
} __namedBarrier;
#endif
local __namedBarrier* __builtin_spirv_OpNamedBarrierInitialize_i32_p3__namedBarrier_p3i32(int Count, local __namedBarrier* nb_array, local uint* id);
void __builtin_spirv_OpMemoryNamedBarrier_p3__namedBarrier_i32_i32(local __namedBarrier* NB, Scope_t Memory, uint Semantics);
void __builtin_spirv_OpMemoryNamedBarrierWrapperOCL_p3__namedBarrier_i32(local __namedBarrier* barrier, cl_mem_fence_flags flags);
void __builtin_spirv_OpMemoryNamedBarrierWrapperOCL_p3__namedBarrier_i32_i32(local __namedBarrier* barrier, cl_mem_fence_flags flags, memory_scope scope);
// Group Instructions
// TODO: Do we want to split out size_t into i64 and i32 as we've done here?
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1i8_p3i8_i64_i64_i64, )(int Execution, global char *Destination, local char *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1i8_p3i8_i32_i32_i64, )(int Execution, global char *Destination, local char *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1i16_p3i16_i64_i64_i64, )(int Execution, global short *Destination, local short *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1i16_p3i16_i32_i32_i64, )(int Execution, global short *Destination, local short *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1i32_p3i32_i64_i64_i64, )(int Execution, global int *Destination, local int *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1i32_p3i32_i32_i32_i64, )(int Execution, global int *Destination, local int *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1i64_p3i64_i64_i64_i64, )(int Execution, global long *Destination, local long *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1i64_p3i64_i32_i32_i64, )(int Execution, global long *Destination, local long *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1f16_p3f16_i64_i64_i64, )(int Execution, global half *Destination, local half *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1f16_p3f16_i32_i32_i64, )(int Execution, global half *Destination, local half *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1f32_p3f32_i64_i64_i64, )(int Execution, global float *Destination, local float *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1f32_p3f32_i32_i32_i64, )(int Execution, global float *Destination, local float *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v2i8_p3v2i8_i64_i64_i64, )(int Execution, global char2 *Destination, local char2 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v2i8_p3v2i8_i32_i32_i64, )(int Execution, global char2 *Destination, local char2 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v3i8_p3v3i8_i64_i64_i64, )(int Execution, global char3 *Destination, local char3 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v3i8_p3v3i8_i32_i32_i64, )(int Execution, global char3 *Destination, local char3 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v4i8_p3v4i8_i64_i64_i64, )(int Execution, global char4 *Destination, local char4 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v4i8_p3v4i8_i32_i32_i64, )(int Execution, global char4 *Destination, local char4 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v8i8_p3v8i8_i64_i64_i64, )(int Execution, global char8 *Destination, local char8 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v8i8_p3v8i8_i32_i32_i64, )(int Execution, global char8 *Destination, local char8 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v16i8_p3v16i8_i64_i64_i64, )(int Execution, global char16 *Destination, local char16 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v16i8_p3v16i8_i32_i32_i64, )(int Execution, global char16 *Destination, local char16 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v2i16_p3v2i16_i64_i64_i64, )(int Execution, global short2 *Destination, local short2 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v2i16_p3v2i16_i32_i32_i64, )(int Execution, global short2 *Destination, local short2 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v3i16_p3v3i16_i64_i64_i64, )(int Execution, global short3 *Destination, local short3 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v3i16_p3v3i16_i32_i32_i64, )(int Execution, global short3 *Destination, local short3 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v4i16_p3v4i16_i64_i64_i64, )(int Execution, global short4 *Destination, local short4 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v4i16_p3v4i16_i32_i32_i64, )(int Execution, global short4 *Destination, local short4 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v8i16_p3v8i16_i64_i64_i64, )(int Execution, global short8 *Destination, local short8 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v8i16_p3v8i16_i32_i32_i64, )(int Execution, global short8 *Destination, local short8 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v16i16_p3v16i16_i64_i64_i64, )(int Execution, global short16 *Destination, local short16 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v16i16_p3v16i16_i32_i32_i64, )(int Execution, global short16 *Destination, local short16 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v2i32_p3v2i32_i64_i64_i64, )(int Execution, global int2 *Destination, local int2 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v2i32_p3v2i32_i32_i32_i64, )(int Execution, global int2 *Destination, local int2 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v3i32_p3v3i32_i64_i64_i64, )(int Execution, global int3 *Destination, local int3 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v3i32_p3v3i32_i32_i32_i64, )(int Execution, global int3 *Destination, local int3 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v4i32_p3v4i32_i64_i64_i64, )(int Execution, global int4 *Destination, local int4 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v4i32_p3v4i32_i32_i32_i64, )(int Execution, global int4 *Destination, local int4 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v8i32_p3v8i32_i64_i64_i64, )(int Execution, global int8 *Destination, local int8 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v8i32_p3v8i32_i32_i32_i64, )(int Execution, global int8 *Destination, local int8 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v16i32_p3v16i32_i64_i64_i64, )(int Execution, global int16 *Destination, local int16 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v16i32_p3v16i32_i32_i32_i64, )(int Execution, global int16 *Destination, local int16 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v2i64_p3v2i64_i64_i64_i64, )(int Execution, global long2 *Destination, local long2 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v2i64_p3v2i64_i32_i32_i64, )(int Execution, global long2 *Destination, local long2 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v3i64_p3v3i64_i64_i64_i64, )(int Execution, global long3 *Destination, local long3 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v3i64_p3v3i64_i32_i32_i64, )(int Execution, global long3 *Destination, local long3 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v4i64_p3v4i64_i64_i64_i64, )(int Execution, global long4 *Destination, local long4 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v4i64_p3v4i64_i32_i32_i64, )(int Execution, global long4 *Destination, local long4 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v8i64_p3v8i64_i64_i64_i64, )(int Execution, global long8 *Destination, local long8 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v8i64_p3v8i64_i32_i32_i64, )(int Execution, global long8 *Destination, local long8 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v16i64_p3v16i64_i64_i64_i64, )(int Execution, global long16 *Destination, local long16 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v16i64_p3v16i64_i32_i32_i64, )(int Execution, global long16 *Destination, local long16 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v2f16_p3v2f16_i64_i64_i64, )(int Execution, global half2 *Destination, local half2 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v2f16_p3v2f16_i32_i32_i64, )(int Execution, global half2 *Destination, local half2 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v3f16_p3v3f16_i64_i64_i64, )(int Execution, global half3 *Destination, local half3 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v3f16_p3v3f16_i32_i32_i64, )(int Execution, global half3 *Destination, local half3 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v4f16_p3v4f16_i64_i64_i64, )(int Execution, global half4 *Destination, local half4 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v4f16_p3v4f16_i32_i32_i64, )(int Execution, global half4 *Destination, local half4 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v8f16_p3v8f16_i64_i64_i64, )(int Execution, global half8 *Destination, local half8 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v8f16_p3v8f16_i32_i32_i64, )(int Execution, global half8 *Destination, local half8 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v16f16_p3v16f16_i64_i64_i64, )(int Execution, global half16 *Destination, local half16 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v16f16_p3v16f16_i32_i32_i64, )(int Execution, global half16 *Destination, local half16 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v2f32_p3v2f32_i64_i64_i64, )(int Execution, global float2 *Destination, local float2 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v2f32_p3v2f32_i32_i32_i64, )(int Execution, global float2 *Destination, local float2 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v3f32_p3v3f32_i64_i64_i64, )(int Execution, global float3 *Destination, local float3 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v3f32_p3v3f32_i32_i32_i64, )(int Execution, global float3 *Destination, local float3 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v4f32_p3v4f32_i64_i64_i64, )(int Execution, global float4 *Destination, local float4 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v4f32_p3v4f32_i32_i32_i64, )(int Execution, global float4 *Destination, local float4 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v8f32_p3v8f32_i64_i64_i64, )(int Execution, global float8 *Destination, local float8 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v8f32_p3v8f32_i32_i32_i64, )(int Execution, global float8 *Destination, local float8 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v16f32_p3v16f32_i64_i64_i64, )(int Execution, global float16 *Destination, local float16 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v16f32_p3v16f32_i32_i32_i64, )(int Execution, global float16 *Destination, local float16 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3i8_p1i8_i64_i64_i64, )(int Execution, local char *Destination, global char *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3i8_p1i8_i32_i32_i64, )(int Execution, local char *Destination, global char *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3i16_p1i16_i64_i64_i64, )(int Execution, local short *Destination, global short *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3i16_p1i16_i32_i32_i64, )(int Execution, local short *Destination, global short *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3i32_p1i32_i64_i64_i64, )(int Execution, local int *Destination, global int *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3i32_p1i32_i32_i32_i64, )(int Execution, local int *Destination, global int *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3i64_p1i64_i64_i64_i64, )(int Execution, local long *Destination, global long *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3i64_p1i64_i32_i32_i64, )(int Execution, local long *Destination, global long *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3f16_p1f16_i64_i64_i64, )(int Execution, local half *Destination, global half *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3f16_p1f16_i32_i32_i64, )(int Execution, local half *Destination, global half *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3f32_p1f32_i64_i64_i64, )(int Execution, local float *Destination, global float *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v2i8_p1v2i8_i64_i64_i64, )(int Execution, local char2 *Destination, global char2 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v2i8_p1v2i8_i32_i32_i64, )(int Execution, local char2 *Destination, global char2 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v3i8_p1v3i8_i64_i64_i64, )(int Execution, local char3 *Destination, global char3 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v3i8_p1v3i8_i32_i32_i64, )(int Execution, local char3 *Destination, global char3 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v4i8_p1v4i8_i64_i64_i64, )(int Execution, local char4 *Destination, global char4 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v4i8_p1v4i8_i32_i32_i64, )(int Execution, local char4 *Destination, global char4 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v8i8_p1v8i8_i64_i64_i64, )(int Execution, local char8 *Destination, global char8 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v8i8_p1v8i8_i32_i32_i64, )(int Execution, local char8 *Destination, global char8 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v16i8_p1v16i8_i64_i64_i64, )(int Execution, local char16 *Destination, global char16 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v16i8_p1v16i8_i32_i32_i64, )(int Execution, local char16 *Destination, global char16 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v2i16_p1v2i16_i64_i64_i64, )(int Execution, local short2 *Destination, global short2 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v2i16_p1v2i16_i32_i32_i64, )(int Execution, local short2 *Destination, global short2 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v3i16_p1v3i16_i64_i64_i64, )(int Execution, local short3 *Destination, global short3 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v3i16_p1v3i16_i32_i32_i64, )(int Execution, local short3 *Destination, global short3 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v4i16_p1v4i16_i64_i64_i64, )(int Execution, local short4 *Destination, global short4 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v4i16_p1v4i16_i32_i32_i64, )(int Execution, local short4 *Destination, global short4 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v8i16_p1v8i16_i64_i64_i64, )(int Execution, local short8 *Destination, global short8 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v8i16_p1v8i16_i32_i32_i64, )(int Execution, local short8 *Destination, global short8 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v16i16_p1v16i16_i64_i64_i64, )(int Execution, local short16 *Destination, global short16 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v16i16_p1v16i16_i32_i32_i64, )(int Execution, local short16 *Destination, global short16 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v2i32_p1v2i32_i64_i64_i64, )(int Execution, local int2 *Destination, global int2 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v2i32_p1v2i32_i32_i32_i64, )(int Execution, local int2 *Destination, global int2 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v3i32_p1v3i32_i64_i64_i64, )(int Execution, local int3 *Destination, global int3 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v3i32_p1v3i32_i32_i32_i64, )(int Execution, local int3 *Destination, global int3 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v4i32_p1v4i32_i64_i64_i64, )(int Execution, local int4 *Destination, global int4 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v4i32_p1v4i32_i32_i32_i64, )(int Execution, local int4 *Destination, global int4 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v8i32_p1v8i32_i64_i64_i64, )(int Execution, local int8 *Destination, global int8 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v8i32_p1v8i32_i32_i32_i64, )(int Execution, local int8 *Destination, global int8 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v16i32_p1v16i32_i64_i64_i64, )(int Execution, local int16 *Destination, global int16 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v16i32_p1v16i32_i32_i32_i64, )(int Execution, local int16 *Destination, global int16 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v2i64_p1v2i64_i64_i64_i64, )(int Execution, local long2 *Destination, global long2 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v2i64_p1v2i64_i32_i32_i64, )(int Execution, local long2 *Destination, global long2 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v3i64_p1v3i64_i64_i64_i64, )(int Execution, local long3 *Destination, global long3 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v3i64_p1v3i64_i32_i32_i64, )(int Execution, local long3 *Destination, global long3 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v4i64_p1v4i64_i64_i64_i64, )(int Execution, local long4 *Destination, global long4 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v4i64_p1v4i64_i32_i32_i64, )(int Execution, local long4 *Destination, global long4 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v8i64_p1v8i64_i64_i64_i64, )(int Execution, local long8 *Destination, global long8 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v8i64_p1v8i64_i32_i32_i64, )(int Execution, local long8 *Destination, global long8 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v16i64_p1v16i64_i64_i64_i64, )(int Execution, local long16 *Destination, global long16 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v16i64_p1v16i64_i32_i32_i64, )(int Execution, local long16 *Destination, global long16 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v2f16_p1v2f16_i64_i64_i64, )(int Execution, local half2 *Destination, global half2 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v2f16_p1v2f16_i32_i32_i64, )(int Execution, local half2 *Destination, global half2 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v3f16_p1v3f16_i64_i64_i64, )(int Execution, local half3 *Destination, global half3 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v3f16_p1v3f16_i32_i32_i64, )(int Execution, local half3 *Destination, global half3 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v4f16_p1v4f16_i64_i64_i64, )(int Execution, local half4 *Destination, global half4 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v4f16_p1v4f16_i32_i32_i64, )(int Execution, local half4 *Destination, global half4 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v8f16_p1v8f16_i64_i64_i64, )(int Execution, local half8 *Destination, global half8 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v8f16_p1v8f16_i32_i32_i64, )(int Execution, local half8 *Destination, global half8 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v16f16_p1v16f16_i64_i64_i64, )(int Execution, local half16 *Destination, global half16 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v16f16_p1v16f16_i32_i32_i64, )(int Execution, local half16 *Destination, global half16 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v2f32_p1v2f32_i64_i64_i64, )(int Execution, local float2 *Destination, global float2 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v2f32_p1v2f32_i32_i32_i64, )(int Execution, local float2 *Destination, global float2 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v3f32_p1v3f32_i64_i64_i64, )(int Execution, local float3 *Destination, global float3 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v3f32_p1v3f32_i32_i32_i64, )(int Execution, local float3 *Destination, global float3 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v4f32_p1v4f32_i64_i64_i64, )(int Execution, local float4 *Destination, global float4 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v4f32_p1v4f32_i32_i32_i64, )(int Execution, local float4 *Destination, global float4 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v8f32_p1v8f32_i64_i64_i64, )(int Execution, local float8 *Destination, global float8 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v8f32_p1v8f32_i32_i32_i64, )(int Execution, local float8 *Destination, global float8 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v16f32_p1v16f32_i64_i64_i64, )(int Execution, local float16 *Destination, global float16 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v16f32_p1v16f32_i32_i32_i64, )(int Execution, local float16 *Destination, global float16 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3f32_p1f32_i32_i32_i64, )(int Execution, local float *Destination, global float *Source, int NumElements, int Stride, __spirv_Event Event);
#if defined(cl_khr_fp64)
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1f64_p3f64_i64_i64_i64, )(int Execution, global double *Destination, local double *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1f64_p3f64_i32_i32_i64, )(int Execution, global double *Destination, local double *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v2f64_p3v2f64_i64_i64_i64, )(int Execution, global double2 *Destination, local double2 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v2f64_p3v2f64_i32_i32_i64, )(int Execution, global double2 *Destination, local double2 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v3f64_p3v3f64_i64_i64_i64, )(int Execution, global double3 *Destination, local double3 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v3f64_p3v3f64_i32_i32_i64, )(int Execution, global double3 *Destination, local double3 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v4f64_p3v4f64_i64_i64_i64, )(int Execution, global double4 *Destination, local double4 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v4f64_p3v4f64_i32_i32_i64, )(int Execution, global double4 *Destination, local double4 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v8f64_p3v8f64_i64_i64_i64, )(int Execution, global double8 *Destination, local double8 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v8f64_p3v8f64_i32_i32_i64, )(int Execution, global double8 *Destination, local double8 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v16f64_p3v16f64_i64_i64_i64, )(int Execution, global double16 *Destination, local double16 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p1v16f64_p3v16f64_i32_i32_i64, )(int Execution, global double16 *Destination, local double16 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3f64_p1f64_i64_i64_i64, )(int Execution, local double *Destination, global double *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3f64_p1f64_i32_i32_i64, )(int Execution, local double *Destination, global double *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v2f64_p1v2f64_i64_i64_i64, )(int Execution, local double2 *Destination, global double2 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v2f64_p1v2f64_i32_i32_i64, )(int Execution, local double2 *Destination, global double2 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v3f64_p1v3f64_i64_i64_i64, )(int Execution, local double3 *Destination, global double3 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v3f64_p1v3f64_i32_i32_i64, )(int Execution, local double3 *Destination, global double3 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v4f64_p1v4f64_i64_i64_i64, )(int Execution, local double4 *Destination, global double4 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v4f64_p1v4f64_i32_i32_i64, )(int Execution, local double4 *Destination, global double4 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v8f64_p1v8f64_i64_i64_i64, )(int Execution, local double8 *Destination, global double8 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v8f64_p1v8f64_i32_i32_i64, )(int Execution, local double8 *Destination, global double8 *Source, int NumElements, int Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v16f64_p1v16f64_i64_i64_i64, )(int Execution, local double16 *Destination, global double16 *Source, long NumElements, long Stride, __spirv_Event Event);
__spirv_Event SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAsyncCopy, _i32_p3v16f64_p1v16f64_i32_i32_i64, )(int Execution, local double16 *Destination, global double16 *Source, int NumElements, int Stride, __spirv_Event Event);
#endif // defined(cl_khr_fp64)
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupWaitEvents, _i32_i32_p0i64, )(int Execution, int NumEvents, private __spirv_Event *EventsList);
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupWaitEvents, _i32_i32_p4i64, )(int Execution, int NumEvents, generic __spirv_Event *EventsList);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if defined(cl_khr_subgroup_non_uniform_vote)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformElect, _i32, )(int Execution);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformAll, _i32_i1, )(int Execution, bool Predicate);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformAny, _i32_i1, )(int Execution, bool Predicate);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformAllEqual, _i32_i8, )(int Execution, char Value);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformAllEqual, _i32_i16, )(int Execution, short Value);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformAllEqual, _i32_i32, )(int Execution, int Value);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformAllEqual, _i32_i64, )(int Execution, long Value);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformAllEqual, _i32_f32, )(int Execution, float Value);
#if defined(cl_khr_fp64)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformAllEqual, _i32_f64, )(int Execution, double Value);
#endif // defined(cl_khr_fp64)
#if defined(cl_khr_fp16)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformAllEqual, _i32_f16, )(int Execution, half Value);
#endif // defined(cl_khr_fp16)
#endif // defined(cl_khr_subgroup_non_uniform_vote)
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAll, _i32_i1, )(int Execution, bool Predicate);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupAny, _i32_i1, )(int Execution, bool Predicate);
#define DECL_SUB_GROUP_BROADCAST_BASE(TYPE, TYPE_ABBR) \
TYPE SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBroadcast, _i32_##TYPE_ABBR##_v3i32, )(int Execution, TYPE Value, int3 LocalId); \
TYPE SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBroadcast, _i32_##TYPE_ABBR##_v3i64, )(int Execution, TYPE Value, long3 LocalId); \
TYPE SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBroadcast, _i32_##TYPE_ABBR##_v2i32, )(int Execution, TYPE Value, int2 LocalId); \
TYPE SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBroadcast, _i32_##TYPE_ABBR##_v2i64, )(int Execution, TYPE Value, long2 LocalId); \
TYPE SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBroadcast, _i32_##TYPE_ABBR##_i32, )(int Execution, TYPE Value, int LocalId); \
TYPE SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBroadcast, _i32_##TYPE_ABBR##_i64, )(int Execution, TYPE Value, long LocalId);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleINTEL, _i8_i32, )(char Data, uint InvocationId);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleINTEL, _i16_i32, )(short Data, uint InvocationId);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleINTEL, _i32_i32, )(int Data, uint InvocationId);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleINTEL, _i64_i32, )(long Data, uint InvocationId);
#if defined(cl_khr_fp16)
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleINTEL, _f16_i32, )(half Data, uint InvocationId);
#endif // defined(cl_khr_fp16)
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleINTEL, _f32_i32, )(float Data, uint InvocationId);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleINTEL, _f64_i32, )(double Data, uint InvocationId);
#endif // defined(cl_khr_fp64)
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleDownINTEL, _i8_i8_i32, )(char Current, char Next, uint Delta);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleDownINTEL, _i16_i16_i32, )(short Current, short Next, uint Delta);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleDownINTEL, _i32_i32_i32, )(int Current, int Next, uint Delta);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleDownINTEL, _i64_i64_i32, )(long Current, long Next, uint Delta);
#if defined(cl_khr_fp16)
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleDownINTEL, _f16_f16_i32, )(half Current, half Next, uint Delta);
#endif // defined(cl_khr_fp16)
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleDownINTEL, _f32_f32_i32, )(float Current, float Next, uint Delta);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleDownINTEL, _f64_f64_i32, )(double Current, double Next, uint Delta);
#endif // defined(cl_khr_fp64)
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleUpINTEL, _i8_i8_i32, )(char Previous, char Current, uint Delta);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleUpINTEL, _i16_i16_i32, )(short Previous, short Current, uint Delta);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleUpINTEL, _i32_i32_i32, )(int Previous, int Current, uint Delta);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleUpINTEL, _i64_i64_i32, )(long Previous, long Current, uint Delta);
#if defined(cl_khr_fp16)
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleUpINTEL, _f16_f16_i32, )(half Previous, half Current, uint Delta);
#endif // defined(cl_khr_fp16)
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleUpINTEL, _f32_f32_i32, )(float Previous, float Current, uint Delta);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleUpINTEL, _f64_f64_i32, )(double Previous, double Current, uint Delta);
#endif // defined(cl_khr_fp64)
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleXorINTEL, _i8_i32, )(char Data, uint Value);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleXorINTEL, _i16_i32, )(short Data, uint Value);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleXorINTEL, _i32_i32, )(int Data, uint Value);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleXorINTEL, _i64_i32, )(long Data, uint Value);
#if defined(cl_khr_fp16)
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleXorINTEL, _f16_i32, )(half Data, uint Value);
#endif // defined(cl_khr_fp16)
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleXorINTEL, _f32_i32, )(float Data, uint Value);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupShuffleXorINTEL, _f64_i32, )(double Data, uint Value);
#endif // defined(cl_khr_fp64)
#ifdef cl_intel_subgroups_char
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupImageBlockReadINTEL, _i8_img2d_ro_v2i32, _Rchar)(global Img2d_ro * image, int2 coord);
char2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupImageBlockReadINTEL, _v2i8_img2d_ro_v2i32, _Rchar2)(global Img2d_ro* image, int2 coord);
char4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupImageBlockReadINTEL, _v4i8_img2d_ro_v2i32, _Rchar4)(global Img2d_ro* image, int2 coord);
char8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupImageBlockReadINTEL, _v8i8_img2d_ro_v2i32, _Rchar8)(global Img2d_ro* image, int2 coord);
char16 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupImageBlockReadINTEL, _v16i8_img2d_ro_v2i32, _Rchar16)(global Img2d_ro* image, int2 coord);
#endif // cl_intel_subgroups_char
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupImageBlockReadINTEL, _i16_img2d_ro_v2i32, _Rshort)(global Img2d_ro* image, int2 coord);
short2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupImageBlockReadINTEL, _v2i16_img2d_ro_v2i32, _Rshort2)(global Img2d_ro* image, int2 coord);
short4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupImageBlockReadINTEL, _v4i16_img2d_ro_v2i32, _Rshort4)(global Img2d_ro* image, int2 coord);
short8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupImageBlockReadINTEL, _v8i16_img2d_ro_v2i32, _Rshort8)(global Img2d_ro* image, int2 coord);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupImageBlockReadINTEL, _i32_img2d_ro_v2i32, _Rint)(global Img2d_ro* image, int2 coord);
int2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupImageBlockReadINTEL, _v2i32_img2d_ro_v2i32, _Rint2)(global Img2d_ro* image, int2 coord);
int4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupImageBlockReadINTEL, _v4i32_img2d_ro_v2i32, _Rint4)(global Img2d_ro* image, int2 coord);
int8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupImageBlockReadINTEL, _v8i32_img2d_ro_v2i32, _Rint8)(global Img2d_ro* image, int2 coord);
#ifdef cl_intel_subgroups_long
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupImageBlockReadINTEL, _i64_img2d_ro_v2i32, _Rlong)(global Img2d_ro* image, int2 coord);
long2 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupImageBlockReadINTEL, _v2i64_img2d_ro_v2i32, _Rlong2)(global Img2d_ro* image, int2 coord);
long4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupImageBlockReadINTEL, _v4i64_img2d_ro_v2i32, _Rlong4)(global Img2d_ro* image, int2 coord);
long8 SPIRV_OVERLOADABLE SPIRV_BUILTIN(SubgroupImageBlockReadINTEL, _v8i64_img2d_ro_v2i32, _Rlong8)(global Img2d_ro* image, int2 coord);
#endif // cl_intel_subgroups_long
#define DECL_SUB_GROUP_BROADCAST(TYPE, TYPE_ABBR) \
DECL_SUB_GROUP_BROADCAST_BASE(TYPE, TYPE_ABBR) \
DECL_SUB_GROUP_BROADCAST_BASE(TYPE##2, v2##TYPE_ABBR) \
DECL_SUB_GROUP_BROADCAST_BASE(TYPE##3, v3##TYPE_ABBR) \
DECL_SUB_GROUP_BROADCAST_BASE(TYPE##4, v4##TYPE_ABBR) \
DECL_SUB_GROUP_BROADCAST_BASE(TYPE##8, v8##TYPE_ABBR) \
DECL_SUB_GROUP_BROADCAST_BASE(TYPE##16, v16##TYPE_ABBR)
DECL_SUB_GROUP_BROADCAST(char, i8)
DECL_SUB_GROUP_BROADCAST(short, i16)
DECL_SUB_GROUP_BROADCAST(int, i32)
DECL_SUB_GROUP_BROADCAST(long, i64)
DECL_SUB_GROUP_BROADCAST(float, f32)
#if defined(cl_khr_fp16)
DECL_SUB_GROUP_BROADCAST(half, f16)
#endif // defined(cl_khr_fp16)
#if defined(cl_khr_fp64)
DECL_SUB_GROUP_BROADCAST(double, f64)
#endif // defined(cl_khr_fp64)
#if defined(cl_khr_subgroup_ballot)
#define DECL_NON_UNIFORM_BROADCAST_BASE(TYPE, TYPE_ABBR) \
TYPE SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformBroadcast, _i32_##TYPE_ABBR##_i32, )( \
int Execution, TYPE Value, uint Id); \
TYPE SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformBroadcastFirst, _i32_##TYPE_ABBR, )(int Execution, TYPE Value);
#define DECL_NON_UNIFORM_BROADCAST(TYPE, TYPE_ABBR) \
DECL_NON_UNIFORM_BROADCAST_BASE(TYPE, TYPE_ABBR) \
DECL_NON_UNIFORM_BROADCAST_BASE(TYPE##2, v2##TYPE_ABBR) \
DECL_NON_UNIFORM_BROADCAST_BASE(TYPE##3, v3##TYPE_ABBR) \
DECL_NON_UNIFORM_BROADCAST_BASE(TYPE##4, v4##TYPE_ABBR) \
DECL_NON_UNIFORM_BROADCAST_BASE(TYPE##8, v8##TYPE_ABBR) \
DECL_NON_UNIFORM_BROADCAST_BASE(TYPE##16, v16##TYPE_ABBR)
DECL_NON_UNIFORM_BROADCAST(char, i8)
DECL_NON_UNIFORM_BROADCAST(short, i16)
DECL_NON_UNIFORM_BROADCAST(int, i32)
DECL_NON_UNIFORM_BROADCAST(long, i64)
DECL_NON_UNIFORM_BROADCAST(float, f32)
#if defined(cl_khr_fp64)
DECL_NON_UNIFORM_BROADCAST(double, f64)
#endif // defined(cl_khr_fp64)
#if defined(cl_khr_fp16)
DECL_NON_UNIFORM_BROADCAST(half, f16)
#endif // defined(cl_khr_fp16)
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformBallot, _i32_i1, )(int Execution, bool Predicate);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformInverseBallot, _i32_v4i32, )(int Execution, uint4 Value);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformBallotBitExtract, _i32_v4i32_i32, )(int Execution, uint4 Value, uint Index);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformBallotBitCount, _i32_i32_v4i32, )(int Execution, int Operation, uint4 Value);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformBallotFindLSB, _i32_v4i32, )(int Execution, uint4 Value);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformBallotFindMSB, _i32_v4i32, )(int Execution, uint4 Value);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN_NO_OP(BuiltInSubgroupEqMask, , )(void);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN_NO_OP(BuiltInSubgroupGeMask, , )(void);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN_NO_OP(BuiltInSubgroupGtMask, , )(void);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN_NO_OP(BuiltInSubgroupLeMask, , )(void);
uint4 SPIRV_OVERLOADABLE SPIRV_BUILTIN_NO_OP(BuiltInSubgroupLtMask, , )(void);
#endif // defined(cl_khr_subgroup_ballot)
#if defined(cl_khr_subgroup_shuffle)
#define DECL_NON_UNIFORM_SHUFFLE(TYPE, TYPE_ABBR) \
TYPE SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformShuffle, _i32_##TYPE_ABBR##_i32, )( \
int Execution, TYPE Value, uint Id); \
TYPE SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformShuffleXor, _i32_##TYPE_ABBR##_i32, )(int Execution, TYPE Value, uint Mask);
DECL_NON_UNIFORM_SHUFFLE(char, i8)
DECL_NON_UNIFORM_SHUFFLE(short, i16)
DECL_NON_UNIFORM_SHUFFLE(int, i32)
DECL_NON_UNIFORM_SHUFFLE(long, i64)
DECL_NON_UNIFORM_SHUFFLE(float, f32)
#if defined(cl_khr_fp64)
DECL_NON_UNIFORM_SHUFFLE(double, f64)
#endif // defined(cl_khr_fp64)
#if defined(cl_khr_fp16)
DECL_NON_UNIFORM_SHUFFLE(half, f16)
#endif // defined(cl_khr_fp16)
#endif // defined(cl_khr_subgroup_shuffle)
#if defined(cl_khr_subgroup_shuffle_relative)
#define DECL_NON_UNIFORM_SHUFFLE_RELATIVE(TYPE, TYPE_ABBR) \
TYPE SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformShuffleUp, _i32_##TYPE_ABBR##_i32, )( \
int Execution, TYPE Value, uint Delta); \
TYPE SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniformShuffleDown, _i32_##TYPE_ABBR##_i32, )(int Execution, TYPE Value, uint Delta);
DECL_NON_UNIFORM_SHUFFLE_RELATIVE(char, i8)
DECL_NON_UNIFORM_SHUFFLE_RELATIVE(short, i16)
DECL_NON_UNIFORM_SHUFFLE_RELATIVE(int, i32)
DECL_NON_UNIFORM_SHUFFLE_RELATIVE(long, i64)
DECL_NON_UNIFORM_SHUFFLE_RELATIVE(float, f32)
#if defined(cl_khr_fp64)
DECL_NON_UNIFORM_SHUFFLE_RELATIVE(double, f64)
#endif // defined(cl_khr_fp64)
#if defined(cl_khr_fp16)
DECL_NON_UNIFORM_SHUFFLE_RELATIVE(half, f16)
#endif // defined(cl_khr_fp16)
#endif // defined(cl_khr_subgroup_shuffle_relative)
#if defined(cl_khr_subgroup_non_uniform_arithmetic) || defined(cl_khr_subgroup_clustered_reduce)
#define DEFN_NON_UNIFORM_OPERATION_BASE(TYPE, OPERATION, TYPE_ABBR)
#define DEFN_NON_UNIFORM_CLUSTERED_OPERATION(TYPE, OPERATION, TYPE_ABBR)
#if defined(cl_khr_subgroup_non_uniform_arithmetic)
#define DEFN_NON_UNIFORM_OPERATION_BASE(TYPE, OPERATION, TYPE_ABBR) \
TYPE SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniform##OPERATION, _i32_i32_##TYPE_ABBR, )(int Execution, int Operation, TYPE X);
#endif // defined(cl_khr_subgroup_non_uniform_arithmetic)
#if defined(cl_khr_subgroup_clustered_reduce)
#define DEFN_NON_UNIFORM_CLUSTERED_OPERATION(TYPE, OPERATION, TYPE_ABBR) \
TYPE SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupNonUniform##OPERATION, _i32_i32_##TYPE_ABBR##_i32, )(int Execution, int Operation, TYPE X, uint ClusterSize);
#endif // defined(cl_khr_subgroup_clustered_reduce)
#define DEFN_NON_UNIFORM_OPERATION(TYPE, OPERATION, TYPE_ABBR) \
DEFN_NON_UNIFORM_OPERATION_BASE(TYPE, OPERATION, TYPE_ABBR) \
DEFN_NON_UNIFORM_CLUSTERED_OPERATION(TYPE, OPERATION, TYPE_ABBR)
// ARITHMETIC OPERATIONS
// - OpGroupNonUniformIAdd, OpGroupNonUniformFAdd
// - OpGroupNonUniformIMul, OpGroupNonUniformFMul
#define DEFN_NON_UNIFORM_ADD_MUL(TYPE, TYPE_SIGN, TYPE_ABBR) \
DEFN_NON_UNIFORM_OPERATION(TYPE, TYPE_SIGN##Add, TYPE_ABBR) \
DEFN_NON_UNIFORM_OPERATION(TYPE, TYPE_SIGN##Mul, TYPE_ABBR)
DEFN_NON_UNIFORM_ADD_MUL(char, I, i8)
DEFN_NON_UNIFORM_ADD_MUL(short, I, i16)
DEFN_NON_UNIFORM_ADD_MUL(int, I, i32)
DEFN_NON_UNIFORM_ADD_MUL(long, I, i64)
DEFN_NON_UNIFORM_ADD_MUL(float, F, f32)
#if defined(cl_khr_fp64)
DEFN_NON_UNIFORM_ADD_MUL(double, F, f64)
#endif // defined(cl_khr_fp64)
#if defined(cl_khr_fp16)
DEFN_NON_UNIFORM_ADD_MUL(half, F, f16)
#endif // defined(cl_khr_fp16)
// - OpGroupNonUniformSMin, OpGroupNonUniformUMin, OpGroupNonUniformFMin
// - OpGroupNonUniformSMax, OpGroupNonUniformUMax, OpGroupNonUniformFMax
#define DEFN_NON_UNIFORM_MIN_MAX(TYPE, TYPE_SIGN, TYPE_ABBR) \
DEFN_NON_UNIFORM_OPERATION(TYPE, TYPE_SIGN##Min, TYPE_ABBR) \
DEFN_NON_UNIFORM_OPERATION(TYPE, TYPE_SIGN##Max, TYPE_ABBR)
DEFN_NON_UNIFORM_MIN_MAX(char, S, i8)
DEFN_NON_UNIFORM_MIN_MAX(uchar, U, i8)
DEFN_NON_UNIFORM_MIN_MAX(short, S, i16)
DEFN_NON_UNIFORM_MIN_MAX(ushort, U, i16)
DEFN_NON_UNIFORM_MIN_MAX(int, S, i32)
DEFN_NON_UNIFORM_MIN_MAX(uint, U, i32)
DEFN_NON_UNIFORM_MIN_MAX(long, S, i64)
DEFN_NON_UNIFORM_MIN_MAX(ulong, U, i64)
DEFN_NON_UNIFORM_MIN_MAX(float, F, f32)
#if defined(cl_khr_fp64)
DEFN_NON_UNIFORM_MIN_MAX(double, F, f64)
#endif // defined(cl_khr_fp64)
#if defined(cl_khr_fp16)
DEFN_NON_UNIFORM_MIN_MAX(half, F, f16)
#endif // defined(cl_khr_fp16)
// BITWISE OPERATIONS
// - OpGroupNonUniformBitwiseAnd
// - OpGroupNonUniformBitwiseOr
// - OpGroupNonUniformBitwiseXor
#define DEFN_NON_UNIFORM_BITWISE_OPERATIONS(TYPE, TYPE_ABBR) \
DEFN_NON_UNIFORM_OPERATION(TYPE, BitwiseAnd, TYPE_ABBR) \
DEFN_NON_UNIFORM_OPERATION(TYPE, BitwiseOr, TYPE_ABBR) \
DEFN_NON_UNIFORM_OPERATION(TYPE, BitwiseXor, TYPE_ABBR)
DEFN_NON_UNIFORM_BITWISE_OPERATIONS(char, i8)
DEFN_NON_UNIFORM_BITWISE_OPERATIONS(short, i16)
DEFN_NON_UNIFORM_BITWISE_OPERATIONS(int, i32)
DEFN_NON_UNIFORM_BITWISE_OPERATIONS(long, i64)
// LOGICAL OPERATIONS
// - OpGroupNonUniformLogicalAnd
// - OpGroupNonUniformLogicalOr
// - OpGroupNonUniformLogicalXor
#define DEFN_NON_UNIFORM_LOGICAL_OPERATIONS(TYPE, TYPE_ABBR) \
DEFN_NON_UNIFORM_OPERATION(TYPE, LogicalAnd, TYPE_ABBR) \
DEFN_NON_UNIFORM_OPERATION(TYPE, LogicalOr, TYPE_ABBR) \
DEFN_NON_UNIFORM_OPERATION(TYPE, LogicalXor, TYPE_ABBR)
DEFN_NON_UNIFORM_LOGICAL_OPERATIONS(bool, i1)
#endif // defined(cl_khr_subgroup_non_uniform_arithmetic) || defined(cl_khr_subgroup_clustered_reduce)
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupIAdd, _i32_i32_i8, )(int Execution, int Operation, char X);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupIAdd, _i32_i32_i16, )(int Execution, int Operation, short X);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupIAdd, _i32_i32_i32, )(int Execution, int Operation, int X);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupIAdd, _i32_i32_i64, )(int Execution, int Operation, long X);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupFAdd, _i32_i32_f16, )(int Execution, int Operation, half X);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupFAdd, _i32_i32_f32, )(int Execution, int Operation, float X);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupFAdd, _i32_i32_f64, )(int Execution, int Operation, double X);
#endif // defined(cl_khr_fp64)
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupUMin, _i32_i32_i8, )(int Execution, int Operation, uchar X);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupUMin, _i32_i32_i16, )(int Execution, int Operation, ushort X);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupUMin, _i32_i32_i32, )(int Execution, int Operation, uint X);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupUMin, _i32_i32_i64, )(int Execution, int Operation, ulong X);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupFMin, _i32_i32_f16, )(int Execution, int Operation, half X);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupFMin, _i32_i32_f32, )(int Execution, int Operation, float X);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupFMin, _i32_i32_f64, )(int Execution, int Operation, double X);
#endif // defined(cl_khr_fp64)
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupSMin, _i32_i32_i8, )(int Execution, int Operation, char X);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupSMin, _i32_i32_i16, )(int Execution, int Operation, short X);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupSMin, _i32_i32_i32, )(int Execution, int Operation, int X);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupSMin, _i32_i32_i64, )(int Execution, int Operation, long X);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupFMax, _i32_i32_f16, )(int Execution, int Operation, half X);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupFMax, _i32_i32_f32, )(int Execution, int Operation, float X);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupFMax, _i32_i32_f64, )(int Execution, int Operation, double X);
#endif // defined(cl_khr_fp64)
uchar SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupUMax, _i32_i32_i8, )(int Execution, int Operation, uchar X);
ushort SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupUMax, _i32_i32_i16, )(int Execution, int Operation, ushort X);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupUMax, _i32_i32_i32, )(int Execution, int Operation, uint X);
ulong SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupUMax, _i32_i32_i64, )(int Execution, int Operation, ulong X);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupSMax, _i32_i32_i8, )(int Execution, int Operation, char X);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupSMax, _i32_i32_i16, )(int Execution, int Operation, short X);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupSMax, _i32_i32_i32, )(int Execution, int Operation, int X);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupSMax, _i32_i32_i64, )(int Execution, int Operation, long X);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupIMulKHR, _i32_i32_i8, )(int Execution, int Operation, char X);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupIMulKHR, _i32_i32_i16, )(int Execution, int Operation, short X);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupIMulKHR, _i32_i32_i32, )(int Execution, int Operation, int X);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupIMulKHR, _i32_i32_i64, )(int Execution, int Operation, long X);
half SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupFMulKHR, _i32_i32_f16, )(int Execution, int Operation, half X);
float SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupFMulKHR, _i32_i32_f32, )(int Execution, int Operation, float X);
#if defined(cl_khr_fp64)
double SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupFMulKHR, _i32_i32_f64, )(int Execution, int Operation, double X);
#endif // defined(cl_khr_fp64)
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBitwiseAndKHR, _i32_i32_i8, )(int Execution, int Operation, char X);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBitwiseAndKHR, _i32_i32_i16, )(int Execution, int Operation, short X);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBitwiseAndKHR, _i32_i32_i32, )(int Execution, int Operation, int X);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBitwiseAndKHR, _i32_i32_i64, )(int Execution, int Operation, long X);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBitwiseOrKHR, _i32_i32_i8, )(int Execution, int Operation, char X);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBitwiseOrKHR, _i32_i32_i16, )(int Execution, int Operation, short X);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBitwiseOrKHR, _i32_i32_i32, )(int Execution, int Operation, int X);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBitwiseOrKHR, _i32_i32_i64, )(int Execution, int Operation, long X);
char SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBitwiseXorKHR, _i32_i32_i8, )(int Execution, int Operation, char X);
short SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBitwiseXorKHR, _i32_i32_i16, )(int Execution, int Operation, short X);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBitwiseXorKHR, _i32_i32_i32, )(int Execution, int Operation, int X);
long SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupBitwiseXorKHR, _i32_i32_i64, )(int Execution, int Operation, long X);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupLogicalAndKHR, _i32_i32_i1, )(int Execution, int Operation, bool X);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupLogicalOrKHR, _i32_i32_i1, )(int Execution, int Operation, bool X);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupLogicalXorKHR, _i32_i32_i1, )(int Execution, int Operation, bool X);
// Device-Side Enqueue Instructions
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(EnqueueMarker, _i64_i32_p0i64_p0i64, )(
__spirv_Queue Queue, uint NumEvents, __spirv_DeviceEvent private* WaitEvents, __spirv_DeviceEvent private* RetEvent);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(EnqueueMarker, _i64_i32_p3i64_p3i64, )(
__spirv_Queue Queue, uint NumEvents, __spirv_DeviceEvent local* WaitEvents, __spirv_DeviceEvent local* RetEvent);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(EnqueueMarker, _i64_i32_p4i64_p4i64, )(
__spirv_Queue Queue, uint NumEvents, __spirv_DeviceEvent generic* WaitEvents, __spirv_DeviceEvent generic* RetEvent);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
typedef struct
{
uint dim;
size_t globalWorkOffset[3];
size_t globalWorkSize[3];
size_t localWorkSize[3];
} Ndrange_t;
// OpEnqueueKernel will be custom lowered?
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
uint __builtin_spirv_OpGetKernelWorkGroupSize_fp0i32_p0i8_i32_i32(uchar* Invoke, private uchar *Param, uint ParamSize, uint ParamAlign);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(RetainEvent, _i64, )(__spirv_DeviceEvent Event);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(ReleaseEvent, _i64, )(__spirv_DeviceEvent Event);
__spirv_DeviceEvent SPIRV_OVERLOADABLE SPIRV_BUILTIN(CreateUserEvent, , )(void);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsValidEvent, _i64, )(__spirv_DeviceEvent Event);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(SetUserEventStatus, _i64_i32, )(__spirv_DeviceEvent Event, int Status);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(CaptureEventProfilingInfo, _i64_i32_p1i8, )(__spirv_DeviceEvent Event, int ProfilingInfo, global char *Value);
__spirv_Queue SPIRV_OVERLOADABLE SPIRV_BUILTIN(GetDefaultQueue, , )(void);
#define DECL_BUILD_NDRANGE(TYPE, TYPE_MANGLING) \
Ndrange_t SPIRV_OVERLOADABLE SPIRV_BUILTIN(BuildNDRange, _##TYPE_MANGLING##_##TYPE_MANGLING##_##TYPE_MANGLING, _1D)(TYPE GlobalWorkSize, TYPE LocalWorkSize, TYPE GlobalWorkOffset); \
Ndrange_t SPIRV_OVERLOADABLE SPIRV_BUILTIN(BuildNDRange, _a2##TYPE_MANGLING##_a2##TYPE_MANGLING##_a2##TYPE_MANGLING, _2D)(TYPE GlobalWorkSize[2], TYPE LocalWorkSize[2], TYPE GlobalWorkOffset[2]); \
Ndrange_t SPIRV_OVERLOADABLE SPIRV_BUILTIN(BuildNDRange, _a3##TYPE_MANGLING##_a3##TYPE_MANGLING##_a3##TYPE_MANGLING, _3D)(TYPE GlobalWorkSize[3], TYPE LocalWorkSize[3], TYPE GlobalWorkOffset[3]);
#if __32bit__ > 0
DECL_BUILD_NDRANGE(int, i32)
#else
DECL_BUILD_NDRANGE(long, i64)
#endif
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
// Pipe Instructions
#if (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ReadPipe, _Pipe_ro_p4i8_i32, )(__spirv_Pipe_ro Pipe, generic char* Pointer, int PacketSize /*, int PacketAlignment*/);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(WritePipe, _Pipe_wo_p4i8_i32, )(__spirv_Pipe_wo Pipe, generic char* Pointer, int PacketSize/*, int PacketAlignment*/);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ReservedReadPipe, _Pipe_ro_ReserveId_i32_p4i8_i32, )(__spirv_Pipe_ro Pipe, __spirv_ReserveId ReserveId, int Index, generic char* Pointer, int PacketSize/*, int PacketAlignment*/);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN(ReservedWritePipe, _Pipe_wo_ReserveId_i32_p4i8_i32, )(__spirv_Pipe_wo Pipe, __spirv_ReserveId ReserveId, int Index, generic char* Pointer, int PacketSize/*, int PacketAlignment*/);
__spirv_ReserveId SPIRV_OVERLOADABLE SPIRV_BUILTIN(ReserveReadPipePackets, _Pipe_ro_i32_i32, )(__spirv_Pipe_ro Pipe, int NumPackets, int PacketSize/*, int PacketAlignment*/);
__spirv_ReserveId SPIRV_OVERLOADABLE SPIRV_BUILTIN(ReserveWritePipePackets, _Pipe_wo_i32_i32, )(__spirv_Pipe_wo Pipe, int NumPackets, int PacketSize/*, int PacketAlignment*/);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(CommitReadPipe, _Pipe_ro_ReserveId_i32, )(__spirv_Pipe_ro Pipe, __spirv_ReserveId ReserveId, int PacketSize/*, int PacketAlignment*/);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(CommitWritePipe, _Pipe_wo_ReserveId_i32, )(__spirv_Pipe_wo Pipe, __spirv_ReserveId ReserveId, int PacketSize/*, int PacketAlignment*/);
bool SPIRV_OVERLOADABLE SPIRV_BUILTIN(IsValidReserveId, _ReserveId, )(__spirv_ReserveId ReserveId);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(GetNumPipePackets, _Pipe_ro_i32, )(__spirv_Pipe_ro Pipe, int PacketSize/*, int PacketAlignment*/);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(GetNumPipePackets, _Pipe_wo_i32, )(__spirv_Pipe_wo Pipe, int PacketSize/*, int PacketAlignment*/);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(GetMaxPipePackets, _Pipe_ro_i32, )(__spirv_Pipe_ro Pipe, int PacketSize/*, int PacketAlignment*/);
uint SPIRV_OVERLOADABLE SPIRV_BUILTIN(GetMaxPipePackets, _Pipe_wo_i32, )(__spirv_Pipe_wo Pipe, int PacketSize/*, int PacketAlignment*/);
__spirv_ReserveId SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupReserveReadPipePackets, _i32_Pipe_ro_i32_i32, )(int Execution, __spirv_Pipe_ro Pipe, int NumPackets, int PacketSize/*, int PacketAlignment*/);
__spirv_ReserveId SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupReserveWritePipePackets, _i32_Pipe_wo_i32_i32, )(int Execution, __spirv_Pipe_wo Pipe, int NumPackets, int PacketSize/*, int PacketAlignment*/);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupCommitReadPipe, _i32_Pipe_ro_ReserveId_i32, )(int Execution, __spirv_Pipe_ro Pipe, __spirv_ReserveId ReserveId, int PacketSize/*, int PacketAlignment*/);
void SPIRV_OVERLOADABLE SPIRV_BUILTIN(GroupCommitWritePipe, _i32_Pipe_wo_ReserveId_i32, )(int Execution, __spirv_Pipe_wo Pipe, __spirv_ReserveId ReserveId, int PacketSize/*, int PacketAlignment*/);
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
#include "spirv_math.h"
char2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2i8_v2i8, )(char2 v, char2 m);
char2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4i8_v2i8, )(char4 v, char2 m);
char2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8i8_v2i8, )(char8 v, char2 m);
char2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16i8_v2i8, )(char16 v, char2 m);
char4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2i8_v4i8, )(char2 v, char4 m);
char4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4i8_v4i8, )(char4 v, char4 m);
char4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8i8_v4i8, )(char8 v, char4 m);
char4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16i8_v4i8, )(char16 v, char4 m);
char8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2i8_v8i8, )(char2 v, char8 m);
char8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4i8_v8i8, )(char4 v, char8 m);
char8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8i8_v8i8, )(char8 v, char8 m);
char8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16i8_v8i8, )(char16 v, char8 m);
char16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2i8_v16i8, )(char2 v, char16 m);
char16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4i8_v16i8, )(char4 v, char16 m);
char16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8i8_v16i8, )(char8 v, char16 m);
char16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16i8_v16i8, )(char16 v, char16 m);
short2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2i16_v2i16, )(short2 v, short2 m);
short2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4i16_v2i16, )(short4 v, short2 m);
short2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8i16_v2i16, )(short8 v, short2 m);
short2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16i16_v2i16, )(short16 v, short2 m);
short4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2i16_v4i16, )(short2 v, short4 m);
short4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4i16_v4i16, )(short4 v, short4 m);
short4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8i16_v4i16, )(short8 v, short4 m);
short4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16i16_v4i16, )(short16 v, short4 m);
short8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2i16_v8i16, )(short2 v, short8 m);
short8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4i16_v8i16, )(short4 v, short8 m);
short8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8i16_v8i16, )(short8 v, short8 m);
short8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16i16_v8i16, )(short16 v, short8 m);
short16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2i16_v16i16, )(short2 v, short16 m);
short16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4i16_v16i16, )(short4 v, short16 m);
short16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8i16_v16i16, )(short8 v, short16 m);
short16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16i16_v16i16, )(short16 v, short16 m);
int2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2i32_v2i32, )(int2 v, int2 m);
int2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4i32_v2i32, )(int4 v, int2 m);
int2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8i32_v2i32, )(int8 v, int2 m);
int2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16i32_v2i32, )(int16 v, int2 m);
int4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2i32_v4i32, )(int2 v, int4 m);
int4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4i32_v4i32, )(int4 v, int4 m);
int4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8i32_v4i32, )(int8 v, int4 m);
int4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16i32_v4i32, )(int16 v, int4 m);
int8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2i32_v8i32, )(int2 v, int8 m);
int8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4i32_v8i32, )(int4 v, int8 m);
int8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8i32_v8i32, )(int8 v, int8 m);
int8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16i32_v8i32, )(int16 v, int8 m);
int16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2i32_v16i32, )(int2 v, int16 m);
int16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4i32_v16i32, )(int4 v, int16 m);
int16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8i32_v16i32, )(int8 v, int16 m);
int16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16i32_v16i32, )(int16 v, int16 m);
long2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2i64_v2i64, )(long2 v, long2 m);
long2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4i64_v2i64, )(long4 v, long2 m);
long2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8i64_v2i64, )(long8 v, long2 m);
long2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16i64_v2i64, )(long16 v, long2 m);
long4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2i64_v4i64, )(long2 v, long4 m);
long4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4i64_v4i64, )(long4 v, long4 m);
long4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8i64_v4i64, )(long8 v, long4 m);
long4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16i64_v4i64, )(long16 v, long4 m);
long8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2i64_v8i64, )(long2 v, long8 m);
long8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4i64_v8i64, )(long4 v, long8 m);
long8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8i64_v8i64, )(long8 v, long8 m);
long8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16i64_v8i64, )(long16 v, long8 m);
long16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2i64_v16i64, )(long2 v, long16 m);
long16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4i64_v16i64, )(long4 v, long16 m);
long16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8i64_v16i64, )(long8 v, long16 m);
long16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16i64_v16i64, )(long16 v, long16 m);
float2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2f32_v2i32, )(float2 v, int2 m);
float2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4f32_v2i32, )(float4 v, int2 m);
float2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8f32_v2i32, )(float8 v, int2 m);
float2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16f32_v2i32, )(float16 v, int2 m);
float4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2f32_v4i32, )(float2 v, int4 m);
float4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4f32_v4i32, )(float4 v, int4 m);
float4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8f32_v4i32, )(float8 v, int4 m);
float4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16f32_v4i32, )(float16 v, int4 m);
float8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2f32_v8i32, )(float2 v, int8 m);
float8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4f32_v8i32, )(float4 v, int8 m);
float8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8f32_v8i32, )(float8 v, int8 m);
float8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16f32_v8i32, )(float16 v, int8 m);
float16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2f32_v16i32, )(float2 v, int16 m);
float16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4f32_v16i32, )(float4 v, int16 m);
float16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8f32_v16i32, )(float8 v, int16 m);
float16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16f32_v16i32, )(float16 v, int16 m);
char2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2i8_v2i8_v2i8, )(char2 v0, char2 v1, char2 m);
char2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4i8_v4i8_v2i8, )(char4 v0, char4 v1, char2 m);
char2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8i8_v8i8_v2i8, )(char8 v0, char8 v1, char2 m);
char2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16i8_v16i8_v2i8, )(char16 v0, char16 v1, char2 m);
char4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2i8_v2i8_v4i8, )(char2 v0, char2 v1, char4 m);
char4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4i8_v4i8_v4i8, )(char4 v0, char4 v1, char4 m);
char4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8i8_v8i8_v4i8, )(char8 v0, char8 v1, char4 m);
char4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16i8_v16i8_v4i8, )(char16 v0, char16 v1, char4 m);
char8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2i8_v2i8_v8i8, )(char2 v0, char2 v1, char8 m);
char8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4i8_v4i8_v8i8, )(char4 v0, char4 v1, char8 m);
char8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8i8_v8i8_v8i8, )(char8 v0, char8 v1, char8 m);
char8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16i8_v16i8_v8i8, )(char16 v0, char16 v1, char8 m);
char16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2i8_v2i8_v16i8, )(char2 v0, char2 v1, char16 m);
char16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4i8_v4i8_v16i8, )(char4 v0, char4 v1, char16 m);
char16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8i8_v8i8_v16i8, )(char8 v0, char8 v1, char16 m);
char16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16i8_v16i8_v16i8, )(char16 v0, char16 v1, char16 m);
short2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2i16_v2i16_v2i16, )(short2 v0, short2 v1, short2 m);
short2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4i16_v4i16_v2i16, )(short4 v0, short4 v1, short2 m);
short2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8i16_v8i16_v2i16, )(short8 v0, short8 v1, short2 m);
short2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16i16_v16i16_v2i16, )(short16 v0, short16 v1, short2 m);
short4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2i16_v2i16_v4i16, )(short2 v0, short2 v1, short4 m);
short4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4i16_v4i16_v4i16, )(short4 v0, short4 v1, short4 m);
short4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8i16_v8i16_v4i16, )(short8 v0, short8 v1, short4 m);
short4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16i16_v16i16_v4i16, )(short16 v0, short16 v1, short4 m);
short8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2i16_v2i16_v8i16, )(short2 v0, short2 v1, short8 m);
short8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4i16_v4i16_v8i16, )(short4 v0, short4 v1, short8 m);
short8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8i16_v8i16_v8i16, )(short8 v0, short8 v1, short8 m);
short8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16i16_v16i16_v8i16, )(short16 v0, short16 v1, short8 m);
short16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2i16_v2i16_v16i16, )(short2 v0, short2 v1, short16 m);
short16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4i16_v4i16_v16i16, )(short4 v0, short4 v1, short16 m);
short16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8i16_v8i16_v16i16, )(short8 v0, short8 v1, short16 m);
short16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16i16_v16i16_v16i16, )(short16 v0, short16 v1, short16 m);
int2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2i32_v2i32_v2i32, )(int2 v0, int2 v1, int2 m);
int2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4i32_v4i32_v2i32, )(int4 v0, int4 v1, int2 m);
int2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8i32_v8i32_v2i32, )(int8 v0, int8 v1, int2 m);
int2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16i32_v16i32_v2i32, )(int16 v0, int16 v1, int2 m);
int4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2i32_v2i32_v4i32, )(int2 v0, int2 v1, int4 m);
int4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4i32_v4i32_v4i32, )(int4 v0, int4 v1, int4 m);
int4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8i32_v8i32_v4i32, )(int8 v0, int8 v1, int4 m);
int4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16i32_v16i32_v4i32, )(int16 v0, int16 v1, int4 m);
int8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2i32_v2i32_v8i32, )(int2 v0, int2 v1, int8 m);
int8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4i32_v4i32_v8i32, )(int4 v0, int4 v1, int8 m);
int8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8i32_v8i32_v8i32, )(int8 v0, int8 v1, int8 m);
int8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16i32_v16i32_v8i32, )(int16 v0, int16 v1, int8 m);
int16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2i32_v2i32_v16i32, )(int2 v0, int2 v1, int16 m);
int16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4i32_v4i32_v16i32, )(int4 v0, int4 v1, int16 m);
int16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8i32_v8i32_v16i32, )(int8 v0, int8 v1, int16 m);
int16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16i32_v16i32_v16i32, )(int16 v0, int16 v1, int16 m);
long2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2i64_v2i64_v2i64, )(long2 v0, long2 v1, long2 m);
long2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4i64_v4i64_v2i64, )(long4 v0, long4 v1, long2 m);
long2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8i64_v8i64_v2i64, )(long8 v0, long8 v1, long2 m);
long2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16i64_v16i64_v2i64, )(long16 v0, long16 v1, long2 m);
long4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2i64_v2i64_v4i64, )(long2 v0, long2 v1, long4 m);
long4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4i64_v4i64_v4i64, )(long4 v0, long4 v1, long4 m);
long4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8i64_v8i64_v4i64, )(long8 v0, long8 v1, long4 m);
long4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16i64_v16i64_v4i64, )(long16 v0, long16 v1, long4 m);
long8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2i64_v2i64_v8i64, )(long2 v0, long2 v1, long8 m);
long8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4i64_v4i64_v8i64, )(long4 v0, long4 v1, long8 m);
long8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8i64_v8i64_v8i64, )(long8 v0, long8 v1, long8 m);
long8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16i64_v16i64_v8i64, )(long16 v0, long16 v1, long8 m);
long16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2i64_v2i64_v16i64, )(long2 v0, long2 v1, long16 m);
long16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4i64_v4i64_v16i64, )(long4 v0, long4 v1, long16 m);
long16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8i64_v8i64_v16i64, )(long8 v0, long8 v1, long16 m);
long16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16i64_v16i64_v16i64, )(long16 v0, long16 v1, long16 m);
float2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2f32_v2f32_v2i32, )(float2 v0, float2 v1, int2 m);
float2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4f32_v4f32_v2i32, )(float4 v0, float4 v1, int2 m);
float2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8f32_v8f32_v2i32, )(float8 v0, float8 v1, int2 m);
float2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16f32_v16f32_v2i32, )(float16 v0, float16 v1, int2 m);
float4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2f32_v2f32_v4i32, )(float2 v0, float2 v1, int4 m);
float4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4f32_v4f32_v4i32, )(float4 v0, float4 v1, int4 m);
float4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8f32_v8f32_v4i32, )(float8 v0, float8 v1, int4 m);
float4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16f32_v16f32_v4i32, )(float16 v0, float16 v1, int4 m);
float8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2f32_v2f32_v8i32, )(float2 v0, float2 v1, int8 m);
float8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4f32_v4f32_v8i32, )(float4 v0, float4 v1, int8 m);
float8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8f32_v8f32_v8i32, )(float8 v0, float8 v1, int8 m);
float8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16f32_v16f32_v8i32, )(float16 v0, float16 v1, int8 m);
float16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2f32_v2f32_v16i32, )(float2 v0, float2 v1, int16 m);
float16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4f32_v4f32_v16i32, )(float4 v0, float4 v1, int16 m);
float16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8f32_v8f32_v16i32, )(float8 v0, float8 v1, int16 m);
float16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16f32_v16f32_v16i32, )(float16 v0, float16 v1, int16 m);
half2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2f16_v2i16, )(half2 v, short2 m);
half2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4f16_v2i16, )(half4 v, short2 m);
half2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8f16_v2i16, )(half8 v, short2 m);
half2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16f16_v2i16, )(half16 v, short2 m);
half4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2f16_v4i16, )(half2 v, short4 m);
half4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4f16_v4i16, )(half4 v, short4 m);
half4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8f16_v4i16, )(half8 v, short4 m);
half4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16f16_v4i16, )(half16 v, short4 m);
half8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2f16_v8i16, )(half2 v, short8 m);
half8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4f16_v8i16, )(half4 v, short8 m);
half8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8f16_v8i16, )(half8 v, short8 m);
half8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16f16_v8i16, )(half16 v, short8 m);
half16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2f16_v16i16, )(half2 v, short16 m);
half16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4f16_v16i16, )(half4 v, short16 m);
half16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8f16_v16i16, )(half8 v, short16 m);
half16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16f16_v16i16, )(half16 v, short16 m);
half2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2f16_v2f16_v2i16, )(half2 v0, half2 v1, short2 m);
half2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4f16_v4f16_v2i16, )(half4 v0, half4 v1, short2 m);
half2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8f16_v8f16_v2i16, )(half8 v0, half8 v1, short2 m);
half2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16f16_v16f16_v2i16, )(half16 v0, half16 v1, short2 m);
half4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2f16_v2f16_v4i16, )(half2 v0, half2 v1, short4 m);
half4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4f16_v4f16_v4i16, )(half4 v0, half4 v1, short4 m);
half4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8f16_v8f16_v4i16, )(half8 v0, half8 v1, short4 m);
half4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16f16_v16f16_v4i16, )(half16 v0, half16 v1, short4 m);
half8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2f16_v2f16_v8i16, )(half2 v0, half2 v1, short8 m);
half8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4f16_v4f16_v8i16, )(half4 v0, half4 v1, short8 m);
half8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8f16_v8f16_v8i16, )(half8 v0, half8 v1, short8 m);
half8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16f16_v16f16_v8i16, )(half16 v0, half16 v1, short8 m);
half16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2f16_v2f16_v16i16, )(half2 v0, half2 v1, short16 m);
half16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4f16_v4f16_v16i16, )(half4 v0, half4 v1, short16 m);
half16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8f16_v8f16_v16i16, )(half8 v0, half8 v1, short16 m);
half16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16f16_v16f16_v16i16, )(half16 v0, half16 v1, short16 m);
#if defined(cl_khr_fp64)
double2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2f64_v2i64, )(double2 v, long2 m);
double2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4f64_v2i64, )(double4 v, long2 m);
double2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8f64_v2i64, )(double8 v, long2 m);
double2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16f64_v2i64, )(double16 v, long2 m);
double4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2f64_v4i64, )(double2 v, long4 m);
double4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4f64_v4i64, )(double4 v, long4 m);
double4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8f64_v4i64, )(double8 v, long4 m);
double4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16f64_v4i64, )(double16 v, long4 m);
double8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2f64_v8i64, )(double2 v, long8 m);
double8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4f64_v8i64, )(double4 v, long8 m);
double8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8f64_v8i64, )(double8 v, long8 m);
double8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16f64_v8i64, )(double16 v, long8 m);
double16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v2f64_v16i64, )(double2 v, long16 m);
double16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v4f64_v16i64, )(double4 v, long16 m);
double16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v8f64_v16i64, )(double8 v, long16 m);
double16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle, _v16f64_v16i64, )(double16 v, long16 m);
double2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2f64_v2f64_v2i64, )(double2 v0, double2 v1, long2 m);
double2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4f64_v4f64_v2i64, )(double4 v0, double4 v1, long2 m);
double2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8f64_v8f64_v2i64, )(double8 v0, double8 v1, long2 m);
double2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16f64_v16f64_v2i64, )(double16 v0, double16 v1, long2 m);
double4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2f64_v2f64_v4i64, )(double2 v0, double2 v1, long4 m);
double4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4f64_v4f64_v4i64, )(double4 v0, double4 v1, long4 m);
double4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8f64_v8f64_v4i64, )(double8 v0, double8 v1, long4 m);
double4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16f64_v16f64_v4i64, )(double16 v0, double16 v1, long4 m);
double8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2f64_v2f64_v8i64, )(double2 v0, double2 v1, long8 m);
double8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4f64_v4f64_v8i64, )(double4 v0, double4 v1, long8 m);
double8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8f64_v8f64_v8i64, )(double8 v0, double8 v1, long8 m);
double8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16f64_v16f64_v8i64, )(double16 v0, double16 v1, long8 m);
double16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v2f64_v2f64_v16i64, )(double2 v0, double2 v1, long16 m);
double16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v4f64_v4f64_v16i64, )(double4 v0, double4 v1, long16 m);
double16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v8f64_v8f64_v16i64, )(double8 v0, double8 v1, long16 m);
double16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(shuffle2, _v16f64_v16f64_v16i64, )(double16 v0, double16 v1, long16 m);
#endif // defined(cl_khr_fp64)
char SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _i8_i8, )(char x, char y);
char2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v2i8_v2i8, )(char2 x, char2 y);
char3 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v3i8_v3i8, )(char3 x, char3 y);
char4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v4i8_v4i8, )(char4 x, char4 y);
char8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v8i8_v8i8, )(char8 x, char8 y);
char16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v16i8_v16i8, )(char16 x, char16 y);
uchar SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _i8_i8, )(uchar x, uchar y);
uchar2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v2i8_v2i8, )(uchar2 x, uchar2 y);
uchar3 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v3i8_v3i8, )(uchar3 x, uchar3 y);
uchar4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v4i8_v4i8, )(uchar4 x, uchar4 y);
uchar8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v8i8_v8i8, )(uchar8 x, uchar8 y);
uchar16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v16i8_v16i8, )(uchar16 x, uchar16 y);
short SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _i16_i16, )(short x, short y);
short2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v2i16_v2i16, )(short2 x, short2 y);
short3 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v3i16_v3i16, )(short3 x, short3 y);
short4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v4i16_v4i16, )(short4 x, short4 y);
short8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v8i16_v8i16, )(short8 x, short8 y);
short16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v16i16_v16i16, )(short16 x, short16 y);
ushort SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _i16_i16, )(ushort x, ushort y);
ushort2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v2i16_v2i16, )(ushort2 x, ushort2 y);
ushort3 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v3i16_v3i16, )(ushort3 x, ushort3 y);
ushort4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v4i16_v4i16, )(ushort4 x, ushort4 y);
ushort8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v8i16_v8i16, )(ushort8 x, ushort8 y);
ushort16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v16i16_v16i16, )(ushort16 x, ushort16 y);
int SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _i32_i32, )(int x, int y);
int2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v2i32_v2i32, )(int2 x, int2 y);
int3 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v3i32_v3i32, )(int3 x, int3 y);
int4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v4i32_v4i32, )(int4 x, int4 y);
int8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v8i32_v8i32, )(int8 x, int8 y);
int16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v16i32_v16i32, )(int16 x, int16 y);
uint SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _i32_i32, )(uint x, uint y);
uint2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v2i32_v2i32, )(uint2 x, uint2 y);
uint3 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v3i32_v3i32, )(uint3 x, uint3 y);
uint4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v4i32_v4i32, )(uint4 x, uint4 y);
uint8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v8i32_v8i32, )(uint8 x, uint8 y);
uint16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v16i32_v16i32, )(uint16 x, uint16 y);
long SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _i64_i64, )(long x, long y);
long2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v2i64_v2i64, )(long2 x, long2 y);
long3 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v3i64_v3i64, )(long3 x, long3 y);
long4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v4i64_v4i64, )(long4 x, long4 y);
long8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v8i64_v8i64, )(long8 x, long8 y);
long16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(s_min, _v16i64_v16i64, )(long16 x, long16 y);
ulong SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _i64_i64, )(ulong x, ulong y);
ulong2 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v2i64_v2i64, )(ulong2 x, ulong2 y);
ulong3 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v3i64_v3i64, )(ulong3 x, ulong3 y);
ulong4 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v4i64_v4i64, )(ulong4 x, ulong4 y);
ulong8 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v8i64_v8i64, )(ulong8 x, ulong8 y);
ulong16 SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(u_min, _v16i64_v16i64, )(ulong16 x, ulong16 y);
// Misc Instructions
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1i8_i32, )( global char* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v2i8_i32, )( global char2* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v3i8_i32, )( global char3* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v4i8_i32, )( global char4* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v8i8_i32, )( global char8* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v16i8_i32, )( global char16* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1i16_i32, )( global short* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v2i16_i32, )( global short2* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v3i16_i32, )( global short3* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v4i16_i32, )( global short4* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v8i16_i32, )( global short8* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v16i16_i32, )( global short16* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1i32_i32, )( global int* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v2i32_i32, )( global int2* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v3i32_i32, )( global int3* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v4i32_i32, )( global int4* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v8i32_i32, )( global int8* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v16i32_i32, )( global int16* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1i64_i32, )( global long* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v2i64_i32, )( global long2* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v3i64_i32, )( global long3* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v4i64_i32, )( global long4* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v8i64_i32, )( global long8* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v16i64_i32, )( global long16* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1f32_i32, )( global float* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v2f32_i32, )( global float2* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v3f32_i32, )( global float3* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v4f32_i32, )( global float4* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v8f32_i32, )( global float8* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v16f32_i32, )( global float16* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1f16_i32, )( global half* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v2f16_i32, )( global half2* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v3f16_i32, )( global half3* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v4f16_i32, )( global half4* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v8f16_i32, )( global half8* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v16f16_i32, )( global half16* p, int num_elements);
#if defined(cl_khr_fp64)
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1f64_i32, )( global double* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v2f64_i32, )( global double2* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v3f64_i32, )( global double3* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v4f64_i32, )( global double4* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v8f64_i32, )( global double8* p, int num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v16f64_i32, )( global double16* p, int num_elements);
#endif // defined(cl_khr_fp64)
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1i8_i64, )( global char* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v2i8_i64, )( global char2* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v3i8_i64, )( global char3* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v4i8_i64, )( global char4* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v8i8_i64, )( global char8* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v16i8_i64, )( global char16* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1i16_i64, )( global short* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v2i16_i64, )( global short2* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v3i16_i64, )( global short3* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v4i16_i64, )( global short4* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v8i16_i64, )( global short8* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v16i16_i64, )( global short16* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1i32_i64, )( global int* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v2i32_i64, )( global int2* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v3i32_i64, )( global int3* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v4i32_i64, )( global int4* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v8i32_i64, )( global int8* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v16i32_i64, )( global int16* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1i64_i64, )( global long* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v2i64_i64, )( global long2* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v3i64_i64, )( global long3* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v4i64_i64, )( global long4* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v8i64_i64, )( global long8* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v16i64_i64, )( global long16* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1f32_i64, )( global float* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v2f32_i64, )( global float2* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v3f32_i64, )( global float3* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v4f32_i64, )( global float4* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v8f32_i64, )( global float8* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v16f32_i64, )( global float16* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1f16_i64, )( global half* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v2f16_i64, )( global half2* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v3f16_i64, )( global half3* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v4f16_i64, )( global half4* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v8f16_i64, )( global half8* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v16f16_i64, )( global half16* p, long num_elements);
#if defined(cl_khr_fp64)
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1f64_i64, )( global double* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v2f64_i64, )( global double2* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v3f64_i64, )( global double3* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v4f64_i64, )( global double4* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v8f64_i64, )( global double8* p, long num_elements);
void SPIRV_OVERLOADABLE SPIRV_OCL_BUILTIN(prefetch, _p1v16f64_i64, )( global double16* p, long num_elements);
#endif // defined(cl_khr_fp64)
uint __builtin_spirv_OpReadClockKHR_i32_i32(uint scope);
ulong __builtin_spirv_OpReadClockKHR_i64_i32(uint scope);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN_NO_OP(BuiltInSubDeviceIDINTEL, , )(void);
int SPIRV_OVERLOADABLE SPIRV_BUILTIN_NO_OP(GlobalHWThreadIDINTEL, , )(void);
#endif // __SPIRV_H__
|
f881a6b75328a2867f295546dafc95f8187e1c73
|
b1fcecfa2d9b42db62ba22f4635b3e845bf4ab56
|
/nginx/src/os/unix/ngx_socket.h
|
8f67566816d5d10d9027f6833c14980ca318bed7
|
[
"BSD-2-Clause"
] |
permissive
|
chronolaw/annotated_nginx
|
606b5ae08b8173daa01fcac353b089b17deff08d
|
60b0e2a15d4c7c51313bd117bab026046c3da01b
|
refs/heads/master
| 2023-06-29T09:15:23.066046
| 2023-06-17T08:35:25
| 2023-06-17T08:35:25
| 51,183,743
| 573
| 206
| null | null | null | null |
UTF-8
|
C
| false
| false
| 1,613
|
h
|
ngx_socket.h
|
// annotated by chrono since 2016
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_SOCKET_H_INCLUDED_
#define _NGX_SOCKET_H_INCLUDED_
#include <ngx_config.h>
#define NGX_WRITE_SHUTDOWN SHUT_WR
#define NGX_READ_SHUTDOWN SHUT_RD
#define NGX_RDWR_SHUTDOWN SHUT_RDWR
typedef int ngx_socket_t;
#define ngx_socket socket
#define ngx_socket_n "socket()"
// 默认会定义NGX_HAVE_FIONBIO
#if (NGX_HAVE_FIONBIO)
// 设置socket为非阻塞模式
// ioctl(s, FIONBIO, &nb)
int ngx_nonblocking(ngx_socket_t s);
int ngx_blocking(ngx_socket_t s);
#define ngx_nonblocking_n "ioctl(FIONBIO)"
#define ngx_blocking_n "ioctl(!FIONBIO)"
#else
#define ngx_nonblocking(s) fcntl(s, F_SETFL, fcntl(s, F_GETFL) | O_NONBLOCK)
#define ngx_nonblocking_n "fcntl(O_NONBLOCK)"
#define ngx_blocking(s) fcntl(s, F_SETFL, fcntl(s, F_GETFL) & ~O_NONBLOCK)
#define ngx_blocking_n "fcntl(!O_NONBLOCK)"
#endif
#if (NGX_HAVE_FIONREAD)
#define ngx_socket_nread(s, n) ioctl(s, FIONREAD, n)
#define ngx_socket_nread_n "ioctl(FIONREAD)"
#endif
int ngx_tcp_nopush(ngx_socket_t s);
int ngx_tcp_push(ngx_socket_t s);
#if (NGX_LINUX)
#define ngx_tcp_nopush_n "setsockopt(TCP_CORK)"
#define ngx_tcp_push_n "setsockopt(!TCP_CORK)"
#else
#define ngx_tcp_nopush_n "setsockopt(TCP_NOPUSH)"
#define ngx_tcp_push_n "setsockopt(!TCP_NOPUSH)"
#endif
#define ngx_shutdown_socket shutdown
#define ngx_shutdown_socket_n "shutdown()"
#define ngx_close_socket close
#define ngx_close_socket_n "close() socket"
#endif /* _NGX_SOCKET_H_INCLUDED_ */
|
7e80c7091f39efdbc570a94934b65f1eae9306b6
|
ea401c3e792a50364fe11f7cea0f35f99e8f4bde
|
/hackathon/PengXie/NeuronStructNavigator/cmake-3.6.2/Tests/LinkLine/Two.c
|
5fc212e0ff5b567a474a7edd53a4bb98f0f07b54
|
[
"BSD-3-Clause",
"MIT"
] |
permissive
|
Vaa3D/vaa3d_tools
|
edb696aa3b9b59acaf83d6d27c6ae0a14bf75fe9
|
e6974d5223ae70474efaa85e1253f5df1814fae8
|
refs/heads/master
| 2023-08-03T06:12:01.013752
| 2023-08-02T07:26:01
| 2023-08-02T07:26:01
| 50,527,925
| 107
| 86
|
MIT
| 2023-05-22T23:43:48
| 2016-01-27T18:19:17
|
C++
|
UTF-8
|
C
| false
| false
| 98
|
c
|
Two.c
|
void OneFunc();
void TwoFunc()
{
static int i = 0;
++i;
if (i == 1) {
OneFunc();
}
}
|
4d730a1a38dbecda56a98645ce5f5025bdadf1a7
|
bbed308c9ee9b2123b691592419db011a35b9e5e
|
/include/caryll/buffer.h
|
4d06f10f8dcd2c6232c77be6aaf5f1e4afffe146
|
[
"MIT"
] |
permissive
|
nowar-fonts/Warcraft-Font-Merger
|
f42cec645c29ec8736a4f66ca04c0aa416c6ca6b
|
7462fbab32afeb7bb94506aa88d899240d6066e9
|
refs/heads/master
| 2023-07-07T05:23:17.852003
| 2023-07-02T04:48:29
| 2023-07-02T04:48:29
| 161,875,032
| 455
| 38
|
MIT
| 2023-07-02T04:48:30
| 2018-12-15T05:58:34
|
C
|
UTF-8
|
C
| false
| false
| 1,737
|
h
|
buffer.h
|
#ifndef CARYLL_INCLUDE_BUFFER_H
#define CARYLL_INCLUDE_BUFFER_H
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdarg.h>
#include "dep/sds.h"
typedef struct caryll_Buffer {
size_t cursor;
size_t size;
size_t free;
uint8_t *data;
} caryll_Buffer;
caryll_Buffer *bufnew();
caryll_Buffer *bufninit(uint32_t n, ...);
void buffree(caryll_Buffer *buf);
size_t buflen(caryll_Buffer *buf);
size_t bufpos(caryll_Buffer *buf);
void bufseek(caryll_Buffer *buf, size_t pos);
void bufclear(caryll_Buffer *buf);
void bufwrite8(caryll_Buffer *buf, uint8_t byte);
void bufwrite16l(caryll_Buffer *buf, uint16_t x);
void bufwrite16b(caryll_Buffer *buf, uint16_t x);
void bufwrite24l(caryll_Buffer *buf, uint32_t x);
void bufwrite24b(caryll_Buffer *buf, uint32_t x);
void bufwrite32l(caryll_Buffer *buf, uint32_t x);
void bufwrite32b(caryll_Buffer *buf, uint32_t x);
void bufwrite64l(caryll_Buffer *buf, uint64_t x);
void bufwrite64b(caryll_Buffer *buf, uint64_t x);
void bufnwrite8(caryll_Buffer *buf, uint32_t n, ...);
void bufwrite_sds(caryll_Buffer *buf, sds str);
void bufwrite_str(caryll_Buffer *buf, const char *str);
void bufwrite_bytes(caryll_Buffer *buf, size_t size, const uint8_t *str);
void bufwrite_buf(caryll_Buffer *buf, caryll_Buffer *that);
void bufwrite_bufdel(caryll_Buffer *buf, caryll_Buffer *that);
void bufping16b(caryll_Buffer *buf, size_t *offset, size_t *cp);
void bufping16bd(caryll_Buffer *buf, size_t *offset, size_t *shift, size_t *cp);
void bufpingpong16b(caryll_Buffer *buf, caryll_Buffer *that, size_t *offset, size_t *cp);
void bufpong(caryll_Buffer *buf, size_t *offset, size_t *cp);
void bufprint(caryll_Buffer *buf);
void buflongalign(caryll_Buffer *buf);
#endif
|
13c588a6cf627c303abd0b3600363bfcef2b4899
|
a94123c344da84c73936e3f9acd69eb53821206f
|
/src/runq.c
|
45abf8a65840717a9bbaa28f61e7c6fb40e5b7b9
|
[
"MIT"
] |
permissive
|
shiyanhui/libcsp
|
46e2f5ebbc10cdc5e0c4604f59bf27469fac237b
|
d801892c10e16f09b3957c4e40aec792e98905b4
|
refs/heads/master
| 2023-07-06T14:50:21.765306
| 2023-06-30T08:22:47
| 2023-06-30T08:22:47
| 253,600,944
| 1,359
| 81
|
MIT
| 2023-06-30T08:22:49
| 2020-04-06T19:51:44
|
C
|
UTF-8
|
C
| false
| false
| 2,745
|
c
|
runq.c
|
/*
* Copyright (c) 2020, Yanhui Shi <lime.syh at gmail dot com>
* All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "common.h"
#include "runq.h"
csp_mmrbq_define(csp_proc_t *, proc);
csp_lrunq_t *csp_lrunq_new() {
csp_lrunq_t *lrunq = (csp_lrunq_t *)malloc(sizeof(csp_lrunq_t));
if (lrunq == NULL) {
return NULL;
}
lrunq->len = 0;
lrunq->head = lrunq->tail = NULL;
lrunq->poped_times = 0;
return lrunq;
}
void csp_lrunq_push(csp_lrunq_t *lrunq, csp_proc_t *proc) {
if (lrunq->tail != NULL) {
lrunq->tail->next = proc;
proc->pre = lrunq->tail;
lrunq->tail = proc;
} else {
lrunq->head = lrunq->tail = proc;
}
lrunq->len++;
}
void csp_lrunq_push_front(csp_lrunq_t *lrunq, csp_proc_t *proc) {
if (lrunq->head != NULL) {
proc->next = lrunq->head;
lrunq->head->pre = proc;
lrunq->head = proc;
} else {
lrunq->head = lrunq->tail = proc;
}
lrunq->len++;
}
int csp_lrunq_try_pop_front(csp_lrunq_t *lrunq, csp_proc_t **proc) {
if (csp_unlikely((lrunq->poped_times & 0x1f) == 0x1f)) {
lrunq->poped_times++;
return csp_lrunq_missed;
}
if (csp_unlikely(lrunq->head == NULL)) {
return csp_lrunq_failed;
}
*proc = lrunq->head;
if (lrunq->head != lrunq->tail) {
lrunq->head = (*proc)->next;
lrunq->head->pre = NULL;
(*proc)->next = NULL;
} else {
lrunq->head = lrunq->tail = NULL;
}
lrunq->len--;
lrunq->poped_times++;
return csp_lrunq_ok;
}
/* `n` should be guaranteed by caller to be `0 < n <= lrunq->len`. */
void csp_lrunq_popm_front(
csp_lrunq_t *lrunq, size_t n, csp_proc_t **start, csp_proc_t **end) {
lrunq->len -= n;
if (csp_unlikely(lrunq->len == 0)) {
*start = lrunq->head;
*end = lrunq->tail;
lrunq->head = lrunq->tail = NULL;
return;
}
*start = lrunq->head;
for (int i = 0; i < n; i++) {
lrunq->head = lrunq->head->next;
}
*end = lrunq->head->pre;
lrunq->head->pre = NULL;
(*end)->next = NULL;
}
void csp_lrunq_destroy(csp_lrunq_t *lrunq) {
free(lrunq);
}
|
3e2e364ddfd7df5f8256eafffd72d0de926357f1
|
653ab4373a629a3695872d805a62f6b7ba937eed
|
/SDWebImage/include/SDWebImage/SDWebImageDownloaderRequestModifier.h
|
f7aa82b943c64777cc12433dcb6ae31dcaf761a1
|
[
"MIT",
"Apache-2.0"
] |
permissive
|
SDWebImage/SDWebImage
|
b3fbbe42cacc834726af77571d675ab1a7aee2f8
|
507225ea04876894856186af6d3c30a9e8c1200a
|
refs/heads/master
| 2023-08-31T09:49:02.624904
| 2023-08-23T10:26:29
| 2023-08-23T10:26:29
| 313,419
| 5,435
| 1,427
|
MIT
| 2023-09-12T08:03:38
| 2009-09-21T17:39:19
|
Objective-C
|
UTF-8
|
C
| false
| false
| 48
|
h
|
SDWebImageDownloaderRequestModifier.h
|
../../Core/SDWebImageDownloaderRequestModifier.h
|
b38370bbd140f160397e370fa828990e3b072646
|
a932af66223d27a79631d15ecb158ffafbcd6332
|
/firmware/board/board.h
|
bcb9e3bf486b6e42544743b838e965b39b8d851a
|
[
"LicenseRef-scancode-warranty-disclaimer"
] |
no_license
|
pok3r-custom/pok3r_re_firmware
|
3bba9e943f109973f205f9e3ac51c61b4723b0ab
|
2fd4073aeefe713ef769b93b077aa67090a0b620
|
refs/heads/master
| 2022-11-13T00:13:16.106911
| 2021-09-09T17:14:05
| 2021-09-09T17:14:05
| 75,358,442
| 114
| 13
| null | null | null | null |
UTF-8
|
C
| false
| false
| 867
|
h
|
board.h
|
#ifndef BOARD_H
#define BOARD_H
#define REG(A) (*(volatile u32*)(A))
#define STRUCT_SIZE_ASSERT(N, S) _Static_assert(sizeof(N) == S, "incorrect packed struct size")
#define STRUCT_ADDR_ASSERT(F, A) _Static_assert((u32)(&(F)) == (A), "incorrect packed struct field address")
#define STRUCT_REG_CHECK(M, R) STRUCT_ADDR_ASSERT(REG_##M->R, M##_##R)
#define STRUCT_REGISTER_START typedef union { struct
#define STRUCT_REGISTER_END __attribute__((packed)) __attribute__ ((aligned(4))); u32 word; }
#define STRUCT_REG_PTR(N) ((volatile N##_map *)N##_BASE)
#define SET_REG(A, M, O, D) REG(A) |= (D << O & M)
#define GET_REG(A, M, O, D) REG(A) |= (D << O & M)
#define MIN(A, B) ((A) < (B) ? (A) : (B))
#define MAX(A, B) ((A) > (B) ? (A) : (B))
#define NULL ((void*)0)
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned long u32;
#endif // BOARD_H
|
34bcd11db6c157e4da6c61cdd8cadf118276f014
|
bb82a5f977bef455714c16e24e2d8254e2d0faa5
|
/src/vendor/duktape-2.7.0/src-separate/duk_heaphdr_assert.c
|
8e70d07a926295cd17b9f1d1f2595c47ef51094b
|
[
"Unlicense",
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] |
permissive
|
pqrs-org/Karabiner-Elements
|
4ae307d82f8b67547c161c7d46d2083a0fd07630
|
d05057d7c769e2ff35638282e888a6d5eca566be
|
refs/heads/main
| 2023-09-01T03:11:08.474417
| 2023-09-01T00:44:19
| 2023-09-01T00:44:19
| 63,037,806
| 8,197
| 389
|
Unlicense
| 2023-09-01T00:11:00
| 2016-07-11T04:57:55
|
C++
|
UTF-8
|
C
| false
| false
| 2,249
|
c
|
duk_heaphdr_assert.c
|
/*
* duk_heaphdr assertion helpers
*/
#include "duk_internal.h"
#if defined(DUK_USE_ASSERTIONS)
#if defined(DUK_USE_DOUBLE_LINKED_HEAP)
DUK_INTERNAL void duk_heaphdr_assert_links(duk_heap *heap, duk_heaphdr *h) {
DUK_UNREF(heap);
if (h != NULL) {
duk_heaphdr *h_prev, *h_next;
h_prev = DUK_HEAPHDR_GET_PREV(heap, h);
h_next = DUK_HEAPHDR_GET_NEXT(heap, h);
DUK_ASSERT(h_prev == NULL || (DUK_HEAPHDR_GET_NEXT(heap, h_prev) == h));
DUK_ASSERT(h_next == NULL || (DUK_HEAPHDR_GET_PREV(heap, h_next) == h));
}
}
#else
DUK_INTERNAL void duk_heaphdr_assert_links(duk_heap *heap, duk_heaphdr *h) {
DUK_UNREF(heap);
DUK_UNREF(h);
}
#endif
DUK_INTERNAL void duk_heaphdr_assert_valid(duk_heaphdr *h) {
DUK_ASSERT(h != NULL);
DUK_ASSERT(DUK_HEAPHDR_HTYPE_VALID(h));
}
/* Assert validity of a heaphdr, including all subclasses. */
DUK_INTERNAL void duk_heaphdr_assert_valid_subclassed(duk_heaphdr *h) {
switch (DUK_HEAPHDR_GET_TYPE(h)) {
case DUK_HTYPE_OBJECT: {
duk_hobject *h_obj = (duk_hobject *) h;
DUK_HOBJECT_ASSERT_VALID(h_obj);
if (DUK_HOBJECT_IS_COMPFUNC(h_obj)) {
DUK_HCOMPFUNC_ASSERT_VALID((duk_hcompfunc *) h_obj);
} else if (DUK_HOBJECT_IS_NATFUNC(h_obj)) {
DUK_HNATFUNC_ASSERT_VALID((duk_hnatfunc *) h_obj);
} else if (DUK_HOBJECT_IS_DECENV(h_obj)) {
DUK_HDECENV_ASSERT_VALID((duk_hdecenv *) h_obj);
} else if (DUK_HOBJECT_IS_OBJENV(h_obj)) {
DUK_HOBJENV_ASSERT_VALID((duk_hobjenv *) h_obj);
} else if (DUK_HOBJECT_IS_BUFOBJ(h_obj)) {
#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
DUK_HBUFOBJ_ASSERT_VALID((duk_hbufobj *) h_obj);
#endif
} else if (DUK_HOBJECT_IS_BOUNDFUNC(h_obj)) {
DUK_HBOUNDFUNC_ASSERT_VALID((duk_hboundfunc *) h_obj);
} else if (DUK_HOBJECT_IS_PROXY(h_obj)) {
DUK_HPROXY_ASSERT_VALID((duk_hproxy *) h_obj);
} else if (DUK_HOBJECT_IS_THREAD(h_obj)) {
DUK_HTHREAD_ASSERT_VALID((duk_hthread *) h_obj);
} else {
/* Just a plain object. */
;
}
break;
}
case DUK_HTYPE_STRING: {
duk_hstring *h_str = (duk_hstring *) h;
DUK_HSTRING_ASSERT_VALID(h_str);
break;
}
case DUK_HTYPE_BUFFER: {
duk_hbuffer *h_buf = (duk_hbuffer *) h;
DUK_HBUFFER_ASSERT_VALID(h_buf);
break;
}
default: {
DUK_ASSERT(0);
}
}
}
#endif /* DUK_USE_ASSERTIONS */
|
07cac7ebc37b159fee8f72b52dc745c8a4660d25
|
7f6c235b0598353549959c18f69eefd20b766907
|
/include/arch/x1.h
|
c0304ce6207f127e900494a1f48f43c81e67fcd3
|
[
"ClArtistic"
] |
permissive
|
z88dk/z88dk
|
46dfd4905f36d99333173cadd0a660839befc9f0
|
8b07f37cc43c5d9ffe69b563c80763491d8faff7
|
refs/heads/master
| 2023-09-04T19:29:49.254958
| 2023-09-03T20:51:24
| 2023-09-03T20:51:24
| 54,035,569
| 820
| 263
|
NOASSERTION
| 2023-09-05T11:09:04
| 2016-03-16T13:48:16
|
Assembly
|
UTF-8
|
C
| false
| false
| 4,692
|
h
|
x1.h
|
/*
* Header file for Sharp X1 specific stuff
*
* $Id: x1.h $
*
*/
#ifndef __X1_H__
#define __X1_H__
#include <sys/compiler.h>
// PSG register, sound, ...
// Init the PSG (reset sound etc..)
//extern void __LIB__ x1_initpsg();
// Set the palette to configure the 8 colours
extern void x1_set_palette(int blue, int red, int green);
// Programmable Character Generator
// Get the PCG version (1 or 2), depending on the X1 model (or chipset)
// and on the mode DIP switch
extern int __LIB__ x1_get_pcg_version();
// Switch to 40 columns text mode
extern void __LIB__ x1_set_text_40();
// HighScan version, for turbo models only
extern void __LIB__ x1_set_text_40_hs();
// Switch to 80 columns text mode
extern void __LIB__ x1_set_text_80();
// HighScan version, for turbo models only
extern void __LIB__ x1_set_text_80_hs();
// Set 16 6845 CRTC registers at once
extern void __LIB__ set_crtc(void *reg_list) __z88dk_fastcall;
// Set the first 10 6845 CRTC registers
extern void __LIB__ set_crtc_10(void *reg_list) __z88dk_fastcall;
// Set a single register in the 6845 CRTC
extern void __LIB__ set_crtc_reg(int reg, int val) __smallc;
// Send a command to the SUB-CPU
extern void __LIB__ subcpu_command(int command) __z88dk_fastcall;
// Send a byte parameter to the SUB-CPU
extern void __LIB__ subcpu_set(int command) __z88dk_fastcall;
// Reset the SUB-CPU
extern void __LIB__ subcpu_reset() __z88dk_fastcall;
// Get a byte from the SUB-CPU
extern int __LIB__ subcpu_get();
// Wait the SUB CPU to be ready, used by libraries
extern void wait_sub_cpu();
// Timer related commands
#define SUBCPU_TIMER 0x0d
#define SET_TIMER_0 0xd0
#define SET_TIMER_1 0xd1
#define SET_TIMER_2 0xd2
#define SET_TIMER_3 0xd3
#define SET_TIMER_4 0xd4
#define SET_TIMER_5 0xd5
#define SET_TIMER_6 0xd6
#define SET_TIMER_7 0xd7
#define GET_TIMER_0 0xd8
#define GET_TIMER_1 0xd9
#define GET_TIMER_2 0xda
#define GET_TIMER_3 0xdb
#define GET_TIMER_4 0xdc
#define GET_TIMER_5 0xdd
#define GET_TIMER_6 0xde
#define GET_TIMER_7 0xdf
#define X1_TIMER_MODE_OFF 0x00
#define X1_TIMER_MODE_TVCMD 0x40
#define X1_TIMER_MODE_STOP 0x80
#define X1_TIMER_MODE_TAPE 0xc0
#define SUBCPU_IRQ_VECTOR_SET 0xe4
#define SUBCPU_IRQ_TIMERS_OFF 0xe5
// Direct keyboard access mode, not always available
#define SUBCPU_KEYBOARD_DIECT 0xe3
// on first byte
#define X1_KEY_C 1
#define X1_KEY_X 2
#define X1_KEY_Z 4
#define X1_KEY_D 8
#define X1_KEY_A 16
#define X1_KEY_E 32
#define X1_KEY_W 64
#define X1_KEY_Q 128
// on second byte
#define X1_KEY_3 1
#define X1_KEY_6 2
#define X1_KEY_9 4
#define X1_KEY_2 8
#define X1_KEY_8 16
#define X1_KEY_1 32
#define X1_KEY_4 64
#define X1_KEY_7 128
// on third byte
// .. to be completed
// Text typing keyboard access mode
// Two bytes to get, the SHIFT status flags and the ASCII code
#define SUBCPU_READ_KEYBOARD 0xe6
#define SHIFT_CTRL 1
#define SHIFT_SFT 2
#define SHIFT_KANA 4
#define SHIFT_CAPS 8
#define SHIFT_GRPH 16
#define SHIFT_REP 32
#define SHIFT_KIN 64
#define SHIFT_TEN 128
// TV control and text overlapping controls
#define SUBCPU_SET_TV 0xe7
#define SUBCPU_GET_TV 0xe8
#define TV_VOL_UP 0x01
#define TV_VOL_DOWN 0x02
#define TV_VOL_DEFAULT 0x03
#define TV_MUTE 0x06
#define TV_OFF 0x0d
#define TV_ON_FF 0x0e
#define TV_CHANNEL_1 0x10
#define TV_CHANNEL_2 0x11
#define TV_CHANNEL_3 0x12
#define TV_CHANNEL_4 0x13
#define TV_CHANNEL_5 0x14
#define TV_CHANNEL_6 0x15
#define TV_CHANNEL_7 0x16
#define TV_CHANNEL_8 0x17
#define TV_CHANNEL_9 0x18
#define TV_CHANNEL_10 0x19
#define TV_CHANNEL_11 0x1a
#define TV_CHANNEL_12 0x1b
// Cassette Recorder
extern int __LIB__ tape(int command) __z88dk_fastcall;
extern void tape_status(int command);
#define SUBCPU_TAPE_CONTROL 0xe9
#define SUBCPU_TAPE_STATUS 0xea
#define TAPE_EJECT 0x00
#define TAPE_STOP 0x01
#define TAPE_PLAY 0x02
#define TAPE_FFWD 0x03
#define TAPE_REW 0x04
#define TAPE_APSS_NEXT 0x05
#define TAPE_APSS_PREV 0x06
#define TAPE_RECORD 0x07
#define SUBCPU_TAPE_SENSOR 0xeb
#define TAPE_END 1 // set if Tape end
#define TAPE_SET 2 // set if cassette is present
#define TAPE_WP 3 // set if Write Protected
// Time / Date
#define SUBCPU_SET_CALENDAR 0xec
#define SUBCPU_GET_CALENDAR 0xed
#define SUBCPU_SET_CLOCK 0xee
#define SUBCPU_GET_CLOCK 0xef
// Input.h
extern unsigned int __LIB__ in_JoyX1(char num);
#define in_JoyX1_1() in_JoyX1(0x0E);
#define in_JoyX1_2() in_JoyX1(0x0F);
#define in_GetKey() in_Inkey();
#endif
|
9bea41a78c8b20681b097a0919e0ef7a71453f8d
|
035660e8cc10571ebbd0d4393fef063bb7eb98f6
|
/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h
|
a604aae3447bf5e523ccead8fa1b6064f4cc3456
|
[] |
no_license
|
zeldaret/mm
|
f163a5e7c4314105777369fa7671ce9c2a99922a
|
4ae00e909e74044f05155683b49d2561f91de7ba
|
refs/heads/master
| 2023-08-06T07:22:04.912966
| 2023-08-04T20:36:03
| 2023-08-04T20:36:03
| 247,875,852
| 915
| 328
| null | 2023-09-14T11:48:59
| 2020-03-17T04:03:07
|
C
|
UTF-8
|
C
| false
| false
| 242
|
h
|
z_oceff_wipe3.h
|
#ifndef Z_OCEFF_WIPE3_H
#define Z_OCEFF_WIPE3_H
#include "global.h"
struct OceffWipe3;
typedef struct OceffWipe3 {
/* 0x000 */ Actor actor;
/* 0x144 */ s16 counter;
} OceffWipe3; // size = 0x148
#endif // Z_OCEFF_WIPE3_H
|
9e2dfb9f773cff629d6b00a3032bb57b96886733
|
d8c8f4148940cd9c93bb0692af8c5004f47af05e
|
/xUSL/NBIO/IOD/include/NbioBaseReg.h
|
c099668ef83100526b4bba816a7ac514e693afdc
|
[
"MIT"
] |
permissive
|
openSIL/openSIL
|
92213cc94dd4c6d6c43fedeaedd96537001e182f
|
0f39fbc2454af9a67fc84a88093bcd2f2c8dd887
|
refs/heads/main
| 2023-08-19T11:48:14.911453
| 2023-08-07T20:50:54
| 2023-08-07T20:50:54
| 652,124,068
| 233
| 14
| null | 2023-06-28T15:55:29
| 2023-06-11T06:54:24
|
C
|
UTF-8
|
C
| false
| false
| 20,020
|
h
|
NbioBaseReg.h
|
/**
* @file NbioBaseReg.h
* @brief This file contains all Nbio Base Register definitions
*/
/* Copyright 2022-2023 Advanced Micro Devices, Inc. All rights reserved. */
// SPDX-License-Identifier: MIT
#pragma once
#define SIL_RESERVED_122 0
#define SIL_RESERVED_121 0xf
#define SIL_RESERVED_124 4
#define SIL_RESERVED_123 0xf0
#define SIL_RESERVED_126 8
#define SIL_RESERVED_125 0xf00
#define SIL_RESERVED_128 12
#define SIL_RESERVED_127 0xf000
#define SIL_RESERVED_130 16
#define SIL_RESERVED_129 0xf0000
#define SIL_RESERVED_132 20
#define SIL_RESERVED_131 0xf00000
#define SIL_RESERVED_134 24
#define SIL_RESERVED_133 0xf000000
#define SIL_RESERVED_136 28
#define SIL_RESERVED_135 0xf0000000
#define SIL_RESERVED_536 0x13b1825cUL
#define SIL_RESERVED_220 21
#define SIL_RESERVED_219 0x200000
#define SIL_RESERVED_739 0x13b10004UL
#define SIL_RESERVED_769 0
#define SIL_RESERVED_768 0x1
#define SIL_RESERVED_747 0x13b3100cUL
#define SIL_RESERVED3_1490 6
#define SIL_RESERVED3_1491 0x40
#define SIL_RESERVED3_1492 12
#define SIL_RESERVED3_1493 0x1000
#define SIL_RESERVED3_1494 17
#define SIL_RESERVED3_1495 0x20000
#define SIL_RESERVED3_1496 0x1530001cUL
#define SIL_RESERVED3_1497 0x1470001cUL
#define SIL_RESERVED3_1498 0x14b0001cUL
#define SIL_RESERVED3_1499 21
#define SIL_RESERVED3_1500 0xe00000
#define SIL_RESERVED3_1501 0x15704330UL
#define SIL_RESERVED2_1084 16
#define SIL_RESERVED3_1502 0x10000
#define SIL_RESERVED3_1503 0x4000200UL
#define SIL_RESERVED_224 29
#define SIL_RESERVED_223 0x20000000
#define SIL_RESERVED_222 31
#define SIL_RESERVED_221 0x80000000
#define SIL_RESERVED_748 0x1a380080UL
#define SIL_RESERVED_226 17
#define SIL_RESERVED_225 0x20000
#define SIL_RESERVED_228 21
#define SIL_RESERVED_227 0x200000
#define SIL_RESERVED_749 0x1a380040UL
#define SIL_RESERVED_412 6
#define SIL_RESERVED_411 0x40
#define SIL_RESERVED_410 14
#define SIL_RESERVED_409 0xc000
#define SIL_RESERVED_751 0x1a380100UL
#define SIL_RESERVED_416 7
#define SIL_RESERVED_415 0x1f80
#define SIL_RESERVED_414 13
#define SIL_RESERVED_413 0xfe000
#define SIL_RESERVED_752 0x1a3804d8UL
#define SIL_RESERVED_418 19
#define SIL_RESERVED_417 0xf80000
#define SIL_RESERVED_753 0x1a3804dcUL
#define SIL_RESERVED_420 2
#define SIL_RESERVED_419 0x4
#define SIL_RESERVED_754 0x1a3804d4UL
#define SIL_RESERVED_424 5
#define SIL_RESERVED_423 0x20
#define SIL_RESERVED_422 6
#define SIL_RESERVED_421 0x40
#define SIL_RESERVED_426 18
#define SIL_RESERVED_425 0x40000
#define SIL_RESERVED_428 20
#define SIL_RESERVED_427 0x100000
#define SIL_RESERVED_755 0x1a3802c0UL
#define SIL_RESERVED_430 24
#define SIL_RESERVED_429 0x1000000
#define SIL_RESERVED_432 25
#define SIL_RESERVED_431 0x2000000
#define SIL_RESERVED_756 0x1a380620UL
#define SIL_RESERVED_434 26
#define SIL_RESERVED_433 0x4000000
#define SIL_RESERVED_757 0x1a380628UL
#define SIL_RESERVED2_1094 13
#define SIL_RESERVED2_1092 0x2000
#define SIL_RESERVED_532 0x1a340008UL
#define SIL_RESERVED_441 15
#define SIL_RESERVED_440 0x8000
#define SIL_RESERVED_533 0x1a34000cUL
#define SIL_RESERVED_443 8
#define SIL_RESERVED_442 0x700
#define SIL_RESERVED_534 0x1a340300UL
typedef union {
struct {
uint32_t LC_ADVERTISE_MODIFIED_TS_OS_SUPPORT:1;
uint32_t LC_MODIFIED_TS_OS_SUPPORT_RCVD:1;
uint32_t LC_MODIFIED_TS_SENT:1;
uint32_t LC_MODIFIED_TS_RCVD:1;
uint32_t LC_ALTERNATE_PROTOCOL_NEGOTIATION_STATE0:2;
uint32_t LC_ALTERNATE_PROTOCOL_NEGOTIATION_STATE1:2;
uint32_t LC_ALTERNATE_PROTOCOL_NEGOTIATION_STATE2:2;
uint32_t LC_ALTERNATE_PROTOCOL_NEGOTIATION_STATE3:2;
uint32_t LC_ALTERNATE_PROTOCOL_NEGOTIATION_STATUS:2;
uint32_t LC_ALTERNATE_PROTOCOL_RESPONSE_TIME_LIMIT:2;
uint32_t LC_ALTERNATE_PROTOCOL_COUNT:8;
uint32_t LC_MODIFIED_TS_USAGE_MODE_1_SUPPORTED:1;
uint32_t LC_MODIFIED_TS_USAGE_MODE_2_SUPPORTED:1;
uint32_t LC_ALTERNATE_PROTOCOL_SELECTIVE_ENABLE_SUPPORTED:1;
uint32_t LC_ALTERNATE_PROTOCOL_CXL_PCIE_ONLY_NEG_MODE:1;
uint32_t LC_ALTERNATE_PROTOCOL_CHECK_COMMON_CLOCK:1;
uint32_t LC_ALTERNATE_PROTOCOL_CHECK_RTM_CXL_AWARE:1;
uint32_t LC_ALTERNATE_PROTOCOL_ABORT_RCVD_USAGE_MODE_000:1;
uint32_t LC_CXL_COMMON_CLOCK_IN_MODTS2:1;
} Field;
uint32_t Value;
} SIL_RESERVED_4;
#define SIL_RESERVED_509 0x1a340424UL
#define SIL_RESERVED_242 23
#define SIL_RESERVED_241 0x800000
#define SIL_RESERVED_512 0x1a340280UL
#define SIL_RESERVED_246 8
#define SIL_RESERVED_245 0x100
#define SIL_RESERVED_244 14
#define SIL_RESERVED_243 0xc000
#define SIL_RESERVED_513 0x1a3402c4UL
#define SIL_RESERVED3_1504 12
#define SIL_RESERVED3_1505 0x1000
#define SIL_RESERVED3_1506 14
#define SIL_RESERVED3_1507 0x4000
#define SIL_RESERVED_514 0x1a3402d4UL
#define SIL_RESERVED_248 4
#define SIL_RESERVED_247 0x10
#define SIL_RESERVED_515 0x1a3402d8UL
#define SIL_RESERVED_250 0
#define SIL_RESERVED_249 0x3
#define SIL_RESERVED_252 2
#define SIL_RESERVED_251 0xc
#define SIL_RESERVED_254 4
#define SIL_RESERVED_253 0x30
#define SIL_RESERVED_260 12
#define SIL_RESERVED_255 20
#define SIL_RESERVED_257 21
#define SIL_RESERVED_256 0x600000
#define SIL_RESERVED_259 23
#define SIL_RESERVED_258 0x1800000
#define SIL_RESERVED_516 0x1a3402ecUL
#define SIL_RESERVED_262 0
#define SIL_RESERVED_261 0x1
#define SIL_RESERVED_264 2
#define SIL_RESERVED_263 0xc
#define SIL_RESERVED_270 6
#define SIL_RESERVED_269 0x40
#define SIL_RESERVED_266 10
#define SIL_RESERVED_265 0x400
#define SIL_RESERVED_268 11
#define SIL_RESERVED_267 0x7800
#define SIL_RESERVED_517 0x1a340394UL
#define SIL_RESERVED_272 0
#define SIL_RESERVED_271 0x1
#define SIL_RESERVED_274 2
#define SIL_RESERVED_273 0xc
#define SIL_RESERVED_280 6
#define SIL_RESERVED_279 0x40
#define SIL_RESERVED_276 10
#define SIL_RESERVED_275 0x400
#define SIL_RESERVED_278 11
#define SIL_RESERVED_277 0x7800
#define SIL_RESERVED_518 0x1a340400UL
#define SIL_RESERVED_282 0
#define SIL_RESERVED_281 0x1
#define SIL_RESERVED_284 2
#define SIL_RESERVED_283 0xc
#define SIL_RESERVED_290 6
#define SIL_RESERVED_289 0x40
#define SIL_RESERVED_286 10
#define SIL_RESERVED_285 0x400
#define SIL_RESERVED_288 11
#define SIL_RESERVED_287 0x7800
#define SIL_RESERVED_519 0x1a340390UL
#define SIL_RESERVED_382 16
#define SIL_RESERVED_381 0x70000
#define SIL_RESERVED_384 20
#define SIL_RESERVED_383 0x700000
#define SIL_RESERVED_523 0x1a340318UL
#define SIL_RESERVED_390 10
#define SIL_RESERVED_389 0x400
#define SIL_RESERVED_386 19
#define SIL_RESERVED_385 0x80000
#define SIL_RESERVED_388 21
#define SIL_RESERVED_387 0x600000
#define SIL_RESERVED_392 30
#define SIL_RESERVED_391 0x40000000
#define SIL_RESERVED_524 0x1a340288UL
#define SIL_RESERVED_403 0x1
#define SIL_RESERVED_404 0x2
#define SIL_RESERVED_405 0x4
#define SIL_RESERVED_406 0x8
#define SIL_RESERVED_527 0x1a340290UL
#define SIL_RESERVED3_1508 12
#define SIL_RESERVED3_1509 0x1000
#define SIL_RESERVED_528 0x1a340414UL
#define SIL_RESERVED_529 0x1a340294UL
#define SIL_RESERVED_408 6
#define SIL_RESERVED_407 0x40
#define SIL_RESERVED_530 0x1a340284UL
typedef union {
struct {
uint32_t TX_REQUESTER_ID_FUNCTION:3;
uint32_t TX_REQUESTER_ID_DEVICE:5;
uint32_t TX_REQUESTER_ID_BUS:8;
uint32_t TX_SWUS_REQUESTER_ID_FUNCTION:3;
uint32_t TX_SWUS_REQUESTER_ID_DEVICE:5;
uint32_t TX_SWUS_REQUESTER_ID_BUS:8;
} Field;
uint32_t Value;
} SIL_RESERVED_5;
#define SIL_RESERVED_531 0x1a340084UL
#define SIL_RESERVED2_964 0x80000
#define SIL_RESERVED2_965 0x100000
#define SIL_RESERVED2_966 0x200000
#define SIL_RESERVED2_967 0x400000
#define SIL_RESERVED2_960 0x800000
#define SIL_RESERVED2_961 0x1000000
#define SIL_RESERVED2_962 0x2000000
#define SIL_RESERVED2_963 0x4000000
#define SIL_RESERVED2_1311 0x5d284UL
typedef union {
struct {
uint32_t ThreadEn;
} Field;
uint32_t Value;
} SIL_RESERVED3_1510;
#define SIL_RESERVED2_1293 0x30081018UL
#define SIL_RESERVED2_1294 0x4a081018UL
#define SIL_RESERVED3_1511 0
#define SIL_RESERVED3_1512 0x1
#define SIL_RESERVED3_1513 1
#define SIL_RESERVED2_969 0x2
#define SIL_RESERVED3_1514 2
#define SIL_RESERVED2_971 0x4
#define SIL_RESERVED3_1515 3
#define SIL_RESERVED2_973 0x8
#define SIL_RESERVED3_1516 4
#define SIL_RESERVED3_1517 0x10
#define SIL_RESERVED3_1518 5
#define SIL_RESERVED2_976 0x20
#define SIL_RESERVED3_1519 6
#define SIL_RESERVED2_978 0x40
#define SIL_RESERVED2_981 7
#define SIL_RESERVED2_980 0x80
#define SIL_RESERVED2_983 8
#define SIL_RESERVED2_982 0x100
#define SIL_RESERVED2_985 9
#define SIL_RESERVED2_984 0x200
#define SIL_RESERVED3_1520 10
#define SIL_RESERVED2_986 0x400
#define SIL_RESERVED3_1521 11
#define SIL_RESERVED2_987 0x800
#define SIL_RESERVED2_989 12
#define SIL_RESERVED2_988 0x1000
#define SIL_RESERVED2_991 13
#define SIL_RESERVED2_990 0x2000
#define SIL_RESERVED2_993 14
#define SIL_RESERVED2_992 0x4000
#define SIL_RESERVED3_1522 15
#define SIL_RESERVED2_994 0x8000
#define SIL_RESERVED2_996 16
#define SIL_RESERVED2_995 0x10000
#define SIL_RESERVED2_998 17
#define SIL_RESERVED2_997 0x20000
#define SIL_RESERVED2_1000 18
#define SIL_RESERVED2_999 0x40000
#define SIL_RESERVED2_1001 19
#define SIL_RESERVED3_1523 0x80000
#define SIL_RESERVED2_1317 0x141e8f0UL
#define SIL_RESERVED2_1034 0
#define SIL_RESERVED2_1033 0x1
#define SIL_RESERVED2_1036 1
#define SIL_RESERVED2_1035 0x2
#define SIL_RESERVED2_1037 2
#define SIL_RESERVED3_1524 0x4
#define SIL_RESERVED3_1525 3
#define SIL_RESERVED2_1038 0x8
#define SIL_RESERVED2_1039 4
#define SIL_RESERVED3_1526 0x10
#define SIL_RESERVED3_1527 5
#define SIL_RESERVED3_1528 0x20
#define SIL_RESERVED2_1041 6
#define SIL_RESERVED2_1040 0x40
#define SIL_RESERVED2_1043 7
#define SIL_RESERVED2_1042 0x80
#define SIL_RESERVED2_1045 8
#define SIL_RESERVED2_1044 0x100
#define SIL_RESERVED2_1047 9
#define SIL_RESERVED2_1046 0x200
#define SIL_RESERVED2_1048 10
#define SIL_RESERVED3_1529 0x400
#define SIL_RESERVED2_1050 11
#define SIL_RESERVED2_1049 0x800
#define SIL_RESERVED2_1051 12
#define SIL_RESERVED3_1530 0x1000
#define SIL_RESERVED2_1052 13
#define SIL_RESERVED3_1531 0x2000
#define SIL_RESERVED3_1532 14
#define SIL_RESERVED3_1533 0x4000
#define SIL_RESERVED2_1053 15
#define SIL_RESERVED3_1534 0x8000
#define SIL_RESERVED3_1535 16
#define SIL_RESERVED2_1054 0x10000
#define SIL_RESERVED2_1055 17
#define SIL_RESERVED3_1536 0x20000
#define SIL_RESERVED2_1057 18
#define SIL_RESERVED2_1056 0x40000
#define SIL_RESERVED3_1537 19
#define SIL_RESERVED2_1058 0x80000
#define SIL_RESERVED2_1321 0x1013a8f0UL
#define SIL_RESERVED2_1258 0
#define SIL_RESERVED2_1257 0x1
#define SIL_RESERVED3_1538 1
#define SIL_RESERVED2_1259 0x2
#define SIL_RESERVED2_1261 2
#define SIL_RESERVED2_1260 0x4
#define SIL_RESERVED2_1263 3
#define SIL_RESERVED2_1262 0x8
#define SIL_RESERVED2_1265 4
#define SIL_RESERVED2_1264 0x10
#define SIL_RESERVED2_1267 5
#define SIL_RESERVED2_1266 0x20
#define SIL_RESERVED2_1269 6
#define SIL_RESERVED2_1268 0x40
#define SIL_RESERVED2_1270 7
#define SIL_RESERVED3_1539 0x80
#define SIL_RESERVED2_1272 8
#define SIL_RESERVED2_1271 0x100
#define SIL_RESERVED2_1274 9
#define SIL_RESERVED2_1273 0x200
#define SIL_RESERVED2_1276 10
#define SIL_RESERVED2_1275 0x400
#define SIL_RESERVED2_1278 11
#define SIL_RESERVED2_1277 0x800
#define SIL_RESERVED2_1280 12
#define SIL_RESERVED2_1279 0x1000
#define SIL_RESERVED2_1281 13
#define SIL_RESERVED3_1540 0x2000
#define SIL_RESERVED2_1283 14
#define SIL_RESERVED2_1282 0x4000
#define SIL_RESERVED2_1285 15
#define SIL_RESERVED2_1284 0x8000
#define SIL_RESERVED2_1287 16
#define SIL_RESERVED2_1286 0x10000
#define SIL_RESERVED2_1288 17
#define SIL_RESERVED3_1541 0x20000
#define SIL_RESERVED2_1290 18
#define SIL_RESERVED2_1289 0x40000
#define SIL_RESERVED2_1292 19
#define SIL_RESERVED2_1291 0x80000
#define SIL_RESERVED3_1542 0x141e190UL
#define SIL_RESERVED2_1416 0x151e140UL
#define SIL_RESERVED3_1543 30
#define SIL_RESERVED3_1544 0x40000000
#define SIL_RESERVED3_1545 0x1a340450UL
#define SIL_RESERVED_238 16
#define SIL_RESERVED_237 0xf0000
#define SIL_RESERVED_236 20
#define SIL_RESERVED_235 0xf00000
#define SIL_RESERVED_234 24
#define SIL_RESERVED_233 0x1000000
#define SIL_RESERVED_510 0x1a340440UL
#define SIL_RESERVED_439 8
#define SIL_RESERVED_438 0x100
#define SIL_RESERVED_437 10
#define SIL_RESERVED_436 0x7c00
#define SIL_RESERVED_232 0
#define SIL_RESERVED_231 0xff
#define SIL_RESERVED_230 8
#define SIL_RESERVED_229 0xff00
#define SIL_RESERVED_750 0x1a38004cUL
#define SIL_RESERVED_402 0
#define SIL_RESERVED_401 0x3ff
#define SIL_RESERVED_398 10
#define SIL_RESERVED_397 0xffc00
#define SIL_RESERVED_400 20
#define SIL_RESERVED_399 0x3ff00000
#define SIL_RESERVED_526 0x1a340404UL
#define SIL_RESERVED_298 0
#define SIL_RESERVED_297 0x1f
#define SIL_RESERVED_304 5
#define SIL_RESERVED_303 0x1e0
#define SIL_RESERVED_300 10
#define SIL_RESERVED_299 0x7c00
#define SIL_RESERVED_306 15
#define SIL_RESERVED_305 0x78000
#define SIL_RESERVED_302 20
#define SIL_RESERVED_301 0x1f00000
#define SIL_RESERVED_308 25
#define SIL_RESERVED_307 0x1e000000
#define SIL_RESERVED_492 0x1a3404e0UL
#define SIL_RESERVED_310 0
#define SIL_RESERVED_309 0x1f
#define SIL_RESERVED_316 5
#define SIL_RESERVED_315 0x1e0
#define SIL_RESERVED_312 10
#define SIL_RESERVED_311 0x7c00
#define SIL_RESERVED_318 15
#define SIL_RESERVED_317 0x78000
#define SIL_RESERVED_314 20
#define SIL_RESERVED_313 0x1f00000
#define SIL_RESERVED_320 25
#define SIL_RESERVED_319 0x1e000000
#define SIL_RESERVED_493 0x1a3404e4UL
#define SIL_RESERVED_322 0
#define SIL_RESERVED_321 0x1f
#define SIL_RESERVED_328 5
#define SIL_RESERVED_327 0x1e0
#define SIL_RESERVED_324 10
#define SIL_RESERVED_323 0x7c00
#define SIL_RESERVED_330 15
#define SIL_RESERVED_329 0x78000
#define SIL_RESERVED_326 20
#define SIL_RESERVED_325 0x1f00000
#define SIL_RESERVED_332 25
#define SIL_RESERVED_331 0x1e000000
#define SIL_RESERVED_494 0x1a3404e8UL
#define SIL_RESERVED_338 0
#define SIL_RESERVED_337 0x1f
#define SIL_RESERVED_344 5
#define SIL_RESERVED_343 0x1e0
#define SIL_RESERVED_334 10
#define SIL_RESERVED_333 0x7c00
#define SIL_RESERVED_340 15
#define SIL_RESERVED_339 0x78000
#define SIL_RESERVED_336 20
#define SIL_RESERVED_335 0x1f00000
#define SIL_RESERVED_342 25
#define SIL_RESERVED_341 0x1e000000
#define SIL_RESERVED_495 0x1a3404ecUL
#define SIL_RESERVED_346 0
#define SIL_RESERVED_345 0x1f
#define SIL_RESERVED_352 5
#define SIL_RESERVED_351 0x1e0
#define SIL_RESERVED_348 10
#define SIL_RESERVED_347 0x7c00
#define SIL_RESERVED_354 15
#define SIL_RESERVED_353 0x78000
#define SIL_RESERVED_350 20
#define SIL_RESERVED_349 0x1f00000
#define SIL_RESERVED_356 25
#define SIL_RESERVED_355 0x1e000000
#define SIL_RESERVED_496 0x1a3404f0UL
#define SIL_RESERVED_358 0
#define SIL_RESERVED_357 0x1f
#define SIL_RESERVED_364 5
#define SIL_RESERVED_363 0x1e0
#define SIL_RESERVED_360 10
#define SIL_RESERVED_359 0x7c00
#define SIL_RESERVED_366 15
#define SIL_RESERVED_365 0x78000
#define SIL_RESERVED_362 20
#define SIL_RESERVED_361 0x1f00000
#define SIL_RESERVED_368 25
#define SIL_RESERVED_367 0x1e000000
#define SIL_RESERVED_497 0x1a3404f4UL
#define SIL_RESERVED_370 0
#define SIL_RESERVED_369 0x1f
#define SIL_RESERVED_376 5
#define SIL_RESERVED_375 0x1e0
#define SIL_RESERVED_372 10
#define SIL_RESERVED_371 0x7c00
#define SIL_RESERVED_378 15
#define SIL_RESERVED_377 0x78000
#define SIL_RESERVED_374 20
#define SIL_RESERVED_373 0x1f00000
#define SIL_RESERVED_380 25
#define SIL_RESERVED_379 0x1e000000
#define SIL_RESERVED_498 0x1a3404f8UL
#define SIL_RESERVED_296 0
#define SIL_RESERVED_295 0x1fffff
#define SIL_RESERVED_522 0x1a3404d4UL
#define SIL_RESERVED_292 0
#define SIL_RESERVED_291 0x1fffff
#define SIL_RESERVED_520 0x1a3404d8UL
#define SIL_RESERVED_294 0
#define SIL_RESERVED_293 0x1fffff
#define SIL_RESERVED_521 0x1a3404dcUL
|
7bbf30cdbf5547d7716577dd44f458566e8c6569
|
f3eed0234b4d0ad2bbb2abd700cf1e2c7a0e8a1d
|
/AKWF-c/AKWF_stereo/AKWF_stereo_0045.h
|
3861fbc4c1e98c323cc747b61b5d8d59d10ff7dc
|
[
"CC0-1.0"
] |
permissive
|
KristofferKarlAxelEkstrand/AKWF-FREE
|
b2defa1a2d389d309be6dd2e9f968923daf80d1b
|
cf8171df36e9fec25416b5f568b72a6e2cb69194
|
refs/heads/master
| 2023-07-23T18:22:36.939705
| 2023-07-10T17:14:40
| 2023-07-10T17:14:40
| 145,817,187
| 359
| 59
|
CC0-1.0
| 2023-07-10T17:14:41
| 2018-08-23T07:26:56
| null |
UTF-8
|
C
| false
| false
| 6,478
|
h
|
AKWF_stereo_0045.h
|
/* Adventure Kid Waveforms (AKWF) converted for use with Teensy Audio Library
*
* Adventure Kid Waveforms(AKWF) Open waveforms library
* https://www.adventurekid.se/akrt/waveforms/adventure-kid-waveforms/
*
* This code is in the public domain, CC0 1.0 Universal (CC0 1.0)
* https://creativecommons.org/publicdomain/zero/1.0/
*
* Converted by Brad Roy, https://github.com/prosper00
*/
/* AKWF_stereo_0045 256 samples
+-----------------------------------------------------------------------------------------------------------------+
|** |
|**** |
| ********* |
| ******** |
| ******** |
| ******** |
| ********* |
| ********* |
| ********* |
| ********** |
| ********** |
| ********** |
| *********** |
| *********** |
| *********|
+-----------------------------------------------------------------------------------------------------------------+
*/
const uint16_t AKWF_stereo_0045 [] = {
49675, 52932, 65195, 60464, 58617, 53781, 62659, 56777, 61711, 54746, 59769, 56580, 58718, 55144, 59559, 56218,
56768, 55114, 56100, 55655, 56427, 54831, 55464, 55088, 54470, 54503, 55102, 54550, 55236, 54150, 54550, 54035,
55034, 53780, 55310, 53542, 55188, 53394, 54908, 53069, 55292, 52993, 54839, 52613, 54631, 52577, 54278, 52172,
54137, 52154, 53494, 51740, 53302, 51720, 52865, 51321, 52586, 51283, 52174, 50909, 52029, 50844, 51707, 50500,
51527, 50403, 51331, 50095, 51180, 49964, 50983, 49690, 50824, 49527, 50664, 49285, 50446, 49096, 50266, 48879,
50031, 48667, 49827, 48470, 49551, 48246, 49343, 48062, 49062, 47826, 48841, 47650, 48565, 47412, 48354, 47239,
48089, 47002, 47885, 46829, 47643, 46594, 47444, 46417, 47216, 46189, 47019, 46007, 46801, 45785, 46597, 45598,
46383, 45382, 46173, 45191, 45957, 44981, 45742, 44787, 45523, 44583, 45303, 44384, 45085, 44183, 44861, 43983,
44645, 43785, 44421, 43585, 44207, 43389, 43987, 43188, 43776, 42994, 43559, 42793, 43350, 42598, 43135, 42400,
42927, 42206, 42716, 42008, 42509, 41814, 42298, 41617, 42088, 41424, 41878, 41228, 41669, 41035, 41460, 40842,
41249, 40649, 41041, 40456, 40832, 40263, 40624, 40071, 40415, 39879, 40207, 39688, 40000, 39498, 39794, 39306,
39588, 39116, 39383, 38926, 39179, 38737, 38974, 38548, 38771, 38359, 38567, 38171, 38365, 37982, 38162, 37794,
37960, 37607, 37757, 37420, 37555, 37234, 37355, 37047, 37152, 36862, 36953, 36676, 36752, 36491, 36552, 36306,
36354, 36122, 36154, 35937, 35954, 35754, 35758, 35570, 35559, 35386, 35361, 35205, 35165, 35022, 34967, 34839,
34772, 34658, 34577, 34478, 34380, 34296, 34184, 34115, 33992, 33936, 33795, 33756, 33602, 33575, 33409, 33396,
33216, 33218, 33022, 33040, 32829, 32861, 32639, 32684, 32447, 32507, 32257, 32332, 32065, 32153, 31876, 31978,
31685, 31802, 31495, 31626, 31305, 31450, 31115, 31275, 30927, 31100, 30739, 30925, 30550, 30751, 30364, 30580,
30176, 30405, 29989, 30232, 29803, 30059, 29616, 29887, 29431, 29714, 29244, 29542, 29060, 29371, 28875, 29200,
28690, 29029, 28507, 28859, 28323, 28690, 28140, 28520, 27957, 28350, 27775, 28180, 27592, 28012, 27410, 27844,
27230, 27675, 27048, 27509, 26867, 27340, 26687, 27174, 26506, 27006, 26326, 26840, 26147, 26675, 25969, 26509,
25791, 26343, 25612, 26178, 25435, 26013, 25256, 25850, 25078, 25685, 24901, 25520, 24726, 25357, 24550, 25194,
24373, 25030, 24197, 24868, 24022, 24706, 23848, 24544, 23674, 24382, 23498, 24221, 23324, 24061, 23152, 23899,
22979, 23739, 22805, 23578, 22633, 23420, 22460, 23259, 22288, 23100, 22116, 22940, 21946, 22783, 21775, 22625,
21606, 22466, 21435, 22309, 21264, 22151, 21096, 21995, 20926, 21838, 20758, 21683, 20588, 21525, 20423, 21371,
20251, 21213, 20087, 21061, 19916, 20902, 19755, 20752, 19582, 20592, 19422, 20444, 19250, 20284, 19092, 20139,
18919, 19978, 18761, 19833, 18591, 19672, 18431, 19527, 18263, 19371, 18103, 19222, 17938, 19067, 17773, 18919,
17615, 18769, 17445, 18615, 17294, 18472, 17117, 18312, 16975, 18176, 16791, 18007, 16658, 17884, 16465, 17707,
16343, 17591, 16140, 17404, 16027, 17300, 15819, 17105, 15712, 17009, 15499, 16807, 15396, 16716, 15184, 16514,
15077, 16423, 14876, 16225, 14755, 16128, 14568, 15941, 14433, 15831, 14269, 15660, 14106, 15528, 13974, 15389,
13776, 15224, 13684, 15119, 13444, 14917, 13399, 14857, 13110, 14606, 13119, 14597, 12776, 14294, 12838, 14341,
12446, 13984, 12557, 14085, 12120, 13674, 12272, 13829, 11799, 13369, 11982, 13570, 11491, 13072, 11680, 13304,
11195, 12783, 11374, 13039, 10927, 12507, 11011, 12734, 10708, 12268, 10602, 12411, 10575, 12034, 10204, 12391,
};
|
59f215d86402c49b7557770d03afe5664257c162
|
00c64e0967d197d8c6fc3427954e2d0b2ff13ca0
|
/clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/policy/non-overloaded/vlse64.c
|
9ed1bbacbfdd532cc4d69d9829d1a70c43b515cf
|
[
"Apache-2.0",
"LLVM-exception",
"NCSA",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
triSYCL/sycl
|
893048e80158cf3359c1ad8912da9ccf493faf69
|
5a95a7136a11b75f01ef839d9229780032bbeecf
|
refs/heads/sycl/unified/master
| 2023-08-23T22:06:46.238209
| 2023-05-24T22:54:31
| 2023-05-24T22:54:31
| 178,923,006
| 103
| 17
|
NOASSERTION
| 2023-09-12T20:03:26
| 2019-04-01T18:29:01
| null |
UTF-8
|
C
| false
| false
| 38,111
|
c
|
vlse64.c
|
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// REQUIRES: riscv-registered-target
// RUN: %clang_cc1 -triple riscv64 -target-feature +v -target-feature +zfh \
// RUN: -target-feature +experimental-zvfh -disable-O0-optnone \
// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \
// RUN: FileCheck --check-prefix=CHECK-RV64 %s
#include <riscv_vector.h>
// CHECK-RV64-LABEL: @test_vlse64_v_f64m1_tu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x double> @llvm.riscv.vlse.nxv1f64.i64(<vscale x 1 x double> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 1 x double> [[TMP0]]
//
vfloat64m1_t test_vlse64_v_f64m1_tu(vfloat64m1_t maskedoff, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m1_tu(maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m2_tu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x double> @llvm.riscv.vlse.nxv2f64.i64(<vscale x 2 x double> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 2 x double> [[TMP0]]
//
vfloat64m2_t test_vlse64_v_f64m2_tu(vfloat64m2_t maskedoff, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m2_tu(maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m4_tu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x double> @llvm.riscv.vlse.nxv4f64.i64(<vscale x 4 x double> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 4 x double> [[TMP0]]
//
vfloat64m4_t test_vlse64_v_f64m4_tu(vfloat64m4_t maskedoff, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m4_tu(maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m8_tu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x double> @llvm.riscv.vlse.nxv8f64.i64(<vscale x 8 x double> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 8 x double> [[TMP0]]
//
vfloat64m8_t test_vlse64_v_f64m8_tu(vfloat64m8_t maskedoff, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m8_tu(maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m1_tu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x i64> @llvm.riscv.vlse.nxv1i64.i64(<vscale x 1 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 1 x i64> [[TMP0]]
//
vint64m1_t test_vlse64_v_i64m1_tu(vint64m1_t maskedoff, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m1_tu(maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m2_tu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x i64> @llvm.riscv.vlse.nxv2i64.i64(<vscale x 2 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 2 x i64> [[TMP0]]
//
vint64m2_t test_vlse64_v_i64m2_tu(vint64m2_t maskedoff, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m2_tu(maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m4_tu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x i64> @llvm.riscv.vlse.nxv4i64.i64(<vscale x 4 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 4 x i64> [[TMP0]]
//
vint64m4_t test_vlse64_v_i64m4_tu(vint64m4_t maskedoff, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m4_tu(maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m8_tu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x i64> @llvm.riscv.vlse.nxv8i64.i64(<vscale x 8 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 8 x i64> [[TMP0]]
//
vint64m8_t test_vlse64_v_i64m8_tu(vint64m8_t maskedoff, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m8_tu(maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m1_tu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x i64> @llvm.riscv.vlse.nxv1i64.i64(<vscale x 1 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 1 x i64> [[TMP0]]
//
vuint64m1_t test_vlse64_v_u64m1_tu(vuint64m1_t maskedoff, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m1_tu(maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m2_tu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x i64> @llvm.riscv.vlse.nxv2i64.i64(<vscale x 2 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 2 x i64> [[TMP0]]
//
vuint64m2_t test_vlse64_v_u64m2_tu(vuint64m2_t maskedoff, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m2_tu(maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m4_tu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x i64> @llvm.riscv.vlse.nxv4i64.i64(<vscale x 4 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 4 x i64> [[TMP0]]
//
vuint64m4_t test_vlse64_v_u64m4_tu(vuint64m4_t maskedoff, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m4_tu(maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m8_tu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x i64> @llvm.riscv.vlse.nxv8i64.i64(<vscale x 8 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 8 x i64> [[TMP0]]
//
vuint64m8_t test_vlse64_v_u64m8_tu(vuint64m8_t maskedoff, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m8_tu(maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m1_ta(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x double> @llvm.riscv.vlse.nxv1f64.i64(<vscale x 1 x double> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 1 x double> [[TMP0]]
//
vfloat64m1_t test_vlse64_v_f64m1_ta(const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m1_ta(base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m2_ta(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x double> @llvm.riscv.vlse.nxv2f64.i64(<vscale x 2 x double> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 2 x double> [[TMP0]]
//
vfloat64m2_t test_vlse64_v_f64m2_ta(const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m2_ta(base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m4_ta(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x double> @llvm.riscv.vlse.nxv4f64.i64(<vscale x 4 x double> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 4 x double> [[TMP0]]
//
vfloat64m4_t test_vlse64_v_f64m4_ta(const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m4_ta(base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m8_ta(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x double> @llvm.riscv.vlse.nxv8f64.i64(<vscale x 8 x double> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 8 x double> [[TMP0]]
//
vfloat64m8_t test_vlse64_v_f64m8_ta(const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m8_ta(base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m1_ta(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x i64> @llvm.riscv.vlse.nxv1i64.i64(<vscale x 1 x i64> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 1 x i64> [[TMP0]]
//
vint64m1_t test_vlse64_v_i64m1_ta(const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m1_ta(base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m2_ta(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x i64> @llvm.riscv.vlse.nxv2i64.i64(<vscale x 2 x i64> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 2 x i64> [[TMP0]]
//
vint64m2_t test_vlse64_v_i64m2_ta(const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m2_ta(base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m4_ta(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x i64> @llvm.riscv.vlse.nxv4i64.i64(<vscale x 4 x i64> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 4 x i64> [[TMP0]]
//
vint64m4_t test_vlse64_v_i64m4_ta(const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m4_ta(base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m8_ta(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x i64> @llvm.riscv.vlse.nxv8i64.i64(<vscale x 8 x i64> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 8 x i64> [[TMP0]]
//
vint64m8_t test_vlse64_v_i64m8_ta(const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m8_ta(base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m1_ta(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x i64> @llvm.riscv.vlse.nxv1i64.i64(<vscale x 1 x i64> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 1 x i64> [[TMP0]]
//
vuint64m1_t test_vlse64_v_u64m1_ta(const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m1_ta(base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m2_ta(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x i64> @llvm.riscv.vlse.nxv2i64.i64(<vscale x 2 x i64> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 2 x i64> [[TMP0]]
//
vuint64m2_t test_vlse64_v_u64m2_ta(const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m2_ta(base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m4_ta(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x i64> @llvm.riscv.vlse.nxv4i64.i64(<vscale x 4 x i64> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 4 x i64> [[TMP0]]
//
vuint64m4_t test_vlse64_v_u64m4_ta(const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m4_ta(base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m8_ta(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x i64> @llvm.riscv.vlse.nxv8i64.i64(<vscale x 8 x i64> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], i64 [[VL:%.*]])
// CHECK-RV64-NEXT: ret <vscale x 8 x i64> [[TMP0]]
//
vuint64m8_t test_vlse64_v_u64m8_ta(const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m8_ta(base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m1_tuma(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x double> @llvm.riscv.vlse.mask.nxv1f64.i64(<vscale x 1 x double> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 1 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 2)
// CHECK-RV64-NEXT: ret <vscale x 1 x double> [[TMP0]]
//
vfloat64m1_t test_vlse64_v_f64m1_tuma(vbool64_t mask, vfloat64m1_t maskedoff, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m1_tuma(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m2_tuma(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x double> @llvm.riscv.vlse.mask.nxv2f64.i64(<vscale x 2 x double> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 2 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 2)
// CHECK-RV64-NEXT: ret <vscale x 2 x double> [[TMP0]]
//
vfloat64m2_t test_vlse64_v_f64m2_tuma(vbool32_t mask, vfloat64m2_t maskedoff, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m2_tuma(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m4_tuma(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x double> @llvm.riscv.vlse.mask.nxv4f64.i64(<vscale x 4 x double> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 4 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 2)
// CHECK-RV64-NEXT: ret <vscale x 4 x double> [[TMP0]]
//
vfloat64m4_t test_vlse64_v_f64m4_tuma(vbool16_t mask, vfloat64m4_t maskedoff, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m4_tuma(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m8_tuma(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x double> @llvm.riscv.vlse.mask.nxv8f64.i64(<vscale x 8 x double> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 8 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 2)
// CHECK-RV64-NEXT: ret <vscale x 8 x double> [[TMP0]]
//
vfloat64m8_t test_vlse64_v_f64m8_tuma(vbool8_t mask, vfloat64m8_t maskedoff, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m8_tuma(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m1_tuma(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x i64> @llvm.riscv.vlse.mask.nxv1i64.i64(<vscale x 1 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 1 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 2)
// CHECK-RV64-NEXT: ret <vscale x 1 x i64> [[TMP0]]
//
vint64m1_t test_vlse64_v_i64m1_tuma(vbool64_t mask, vint64m1_t maskedoff, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m1_tuma(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m2_tuma(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x i64> @llvm.riscv.vlse.mask.nxv2i64.i64(<vscale x 2 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 2 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 2)
// CHECK-RV64-NEXT: ret <vscale x 2 x i64> [[TMP0]]
//
vint64m2_t test_vlse64_v_i64m2_tuma(vbool32_t mask, vint64m2_t maskedoff, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m2_tuma(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m4_tuma(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x i64> @llvm.riscv.vlse.mask.nxv4i64.i64(<vscale x 4 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 4 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 2)
// CHECK-RV64-NEXT: ret <vscale x 4 x i64> [[TMP0]]
//
vint64m4_t test_vlse64_v_i64m4_tuma(vbool16_t mask, vint64m4_t maskedoff, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m4_tuma(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m8_tuma(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x i64> @llvm.riscv.vlse.mask.nxv8i64.i64(<vscale x 8 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 8 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 2)
// CHECK-RV64-NEXT: ret <vscale x 8 x i64> [[TMP0]]
//
vint64m8_t test_vlse64_v_i64m8_tuma(vbool8_t mask, vint64m8_t maskedoff, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m8_tuma(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m1_tuma(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x i64> @llvm.riscv.vlse.mask.nxv1i64.i64(<vscale x 1 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 1 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 2)
// CHECK-RV64-NEXT: ret <vscale x 1 x i64> [[TMP0]]
//
vuint64m1_t test_vlse64_v_u64m1_tuma(vbool64_t mask, vuint64m1_t maskedoff, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m1_tuma(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m2_tuma(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x i64> @llvm.riscv.vlse.mask.nxv2i64.i64(<vscale x 2 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 2 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 2)
// CHECK-RV64-NEXT: ret <vscale x 2 x i64> [[TMP0]]
//
vuint64m2_t test_vlse64_v_u64m2_tuma(vbool32_t mask, vuint64m2_t maskedoff, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m2_tuma(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m4_tuma(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x i64> @llvm.riscv.vlse.mask.nxv4i64.i64(<vscale x 4 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 4 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 2)
// CHECK-RV64-NEXT: ret <vscale x 4 x i64> [[TMP0]]
//
vuint64m4_t test_vlse64_v_u64m4_tuma(vbool16_t mask, vuint64m4_t maskedoff, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m4_tuma(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m8_tuma(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x i64> @llvm.riscv.vlse.mask.nxv8i64.i64(<vscale x 8 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 8 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 2)
// CHECK-RV64-NEXT: ret <vscale x 8 x i64> [[TMP0]]
//
vuint64m8_t test_vlse64_v_u64m8_tuma(vbool8_t mask, vuint64m8_t maskedoff, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m8_tuma(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m1_tumu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x double> @llvm.riscv.vlse.mask.nxv1f64.i64(<vscale x 1 x double> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 1 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 0)
// CHECK-RV64-NEXT: ret <vscale x 1 x double> [[TMP0]]
//
vfloat64m1_t test_vlse64_v_f64m1_tumu(vbool64_t mask, vfloat64m1_t maskedoff, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m1_tumu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m2_tumu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x double> @llvm.riscv.vlse.mask.nxv2f64.i64(<vscale x 2 x double> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 2 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 0)
// CHECK-RV64-NEXT: ret <vscale x 2 x double> [[TMP0]]
//
vfloat64m2_t test_vlse64_v_f64m2_tumu(vbool32_t mask, vfloat64m2_t maskedoff, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m2_tumu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m4_tumu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x double> @llvm.riscv.vlse.mask.nxv4f64.i64(<vscale x 4 x double> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 4 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 0)
// CHECK-RV64-NEXT: ret <vscale x 4 x double> [[TMP0]]
//
vfloat64m4_t test_vlse64_v_f64m4_tumu(vbool16_t mask, vfloat64m4_t maskedoff, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m4_tumu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m8_tumu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x double> @llvm.riscv.vlse.mask.nxv8f64.i64(<vscale x 8 x double> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 8 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 0)
// CHECK-RV64-NEXT: ret <vscale x 8 x double> [[TMP0]]
//
vfloat64m8_t test_vlse64_v_f64m8_tumu(vbool8_t mask, vfloat64m8_t maskedoff, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m8_tumu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m1_tumu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x i64> @llvm.riscv.vlse.mask.nxv1i64.i64(<vscale x 1 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 1 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 0)
// CHECK-RV64-NEXT: ret <vscale x 1 x i64> [[TMP0]]
//
vint64m1_t test_vlse64_v_i64m1_tumu(vbool64_t mask, vint64m1_t maskedoff, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m1_tumu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m2_tumu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x i64> @llvm.riscv.vlse.mask.nxv2i64.i64(<vscale x 2 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 2 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 0)
// CHECK-RV64-NEXT: ret <vscale x 2 x i64> [[TMP0]]
//
vint64m2_t test_vlse64_v_i64m2_tumu(vbool32_t mask, vint64m2_t maskedoff, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m2_tumu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m4_tumu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x i64> @llvm.riscv.vlse.mask.nxv4i64.i64(<vscale x 4 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 4 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 0)
// CHECK-RV64-NEXT: ret <vscale x 4 x i64> [[TMP0]]
//
vint64m4_t test_vlse64_v_i64m4_tumu(vbool16_t mask, vint64m4_t maskedoff, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m4_tumu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m8_tumu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x i64> @llvm.riscv.vlse.mask.nxv8i64.i64(<vscale x 8 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 8 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 0)
// CHECK-RV64-NEXT: ret <vscale x 8 x i64> [[TMP0]]
//
vint64m8_t test_vlse64_v_i64m8_tumu(vbool8_t mask, vint64m8_t maskedoff, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m8_tumu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m1_tumu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x i64> @llvm.riscv.vlse.mask.nxv1i64.i64(<vscale x 1 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 1 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 0)
// CHECK-RV64-NEXT: ret <vscale x 1 x i64> [[TMP0]]
//
vuint64m1_t test_vlse64_v_u64m1_tumu(vbool64_t mask, vuint64m1_t maskedoff, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m1_tumu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m2_tumu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x i64> @llvm.riscv.vlse.mask.nxv2i64.i64(<vscale x 2 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 2 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 0)
// CHECK-RV64-NEXT: ret <vscale x 2 x i64> [[TMP0]]
//
vuint64m2_t test_vlse64_v_u64m2_tumu(vbool32_t mask, vuint64m2_t maskedoff, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m2_tumu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m4_tumu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x i64> @llvm.riscv.vlse.mask.nxv4i64.i64(<vscale x 4 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 4 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 0)
// CHECK-RV64-NEXT: ret <vscale x 4 x i64> [[TMP0]]
//
vuint64m4_t test_vlse64_v_u64m4_tumu(vbool16_t mask, vuint64m4_t maskedoff, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m4_tumu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m8_tumu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x i64> @llvm.riscv.vlse.mask.nxv8i64.i64(<vscale x 8 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 8 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 0)
// CHECK-RV64-NEXT: ret <vscale x 8 x i64> [[TMP0]]
//
vuint64m8_t test_vlse64_v_u64m8_tumu(vbool8_t mask, vuint64m8_t maskedoff, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m8_tumu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m1_tama(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x double> @llvm.riscv.vlse.mask.nxv1f64.i64(<vscale x 1 x double> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 1 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 3)
// CHECK-RV64-NEXT: ret <vscale x 1 x double> [[TMP0]]
//
vfloat64m1_t test_vlse64_v_f64m1_tama(vbool64_t mask, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m1_tama(mask, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m2_tama(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x double> @llvm.riscv.vlse.mask.nxv2f64.i64(<vscale x 2 x double> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 2 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 3)
// CHECK-RV64-NEXT: ret <vscale x 2 x double> [[TMP0]]
//
vfloat64m2_t test_vlse64_v_f64m2_tama(vbool32_t mask, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m2_tama(mask, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m4_tama(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x double> @llvm.riscv.vlse.mask.nxv4f64.i64(<vscale x 4 x double> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 4 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 3)
// CHECK-RV64-NEXT: ret <vscale x 4 x double> [[TMP0]]
//
vfloat64m4_t test_vlse64_v_f64m4_tama(vbool16_t mask, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m4_tama(mask, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m8_tama(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x double> @llvm.riscv.vlse.mask.nxv8f64.i64(<vscale x 8 x double> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 8 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 3)
// CHECK-RV64-NEXT: ret <vscale x 8 x double> [[TMP0]]
//
vfloat64m8_t test_vlse64_v_f64m8_tama(vbool8_t mask, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m8_tama(mask, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m1_tama(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x i64> @llvm.riscv.vlse.mask.nxv1i64.i64(<vscale x 1 x i64> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 1 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 3)
// CHECK-RV64-NEXT: ret <vscale x 1 x i64> [[TMP0]]
//
vint64m1_t test_vlse64_v_i64m1_tama(vbool64_t mask, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m1_tama(mask, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m2_tama(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x i64> @llvm.riscv.vlse.mask.nxv2i64.i64(<vscale x 2 x i64> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 2 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 3)
// CHECK-RV64-NEXT: ret <vscale x 2 x i64> [[TMP0]]
//
vint64m2_t test_vlse64_v_i64m2_tama(vbool32_t mask, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m2_tama(mask, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m4_tama(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x i64> @llvm.riscv.vlse.mask.nxv4i64.i64(<vscale x 4 x i64> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 4 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 3)
// CHECK-RV64-NEXT: ret <vscale x 4 x i64> [[TMP0]]
//
vint64m4_t test_vlse64_v_i64m4_tama(vbool16_t mask, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m4_tama(mask, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m8_tama(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x i64> @llvm.riscv.vlse.mask.nxv8i64.i64(<vscale x 8 x i64> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 8 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 3)
// CHECK-RV64-NEXT: ret <vscale x 8 x i64> [[TMP0]]
//
vint64m8_t test_vlse64_v_i64m8_tama(vbool8_t mask, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m8_tama(mask, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m1_tama(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x i64> @llvm.riscv.vlse.mask.nxv1i64.i64(<vscale x 1 x i64> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 1 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 3)
// CHECK-RV64-NEXT: ret <vscale x 1 x i64> [[TMP0]]
//
vuint64m1_t test_vlse64_v_u64m1_tama(vbool64_t mask, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m1_tama(mask, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m2_tama(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x i64> @llvm.riscv.vlse.mask.nxv2i64.i64(<vscale x 2 x i64> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 2 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 3)
// CHECK-RV64-NEXT: ret <vscale x 2 x i64> [[TMP0]]
//
vuint64m2_t test_vlse64_v_u64m2_tama(vbool32_t mask, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m2_tama(mask, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m4_tama(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x i64> @llvm.riscv.vlse.mask.nxv4i64.i64(<vscale x 4 x i64> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 4 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 3)
// CHECK-RV64-NEXT: ret <vscale x 4 x i64> [[TMP0]]
//
vuint64m4_t test_vlse64_v_u64m4_tama(vbool16_t mask, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m4_tama(mask, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m8_tama(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x i64> @llvm.riscv.vlse.mask.nxv8i64.i64(<vscale x 8 x i64> poison, ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 8 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 3)
// CHECK-RV64-NEXT: ret <vscale x 8 x i64> [[TMP0]]
//
vuint64m8_t test_vlse64_v_u64m8_tama(vbool8_t mask, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m8_tama(mask, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m1_tamu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x double> @llvm.riscv.vlse.mask.nxv1f64.i64(<vscale x 1 x double> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 1 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 1)
// CHECK-RV64-NEXT: ret <vscale x 1 x double> [[TMP0]]
//
vfloat64m1_t test_vlse64_v_f64m1_tamu(vbool64_t mask, vfloat64m1_t maskedoff, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m1_tamu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m2_tamu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x double> @llvm.riscv.vlse.mask.nxv2f64.i64(<vscale x 2 x double> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 2 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 1)
// CHECK-RV64-NEXT: ret <vscale x 2 x double> [[TMP0]]
//
vfloat64m2_t test_vlse64_v_f64m2_tamu(vbool32_t mask, vfloat64m2_t maskedoff, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m2_tamu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m4_tamu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x double> @llvm.riscv.vlse.mask.nxv4f64.i64(<vscale x 4 x double> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 4 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 1)
// CHECK-RV64-NEXT: ret <vscale x 4 x double> [[TMP0]]
//
vfloat64m4_t test_vlse64_v_f64m4_tamu(vbool16_t mask, vfloat64m4_t maskedoff, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m4_tamu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_f64m8_tamu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x double> @llvm.riscv.vlse.mask.nxv8f64.i64(<vscale x 8 x double> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 8 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 1)
// CHECK-RV64-NEXT: ret <vscale x 8 x double> [[TMP0]]
//
vfloat64m8_t test_vlse64_v_f64m8_tamu(vbool8_t mask, vfloat64m8_t maskedoff, const double *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_f64m8_tamu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m1_tamu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x i64> @llvm.riscv.vlse.mask.nxv1i64.i64(<vscale x 1 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 1 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 1)
// CHECK-RV64-NEXT: ret <vscale x 1 x i64> [[TMP0]]
//
vint64m1_t test_vlse64_v_i64m1_tamu(vbool64_t mask, vint64m1_t maskedoff, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m1_tamu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m2_tamu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x i64> @llvm.riscv.vlse.mask.nxv2i64.i64(<vscale x 2 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 2 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 1)
// CHECK-RV64-NEXT: ret <vscale x 2 x i64> [[TMP0]]
//
vint64m2_t test_vlse64_v_i64m2_tamu(vbool32_t mask, vint64m2_t maskedoff, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m2_tamu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m4_tamu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x i64> @llvm.riscv.vlse.mask.nxv4i64.i64(<vscale x 4 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 4 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 1)
// CHECK-RV64-NEXT: ret <vscale x 4 x i64> [[TMP0]]
//
vint64m4_t test_vlse64_v_i64m4_tamu(vbool16_t mask, vint64m4_t maskedoff, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m4_tamu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_i64m8_tamu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x i64> @llvm.riscv.vlse.mask.nxv8i64.i64(<vscale x 8 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 8 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 1)
// CHECK-RV64-NEXT: ret <vscale x 8 x i64> [[TMP0]]
//
vint64m8_t test_vlse64_v_i64m8_tamu(vbool8_t mask, vint64m8_t maskedoff, const int64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_i64m8_tamu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m1_tamu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x i64> @llvm.riscv.vlse.mask.nxv1i64.i64(<vscale x 1 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 1 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 1)
// CHECK-RV64-NEXT: ret <vscale x 1 x i64> [[TMP0]]
//
vuint64m1_t test_vlse64_v_u64m1_tamu(vbool64_t mask, vuint64m1_t maskedoff, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m1_tamu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m2_tamu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x i64> @llvm.riscv.vlse.mask.nxv2i64.i64(<vscale x 2 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 2 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 1)
// CHECK-RV64-NEXT: ret <vscale x 2 x i64> [[TMP0]]
//
vuint64m2_t test_vlse64_v_u64m2_tamu(vbool32_t mask, vuint64m2_t maskedoff, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m2_tamu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m4_tamu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x i64> @llvm.riscv.vlse.mask.nxv4i64.i64(<vscale x 4 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 4 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 1)
// CHECK-RV64-NEXT: ret <vscale x 4 x i64> [[TMP0]]
//
vuint64m4_t test_vlse64_v_u64m4_tamu(vbool16_t mask, vuint64m4_t maskedoff, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m4_tamu(mask, maskedoff, base, bstride, vl);
}
// CHECK-RV64-LABEL: @test_vlse64_v_u64m8_tamu(
// CHECK-RV64-NEXT: entry:
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x i64> @llvm.riscv.vlse.mask.nxv8i64.i64(<vscale x 8 x i64> [[MASKEDOFF:%.*]], ptr [[BASE:%.*]], i64 [[BSTRIDE:%.*]], <vscale x 8 x i1> [[MASK:%.*]], i64 [[VL:%.*]], i64 1)
// CHECK-RV64-NEXT: ret <vscale x 8 x i64> [[TMP0]]
//
vuint64m8_t test_vlse64_v_u64m8_tamu(vbool8_t mask, vuint64m8_t maskedoff, const uint64_t *base, ptrdiff_t bstride, size_t vl) {
return vlse64_v_u64m8_tamu(mask, maskedoff, base, bstride, vl);
}
|
6952c747ba4ab4ea310ee780aecb301aa8bde4d2
|
05d0a9553358fbf159e566c403626de2718e17c9
|
/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/lz4/Lz4Compressor.c
|
2c8af1b9115d587b13ef526fbaba07cb1724652b
|
[
"Apache-2.0",
"CC-BY-2.5",
"LGPL-2.1-only",
"LicenseRef-scancode-other-permissive",
"EPL-1.0",
"Classpath-exception-2.0",
"GCC-exception-3.1",
"BSD-3-Clause",
"CC-PDDC",
"GPL-2.0-only",
"CDDL-1.0",
"MIT",
"LicenseRef-scancode-public-domain",
"GPL-1.0-or-later",
"LicenseRef-scancode-jdom",
"LicenseRef-scancode-proprietary-license",
"BSD-2-Clause-Views",
"MPL-2.0-no-copyleft-exception",
"MPL-2.0",
"CC-BY-3.0",
"AGPL-3.0-only",
"LicenseRef-scancode-unknown-license-reference",
"BSD-2-Clause",
"CDDL-1.1",
"LicenseRef-scancode-protobuf",
"LGPL-2.1-or-later",
"LGPL-2.0-or-later",
"LicenseRef-scancode-oracle-bcl-javase-javafx-2012",
"LGPL-2.0-only",
"LicenseRef-scancode-unknown"
] |
permissive
|
hopshadoop/hops
|
d8baaf20bc418af460e582974839a3a9a72f173a
|
ed0d4de3dadbde5afa12899e703954aa67db7b3b
|
refs/heads/master
| 2023-08-31T20:36:31.212647
| 2023-08-28T15:31:37
| 2023-08-28T15:31:37
| 32,975,439
| 295
| 85
|
Apache-2.0
| 2023-09-05T09:19:57
| 2015-03-27T08:31:42
|
Java
|
UTF-8
|
C
| false
| false
| 5,119
|
c
|
Lz4Compressor.c
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "org_apache_hadoop.h"
#include "org_apache_hadoop_io_compress_lz4_Lz4Compressor.h"
#ifdef UNIX
#include "config.h"
#endif // UNIX
#include "lz4.h"
#include "lz4hc.h"
static jfieldID Lz4Compressor_uncompressedDirectBuf;
static jfieldID Lz4Compressor_uncompressedDirectBufLen;
static jfieldID Lz4Compressor_compressedDirectBuf;
static jfieldID Lz4Compressor_directBufferSize;
JNIEXPORT void JNICALL Java_org_apache_hadoop_io_compress_lz4_Lz4Compressor_initIDs
(JNIEnv *env, jclass clazz){
Lz4Compressor_uncompressedDirectBuf = (*env)->GetFieldID(env, clazz,
"uncompressedDirectBuf",
"Ljava/nio/Buffer;");
Lz4Compressor_uncompressedDirectBufLen = (*env)->GetFieldID(env, clazz,
"uncompressedDirectBufLen", "I");
Lz4Compressor_compressedDirectBuf = (*env)->GetFieldID(env, clazz,
"compressedDirectBuf",
"Ljava/nio/Buffer;");
Lz4Compressor_directBufferSize = (*env)->GetFieldID(env, clazz,
"directBufferSize", "I");
}
JNIEXPORT jint JNICALL Java_org_apache_hadoop_io_compress_lz4_Lz4Compressor_compressBytesDirect
(JNIEnv *env, jobject thisj){
const char* uncompressed_bytes;
char *compressed_bytes;
// Get members of Lz4Compressor
jobject uncompressed_direct_buf = (*env)->GetObjectField(env, thisj, Lz4Compressor_uncompressedDirectBuf);
jint uncompressed_direct_buf_len = (*env)->GetIntField(env, thisj, Lz4Compressor_uncompressedDirectBufLen);
jobject compressed_direct_buf = (*env)->GetObjectField(env, thisj, Lz4Compressor_compressedDirectBuf);
jint compressed_direct_buf_len = (*env)->GetIntField(env, thisj, Lz4Compressor_directBufferSize);
// Get the input direct buffer
uncompressed_bytes = (const char*)(*env)->GetDirectBufferAddress(env, uncompressed_direct_buf);
if (uncompressed_bytes == 0) {
return (jint)0;
}
// Get the output direct buffer
compressed_bytes = (char *)(*env)->GetDirectBufferAddress(env, compressed_direct_buf);
if (compressed_bytes == 0) {
return (jint)0;
}
compressed_direct_buf_len = LZ4_compress(uncompressed_bytes, compressed_bytes, uncompressed_direct_buf_len);
if (compressed_direct_buf_len < 0){
THROW(env, "java/lang/InternalError", "LZ4_compress failed");
}
(*env)->SetIntField(env, thisj, Lz4Compressor_uncompressedDirectBufLen, 0);
return (jint)compressed_direct_buf_len;
}
JNIEXPORT jstring JNICALL
Java_org_apache_hadoop_io_compress_lz4_Lz4Compressor_getLibraryName(
JNIEnv *env, jclass class
) {
char version_buf[128];
snprintf(version_buf, sizeof(version_buf), "revision:%d", LZ4_versionNumber());
return (*env)->NewStringUTF(env, version_buf);
}
JNIEXPORT jint JNICALL Java_org_apache_hadoop_io_compress_lz4_Lz4Compressor_compressBytesDirectHC
(JNIEnv *env, jobject thisj){
const char* uncompressed_bytes = NULL;
char* compressed_bytes = NULL;
// Get members of Lz4Compressor
jobject uncompressed_direct_buf = (*env)->GetObjectField(env, thisj, Lz4Compressor_uncompressedDirectBuf);
jint uncompressed_direct_buf_len = (*env)->GetIntField(env, thisj, Lz4Compressor_uncompressedDirectBufLen);
jobject compressed_direct_buf = (*env)->GetObjectField(env, thisj, Lz4Compressor_compressedDirectBuf);
jint compressed_direct_buf_len = (*env)->GetIntField(env, thisj, Lz4Compressor_directBufferSize);
// Get the input direct buffer
uncompressed_bytes = (const char*)(*env)->GetDirectBufferAddress(env, uncompressed_direct_buf);
if (uncompressed_bytes == 0) {
return (jint)0;
}
// Get the output direct buffer
compressed_bytes = (char *)(*env)->GetDirectBufferAddress(env, compressed_direct_buf);
if (compressed_bytes == 0) {
return (jint)0;
}
compressed_direct_buf_len = LZ4_compressHC(uncompressed_bytes, compressed_bytes, uncompressed_direct_buf_len);
if (compressed_direct_buf_len < 0){
THROW(env, "java/lang/InternalError", "LZ4_compressHC failed");
}
(*env)->SetIntField(env, thisj, Lz4Compressor_uncompressedDirectBufLen, 0);
return (jint)compressed_direct_buf_len;
}
|
cd85ed70382574bbb5cb7465b4836ff39f136184
|
317410b28757af216145d23259d63fc96d07f613
|
/apps/hid/examples/idle/app_idle.c
|
bacfacf9549677ac91c2dc6af9f0003dde5cbe3a
|
[
"Apache-2.0"
] |
permissive
|
Jieli-Tech/fw-AC63_BT_SDK
|
48c757dca7e8000ec763bf5466583a4cd8c4a11c
|
393d63758081d56f0bf0a39ac596bee32c33d493
|
refs/heads/master
| 2023-07-18T02:14:56.187266
| 2023-06-21T03:14:20
| 2023-06-21T03:14:20
| 272,586,610
| 113
| 76
|
Apache-2.0
| 2022-10-20T23:07:31
| 2020-06-16T02:02:15
|
C
|
UTF-8
|
C
| false
| false
| 2,196
|
c
|
app_idle.c
|
#include "system/app_core.h"
#include "system/includes.h"
#include "server/server_core.h"
#include "app_config.h"
#include "app_action.h"
#define LOG_TAG_CONST APP_IDLE
#define LOG_TAG "[APP_IDLE]"
#define LOG_ERROR_ENABLE
#define LOG_DEBUG_ENABLE
#define LOG_INFO_ENABLE
/* #define LOG_DUMP_ENABLE */
#define LOG_CLI_ENABLE
#include "debug.h"
#if CONFIG_APP_IDLE
#if TCFG_USER_EDR_ENABLE || TCFG_USER_BLE_ENABLE
//默认应用不需要打开配置,有需要自己添加
/* #error " confirm, need disable !!!!!!" */
#endif
static void idle_timer_handle_test(void)
{
log_info("wakeup");
}
static void idle_app_start()
{
log_info("=======================================");
log_info("---------idle demo---------");
log_info("=======================================");
log_info("app_file: %s", __FILE__);
clk_set("sys", BT_NORMAL_HZ);
sys_timer_add(NULL, idle_timer_handle_test, 2000);
}
static int idle_event_handler(struct application *app, struct sys_event *event)
{
switch (event->type) {
case SYS_KEY_EVENT:
return 0;
case SYS_BT_EVENT:
return 0;
case SYS_DEVICE_EVENT:
return 0;
default:
return false;
}
}
static
static int idle_state_machine(struct application *app, enum app_state state,
struct intent *it)
{
switch (state) {
case APP_STA_CREATE:
break;
case APP_STA_START:
if (!it) {
break;
}
switch (it->action) {
case ACTION_IDLE_MAIN:
log_info("ACTION_IDLE_MAIN\n");
/* os_taskq_flush(); */
idle_app_start();
break;
}
break;
case APP_STA_PAUSE:
break;
case APP_STA_RESUME:
break;
case APP_STA_STOP:
break;
case APP_STA_DESTROY:
break;
}
return 0;
}
static const struct application_operation app_idle_ops = {
.state_machine = idle_state_machine,
.event_handler = idle_event_handler,
};
REGISTER_APPLICATION(app_app_idle) = {
.name = "idle",
.action = ACTION_IDLE_MAIN,
.ops = &app_idle_ops,
.state = APP_STA_DESTROY,
};
#endif
|
477f0a2a0858708071cfb1a816b36ce85c0a061e
|
167c6226bc77c5daaedab007dfdad4377f588ef4
|
/cpp/ql/test/library-tests/lossy_pointer_cast/lossy_pointer_cast.c
|
8f76cdb42f20b5538d7fd6b01335c4367dcb0a8c
|
[
"LicenseRef-scancode-public-domain",
"MIT"
] |
permissive
|
github/codeql
|
1eebb449a34f774db9e881b52cb8f7a1b1a53612
|
d109637e2d7ab3b819812eb960c05cb31d9d2168
|
refs/heads/main
| 2023-08-20T11:32:39.162059
| 2023-08-18T14:33:32
| 2023-08-18T14:33:32
| 143,040,428
| 5,987
| 1,363
|
MIT
| 2023-09-14T19:36:50
| 2018-07-31T16:35:51
|
CodeQL
|
UTF-8
|
C
| false
| false
| 571
|
c
|
lossy_pointer_cast.c
|
void f(void) {
void *p1, *p2, *p3, *p4;
short int i;
long long int z;
z = (long long int)p1; // OK: long long int is big enough
i = (short int)p2; // Bad: short is too small
i = (short int)(long long int)p3; // OK: we assume they know what
// they are doing if they go
// via a large-enough type
i = (short int)(void *)p4; // Bad: Going via a pointer type is
// not convincing
}
|
7edba0bf8afc45e0ae5cfee13e8a7ed893f8f9a5
|
f4056b1d5cb2d222f315c7f790ccf14d01436834
|
/hw/xwin/winwindow.h
|
92a839c4dc91034db7489b578b3cc5eeabdc95dd
|
[
"SGI-B-2.0",
"ISC",
"LicenseRef-scancode-mit-old-style",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-x11-adobe",
"LicenseRef-scancode-xfree86-1.0",
"HPND-sell-variant",
"ICU",
"MIT-open-group",
"BSD-3-Clause",
"HPND",
"X11-distribute-modifications-variant",
"MIT",
"LicenseRef-scancode-other-permissive",
"X11"
] |
permissive
|
XQuartz/xorg-server
|
cd677ecd115213f5534cc1b06aff6a8c9a3ea733
|
0ea9b595891f2f31915538192961f3404d9ca699
|
refs/heads/master
| 2023-09-05T12:04:27.866042
| 2023-01-18T18:38:41
| 2023-01-26T17:51:16
| 44,375,619
| 287
| 60
|
NOASSERTION
| 2022-12-14T15:56:16
| 2015-10-16T09:29:57
|
C
|
UTF-8
|
C
| false
| false
| 4,662
|
h
|
winwindow.h
|
/*
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
*Copyright (C) Colin Harrison 2005-2009
*
*Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
*"Software"), to deal in the Software without restriction, including
*without limitation the rights to use, copy, modify, merge, publish,
*distribute, sublicense, and/or sell copies of the Software, and to
*permit persons to whom the Software is furnished to do so, subject to
*the following conditions:
*
*The above copyright notice and this permission notice shall be
*included in all copies or substantial portions of the Software.
*
*THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
*EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
*MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
*NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
*ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
*CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
*WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*Except as contained in this notice, the name of the XFree86 Project
*shall not be used in advertising or otherwise to promote the sale, use
*or other dealings in this Software without prior written authorization
*from the XFree86 Project.
*
* Authors: Kensuke Matsuzaki
* Colin Harrison
*/
#if !defined(_WINWINDOW_H_)
#define _WINWINDOW_H_
#ifndef NO
#define NO 0
#endif
#ifndef YES
#define YES 1
#endif
/* Constant strings */
#ifndef PROJECT_NAME
#define PROJECT_NAME "Cygwin/X"
#endif
#define EXECUTABLE_NAME "XWin"
#define WINDOW_CLASS "cygwin/x"
#define WINDOW_TITLE PROJECT_NAME ":%s.%d"
#define WINDOW_TITLE_XDMCP "%s:%s.%d"
#define WIN_SCR_PROP "cyg_screen_prop rl"
#define WINDOW_CLASS_X "cygwin/x X rl"
#define WINDOW_CLASS_X_MSG "cygwin/x X msg"
#define WINDOW_TITLE_X PROJECT_NAME " X"
#define WIN_WINDOW_PROP "cyg_window_prop_rl"
#ifdef HAS_DEVWINDOWS
#define WIN_MSG_QUEUE_FNAME "/dev/windows"
#endif
#define WIN_WID_PROP "cyg_wid_prop_rl"
#define WIN_NEEDMANAGE_PROP "cyg_override_redirect_prop_rl"
#ifndef CYGMULTIWINDOW_DEBUG
#define CYGMULTIWINDOW_DEBUG NO
#endif
#ifndef CYGWINDOWING_DEBUG
#define CYGWINDOWING_DEBUG NO
#endif
#define XMING_SIGNATURE 0x12345678L
typedef struct _winPrivScreenRec *winPrivScreenPtr;
/*
* Window privates
*/
typedef struct {
DWORD dwDummy;
HRGN hRgn;
HWND hWnd;
winPrivScreenPtr pScreenPriv;
Bool fXKilled;
HDWP hDwp;
#ifdef XWIN_GLX_WINDOWS
Bool fWglUsed;
#endif
} winPrivWinRec, *winPrivWinPtr;
typedef struct _winWMMessageRec {
DWORD dwID;
DWORD msg;
int iWindow;
HWND hwndWindow;
int iX, iY;
int iWidth, iHeight;
} winWMMessageRec, *winWMMessagePtr;
/*
* winmultiwindowwm.c
*/
#define WM_WM_MOVE (WM_USER + 1)
#define WM_WM_SIZE (WM_USER + 2)
#define WM_WM_RAISE (WM_USER + 3)
#define WM_WM_LOWER (WM_USER + 4)
#define WM_WM_UNMAP (WM_USER + 6)
#define WM_WM_KILL (WM_USER + 7)
#define WM_WM_ACTIVATE (WM_USER + 8)
#define WM_WM_NAME_EVENT (WM_USER + 9)
#define WM_WM_ICON_EVENT (WM_USER + 10)
#define WM_WM_CHANGE_STATE (WM_USER + 11)
#define WM_WM_MAP_UNMANAGED (WM_USER + 12)
#define WM_WM_MAP_MANAGED (WM_USER + 13)
#define WM_WM_HINTS_EVENT (WM_USER + 14)
#define MwmHintsDecorations (1L << 1)
#define MwmDecorAll (1L << 0)
#define MwmDecorBorder (1L << 1)
#define MwmDecorHandle (1L << 2)
#define MwmDecorTitle (1L << 3)
#define MwmDecorMenu (1L << 4)
#define MwmDecorMinimize (1L << 5)
#define MwmDecorMaximize (1L << 6)
/*
This structure only contains 3 elements. The Motif 2.0 structure contains 5,
but we only need the first 3, so that is all we will define
This structure represents xcb_get_property()'s view of the property as a
sequence of ints, rather than XGetWindowProperty()'s view of the property as a
sequence of arch-dependent longs.
*/
typedef struct MwmHints {
unsigned int flags, functions, decorations;
} MwmHints;
#define PropMwmHintsElements 3
void
winSendMessageToWM(void *pWMInfo, winWMMessagePtr msg);
Bool
winInitWM(void **ppWMInfo,
pthread_t * ptWMProc,
pthread_t * ptXMsgProc,
pthread_mutex_t * ppmServerStarted,
int dwScreen, HWND hwndScreen, Bool compositeWM);
void
winDeinitMultiWindowWM(void);
void
winPropertyStoreInit(void);
void
winPropertyStoreDestroy(void);
void
winSetAppUserModelID(HWND hWnd, const char *AppID);
void
winShowWindowOnTaskbar(HWND hWnd, Bool show);
#endif
|
5ddf88b1140ae7d54bf04777b66ab2073c7cfa8f
|
e9b2c1f687bb9f34732d7eb2bc784a75705a371e
|
/server/exports.c
|
7fb150f76a7a04f4642df1f9dab4c05812080663
|
[
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
libguestfs/nbdkit
|
30bf70eb29843805597a6bbe5b56cc024bfedead
|
45b72f5bd8fc1b475fa130d06c86cd877bf595d5
|
refs/heads/master
| 2023-09-02T12:48:33.201066
| 2023-03-10T09:59:15
| 2023-03-10T10:08:50
| 10,839,800
| 209
| 45
|
NOASSERTION
| 2021-01-24T00:25:00
| 2013-06-21T09:43:21
|
C
|
UTF-8
|
C
| false
| false
| 4,405
|
c
|
exports.c
|
/* nbdkit
* Copyright Red Hat
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of Red Hat nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <config.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include "vector.h"
#include "internal.h"
/* Cap nr_exports to avoid sending over-large replies to the client,
* and to avoid a plugin with large list consuming too much memory.
*/
#define MAX_EXPORTS 10000
/* Appendable list of exports. */
DEFINE_VECTOR_TYPE (exports, struct nbdkit_export);
struct nbdkit_exports {
exports exports;
bool use_default;
};
NBDKIT_DLL_PUBLIC struct nbdkit_exports *
nbdkit_exports_new (void)
{
struct nbdkit_exports *r;
r = malloc (sizeof *r);
if (r == NULL) {
nbdkit_error ("nbdkit_exports_new: malloc: %m");
return NULL;
}
r->exports = (exports) empty_vector;
r->use_default = false;
return r;
}
static void
nbdkit_export_clear (struct nbdkit_export exp)
{
free (exp.name);
free (exp.description);
}
NBDKIT_DLL_PUBLIC void
nbdkit_exports_free (struct nbdkit_exports *exps)
{
if (exps) {
exports_iter (&exps->exports, nbdkit_export_clear);
free (exps->exports.ptr);
free (exps);
}
}
NBDKIT_DLL_PUBLIC size_t
nbdkit_exports_count (const struct nbdkit_exports *exps)
{
return exps->exports.len;
}
NBDKIT_DLL_PUBLIC const struct nbdkit_export
nbdkit_get_export (const struct nbdkit_exports *exps, size_t i)
{
assert (i < exps->exports.len);
return exps->exports.ptr[i];
}
NBDKIT_DLL_PUBLIC int
nbdkit_add_export (struct nbdkit_exports *exps,
const char *name, const char *description)
{
struct nbdkit_export e = { NULL, NULL };
if (exps->exports.len == MAX_EXPORTS) {
nbdkit_error ("nbdkit_add_export: too many exports");
errno = EINVAL;
return -1;
}
if (strlen (name) > NBD_MAX_STRING ||
(description && strlen (description) > NBD_MAX_STRING)) {
nbdkit_error ("nbdkit_add_export: string too long");
errno = EINVAL;
return -1;
}
e.name = strdup (name);
if (e.name == NULL) {
nbdkit_error ("nbdkit_add_export: strdup: %m");
return -1;
}
if (description) {
e.description = strdup (description);
if (e.description == NULL) {
nbdkit_error ("nbdkit_add_export: strdup: %m");
free (e.name);
errno = ENOMEM;
return -1;
}
}
if (exports_append (&exps->exports, e) == -1) {
nbdkit_error ("nbdkit_add_export: realloc: %m");
free (e.name);
free (e.description);
errno = ENOMEM;
return -1;
}
return 0;
}
NBDKIT_DLL_PUBLIC int
nbdkit_use_default_export (struct nbdkit_exports *exps)
{
exps->use_default = true;
return 0;
}
int
exports_resolve_default (struct nbdkit_exports *exps, struct backend *b,
int readonly)
{
const char *def = NULL;
if (exps->use_default) {
def = backend_default_export (b, readonly);
exps->use_default = false;
}
if (def)
return nbdkit_add_export (exps, def, NULL);
return 0;
}
|
8385a4e6718197ee832e33c80e136de849e0a2fe
|
f3eed0234b4d0ad2bbb2abd700cf1e2c7a0e8a1d
|
/AKWF-c/AKWF_0009/AKWF_0834.h
|
94d0c50b775478cd7e190ca56041901f0f5b6aee
|
[
"CC0-1.0"
] |
permissive
|
KristofferKarlAxelEkstrand/AKWF-FREE
|
b2defa1a2d389d309be6dd2e9f968923daf80d1b
|
cf8171df36e9fec25416b5f568b72a6e2cb69194
|
refs/heads/master
| 2023-07-23T18:22:36.939705
| 2023-07-10T17:14:40
| 2023-07-10T17:14:40
| 145,817,187
| 359
| 59
|
CC0-1.0
| 2023-07-10T17:14:41
| 2018-08-23T07:26:56
| null |
UTF-8
|
C
| false
| false
| 4,672
|
h
|
AKWF_0834.h
|
/* Adventure Kid Waveforms (AKWF) converted for use with Teensy Audio Library
*
* Adventure Kid Waveforms(AKWF) Open waveforms library
* https://www.adventurekid.se/akrt/waveforms/adventure-kid-waveforms/
*
* This code is in the public domain, CC0 1.0 Universal (CC0 1.0)
* https://creativecommons.org/publicdomain/zero/1.0/
*
* Converted by Brad Roy, https://github.com/prosper00
*/
/* AKWF_0834 256 samples
+-----------------------------------------------------------------------------------------------------------------+
| **** **** |
| *** *** |
| *** *** ***** |
| *** *** ** ** |
| *** *** * ** |
| ** ** * *** |
|** *** ** ** |
|* ** ** ** *|
| ** ** *** ***|
| *** * **** **** |
| ** ** ******** |
| *** ** |
| *** ** |
| *** *** |
| **** **** |
+-----------------------------------------------------------------------------------------------------------------+
*/
const uint16_t AKWF_0834 [] = {
32885, 33792, 34830, 35848, 36899, 37936, 38999, 40046, 41111, 42156, 43211, 44247, 45287, 46303, 47316, 48307,
49289, 50245, 51190, 52107, 53006, 53877, 54727, 55548, 56343, 57109, 57845, 58552, 59227, 59872, 60481, 61059,
61600, 62109, 62579, 63017, 63415, 63779, 64103, 64390, 64637, 64848, 65018, 65148, 65238, 65289, 65299, 65268,
65199, 65086, 64932, 64737, 64503, 64226, 63907, 63548, 63147, 62705, 62222, 61699, 61135, 60530, 59886, 59203,
58479, 57719, 56919, 56084, 55214, 54313, 53381, 52421, 51436, 50426, 49393, 48341, 47271, 46183, 45083, 43969,
42845, 41712, 40570, 39425, 38275, 37123, 35971, 34820, 33670, 32527, 31388, 30256, 29132, 28018, 26914, 25822,
24743, 23678, 22628, 21593, 20577, 19577, 18597, 17636, 16695, 15774, 14877, 14000, 13146, 12315, 11508, 10727,
9968, 9235, 8529, 7847, 7193, 6565, 5963, 5389, 4843, 4324, 3834, 3370, 2938, 2533, 2157, 1811,
1494, 1206, 950, 723, 527, 361, 226, 123, 50, 11, 1, 26, 82, 171, 291, 445,
633, 854, 1108, 1396, 1718, 2075, 2466, 2890, 3350, 3844, 4374, 4935, 5535, 6166, 6836, 7535,
8275, 9042, 9854, 10687, 11567, 12466, 13415, 14375, 15397, 16406, 17730, 19969, 22595, 25303, 28020, 30671,
33234, 35668, 37975, 40123, 42120, 43943, 45604, 47083, 48393, 49520, 50478, 51256, 51866, 52307, 52584, 52700,
52666, 52484, 52162, 51708, 51130, 50445, 49661, 48795, 47855, 46856, 45804, 44712, 43586, 42438, 41273, 40100,
38925, 37756, 36596, 35452, 34327, 33228, 32158, 31120, 30119, 29154, 28233, 27355, 26524, 25740, 25007, 24324,
23696, 23120, 22603, 22138, 21735, 21386, 21099, 20868, 20697, 20585, 20533, 20538, 20604, 20729, 20909, 21152,
21446, 21801, 22206, 22672, 23184, 23757, 24368, 25042, 25747, 26516, 27307, 28157, 29019, 29939, 30855, 31844,
};
|
a5a4098321ef217627fe6ee824263c1719a96671
|
b0f08154e3eebc7d8465efc57597e52d08d69c18
|
/src/broker/broker_msg.h
|
09bb522c935477951315659d083e510ad7cef00c
|
[
"BSD-3-Clause",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
CUBRID/cubrid
|
8f71a0010243b72e43ba887d229210650f4e901e
|
3b952af33230839a1b561a78ecd4b773374b66f8
|
refs/heads/develop
| 2023-08-18T19:16:30.987583
| 2023-08-18T08:18:05
| 2023-08-18T08:18:05
| 52,080,367
| 287
| 294
|
NOASSERTION
| 2023-09-14T21:29:09
| 2016-02-19T10:25:32
|
C
|
UTF-8
|
C
| false
| false
| 2,095
|
h
|
broker_msg.h
|
/*
* Copyright 2008 Search Solution Corporation
* Copyright 2016 CUBRID Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/*
* broker_msg.h - Dispatcher Interface Header File
* This file contains exported stuffs from Dispatcher
*/
#ifndef _BROKER_MSG_H_
#define _BROKER_MSG_H_
#ident "$Id$"
/* We use the following length to store any identifiers in the
* implementation. The identifiers include application_name, path_name,
* a line in the UniWeb application registry and so forth.
* Note that, however, we DO NOT ensure that the length is enough for each
* given identifier in the implementation. If too long identifier is given,
* the behavior is undefined. We just recommend to increase the following
* value in that case.
*/
#define UW_MAX_LENGTH 1024
/* the magic string for UniWeb socket */
#ifdef _EDU_
#define UW_SOCKET_MAGIC "UW4.0EDU"
#else
#define UW_SOCKET_MAGIC "V3RQ4.0"
#endif
#define V3_HEADER_OK_COMPRESS "V3_OK_COMP"
#define V3_HEADER_OK "V3_OK"
#define V3_HEADER_ERR "V3_ERR"
#define V3_RESPONSE_HEADER_SIZE 16
/* PRE_SEND_DATA_SIZE = PRE_SEND_SCRIPT_SIZE + PRE_SEND_PRG_NAME_SIZE */
#ifdef _EDU_
#define PRE_SEND_DATA_SIZE 114
#else
#define PRE_SEND_DATA_SIZE 66
#endif
#define PRE_SEND_SCRIPT_SIZE 30
#define PRE_SEND_PRG_NAME_SIZE 20
#define PRE_SEND_SESSION_ID_SIZE 16
#ifdef _EDU_
#define PRE_SEND_KEY_SIZE 48
#define PRE_SEND_KEY_OFFSET \
(PRE_SEND_SCRIPT_SIZE + PRE_SEND_PRG_NAME_SIZE + PRE_SEND_SESSION_ID_SIZE)
#endif
#endif /* _BROKER_MSG_H_ */
|
05ed05d5e13e644843bb8870f6208404e58e8214
|
b6acd6eed2b8946c1c1e19fa30081cbab0a2954f
|
/starry_fmu/RTOS/components/gui/src/image_png.c
|
9797d874884cdb5218a5d68698af34dbc37ebfa4
|
[
"BSD-3-Clause"
] |
permissive
|
JcZou/StarryPilot
|
7ce1ed454f133ccd30d71916811e2bf23196d2eb
|
97af0338a54e1eeece877c72222aeaf4b7e80ad7
|
refs/heads/master
| 2023-03-12T19:10:17.225314
| 2021-11-27T19:44:26
| 2021-11-27T19:44:26
| 137,048,745
| 304
| 172
|
BSD-3-Clause
| 2020-08-26T07:34:49
| 2018-06-12T09:27:59
|
C
|
UTF-8
|
C
| false
| false
| 19,122
|
c
|
image_png.c
|
#include <rtthread.h>
#include <rtgui/rtgui_system.h>
#include <rtgui/blit.h>
#include <rtgui/driver.h>
#ifdef RTGUI_IMAGE_PNG
#include "png.h"
#include <rtgui/image_png.h>
#define PNG_MAGIC_LEN 8
struct rtgui_image_png
{
rt_bool_t is_loaded;
struct rtgui_filerw *filerw;
/* png image information */
png_structp png_ptr;
png_infop info_ptr;
rt_uint8_t *pixels;
};
static rt_bool_t rtgui_image_png_check(struct rtgui_filerw *file);
static rt_bool_t rtgui_image_png_load(struct rtgui_image *image, struct rtgui_filerw *file, rt_bool_t load);
static void rtgui_image_png_unload(struct rtgui_image *image);
static void rtgui_image_png_blit(struct rtgui_image *image, struct rtgui_dc *dc, struct rtgui_rect *rect);
struct rtgui_image_engine rtgui_image_png_engine =
{
"png",
{ RT_NULL },
rtgui_image_png_check,
rtgui_image_png_load,
rtgui_image_png_unload,
rtgui_image_png_blit,
};
static void rtgui_image_png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
struct rtgui_filerw *filerw = (struct rtgui_filerw *)png_ptr->io_ptr;
rtgui_filerw_read(filerw, data, length, 1);
}
static rt_bool_t rtgui_image_png_process(png_structp png_ptr, png_infop info_ptr, struct rtgui_image_png *png)
{
rt_uint32_t x, y;
png_bytep row;
png_bytep data;
rtgui_color_t *ptr;
row = (png_bytep) rtgui_malloc(png_get_rowbytes(png_ptr, info_ptr));
if (row == RT_NULL) return RT_FALSE;
ptr = (rtgui_color_t *)png->pixels;
switch (info_ptr->color_type)
{
case PNG_COLOR_TYPE_RGB:
for (y = 0; y < info_ptr->height; y++)
{
png_read_row(png_ptr, row, png_bytep_NULL);
for (x = 0; x < info_ptr->width; x++)
{
data = &(row[x * 3]);
ptr[x + y * info_ptr->width] = RTGUI_RGB(data[0], data[1], data[2]);
}
}
break;
case PNG_COLOR_TYPE_RGBA:
for (y = 0; y < info_ptr->height; y++)
{
png_read_row(png_ptr, row, png_bytep_NULL);
for (x = 0; x < info_ptr->width; x++)
{
data = &(row[x * 4]);
ptr[x + y * info_ptr->width] = RTGUI_ARGB(data[3], data[0], data[1], data[2]);
}
}
break;
case PNG_COLOR_TYPE_PALETTE:
for (y = 0; y < info_ptr->height; y++)
{
png_read_row(png_ptr, row, png_bytep_NULL);
for (x = 0; x < info_ptr->width; x++)
{
data = &(row[x]);
ptr[x] = RTGUI_ARGB(0, info_ptr->palette[data[0]].red,
info_ptr->palette[data[0]].green,
info_ptr->palette[data[0]].blue);
}
}
default:
break;
};
rtgui_free(row);
return RT_TRUE;
}
static rt_bool_t rtgui_image_png_check(struct rtgui_filerw *file)
{
int start;
rt_bool_t is_PNG;
rt_uint8_t magic[4];
if (!file) return 0;
start = rtgui_filerw_tell(file);
/* move to the begining of file */
rtgui_filerw_seek(file, 0, SEEK_SET);
is_PNG = RT_FALSE;
if (rtgui_filerw_read(file, magic, 1, sizeof(magic)) == sizeof(magic))
{
if (magic[0] == 0x89 &&
magic[1] == 'P' &&
magic[2] == 'N' &&
magic[3] == 'G')
{
is_PNG = RT_TRUE;
}
}
rtgui_filerw_seek(file, start, SEEK_SET);
return(is_PNG);
}
static void _image_png_error_fn(png_structp png_ptr, png_const_charp error_message)
{
rt_kprintf(error_message);
}
static rt_bool_t rtgui_image_png_load(struct rtgui_image *image, struct rtgui_filerw *file, rt_bool_t load)
{
png_uint_32 width;
png_uint_32 height;
int bit_depth;
int color_type;
double gamma;
struct rtgui_image_png *png;
png = (struct rtgui_image_png *) rtgui_malloc(sizeof(struct rtgui_image_png));
png->png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (png->png_ptr == RT_NULL)
{
rtgui_free(png);
return RT_FALSE;
}
png_set_error_fn(png->png_ptr, RT_NULL, _image_png_error_fn, _image_png_error_fn);
png->info_ptr = png_create_info_struct(png->png_ptr);
if (png->info_ptr == RT_NULL)
{
png_destroy_read_struct(&png->png_ptr, NULL, NULL);
rtgui_free(png);
return RT_FALSE;
}
png->filerw = file;
png->is_loaded = RT_FALSE;
png_set_read_fn(png->png_ptr, png->filerw, rtgui_image_png_read_data);
png_read_info(png->png_ptr, png->info_ptr);
png_get_IHDR(png->png_ptr, png->info_ptr, &width, &height, &bit_depth,
&color_type, NULL, NULL, NULL);
/* set image information */
image->w = width;
image->h = height;
image->engine = &rtgui_image_png_engine;
image->data = png;
if (bit_depth == 16)
png_set_strip_16(png->png_ptr);
if (color_type == PNG_COLOR_TYPE_PALETTE)
png_set_expand(png->png_ptr);
if (bit_depth < 8)
png_set_expand(png->png_ptr);
if (png_get_valid(png->png_ptr, png->info_ptr, PNG_INFO_tRNS))
png_set_expand(png->png_ptr);
if (color_type == PNG_COLOR_TYPE_GRAY ||
color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
png_set_gray_to_rgb(png->png_ptr);
/* Ignore background color */
/* set gamma conversion */
if (png_get_gAMA(png->png_ptr, png->info_ptr, &gamma))
png_set_gamma(png->png_ptr, (double)2.2, gamma);
png_read_update_info(png->png_ptr, png->info_ptr);
if (load == RT_TRUE)
{
/* load all pixels */
png->pixels = rtgui_malloc(image->w * image->h * sizeof(rtgui_color_t));
if (png->pixels == RT_NULL)
{
png_read_end(png->png_ptr, RT_NULL);
/* destroy png struct */
png_destroy_info_struct(png->png_ptr, &png->info_ptr);
png_destroy_read_struct(&png->png_ptr, RT_NULL, RT_NULL);
/* release data */
rtgui_free(png);
return RT_FALSE;
}
rtgui_image_png_process(png->png_ptr, png->info_ptr, png);
png_read_end(png->png_ptr, RT_NULL);
png->is_loaded = RT_TRUE;
/* close file handler */
rtgui_filerw_close(png->filerw);
png->filerw = RT_NULL;
}
else
{
png->pixels = RT_NULL;
}
return RT_TRUE;
}
static void rtgui_image_png_unload(struct rtgui_image *image)
{
struct rtgui_image_png *png;
if (image != RT_NULL)
{
png = (struct rtgui_image_png *) image->data;
/* destroy png struct */
png_destroy_info_struct(png->png_ptr, &png->info_ptr);
png_destroy_read_struct(&png->png_ptr, RT_NULL, RT_NULL);
if (png->pixels != RT_NULL) rtgui_free(png->pixels);
/* release data */
rtgui_free(png);
}
}
static void rtgui_image_png_blit(struct rtgui_image *image, struct rtgui_dc *dc, struct rtgui_rect *rect)
{
rt_uint16_t x, y, w, h;
rtgui_color_t *ptr;
struct rtgui_image_png *png;
int fg_maxsample;
int ialpha;
float alpha;
rtgui_color_t color;
rtgui_color_t c, bgcolor;
int fc[3], bc[3];
struct rtgui_graphic_driver *hwdev = rtgui_graphic_get_device();
RT_ASSERT(image != RT_NULL && dc != RT_NULL && rect != RT_NULL);
RT_ASSERT(image->data != RT_NULL);
png = (struct rtgui_image_png *) image->data;
w = _UI_MIN(image->w, rtgui_rect_width(*rect));
h = _UI_MIN(image->h, rtgui_rect_height(*rect));
fg_maxsample = (1 << png->info_ptr->bit_depth) - 1;
if (png->pixels != RT_NULL)
{
ptr = (rtgui_color_t *)png->pixels;
bgcolor = RTGUI_DC_BC(dc);
bc[0] = RTGUI_RGB_R(bgcolor);
bc[1] = RTGUI_RGB_G(bgcolor);
bc[2] = RTGUI_RGB_B(bgcolor);
/* draw each point within dc */
for (y = 0; y < h; y ++)
{
for (x = 0; x < w; x++)
{
c = *ptr;
ialpha = RTGUI_RGB_A(c);
if (ialpha == 0)
{
/*
* Foreground image is transparent hear.
* If the background image is already in the frame
* buffer, there is nothing to do.
*/
}
else if (ialpha == fg_maxsample)
{
/*
* Copy foreground pixel to frame buffer.
*/
rtgui_dc_draw_color_point(dc, x + rect->x1, y + rect->y1, c);
}
else
{
/* output = alpha * foreground + (1-alpha) * background */
/*
* Compositing is necessary.
* Get floating-point alpha and its complement.
* Note: alpha is always linear: gamma does not
* affect it.
*/
fc[0] = RTGUI_RGB_R(c);
fc[1] = RTGUI_RGB_G(c);
fc[2] = RTGUI_RGB_B(c);
alpha = (float) ialpha / fg_maxsample;
color = RTGUI_RGB((rt_uint8_t)(fc[0] * alpha + bc[0] * (1 - alpha)),
(rt_uint8_t)(fc[1] * alpha + bc[1] * (1 - alpha)),
(rt_uint8_t)(fc[2] * alpha + bc[2] * (1 - alpha)));
rtgui_dc_draw_color_point(dc, x + rect->x1, y + rect->y1, color);
}
/* move to next color buffer */
ptr ++;
}
}
}
else
{
png_bytep row;
png_bytep data;
row = (png_bytep) rtgui_malloc(png_get_rowbytes(png->png_ptr, png->info_ptr));
if (row == RT_NULL) return ;
switch (png->info_ptr->color_type)
{
case PNG_COLOR_TYPE_RGB:
for (y = 0; y < h; y++)
{
png_read_row(png->png_ptr, row, png_bytep_NULL);
for (x = 0; x < w; x++)
{
data = &(row[x * 3]);
rtgui_dc_draw_color_point(dc, x + rect->x1, y + rect->y1,
RTGUI_RGB(data[0], data[1], data[2]));
}
}
break;
case PNG_COLOR_TYPE_RGBA:
for (y = 0; y < h; y++)
{
png_read_row(png->png_ptr, row, png_bytep_NULL);
for (x = 0; x < w; x++)
{
data = &(row[x * 4]);
if (data[3] != 0)
{
rtgui_dc_draw_color_point(dc, x + rect->x1, y + rect->y1,
RTGUI_ARGB(data[3], data[0], data[1], data[2]));
}
}
}
break;
case PNG_COLOR_TYPE_PALETTE:
for (y = 0; y < h; y++)
{
png_read_row(png->png_ptr, row, png_bytep_NULL);
for (x = 0; x < w; x++)
{
data = &(row[x]);
rtgui_dc_draw_color_point(dc, x + rect->x1, y + rect->y1,
RTGUI_ARGB(0, png->info_ptr->palette[data[0]].red,
png->info_ptr->palette[data[0]].green,
png->info_ptr->palette[data[0]].blue));
}
}
default:
break;
};
rtgui_free(row);
}
}
void rtgui_image_png_init()
{
/* register png on image system */
rtgui_image_register_engine(&rtgui_image_png_engine);
}
#elif defined(RTGUI_IMAGE_LODEPNG)
#include "lodepng.h"
#include <rtgui/image_png.h>
static rt_bool_t rtgui_image_png_check(struct rtgui_filerw *file);
static rt_bool_t rtgui_image_png_load(struct rtgui_image *image, struct rtgui_filerw *file, rt_bool_t load);
static void rtgui_image_png_unload(struct rtgui_image *image);
static void rtgui_image_png_blit(struct rtgui_image *image, struct rtgui_dc *dc, struct rtgui_rect *rect);
struct rtgui_image_engine rtgui_image_png_engine =
{
"png",
{ RT_NULL },
rtgui_image_png_check,
rtgui_image_png_load,
rtgui_image_png_unload,
rtgui_image_png_blit,
};
static rt_bool_t rtgui_image_png_check(struct rtgui_filerw *file)
{
int start;
rt_bool_t is_PNG;
rt_uint8_t magic[4];
if (!file) return 0;
start = rtgui_filerw_tell(file);
/* move to the begining of file */
rtgui_filerw_seek(file, 0, SEEK_SET);
is_PNG = RT_FALSE;
if (rtgui_filerw_read(file, magic, 1, sizeof(magic)) == sizeof(magic))
{
if (magic[0] == 0x89 &&
magic[1] == 'P' &&
magic[2] == 'N' &&
magic[3] == 'G')
{
is_PNG = RT_TRUE;
}
}
rtgui_filerw_seek(file, start, SEEK_SET);
return(is_PNG);
}
static rt_bool_t rtgui_image_png_load(struct rtgui_image *image, struct rtgui_filerw *file, rt_bool_t load)
{
unsigned int width;
unsigned int height;
unsigned int error;
rt_uint8_t* pixel;
rt_uint8_t* in;
rt_uint32_t in_size;
RT_ASSERT(image != RT_NULL);
RT_ASSERT(file != RT_NULL);
rtgui_filerw_seek(file, 0, SEEK_END);
in_size = rtgui_filerw_tell(file);
in = rtgui_malloc(in_size);
if (in == RT_NULL) return RT_FALSE; /* out of memory */
rtgui_filerw_seek(file, 0, SEEK_SET);
rtgui_filerw_read(file, in, in_size, 1);
error = lodepng_decode32(&pixel, &width, &height, in, in_size);
if(error)
{
rt_kprintf("error %u: %s\n", error, lodepng_error_text(error));
rtgui_free(in);
return RT_FALSE;
}
rtgui_free(in);
/* set image information */
image->w = width;
image->h = height;
image->engine = &rtgui_image_png_engine;
image->data = pixel;
/* NOTE: the pixel format of PNG is ABGR888, bit0 R,G,B,A bit31 */
/* convert pixel to ARGB888, swap B/G */
{
rt_uint8_t* pixel_ptr;
rt_uint8_t* pixel_end;
pixel_ptr = (rt_uint8_t*) pixel;
pixel_end = pixel_ptr + width * height * 4;
while (pixel_ptr < pixel_end)
{
pixel_ptr[0] = pixel_ptr[0] ^ pixel_ptr[2];
pixel_ptr[2] = pixel_ptr[0] ^ pixel_ptr[2];
pixel_ptr[0] = pixel_ptr[0] ^ pixel_ptr[2];
pixel_ptr += 4;
}
}
/* close file handler */
rtgui_filerw_close(file);
return RT_TRUE;
}
static void rtgui_image_png_unload(struct rtgui_image *image)
{
rt_uint8_t *pixels;
if (image != RT_NULL)
{
pixels = (rt_uint8_t*) image->data;
/* release data */
rtgui_free(pixels);
}
}
static void rtgui_image_png_blit(struct rtgui_image *image, struct rtgui_dc *dc, struct rtgui_rect *rect)
{
int x, y;
int w, h;
struct rtgui_blit_info info;
struct rtgui_graphic_driver *hw_driver = rtgui_graphic_driver_get_default();
RT_ASSERT(image != RT_NULL && dc != RT_NULL && rect != RT_NULL);
RT_ASSERT(image->data != RT_NULL);
#define blending(s, d, a) (((unsigned)(((s) - (d)) * (a)) >> 8) + (d))
/* this dc is not visible */
if (rtgui_dc_get_visible(dc) != RT_TRUE) return;
w = _UI_MIN(image->w, rtgui_rect_width(*rect));
h = _UI_MIN(image->h, rtgui_rect_height(*rect));
/* border checking */
if (rect->x1 < 0) { x = -rect->x1; w += rect->x1; }
else x = 0;
if (rect->y1 < 0) { y = -rect->y1; h += rect->y1; }
else y = 0;
if (w < 0 || h < 0) return; /* no drawing */
if ((dc->type == RTGUI_DC_CLIENT) || (dc->type == RTGUI_DC_HW && hw_driver->framebuffer == RT_NULL))
{
int dx, dy, start_x;
rtgui_rect_t r;
rtgui_color_t *pixel;
rt_uint8_t alpha;
rtgui_widget_t *owner = RT_NULL;
if (dc->type == RTGUI_DC_CLIENT)
{
/* get owner and calculate dx,dy */
owner = RTGUI_CONTAINER_OF(dc, struct rtgui_widget, dc_type);
dx = owner->extent.x1; dy = owner->extent.y1;
}
else
{
/* hardware DC */
struct rtgui_dc_hw *hw = (struct rtgui_dc_hw *) dc;
dx = hw->owner->extent.x1;
dy = hw->owner->extent.y1;
}
start_x = x;
for (; y < rect->y1 + h; ++y)
{
for (x = start_x; x < rect->x1 + w; ++x)
{
pixel = (rtgui_color_t*)((rt_uint8_t*)image->data + (y - rect->y1) * image->w * 4 +
(x - rect->x1) * 4);
alpha = RTGUI_RGB_A(*pixel);
if (alpha == 0) continue;
if (alpha == 0xff)
{
rtgui_dc_draw_color_point(dc, x, y, *pixel);
}
else
{
rtgui_color_t bc, fc;
/* draw an alpha blending point */
if (hw_driver->framebuffer != RT_NULL)
rtgui_dc_blend_point(dc, x, y, RTGUI_BLENDMODE_BLEND,
RTGUI_RGB_R(*pixel), RTGUI_RGB_G(*pixel), RTGUI_RGB_B(*pixel), RTGUI_RGB_A(*pixel));
else
{
x = x + dx;
y = y + dy;
if (dc->type == RTGUI_DC_CLIENT)
{
if (rtgui_region_contains_point(&(owner->clip), x, y, &r) != RT_EOK)
continue ;
}
/* get background pixel */
hw_driver->ops->get_pixel(&bc, x, y);
/* alpha blending */
fc = RTGUI_RGB(blending(RTGUI_RGB_R(bc), RTGUI_RGB_R(*pixel), alpha),
blending(RTGUI_RGB_G(bc), RTGUI_RGB_G(*pixel), alpha),
blending(RTGUI_RGB_B(bc), RTGUI_RGB_B(*pixel), alpha));
hw_driver->ops->set_pixel(&fc, x, y);
}
}
}
}
}
else
{
int dst_x, dst_y;
info.a = 0;
/* initialize source blit information */
info.src_fmt = RTGRAPHIC_PIXEL_FORMAT_ARGB888;;
info.src_h = h;
info.src_w = w;
info.src_pitch = image->w * rtgui_color_get_bpp(RTGRAPHIC_PIXEL_FORMAT_ARGB888);
info.src_skip = info.src_pitch - w * rtgui_color_get_bpp(RTGRAPHIC_PIXEL_FORMAT_ARGB888);
info.src = (rt_uint8_t *)image->data + y * info.src_pitch + x * rtgui_color_get_bpp(RTGRAPHIC_PIXEL_FORMAT_ARGB888);
if (rect->x1 < 0) dst_x = 0;
else dst_x = rect->x1;
if (rect->y1 < 0) dst_y = 0;
else dst_y = rect->y1;
/* initialize destination blit information */
if (dc->type == RTGUI_DC_BUFFER)
{
struct rtgui_dc_buffer *buffer;
buffer = (struct rtgui_dc_buffer*)dc;
info.dst = rtgui_dc_buffer_get_pixel(RTGUI_DC(buffer)) + dst_y * buffer->pitch +
dst_x * rtgui_color_get_bpp(buffer->pixel_format);
info.dst_h = h;
info.dst_w = w;
info.dst_fmt = buffer->pixel_format;
info.dst_pitch = buffer->pitch;
info.dst_skip = info.dst_pitch - info.dst_w * rtgui_color_get_bpp(buffer->pixel_format);
}
else if (dc->type == RTGUI_DC_HW)
{
struct rtgui_widget *owner;
struct rtgui_rect r;
owner = ((struct rtgui_dc_hw*)dc)->owner;
rtgui_graphic_driver_get_rect(RT_NULL, &r);
/* blit destination */
info.dst = (rt_uint8_t*)hw_driver->framebuffer;
info.dst = info.dst + (owner->extent.y1 + dst_y) * hw_driver->pitch +
(owner->extent.x1 + dst_x) * rtgui_color_get_bpp(hw_driver->pixel_format);
info.dst_fmt = hw_driver->pixel_format;
info.dst_h = h;
info.dst_w = w;
info.dst_pitch = hw_driver->pitch;
info.dst_skip = info.dst_pitch - info.dst_w * rtgui_color_get_bpp(hw_driver->pixel_format);
}
rtgui_blit(&info);
}
}
void rtgui_image_png_init()
{
/* register png on image system */
rtgui_image_register_engine(&rtgui_image_png_engine);
}
#endif
|
4b07aa897bbcbef7533f24d85c0ea08757c7cd81
|
a11e4bdd6157b22067288d860507fa20abea033d
|
/src/bin/e_eap_editor.c
|
e8f02031fb353a8548504883a62243544805eef3
|
[
"BSD-2-Clause"
] |
permissive
|
JeffHoogland/moksha
|
85a0f39dc97daa61d35e64a511013d21552db288
|
c56013644d8cd8e32101bb38a8d1e4ebd9d47f37
|
refs/heads/master
| 2023-08-24T05:39:13.415948
| 2023-08-22T19:49:32
| 2023-08-22T19:49:32
| 34,704,822
| 179
| 51
|
NOASSERTION
| 2023-09-06T14:41:31
| 2015-04-28T02:59:19
|
C
|
UTF-8
|
C
| false
| false
| 34,425
|
c
|
e_eap_editor.c
|
#include "e.h"
struct _E_Config_Dialog_Data
{
Efreet_Desktop *desktop;
int type; /* desktop type */
char *name; /* app name (e.g. Firefox) */
char *generic_name; /* generic app name (e.g. Web Browser) */
char *comment; /* a longer description */
char *exec; /* command to execute */
char *try_exec; /* executable to test for an apps existence */
char *url; /* url to open */
char *startup_wm_class; /* window class */
char *categories; /* list of category names that app is in */
char *mimes; /* list of mimes this app can handle */
char *icon; /* absolute path to file or icon name */
int startup_notify;
int terminal;
int show_in_menus;
E_Desktop_Edit *editor;
char *orig_path; /* informational only */
Evas_Object *orig_path_entry; /* to set when info changes */
Evas_Object *icon_entry; /* to set when icon changes */
/* speed up check_changed tests */
Eina_Bool changed_categories;
Eina_Bool changed_mimes;
Eina_Bool edited_categories;
Eina_Bool edited_mimes;
};
/* local subsystem functions */
static int _e_desktop_edit_view_create(E_Desktop_Edit *editor, E_Container *con);
static void _e_desktop_edit_free(E_Desktop_Edit *editor);
static void *_e_desktop_edit_create_data(E_Config_Dialog *cfd);
static void _e_desktop_edit_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *data);
static int _e_desktop_edit_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *data);
static int _e_desktop_edit_basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *data);
static Evas_Object *_e_desktop_edit_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *data);
static void _e_desktop_editor_cb_icon_select(void *data1, void *data2);
static void _e_desktop_edit_cb_icon_select_destroy(void *obj);
static void _e_desktop_edit_cb_icon_select_ok(void *data, E_Dialog *dia);
static void _e_desktop_edit_cb_icon_select_cancel(void *data, E_Dialog *dia);
static void _e_desktop_editor_icon_update(E_Config_Dialog_Data *cfdata);
static void _e_desktop_editor_cb_exec_select(void *data1, void *data2);
static void _e_desktop_edit_cb_exec_select_destroy(void *obj);
static void _e_desktop_edit_cb_exec_select_ok(void *data, E_Dialog *dia);
static void _e_desktop_edit_cb_exec_select_cancel(void *data, E_Dialog *dia);
static void _e_desktop_editor_exec_update(E_Config_Dialog_Data *cfdata);
static void _e_desktop_edit_select_cb(void *data, Evas_Object *obj);
static void _e_desktop_editor_icon_entry_changed(void *data, Evas_Object *obj);
#define IFADD(src, dst) if (src) dst = eina_stringshare_add(src); else \
dst = NULL
#define IFDEL(src) if (src) eina_stringshare_del(src); src = NULL;
#define IFDUP(src, dst) if (src) dst = strdup(src); else \
dst = NULL
#define IFFREE(src) if (src) free(src); src = NULL;
/* externally accessible functions */
EAPI Efreet_Desktop *
e_desktop_border_create(E_Border *bd)
{
Efreet_Desktop *desktop = NULL;
const char *desktop_dir, *icon_dir;
const char *bname, *bclass, *btitle;
char path[PATH_MAX + PATH_MAX + 2];
bname = bd->client.icccm.name;
if ((bname) && (bname[0] == 0)) bname = NULL;
bclass = bd->client.icccm.class;
if ((bclass) && (bclass[0] == 0)) bclass = NULL;
btitle = e_border_name_get(bd);
desktop_dir = e_user_desktop_dir_get();
if ((!desktop_dir) || (!e_util_dir_check(desktop_dir))) return NULL;
icon_dir = e_user_icon_dir_get();
if ((!icon_dir) || (!e_util_dir_check(icon_dir))) return NULL;
if (bname)
{
snprintf(path, sizeof(path), "%s/%s.desktop", desktop_dir, bname);
desktop = efreet_desktop_empty_new(path);
}
else
{
int i;
for (i = 1; i < 65536; i++)
{
snprintf(path, sizeof(path), "%s/_new_app-%i.desktop",
desktop_dir, i);
if (!ecore_file_exists(path))
{
desktop = efreet_desktop_empty_new(path);
break;
}
}
if (!desktop)
{
snprintf(path, sizeof(path), "%s/_rename_me-%i.desktop",
desktop_dir, (int)ecore_time_get());
desktop = efreet_desktop_empty_new(NULL);
}
}
if (!desktop)
{
//XXX out of memory?
return NULL;
}
if (bclass) desktop->name = strdup(bclass);
else if (bname)
desktop->name = strdup(bname);
else if (btitle)
desktop->name = strdup(btitle);
if (btitle) desktop->comment = strdup(btitle);
if (bclass) desktop->startup_wm_class = strdup(bclass);
if (bd->client.icccm.command.argc > 0)
// FIXME this should concat the entire argv array together
desktop->exec = strdup(bd->client.icccm.command.argv[0]);
else if (bname)
desktop->exec = strdup(bname);
// disable this
// if (bd->client.netwm.startup_id > 0) desktop->startup_notify = 1;
if (bd->client.netwm.icons)
{
/* FIXME
* - Find the icon with the best size
* - Should use mkstemp
*/
char file[PATH_MAX];
snprintf(file, sizeof(file), "%s-%.6f.png", bname ?: "", ecore_time_get());
snprintf(path, sizeof(path), "%s/%s", icon_dir, file);
if (e_util_icon_save(&(bd->client.netwm.icons[0]), path))
desktop->icon = strdup(file);
else
fprintf(stderr, "Could not save file from ARGB: %s\n", path);
}
return desktop;
}
EAPI E_Desktop_Edit *
e_desktop_border_edit(E_Container *con, E_Border *bd)
{
E_Desktop_Edit *editor;
int new_desktop = 0;
if (!con) return NULL;
editor = E_OBJECT_ALLOC(E_Desktop_Edit, E_DESKTOP_EDIT_TYPE, _e_desktop_edit_free);
if (!editor) return NULL;
if (bd->desktop)
editor->desktop = bd->desktop;
/* the border does not yet have a desktop entry. add one and pre-populate
it with values from the border */
if (!editor->desktop)
{
editor->desktop = e_desktop_border_create(bd);
if ((editor->desktop) && (editor->desktop->icon))
editor->tmp_image_path = strdup(editor->desktop->icon);
new_desktop = 1;
}
#if 0
if ((!bname) && (!bclass))
{
e_util_dialog_show(_("Incomplete Window Properties"),
_("The window you are creating an icon for<br>"
"does not contain window name and class<br>"
"properties. Without these, you will have to<br>"
"use the window title instead. This will only<br>"
"work if the window title is the same at<br>"
"the time the window starts up, and does not<br>"
"change."));
}
#endif
if (!_e_desktop_edit_view_create(editor, con))
{
e_object_del(E_OBJECT(editor));
editor = NULL;
}
else
e_config_dialog_changed_set(editor->cfd, new_desktop);
return editor;
}
EAPI E_Desktop_Edit *
e_desktop_edit(E_Container *con, Efreet_Desktop *desktop)
{
E_Desktop_Edit *editor;
if (!con) return NULL;
editor = E_OBJECT_ALLOC(E_Desktop_Edit, E_DESKTOP_EDIT_TYPE, _e_desktop_edit_free);
if (!editor) return NULL;
if (desktop) editor->desktop = desktop;
if (!_e_desktop_edit_view_create(editor, con))
{
e_object_del(E_OBJECT(editor));
editor = NULL;
}
return editor;
}
static int
_e_desktop_edit_view_create(E_Desktop_Edit *editor, E_Container *con)
{
E_Config_Dialog_View *v;
v = E_NEW(E_Config_Dialog_View, 1);
if (!v) return 0;
/* view methods */
v->create_cfdata = _e_desktop_edit_create_data;
v->free_cfdata = _e_desktop_edit_free_data;
v->basic.apply_cfdata = _e_desktop_edit_basic_apply_data;
v->basic.create_widgets = _e_desktop_edit_basic_create_widgets;
v->basic.check_changed = _e_desktop_edit_basic_check_changed;
editor->cfd =
e_config_dialog_new(con, _("Desktop Entry Editor"), "E",
"applications/new_application",
"preferences-applications", 0, v, editor);
if (!editor->cfd)
{
E_FREE(v);
return 0;
}
return 1;
}
/* local subsystem functions */
static void
_e_desktop_edit_free(E_Desktop_Edit *editor)
{
if (!editor) return;
E_OBJECT_CHECK(editor);
E_OBJECT_TYPE_CHECK(editor, E_DESKTOP_EDIT_TYPE);
IFFREE(editor->tmp_image_path);
E_FREE(editor);
}
/**
* Populates the config dialog's data from the .desktop file passed in
*/
static void *
_e_desktop_edit_create_data(E_Config_Dialog *cfd)
{
E_Config_Dialog_Data *cfdata;
Efreet_Desktop *desktop = NULL;
char path[PATH_MAX + PATH_MAX + 2];
cfdata = E_NEW(E_Config_Dialog_Data, 1);
if (!cfdata) return NULL;
cfd->dia->win->state.no_reopen = EINA_TRUE;
cfdata->editor = cfd->data;
/*
* If we can't write to the file on it's current location,
* we always save to the user's applications dir.
* If the file is already there, then edit it directly. Otherwise, create
* a new empty desktop entry there.
*
* cfdata->editor->desktop is the the desktop passed in
* cfdata->desktop is the desktop to save
* desktop is the desktop to load
*/
path[0] = '\0';
if (cfdata->editor->desktop)
{
char dir[PATH_MAX];
const char *file;
if (ecore_file_can_write(cfdata->editor->desktop->orig_path))
cfdata->desktop = efreet_desktop_uncached_new(cfdata->editor->desktop->orig_path);
else
{
snprintf(dir, sizeof(dir), "%s/applications", efreet_data_home_get());
if (!strncmp(dir, cfdata->editor->desktop->orig_path, strlen(dir)))
cfdata->desktop = efreet_desktop_uncached_new(cfdata->editor->desktop->orig_path);
else
{
/* file not in user's dir, so create new desktop that points there */
if (!ecore_file_exists(dir)) ecore_file_mkdir(dir);
file = ecore_file_file_get(cfdata->editor->desktop->orig_path);
snprintf(path, sizeof(path), "%s/%s", dir, file);
/*
* if a file already exists in the user dir with this name, we
* fetch the pointer to it, so the caches stay consistent (this
* probably will never return non null, since the ui shouldn't
* provide a means to edit a file in a system dir when one
* exists in the user's
*/
cfdata->desktop = efreet_desktop_uncached_new(path);
}
}
desktop = cfdata->editor->desktop;
}
if (!cfdata->desktop)
cfdata->desktop = efreet_desktop_empty_new(path);
if (!desktop) desktop = cfdata->desktop;
IFDUP(desktop->name, cfdata->name);
IFDUP(desktop->generic_name, cfdata->generic_name);
IFDUP(desktop->comment, cfdata->comment);
IFDUP(desktop->exec, cfdata->exec);
IFDUP(desktop->try_exec, cfdata->try_exec);
IFDUP(desktop->url, cfdata->url);
IFDUP(desktop->startup_wm_class, cfdata->startup_wm_class);
IFDUP(desktop->orig_path, cfdata->orig_path);
if (desktop->categories)
cfdata->categories = efreet_desktop_string_list_join(desktop->categories);
if (desktop->mime_types)
cfdata->mimes = efreet_desktop_string_list_join(desktop->mime_types);
IFDUP(desktop->icon, cfdata->icon);
cfdata->startup_notify = desktop->startup_notify;
cfdata->terminal = desktop->terminal;
cfdata->show_in_menus = !desktop->no_display;
if (cfdata->exec && *cfdata->exec)
cfdata->type = 0;
else if (cfdata->url && *cfdata->url)
cfdata->type = 1;
return cfdata;
}
/**
* Frees the config dialog data
*/
static void
_e_desktop_edit_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
if (cfdata->editor->tmp_image_path)
{
if ((!cfdata->desktop) || (!cfdata->editor->saved) ||
(!cfdata->desktop->icon) ||
(strcmp(cfdata->editor->tmp_image_path, cfdata->desktop->icon)))
{
ecore_file_unlink(cfdata->editor->tmp_image_path);
}
}
if (cfdata->desktop) efreet_desktop_free(cfdata->desktop);
IFFREE(cfdata->name);
IFFREE(cfdata->generic_name);
IFFREE(cfdata->comment);
IFFREE(cfdata->exec);
IFFREE(cfdata->try_exec);
IFFREE(cfdata->url);
IFFREE(cfdata->startup_wm_class);
IFFREE(cfdata->categories);
IFFREE(cfdata->icon);
IFFREE(cfdata->mimes);
IFFREE(cfdata->orig_path);
if (cfdata->editor->icon_fsel_dia)
e_object_del(E_OBJECT(cfdata->editor->icon_fsel_dia));
e_object_del(E_OBJECT(cfdata->editor));
free(cfdata);
}
static void
_e_desktop_edit_user_local_desktop_filename_generate(E_Config_Dialog_Data *cfdata, char *path)
{
char buf[PATH_MAX];
const char *name;
unsigned int i;
int prefix;
if ((cfdata->name) && (cfdata->name[0]))
name = cfdata->name;
else if ((cfdata->desktop) && (cfdata->desktop->name) &&
(cfdata->desktop->name[0]))
name = cfdata->name;
else
name = NULL;
if (name)
{
const char *s = name;
for (i = 0; i < sizeof(buf) - 1 && s[i]; i++)
{
if (isalnum(s[i]))
buf[i] = s[i];
else
buf[i] = '_';
}
buf[i] = '\0';
}
else
eina_strlcpy(buf, "unnamed_desktop", sizeof(buf));
i = snprintf(path, PATH_MAX, "%s/applications/%s.desktop",
efreet_data_home_get(), buf);
if (i >= PATH_MAX)
{
path[0] = '\0';
return;
}
prefix = i - (sizeof(".desktop") - 1);
for (i = 0; ecore_file_exists(path); i++)
snprintf(path + prefix, PATH_MAX - prefix, "-%u.desktop", i);
}
static void
_e_desktop_edit_update_orig_path(E_Config_Dialog_Data *cfdata)
{
const char *orig_path;
char path[PATH_MAX];
if ((cfdata->desktop->orig_path) && (cfdata->desktop->orig_path[0]))
orig_path = cfdata->desktop->orig_path;
else
{
_e_desktop_edit_user_local_desktop_filename_generate(cfdata, path);
orig_path = cfdata->orig_path = strdup(path);
}
if (cfdata->orig_path_entry)
e_widget_entry_text_set(cfdata->orig_path_entry, orig_path);
}
/**
* Apply the basic config dialog
*/
static int
_e_desktop_edit_basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
char *str;
IFFREE(cfdata->desktop->name);
IFDUP(cfdata->name, cfdata->desktop->name);
IFFREE(cfdata->desktop->comment);
IFDUP(cfdata->comment, cfdata->desktop->comment);
switch (cfdata->type)
{
case 1:
IFFREE(cfdata->desktop->url);
IFDUP(cfdata->url, cfdata->desktop->url);
break;
default:
IFFREE(cfdata->desktop->exec);
IFDUP(cfdata->exec, cfdata->desktop->exec);
IFFREE(cfdata->desktop->try_exec);
IFDUP(cfdata->try_exec, cfdata->desktop->try_exec);
break;
}
IFFREE(cfdata->desktop->generic_name);
IFDUP(cfdata->generic_name, cfdata->desktop->generic_name);
IFFREE(cfdata->desktop->startup_wm_class);
IFDUP(cfdata->startup_wm_class, cfdata->desktop->startup_wm_class);
EINA_LIST_FREE(cfdata->desktop->categories, str)
eina_stringshare_del(str);
cfdata->desktop->categories = efreet_desktop_string_list_parse(cfdata->categories);
EINA_LIST_FREE(cfdata->desktop->mime_types, str)
eina_stringshare_del(str);
cfdata->desktop->mime_types = efreet_desktop_string_list_parse(cfdata->mimes);
IFFREE(cfdata->desktop->icon);
IFDUP(cfdata->icon, cfdata->desktop->icon);
cfdata->desktop->startup_notify = cfdata->startup_notify;
cfdata->desktop->terminal = cfdata->terminal;
cfdata->desktop->no_display = !cfdata->show_in_menus;
if (cfdata->desktop->orig_path && cfdata->desktop->orig_path[0])
cfdata->editor->saved = efreet_desktop_save(cfdata->desktop);
else
{
_e_desktop_edit_update_orig_path(cfdata);
cfdata->editor->saved = efreet_desktop_save_as
(cfdata->desktop, cfdata->orig_path);
}
e_int_menus_cache_clear();
return 1;
}
static int
_e_desktop_edit_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
int ret;
if ((cfdata->startup_notify != cfdata->desktop->startup_notify) ||
(cfdata->terminal != cfdata->desktop->terminal) ||
(cfdata->show_in_menus != !cfdata->desktop->no_display))
return 1;
#define CHECK(k) \
do \
{ \
const char *__k; \
if (cfdata->desktop->k) \
__k = cfdata->desktop->k; \
else if ((cfdata->editor) && (cfdata->editor->desktop)) \
__k = cfdata->editor->desktop->k; \
else \
__k = NULL; \
if ((cfdata->k && !__k) || (!cfdata->k && __k) || \
(cfdata->k && __k && strcmp(cfdata->k, __k) != 0)) \
return 1; \
} \
while (0)
CHECK(name);
CHECK(exec);
CHECK(try_exec);
CHECK(url);
CHECK(comment);
CHECK(generic_name);
CHECK(startup_wm_class);
CHECK(icon);
#undef CHECK
ret = 0;
if (cfdata->edited_categories)
{
const char *str;
Eina_List *lst, *old_lst;
cfdata->edited_categories = EINA_FALSE;
cfdata->changed_categories = EINA_FALSE;
if (cfdata->desktop->categories)
old_lst = cfdata->desktop->categories;
else if ((cfdata->editor) && (cfdata->editor->desktop))
old_lst = cfdata->editor->desktop->categories;
else
old_lst = NULL;
lst = efreet_desktop_string_list_parse(cfdata->categories);
if (eina_list_count(lst) != eina_list_count(old_lst))
cfdata->changed_categories = EINA_TRUE;
EINA_LIST_FREE(lst, str)
{
if (!cfdata->changed_categories)
{
Eina_List *n;
const char *old;
Eina_Bool found = EINA_FALSE;
EINA_LIST_FOREACH(old_lst, n, old)
{
if (strcmp(str, old) == 0)
{
found = EINA_TRUE;
break;
}
}
if (!found)
cfdata->changed_categories = EINA_TRUE;
}
eina_stringshare_del(str);
}
}
ret |= cfdata->changed_categories;
if (!ret)
{
if (cfdata->edited_mimes)
{
const char *str;
Eina_List *lst, *old_lst;
cfdata->edited_mimes = EINA_FALSE;
cfdata->changed_mimes = EINA_FALSE;
if (cfdata->desktop->mime_types)
old_lst = cfdata->desktop->mime_types;
else if ((cfdata->editor) && (cfdata->editor->desktop))
old_lst = cfdata->editor->desktop->mime_types;
else
old_lst = NULL;
lst = efreet_desktop_string_list_parse(cfdata->mimes);
if (eina_list_count(lst) != eina_list_count(old_lst))
cfdata->changed_mimes = EINA_TRUE;
EINA_LIST_FREE(lst, str)
{
if (!cfdata->changed_mimes)
{
Eina_List *n;
const char *old;
Eina_Bool found = EINA_FALSE;
EINA_LIST_FOREACH(old_lst, n, old)
{
if (strcmp(str, old) == 0)
{
found = EINA_TRUE;
break;
}
}
if (!found)
cfdata->changed_mimes = EINA_TRUE;
}
eina_stringshare_del(str);
}
}
ret |= cfdata->changed_mimes;
}
return ret;
}
static void
_e_desktop_editor_name_changed(void *data, Evas_Object *obj __UNUSED__)
{
E_Config_Dialog_Data *cfdata = data;
_e_desktop_edit_update_orig_path(cfdata);
}
static void
_e_desktop_editor_categories_changed(void *data, Evas_Object *obj __UNUSED__)
{
E_Config_Dialog_Data *cfdata = data;
cfdata->edited_categories = EINA_TRUE;
}
static void
_e_desktop_editor_icon_entry_changed(void *data, Evas_Object *obj __UNUSED__)
{
E_Config_Dialog_Data *cfdata = data;
_e_desktop_editor_icon_update(cfdata);
}
static void
_e_desktop_editor_mimes_changed(void *data, Evas_Object *obj __UNUSED__)
{
E_Config_Dialog_Data *cfdata = data;
cfdata->edited_mimes = EINA_TRUE;
}
static Evas_Object *
_e_desktop_edit_basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata)
{
E_Desktop_Edit *editor = cfdata->editor;
E_Radio_Group *rg;
Evas_Object *otb, *ol, *o, *ot;
Evas_Coord mw, mh;
editor->evas = evas;
otb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale);
ot = e_widget_table_add(evas, 0);
o = e_widget_label_add(evas, _("Name"));
e_widget_table_object_append(ot, o, 0, 0, 1, 1, 1, 1, 0, 0);
o = e_widget_entry_add(evas, &(cfdata->name), NULL, NULL, NULL);
e_widget_size_min_get(o, &mw, &mh);
if (mw < 220) mw = 220;
e_widget_size_min_set(o, mw, mh);
if ((!cfdata->desktop->orig_path) || (!cfdata->desktop->orig_path[0]))
e_widget_on_change_hook_set(o, _e_desktop_editor_name_changed, cfdata);
e_widget_table_object_append(ot, o, 1, 0, 1, 1, 1, 1, 1, 0);
o = e_widget_label_add(evas, _("Comment"));
e_widget_table_object_append(ot, o, 0, 1, 1, 1, 1, 1, 0, 0);
o = e_widget_entry_add(evas, &(cfdata->comment), NULL, NULL, NULL);
e_widget_table_object_append(ot, o, 1, 1, 1, 1, 1, 1, 1, 0);
rg = e_widget_radio_group_new(&(cfdata->type));
// desktop type: application
o = e_widget_radio_add(evas, _("Application"), 0, rg);
e_widget_table_object_append(ot, o, 0, 2, 1, 1, 1, 1, 0, 0);
editor->entry_widget_exec = e_widget_entry_add
(evas, &(cfdata->exec), NULL, NULL, NULL);
e_widget_table_object_append(ot, editor->entry_widget_exec, 1, 2, 1, 1, 1, 1, 1, 0);
o = e_widget_button_add
(evas, "...", NULL, _e_desktop_editor_cb_exec_select, cfdata, editor);
e_widget_table_object_append(ot, o, 2, 2, 1, 1, 0, 0, 0, 0);
// desktop type: url
o = e_widget_radio_add(evas, _("URL"), 1, rg);
e_widget_table_object_append(ot, o, 0, 3, 1, 1, 1, 1, 0, 0);
editor->entry_widget_url = e_widget_entry_add
(evas, &(cfdata->url), NULL, NULL, NULL);
e_widget_table_object_append(ot, editor->entry_widget_url, 1, 3, 1, 1, 1, 1, 1, 0);
// FIXME: add url selection dialog (file:/etc/..)
e_widget_toolbook_page_append
(otb, NULL, _("Basic"), ot, 1, 0, 1, 0, 0.5, 0.0);
/* e_widget_size_min_get(ol, &mw, &mh); */
ot = e_widget_table_add(evas, 0);
editor->img_widget = e_widget_button_add
(evas, "", NULL, _e_desktop_editor_cb_icon_select, cfdata, editor);
_e_desktop_editor_icon_update(cfdata);
e_widget_size_min_set(editor->img_widget, 192, 192);
e_widget_table_object_append(ot, editor->img_widget, 0, 0, 2, 1, 1, 1, 0, 0);
o = e_widget_label_add(evas, _("Icon"));
e_widget_table_object_append(ot, o, 0, 1, 1, 1, 1, 1, 0, 0);
o = e_widget_entry_add(evas, &(cfdata->icon), NULL, NULL, NULL);
cfdata->icon_entry = o;
e_widget_on_change_hook_set(o, _e_desktop_editor_icon_entry_changed, cfdata);
e_widget_table_object_append(ot, o, 1, 1, 1, 1, 1, 1, 1, 0);
e_widget_toolbook_page_append
(otb, NULL, _("Icon"), ot, 0, 0, 0, 0, 0.5, 0.5);
ot = e_widget_table_add(evas, 0);
o = e_widget_label_add(evas, _("Generic Name"));
e_widget_table_object_append(ot, o, 0, 0, 1, 1, 1, 1, 0, 0);
o = e_widget_entry_add(evas, &(cfdata->generic_name), NULL, NULL, NULL);
e_widget_table_object_append(ot, o, 1, 0, 1, 1, 1, 1, 1, 0);
o = e_widget_label_add(evas, _("Window Class"));
e_widget_table_object_append(ot, o, 0, 1, 1, 1, 1, 1, 0, 0);
o = e_widget_entry_add(evas, &(cfdata->startup_wm_class), NULL, NULL, NULL);
e_widget_table_object_append(ot, o, 1, 1, 1, 1, 1, 1, 1, 0);
o = e_widget_label_add(evas, _("Categories"));
e_widget_table_object_append(ot, o, 0, 2, 1, 1, 1, 1, 0, 0);
o = e_widget_entry_add(evas, &(cfdata->categories), NULL, NULL, NULL);
e_widget_on_change_hook_set(o, _e_desktop_editor_categories_changed, cfdata);
e_widget_table_object_append(ot, o, 1, 2, 1, 1, 1, 1, 1, 0);
o = e_widget_label_add(evas, _("Mime Types"));
e_widget_table_object_append(ot, o, 0, 3, 1, 1, 1, 1, 0, 0);
o = e_widget_entry_add(evas, &(cfdata->mimes), NULL, NULL, NULL);
e_widget_on_change_hook_set(o, _e_desktop_editor_mimes_changed, cfdata);
e_widget_table_object_append(ot, o, 1, 3, 1, 1, 1, 1, 1, 0);
o = e_widget_label_add(evas, _("Desktop file"));
e_widget_table_object_append(ot, o, 0, 4, 1, 1, 1, 1, 0, 0);
o = e_widget_entry_add(evas, NULL, NULL, NULL, NULL);
e_widget_table_object_append(ot, o, 1, 4, 1, 1, 1, 1, 1, 0);
e_widget_entry_readonly_set(o, 1);
cfdata->orig_path_entry = o;
_e_desktop_edit_update_orig_path(cfdata);
e_widget_toolbook_page_append
(otb, NULL, _("General"), ot, 1, 0, 1, 0, 0.5, 0.0);
ol = e_widget_list_add(evas, 0, 0);
o = e_widget_check_add(evas, _("Startup Notify"), &(cfdata->startup_notify));
e_widget_list_object_append(ol, o, 1, 0, 0.0);
o = e_widget_check_add(evas, _("Run in Terminal"), &(cfdata->terminal));
e_widget_list_object_append(ol, o, 1, 0, 0.0);
o = e_widget_check_add(evas, _("Show in Menus"), &(cfdata->show_in_menus));
e_widget_list_object_append(ol, o, 1, 0, 0.0);
e_widget_toolbook_page_append
(otb, NULL, _("Options"), ol, 1, 0, 1, 0, 0.5, 0.0);
e_widget_toolbook_page_show(otb, 0);
e_util_win_auto_resize_fill(cfd->dia->win);
e_win_centered_set(cfd->dia->win, 1);
return otb;
}
static void
_e_desktop_editor_cb_icon_select(void *data1, void *data2)
{
E_Config_Dialog_Data *cfdata;
E_Dialog *dia;
Evas_Object *o;
Evas_Coord mw, mh;
E_Desktop_Edit *editor;
char *path = NULL;
const char *icon_path = NULL;
char buf[PATH_MAX + 32];
editor = data2;
cfdata = data1;
if (editor->icon_fsel_dia) return;
dia = e_dialog_new(cfdata->editor->cfd->con, "E", "_eap_icon_select_dialog");
if (!dia) return;
e_object_del_attach_func_set(E_OBJECT(dia),
_e_desktop_edit_cb_icon_select_destroy);
snprintf(buf, sizeof(buf), _("Select an Icon for '%s'"), ecore_file_file_get(cfdata->orig_path));
e_dialog_title_set(dia, buf);
dia->data = cfdata;
/* absolute path to icon */
/* XXX change this to a generic icon selector (that can do either
* files from a dir, or icons in the current theme */
if (cfdata->icon)
{
if (ecore_file_exists(cfdata->icon))
icon_path = cfdata->icon;
else
icon_path = efreet_icon_path_find(e_config->icon_theme, cfdata->icon, 64);
if (icon_path)
path = ecore_file_dir_get(icon_path);
}
if (path)
{
o = e_widget_fsel_add(dia->win->evas, "/", path, NULL, NULL,
_e_desktop_edit_select_cb, cfdata,
NULL, cfdata, 1);
free(path);
}
else
{
o = e_widget_fsel_add(dia->win->evas, "~/", "/", NULL, NULL,
_e_desktop_edit_select_cb, cfdata,
NULL, cfdata, 1);
}
evas_object_show(o);
editor->icon_fsel = o;
e_widget_size_min_get(o, &mw, &mh);
e_dialog_content_set(dia, o, mw, mh);
/* buttons at the bottom */
e_dialog_button_add(dia, _("OK"), NULL,
_e_desktop_edit_cb_icon_select_ok, cfdata);
e_dialog_button_add(dia, _("Cancel"), NULL,
_e_desktop_edit_cb_icon_select_cancel, cfdata);
e_win_centered_set(dia->win, 1);
e_dialog_show(dia);
editor->icon_fsel_dia = dia;
}
static void
_e_desktop_editor_cb_exec_select(void *data1, void *data2)
{
E_Config_Dialog_Data *cfdata;
E_Dialog *dia;
Evas_Object *o;
Evas_Coord mw, mh;
E_Desktop_Edit *editor;
char *path = NULL;
editor = data2;
cfdata = data1;
if (editor->exec_fsel_dia) return;
dia = e_dialog_new(cfdata->editor->cfd->con, "E", "_eap_exec_select_dialog");
if (!dia) return;
e_object_del_attach_func_set(E_OBJECT(dia),
_e_desktop_edit_cb_exec_select_destroy);
e_dialog_title_set(dia, _("Select an Executable"));
dia->data = cfdata;
/* absolute path to exe */
if (cfdata->exec)
{
path = ecore_file_dir_get(cfdata->exec);
if (path && !ecore_file_exists(path))
{
free(path);
path = NULL;
}
}
if (path)
{
o = e_widget_fsel_add(dia->win->evas, "/", path, NULL, NULL,
_e_desktop_edit_select_cb, cfdata,
NULL, cfdata, 1);
free(path);
path = NULL;
}
else
{
o = e_widget_fsel_add(dia->win->evas, "~/", "/", NULL, NULL,
_e_desktop_edit_select_cb, cfdata,
NULL, cfdata, 1);
}
evas_object_show(o);
editor->exec_fsel = o;
e_widget_size_min_get(o, &mw, &mh);
e_dialog_content_set(dia, o, mw, mh);
/* buttons at the bottom */
e_dialog_button_add(dia, _("OK"), NULL,
_e_desktop_edit_cb_exec_select_ok, cfdata);
e_dialog_button_add(dia, _("Cancel"), NULL,
_e_desktop_edit_cb_exec_select_cancel, cfdata);
e_win_centered_set(dia->win, 1);
e_dialog_show(dia);
editor->exec_fsel_dia = dia;
}
static void
_e_desktop_edit_select_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__)
{
}
static void
_e_desktop_edit_cb_icon_select_destroy(void *obj)
{
E_Dialog *dia = obj;
E_Config_Dialog_Data *cfdata = dia->data;
/* extra unref isn't needed - there is no extra ref() anywhere i saw */
/* e_object_unref(E_OBJECT(dia));*/
_e_desktop_edit_cb_icon_select_cancel(cfdata, NULL);
}
static void
_e_desktop_edit_cb_icon_select_ok(void *data, E_Dialog *dia)
{
E_Config_Dialog_Data *cfdata;
const char *file;
char *dir;
const char *icon_dir;
cfdata = data;
file = e_widget_fsel_selection_path_get(cfdata->editor->icon_fsel);
dir = ecore_file_dir_get(file);
IFFREE(cfdata->icon);
/* TODO: Check for theme icon */
icon_dir = e_user_icon_dir_get();
if ((icon_dir) && (e_util_dir_check(icon_dir)) && (!e_util_strcmp(dir, icon_dir)))
{
cfdata->icon = strdup(ecore_file_file_get(file));
}
else
{
Eina_List *xdg_dirs, *l;
char buf[PATH_MAX];
xdg_dirs = efreet_data_dirs_get();
EINA_LIST_FOREACH(xdg_dirs, l, icon_dir)
{
snprintf(buf, sizeof(buf), "%s/icons", icon_dir);
if (!ecore_file_is_dir(buf)) continue;
if (!e_util_strcmp(dir, buf))
{
cfdata->icon = strdup(ecore_file_file_get(file));
break;
}
}
}
if (!cfdata->icon)
{
IFDUP(file, cfdata->icon);
}
else
{
/* strip ext */
char *p;
p = strrchr(cfdata->icon, '.');
if (p)
{
/* TODO: Check if known extension */
*p = '\0';
}
}
E_FREE(dir);
e_widget_entry_text_set(cfdata->icon_entry, cfdata->icon);
_e_desktop_edit_cb_icon_select_cancel(data, dia);
}
static void
_e_desktop_edit_cb_icon_select_cancel(void *data, E_Dialog *dia)
{
E_Config_Dialog_Data *cfdata;
cfdata = data;
if (dia) e_util_defer_object_del(E_OBJECT(dia));
cfdata->editor->icon_fsel_dia = NULL;
_e_desktop_editor_icon_update(cfdata);
}
static void
_e_desktop_editor_icon_update(E_Config_Dialog_Data *cfdata)
{
Evas_Object *o;
if (!cfdata->editor->img_widget) return;
o = e_util_icon_theme_icon_add(cfdata->icon, 128, cfdata->editor->evas);
/* NB this takes care of freeing any previous icon object */
e_widget_button_icon_set(cfdata->editor->img_widget, o);
e_widget_change(cfdata->editor->img_widget);
}
static void
_e_desktop_edit_cb_exec_select_destroy(void *obj)
{
E_Dialog *dia = obj;
E_Config_Dialog_Data *cfdata = dia->data;
/* guess it should work like _e_desktop_edit_cb_icon_select_destroy */
/* e_object_unref(E_OBJECT(dia)); */
_e_desktop_edit_cb_exec_select_cancel(cfdata, NULL);
}
static void
_e_desktop_edit_cb_exec_select_ok(void *data, E_Dialog *dia)
{
E_Config_Dialog_Data *cfdata;
const char *file;
cfdata = data;
file = e_widget_fsel_selection_path_get(cfdata->editor->exec_fsel);
IFFREE(cfdata->exec);
IFDUP(file, cfdata->exec);
_e_desktop_edit_cb_exec_select_cancel(data, dia);
}
static void
_e_desktop_edit_cb_exec_select_cancel(void *data, E_Dialog *dia)
{
E_Config_Dialog_Data *cfdata;
cfdata = data;
if (dia) e_util_defer_object_del(E_OBJECT(dia));
cfdata->editor->exec_fsel_dia = NULL;
_e_desktop_editor_exec_update(cfdata);
}
static void
_e_desktop_editor_exec_update(E_Config_Dialog_Data *cfdata)
{
if (!cfdata->editor->entry_widget_exec) return;
e_widget_entry_text_set(cfdata->editor->entry_widget_exec, cfdata->exec);
}
|
a40326d5c4481c4c402eccf1ab3feb81542fe29f
|
3a30cfb29aac91e5c75d4dbcefddfd1f34d5f18c
|
/c-tests/gcc/960219-1.c
|
42a13338ea2efdc290c342ef5e1cdd99e945b53d
|
[
"MIT",
"MPL-1.0",
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LGPL-2.0-only",
"GPL-3.0-only",
"GPL-2.0-only"
] |
permissive
|
vnmakarov/mir
|
a1725bc9c828e8580df6b7ae94e04175db8abe93
|
928e28fb3acaa50d051a906e76a55cc48a556574
|
refs/heads/master
| 2023-09-02T11:10:37.434581
| 2023-08-25T19:25:40
| 2023-08-25T19:25:40
| 178,932,492
| 2,005
| 156
|
MIT
| 2023-08-01T20:29:59
| 2019-04-01T19:24:56
|
C
|
UTF-8
|
C
| false
| false
| 113
|
c
|
960219-1.c
|
extern void exit (int);
f (int i)
{
if (((1 << i) & 1) == 0)
abort ();
}
main ()
{
f (0);
exit (0);
}
|
eb368aa770811218720f8fbb6257974e551553b0
|
de21f9075f55640514c29ef0f1fe3f0690845764
|
/regression/contracts-dfcc/history-pointer-enforce-10/main.c
|
54c6dcabf2ebc2cb2e8dd016fe6989dd435594a5
|
[
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference",
"BSD-4-Clause"
] |
permissive
|
diffblue/cbmc
|
975a074ac445febb3b5715f8792beb545522dc18
|
decd2839c2f51a54b2ad0f3e89fdc1b4bf78cd16
|
refs/heads/develop
| 2023-08-31T05:52:05.342195
| 2023-08-30T13:31:51
| 2023-08-30T13:31:51
| 51,877,056
| 589
| 309
|
NOASSERTION
| 2023-09-14T18:49:17
| 2016-02-16T23:03:52
|
C++
|
UTF-8
|
C
| false
| false
| 811
|
c
|
main.c
|
#include <assert.h>
#include <stdlib.h>
struct pair
{
int x;
int *y;
};
int z = 5;
void foo(struct pair *p) __CPROVER_assigns(*(p->y), z)
__CPROVER_ensures(*(p->y) == __CPROVER_old(*(p->y)) + __CPROVER_old(z))
{
*(p->y) = *(p->y) + z;
z = 10;
}
void bar(struct pair *p) __CPROVER_assigns(p->y)
__CPROVER_ensures(p->y == __CPROVER_old(p->y) + 5)
{
p->y = (p->y + 5);
}
void baz(struct pair p) __CPROVER_assigns()
__CPROVER_ensures(p == __CPROVER_old(p))
{
struct pair pp = p;
struct pair empty = {0};
p = empty;
p = pp;
}
int main()
{
z = 5;
int w[10] = {0};
struct pair *p = malloc(sizeof(*p));
p->y = malloc(sizeof(*(p->y)));
p->x = 2;
*(p->y) = 2;
foo(p);
assert(*(p->y) == 7);
p->y = w;
w[5] = -1;
bar(p);
assert(*(p->y) == -1);
baz(*p);
return 0;
}
|
0f757489eea838203caa657c6c3a76f9b15bc2ad
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/arch/x86/kernel/cpu/scattered.c
|
d92b5dad15dd43069115d179f9487e2ba9603ffc
|
[
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later",
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 2,076
|
c
|
scattered.c
|
/*
* Routines to indentify additional cpu features that are scattered in
* cpuid space.
*/
#include <linux/cpu.h>
#include <asm/pat.h>
#include <asm/processor.h>
#include <asm/apic.h>
struct cpuid_bit {
u16 feature;
u8 reg;
u8 bit;
u32 level;
u32 sub_leaf;
};
enum cpuid_regs {
CR_EAX = 0,
CR_ECX,
CR_EDX,
CR_EBX
};
void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
{
u32 max_level;
u32 regs[4];
const struct cpuid_bit *cb;
static const struct cpuid_bit __cpuinitconst cpuid_bits[] = {
{ X86_FEATURE_DTHERM, CR_EAX, 0, 0x00000006, 0 },
{ X86_FEATURE_IDA, CR_EAX, 1, 0x00000006, 0 },
{ X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006, 0 },
{ X86_FEATURE_PLN, CR_EAX, 4, 0x00000006, 0 },
{ X86_FEATURE_PTS, CR_EAX, 6, 0x00000006, 0 },
{ X86_FEATURE_APERFMPERF, CR_ECX, 0, 0x00000006, 0 },
{ X86_FEATURE_EPB, CR_ECX, 3, 0x00000006, 0 },
{ X86_FEATURE_XSAVEOPT, CR_EAX, 0, 0x0000000d, 1 },
{ X86_FEATURE_HW_PSTATE, CR_EDX, 7, 0x80000007, 0 },
{ X86_FEATURE_CPB, CR_EDX, 9, 0x80000007, 0 },
{ X86_FEATURE_PROC_FEEDBACK, CR_EDX,11, 0x80000007, 0 },
{ X86_FEATURE_NPT, CR_EDX, 0, 0x8000000a, 0 },
{ X86_FEATURE_LBRV, CR_EDX, 1, 0x8000000a, 0 },
{ X86_FEATURE_SVML, CR_EDX, 2, 0x8000000a, 0 },
{ X86_FEATURE_NRIPS, CR_EDX, 3, 0x8000000a, 0 },
{ X86_FEATURE_TSCRATEMSR, CR_EDX, 4, 0x8000000a, 0 },
{ X86_FEATURE_VMCBCLEAN, CR_EDX, 5, 0x8000000a, 0 },
{ X86_FEATURE_FLUSHBYASID, CR_EDX, 6, 0x8000000a, 0 },
{ X86_FEATURE_DECODEASSISTS, CR_EDX, 7, 0x8000000a, 0 },
{ X86_FEATURE_PAUSEFILTER, CR_EDX,10, 0x8000000a, 0 },
{ X86_FEATURE_PFTHRESHOLD, CR_EDX,12, 0x8000000a, 0 },
{ 0, 0, 0, 0, 0 }
};
for (cb = cpuid_bits; cb->feature; cb++) {
/* Verify that the level is valid */
max_level = cpuid_eax(cb->level & 0xffff0000);
if (max_level < cb->level ||
max_level > (cb->level | 0xffff))
continue;
cpuid_count(cb->level, cb->sub_leaf, ®s[CR_EAX],
®s[CR_EBX], ®s[CR_ECX], ®s[CR_EDX]);
if (regs[cb->reg] & (1 << cb->bit))
set_cpu_cap(c, cb->feature);
}
}
|
b3d1dd58b5245ff4ab3ac2cbcd7e826d56899509
|
e683a0b8dbb87c7ceb99e0d06896174a559d2c67
|
/Tools/swat/private.h
|
18d52e577c348677e7e05bbf9d65e58439779192
|
[
"Apache-2.0"
] |
permissive
|
bluewaysw/pcgeos
|
f093d79567d977d992f47065056d14d5a04b9f14
|
c6ae4c8e77b54b9ff654c3916f2191f8b1a1b65d
|
refs/heads/master
| 2023-08-31T00:17:54.481175
| 2023-08-29T19:00:49
| 2023-08-29T19:00:49
| 157,968,410
| 603
| 88
|
Apache-2.0
| 2023-09-13T07:44:06
| 2018-11-17T09:09:55
|
Assembly
|
UTF-8
|
C
| false
| false
| 1,329
|
h
|
private.h
|
/***********************************************************************
*
* Copyright (c) Berkeley Softworks 1988 -- All Rights Reserved
*
* PROJECT: PCGEOS
* MODULE: Swat -- Private data support
* FILE: private.h
*
* AUTHOR: Adam de Boor: Mar 23, 1989
*
* REVISION HISTORY:
* Date Name Description
* ---- ---- -----------
* 3/23/89 ardeb Initial version
*
* DESCRIPTION:
* This is a fake module dating back to the days when patients were
* independent entities. There is a single table of private data
* into which things may be stored by anyone. The table is managed
* by the Table module, so the data are keyed by strings and have
* delete procedures, etc.
*
* $Id: private.h,v 4.1 92/04/13 00:17:58 adam Exp $
*
***********************************************************************/
#ifndef _PRIVATE_H
#define _PRIVATE_H
#ifndef NoDestroy
#define NoDestroy ((void (*)())NULL)
#endif /* NoDestroy */
extern Table privateDataTable;
#define Private_Init() privateDataTable = Table_Create(16)
#define Private_Enter(name, data, destroyProc) \
Table_Enter(privateDataTable, name, data, destroyProc)
#define Private_Delete(name) \
Table_Delete(privateDataTable, name)
#define Private_GetData(name) \
Table_Lookup(privateDataTable, name)
#endif /* _PRIVATE_H */
|
b403301829941069ee6dc4d23e43265bfdafc219
|
28d0f8c01599f8f6c711bdde0b59f9c2cd221203
|
/sys/fs/nfs/common/nfs_diskless.c
|
c09092ee64169c89d36a8824256630837dc9d664
|
[] |
no_license
|
NetBSD/src
|
1a9cbc22ed778be638b37869ed4fb5c8dd616166
|
23ee83f7c0aea0777bd89d8ebd7f0cde9880d13c
|
refs/heads/trunk
| 2023-08-31T13:24:58.105962
| 2023-08-27T15:50:47
| 2023-08-27T15:50:47
| 88,439,547
| 656
| 348
| null | 2023-07-20T20:07:24
| 2017-04-16T20:03:43
| null |
UTF-8
|
C
| false
| false
| 12,629
|
c
|
nfs_diskless.c
|
/* $NetBSD: nfs_diskless.c,v 1.2 2016/12/13 22:41:46 pgoyette Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
*/
#include <sys/cdefs.h>
/* __FBSDID("FreeBSD: head/sys/nfs/nfs_diskless.c 297086 2016-03-20 21:48:26Z ian "); */
__RCSID("$NetBSD: nfs_diskless.c,v 1.2 2016/12/13 22:41:46 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_newnfs.h"
#endif
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/jail.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/if_var.h>
#include <net/ethernet.h>
#include <net/vnet.h>
#include <netinet/in.h>
#include <fs/nfs/common/nfsproto.h>
#include <fs/nfs/client/nfs.h>
#include <fs/nfs/common/nfsdiskless.h>
#define NFS_IFACE_TIMEOUT_SECS 10 /* Timeout for interface to appear. */
static int inaddr_to_sockaddr(char *ev, struct sockaddr_in *sa);
static int hwaddr_to_sockaddr(char *ev, struct sockaddr_dl *sa);
static int decode_nfshandle(char *ev, u_char *fh, int maxfh);
/*
* This structure must be filled in by a primary bootstrap or bootstrap
* server for a diskless/dataless machine. It is initialized below just
* to ensure that it is allocated to initialized data (.data not .bss).
*/
struct nfs_diskless nfs_diskless = { { { 0 } } };
struct nfsv3_diskless nfsv3_diskless = { { { 0 } } };
int nfs_diskless_valid = 0;
/*
* Validate/sanity check a rsize/wsize parameter.
*/
static int
checkrwsize(unsigned long v, const char *name)
{
/*
* 32K is used as an upper bound because most servers
* limit block size to satisfy IPv4's limit of
* 64K/reassembled packet. The lower bound is pretty
* much arbitrary.
*/
if (!(4 <= v && v <= 32*1024)) {
printf("nfs_parse_options: invalid %s %lu ignored\n", name, v);
return 0;
} else
return 1;
}
/*
* Parse mount options and apply them to the supplied
* nfs_diskless state. Used also by bootp/dhcp support.
*/
void
nfs_parse_options(const char *envopts, struct nfs_args *nd)
{
char *opts, *o, *otmp;
unsigned long v;
opts = strdup(envopts, M_TEMP);
otmp = opts;
while ((o = strsep(&otmp, ":;, ")) != NULL) {
if (*o == '\0')
; /* Skip empty options. */
else if (strcmp(o, "soft") == 0)
nd->flags |= NFSMNT_SOFT;
else if (strcmp(o, "intr") == 0)
nd->flags |= NFSMNT_INT;
else if (strcmp(o, "conn") == 0)
nd->flags |= NFSMNT_NOCONN;
else if (strcmp(o, "nolockd") == 0)
nd->flags |= NFSMNT_NOLOCKD;
else if (strcmp(o, "nocto") == 0)
nd->flags |= NFSMNT_NOCTO;
else if (strcmp(o, "nfsv2") == 0)
nd->flags &= ~(NFSMNT_NFSV3 | NFSMNT_NFSV4);
else if (strcmp(o, "nfsv3") == 0) {
nd->flags &= ~NFSMNT_NFSV4;
nd->flags |= NFSMNT_NFSV3;
} else if (strcmp(o, "tcp") == 0)
nd->sotype = SOCK_STREAM;
else if (strcmp(o, "udp") == 0)
nd->sotype = SOCK_DGRAM;
else if (strncmp(o, "rsize=", 6) == 0) {
v = strtoul(o+6, NULL, 10);
if (checkrwsize(v, "rsize")) {
nd->rsize = (int) v;
nd->flags |= NFSMNT_RSIZE;
}
} else if (strncmp(o, "wsize=", 6) == 0) {
v = strtoul(o+6, NULL, 10);
if (checkrwsize(v, "wsize")) {
nd->wsize = (int) v;
nd->flags |= NFSMNT_WSIZE;
}
} else
printf("%s: skipping unknown option \"%s\"\n",
__func__, o);
}
free(opts, M_TEMP);
}
/*
* Populate the essential fields in the nfsv3_diskless structure.
*
* The loader is expected to export the following environment variables:
*
* boot.netif.name name of boot interface
* boot.netif.ip IP address on boot interface
* boot.netif.netmask netmask on boot interface
* boot.netif.gateway default gateway (optional)
* boot.netif.hwaddr hardware address of boot interface
* boot.netif.mtu interface mtu from bootp/dhcp (optional)
* boot.nfsroot.server IP address of root filesystem server
* boot.nfsroot.path path of the root filesystem on server
* boot.nfsroot.nfshandle NFS handle for root filesystem on server
* boot.nfsroot.nfshandlelen and length of this handle (for NFSv3 only)
* boot.nfsroot.options NFS options for the root filesystem
*/
void
nfs_setup_diskless(void)
{
struct nfs_diskless *nd = &nfs_diskless;
struct nfsv3_diskless *nd3 = &nfsv3_diskless;
struct ifnet *ifp;
struct ifaddr *ifa;
struct sockaddr_dl *sdl, ourdl;
struct sockaddr_in myaddr, netmask;
char *cp;
int cnt, fhlen, is_nfsv3;
uint32_t len;
time_t timeout_at;
if (nfs_diskless_valid != 0)
return;
/* get handle size. If this succeeds, it's an NFSv3 setup. */
if ((cp = kern_getenv("boot.nfsroot.nfshandlelen")) != NULL) {
cnt = sscanf(cp, "%d", &len);
freeenv(cp);
if (cnt != 1 || len == 0 || len > NFSX_V3FHMAX) {
printf("nfs_diskless: bad NFS handle len\n");
return;
}
nd3->root_fhsize = len;
is_nfsv3 = 1;
} else
is_nfsv3 = 0;
/* set up interface */
if (inaddr_to_sockaddr("boot.netif.ip", &myaddr))
return;
if (inaddr_to_sockaddr("boot.netif.netmask", &netmask)) {
printf("nfs_diskless: no netmask\n");
return;
}
if (is_nfsv3 != 0) {
bcopy(&myaddr, &nd3->myif.ifra_addr, sizeof(myaddr));
bcopy(&myaddr, &nd3->myif.ifra_broadaddr, sizeof(myaddr));
((struct sockaddr_in *)
&nd3->myif.ifra_broadaddr)->sin_addr.s_addr =
myaddr.sin_addr.s_addr | ~ netmask.sin_addr.s_addr;
bcopy(&netmask, &nd3->myif.ifra_mask, sizeof(netmask));
} else {
bcopy(&myaddr, &nd->myif.ifra_addr, sizeof(myaddr));
bcopy(&myaddr, &nd->myif.ifra_broadaddr, sizeof(myaddr));
((struct sockaddr_in *)
&nd->myif.ifra_broadaddr)->sin_addr.s_addr =
myaddr.sin_addr.s_addr | ~ netmask.sin_addr.s_addr;
bcopy(&netmask, &nd->myif.ifra_mask, sizeof(netmask));
}
if (hwaddr_to_sockaddr("boot.netif.hwaddr", &ourdl)) {
printf("nfs_diskless: no hardware address\n");
return;
}
ifa = NULL;
timeout_at = time_uptime + NFS_IFACE_TIMEOUT_SECS;
retry:
CURVNET_SET(TD_TO_VNET(curthread));
IFNET_RLOCK();
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family == AF_LINK) {
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
if ((sdl->sdl_type == ourdl.sdl_type) &&
(sdl->sdl_alen == ourdl.sdl_alen) &&
!bcmp(LLADDR(sdl),
LLADDR(&ourdl),
sdl->sdl_alen)) {
IFNET_RUNLOCK();
CURVNET_RESTORE();
goto match_done;
}
}
}
}
IFNET_RUNLOCK();
CURVNET_RESTORE();
if (time_uptime < timeout_at) {
pause("nfssdl", hz / 5);
goto retry;
}
printf("nfs_diskless: no interface\n");
return; /* no matching interface */
match_done:
kern_setenv("boot.netif.name", ifp->if_xname);
if (is_nfsv3 != 0) {
strlcpy(nd3->myif.ifra_name, ifp->if_xname,
sizeof(nd3->myif.ifra_name));
/* set up gateway */
inaddr_to_sockaddr("boot.netif.gateway", &nd3->mygateway);
/* set up root mount */
nd3->root_args.rsize = 32768; /* XXX tunable? */
nd3->root_args.wsize = 32768;
nd3->root_args.sotype = SOCK_STREAM;
nd3->root_args.flags = (NFSMNT_NFSV3 | NFSMNT_WSIZE |
NFSMNT_RSIZE | NFSMNT_RESVPORT);
if (inaddr_to_sockaddr("boot.nfsroot.server",
&nd3->root_saddr)) {
printf("nfs_diskless: no server\n");
return;
}
nd3->root_saddr.sin_port = htons(NFS_PORT);
fhlen = decode_nfshandle("boot.nfsroot.nfshandle",
&nd3->root_fh[0], NFSX_V3FHMAX);
if (fhlen == 0) {
printf("nfs_diskless: no NFS handle\n");
return;
}
if (fhlen != nd3->root_fhsize) {
printf("nfs_diskless: bad NFS handle len=%d\n", fhlen);
return;
}
if ((cp = kern_getenv("boot.nfsroot.path")) != NULL) {
strncpy(nd3->root_hostnam, cp, MNAMELEN - 1);
freeenv(cp);
}
if ((cp = kern_getenv("boot.nfsroot.options")) != NULL) {
nfs_parse_options(cp, &nd3->root_args);
freeenv(cp);
}
nfs_diskless_valid = 3;
} else {
strlcpy(nd->myif.ifra_name, ifp->if_xname,
sizeof(nd->myif.ifra_name));
/* set up gateway */
inaddr_to_sockaddr("boot.netif.gateway", &nd->mygateway);
/* set up root mount */
nd->root_args.rsize = 8192; /* XXX tunable? */
nd->root_args.wsize = 8192;
nd->root_args.sotype = SOCK_STREAM;
nd->root_args.flags = (NFSMNT_WSIZE |
NFSMNT_RSIZE | NFSMNT_RESVPORT);
if (inaddr_to_sockaddr("boot.nfsroot.server",
&nd->root_saddr)) {
printf("nfs_diskless: no server\n");
return;
}
nd->root_saddr.sin_port = htons(NFS_PORT);
if (decode_nfshandle("boot.nfsroot.nfshandle",
&nd->root_fh[0], NFSX_V2FH) == 0) {
printf("nfs_diskless: no NFS handle\n");
return;
}
if ((cp = kern_getenv("boot.nfsroot.path")) != NULL) {
strncpy(nd->root_hostnam, cp, MNAMELEN - 1);
freeenv(cp);
}
if ((cp = kern_getenv("boot.nfsroot.options")) != NULL) {
struct nfs_args args;
/*
* XXX yech, convert between old and current
* arg format
*/
args.flags = nd->root_args.flags;
args.sotype = nd->root_args.sotype;
args.rsize = nd->root_args.rsize;
args.wsize = nd->root_args.wsize;
nfs_parse_options(cp, &args);
nd->root_args.flags = args.flags;
nd->root_args.sotype = args.sotype;
nd->root_args.rsize = args.rsize;
nd->root_args.wsize = args.wsize;
freeenv(cp);
}
nfs_diskless_valid = 1;
}
}
static int
inaddr_to_sockaddr(char *ev, struct sockaddr_in *sa)
{
u_int32_t a[4];
char *cp;
int count;
bzero(sa, sizeof(*sa));
sa->sin_len = sizeof(*sa);
sa->sin_family = AF_INET;
if ((cp = kern_getenv(ev)) == NULL)
return (1);
count = sscanf(cp, "%d.%d.%d.%d", &a[0], &a[1], &a[2], &a[3]);
freeenv(cp);
if (count != 4)
return (1);
sa->sin_addr.s_addr =
htonl((a[0] << 24) | (a[1] << 16) | (a[2] << 8) | a[3]);
return (0);
}
static int
hwaddr_to_sockaddr(char *ev, struct sockaddr_dl *sa)
{
char *cp;
u_int32_t a[6];
int count;
bzero(sa, sizeof(*sa));
sa->sdl_len = sizeof(*sa);
sa->sdl_family = AF_LINK;
sa->sdl_type = IFT_ETHER;
sa->sdl_alen = ETHER_ADDR_LEN;
if ((cp = kern_getenv(ev)) == NULL)
return (1);
count = sscanf(cp, "%x:%x:%x:%x:%x:%x",
&a[0], &a[1], &a[2], &a[3], &a[4], &a[5]);
freeenv(cp);
if (count != 6)
return (1);
sa->sdl_data[0] = a[0];
sa->sdl_data[1] = a[1];
sa->sdl_data[2] = a[2];
sa->sdl_data[3] = a[3];
sa->sdl_data[4] = a[4];
sa->sdl_data[5] = a[5];
return (0);
}
static int
decode_nfshandle(char *ev, u_char *fh, int maxfh)
{
u_char *cp, *ep;
int len, val;
ep = cp = kern_getenv(ev);
if (cp == NULL)
return (0);
if ((strlen(cp) < 2) || (*cp != 'X')) {
freeenv(ep);
return (0);
}
len = 0;
cp++;
for (;;) {
if (*cp == 'X') {
freeenv(ep);
return (len);
}
if ((sscanf(cp, "%2x", &val) != 1) || (val > 0xff)) {
freeenv(ep);
return (0);
}
*(fh++) = val;
len++;
cp += 2;
if (len > maxfh) {
freeenv(ep);
return (0);
}
}
}
#if !defined(NEW_NFS_BOOT_BOOTP)
static void
nfs_rootconf(void)
{
nfs_setup_diskless();
if (nfs_diskless_valid)
rootdevnames[0] = "nfs:";
}
SYSINIT(cpu_rootconf, SI_SUB_ROOT_CONF, SI_ORDER_FIRST, nfs_rootconf, NULL);
#endif
|
f5542a52c02e1605c219b14639c49f3c76c96c70
|
fb47ab6337a71029dee71933e449cf7f6805fc0f
|
/platform/qemu-virt-m68k/goldfish_rtc.c
|
ae6f786516d099183fcd2061d124844f88f39310
|
[
"MIT"
] |
permissive
|
littlekernel/lk
|
7e7ba50b87b1f2e0b6e2f052c59249825c91975b
|
30dc320054f70910e1c1ee40a6948ee99672acec
|
refs/heads/master
| 2023-09-02T00:47:52.203963
| 2023-06-21T22:42:35
| 2023-06-21T22:42:35
| 3,058,456
| 3,077
| 618
|
MIT
| 2023-08-30T09:41:31
| 2011-12-27T19:19:36
|
C
|
UTF-8
|
C
| false
| false
| 3,219
|
c
|
goldfish_rtc.c
|
/*
* Copyright (c) 2021 Travis Geiselbrecht
*
* Use of this source code is governed by a MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT
*/
#include "platform_p.h"
#include <assert.h>
#include <inttypes.h>
#include <lk/err.h>
#include <lk/debug.h>
#include <lk/reg.h>
#include <lk/trace.h>
#include <kernel/debug.h>
#include <kernel/thread.h>
#include <platform/interrupts.h>
#include <platform/virt.h>
#include <platform/timer.h>
#include <platform.h>
#define LOCAL_TRACE 0
// implementation of RTC at
// https://github.com/qemu/qemu/blob/master/hw/rtc/goldfish_rtc.c
volatile uint32_t * const goldfish_rtc_base = (void *)VIRT_GF_RTC_MMIO_BASE;
// registers
enum {
RTC_TIME_LOW = 0x00,
RTC_TIME_HIGH = 0x04,
RTC_ALARM_LOW = 0x08,
RTC_ALARM_HIGH = 0x0c,
RTC_IRQ_ENABLED = 0x10,
RTC_CLEAR_ALARM = 0x14,
RTC_ALARM_STATUS = 0x18,
RTC_CLEAR_INTERRUPT = 0x1c,
};
static uint64_t system_boot_offset;
static platform_timer_callback t_callback;
static void *t_arg;
static void write_reg(unsigned int reg, uint32_t val) {
goldfish_rtc_base[reg / 4] = val;
}
static uint32_t read_reg(unsigned int reg) {
return goldfish_rtc_base[reg / 4];
}
// raw time from the RTC is ns wall time
static uint64_t read_raw_time(void) {
uint32_t low, high;
// read both registers and assemble a 64bit counter
// reading low first latches a shadow high register which will prevent wraparound
low = read_reg(RTC_TIME_LOW);
high = read_reg(RTC_TIME_HIGH);
return ((uint64_t)high << 32) | low;
}
enum handler_return rtc_irq(void *unused) {
enum handler_return ret = INT_NO_RESCHEDULE;
write_reg(RTC_CLEAR_ALARM, 1);
write_reg(RTC_CLEAR_INTERRUPT, 1);
if (t_callback) {
ret = t_callback(t_arg, current_time());
}
return ret;
}
void goldfish_rtc_early_init(void) {
// sample the timer and use it as a offset for system start
system_boot_offset = read_raw_time();
// clear and stop any pending irqs on the timer
platform_stop_timer();
register_int_handler(VIRT_GF_RTC_IRQ_BASE, &rtc_irq, NULL);
unmask_interrupt(VIRT_GF_RTC_IRQ_BASE);
// its okay to enable the irq since we've cleared the alarm and any pending interrupts
write_reg(RTC_IRQ_ENABLED, 1);
}
void goldfish_rtc_init(void) {
}
lk_bigtime_t current_time_hires(void) {
uint64_t t = read_raw_time() - system_boot_offset;
return t / 1000ULL; // ns -> us
}
lk_time_t current_time(void) {
uint64_t t = read_raw_time() - system_boot_offset;
return (lk_time_t)(t / 1000000ULL); // ns -> ms
}
status_t platform_set_oneshot_timer (platform_timer_callback callback, void *arg, lk_time_t interval) {
LTRACEF("callback %p, arg %p, interval %u\n", callback, arg, interval);
t_callback = callback;
t_arg = arg;
uint64_t delta = read_raw_time();
delta += interval * 1000000ULL;
write_reg(RTC_ALARM_HIGH, delta >> 32);
write_reg(RTC_ALARM_LOW, delta & 0xffffffff);
return NO_ERROR;
}
void platform_stop_timer(void) {
LTRACE;
write_reg(RTC_CLEAR_ALARM, 1);
write_reg(RTC_CLEAR_INTERRUPT, 1);
}
|
bc286c4e0a0750f8ae810ade755c36724bfe9a65
|
971b2cea2d1c3001aadc8ca1a48110b7db1ed5f2
|
/deps/abc/src/sat/cnf/cnfMap.c
|
a6345471720f74b2b771ac1d0fc8beb36f79cf2a
|
[
"MIT-Modern-Variant",
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] |
permissive
|
emsec/hal
|
70ad2921739967d914dd458984bd7d6d497d3b0a
|
e4fae37bec9168a61100eacfda37a1f291b4d0be
|
refs/heads/master
| 2023-09-02T20:27:32.909426
| 2023-09-01T13:03:24
| 2023-09-01T13:03:24
| 169,076,171
| 510
| 72
|
MIT
| 2023-09-01T13:03:26
| 2019-02-04T12:37:20
|
C++
|
UTF-8
|
C
| false
| false
| 10,022
|
c
|
cnfMap.c
|
/**CFile****************************************************************
FileName [cnfMap.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [AIG-to-CNF conversion.]
Synopsis []
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - April 28, 2007.]
Revision [$Id: cnfMap.c,v 1.00 2007/04/28 00:00:00 alanmi Exp $]
***********************************************************************/
#include "cnf.h"
ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis [Computes area flow of the cut.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Cnf_CutAssignAreaFlow( Cnf_Man_t * p, Dar_Cut_t * pCut, int * pAreaFlows )
{
Aig_Obj_t * pLeaf;
int i;
pCut->Value = 0;
// pCut->uSign = 100 * Cnf_CutSopCost( p, pCut );
pCut->uSign = 10 * Cnf_CutSopCost( p, pCut );
Dar_CutForEachLeaf( p->pManAig, pCut, pLeaf, i )
{
pCut->Value += pLeaf->nRefs;
if ( !Aig_ObjIsNode(pLeaf) )
continue;
assert( pLeaf->nRefs > 0 );
pCut->uSign += pAreaFlows[pLeaf->Id] / (pLeaf->nRefs? pLeaf->nRefs : 1);
}
}
/**Function*************************************************************
Synopsis [Computes area flow of the supergate.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Cnf_CutSuperAreaFlow( Vec_Ptr_t * vSuper, int * pAreaFlows )
{
Aig_Obj_t * pLeaf;
int i, nAreaFlow;
nAreaFlow = 100 * (Vec_PtrSize(vSuper) + 1);
Vec_PtrForEachEntry( Aig_Obj_t *, vSuper, pLeaf, i )
{
pLeaf = Aig_Regular(pLeaf);
if ( !Aig_ObjIsNode(pLeaf) )
continue;
assert( pLeaf->nRefs > 0 );
nAreaFlow += pAreaFlows[pLeaf->Id] / (pLeaf->nRefs? pLeaf->nRefs : 1);
}
return nAreaFlow;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Cnf_DeriveMapping( Cnf_Man_t * p )
{
Vec_Ptr_t * vSuper;
Aig_Obj_t * pObj;
Dar_Cut_t * pCut, * pCutBest;
int i, k, AreaFlow, * pAreaFlows;
// allocate area flows
pAreaFlows = ABC_ALLOC( int, Aig_ManObjNumMax(p->pManAig) );
memset( pAreaFlows, 0, sizeof(int) * Aig_ManObjNumMax(p->pManAig) );
// visit the nodes in the topological order and update their best cuts
vSuper = Vec_PtrAlloc( 100 );
Aig_ManForEachNode( p->pManAig, pObj, i )
{
// go through the cuts
pCutBest = NULL;
Dar_ObjForEachCut( pObj, pCut, k )
{
pCut->fBest = 0;
if ( k == 0 )
continue;
Cnf_CutAssignAreaFlow( p, pCut, pAreaFlows );
if ( pCutBest == NULL || pCutBest->uSign > pCut->uSign ||
(pCutBest->uSign == pCut->uSign && pCutBest->Value < pCut->Value) )
pCutBest = pCut;
}
// check the big cut
// Aig_ObjCollectSuper( pObj, vSuper );
// get the area flow of this cut
// AreaFlow = Cnf_CutSuperAreaFlow( vSuper, pAreaFlows );
AreaFlow = ABC_INFINITY;
if ( AreaFlow >= (int)pCutBest->uSign )
{
pAreaFlows[pObj->Id] = pCutBest->uSign;
pCutBest->fBest = 1;
}
else
{
pAreaFlows[pObj->Id] = AreaFlow;
pObj->fMarkB = 1; // mark the special node
}
}
Vec_PtrFree( vSuper );
ABC_FREE( pAreaFlows );
/*
// compute the area of mapping
AreaFlow = 0;
Aig_ManForEachCo( p->pManAig, pObj, i )
AreaFlow += Dar_ObjBestCut(Aig_ObjFanin0(pObj))->uSign / 100 / Aig_ObjFanin0(pObj)->nRefs;
printf( "Area of the network = %d.\n", AreaFlow );
*/
}
#if 0
/**Function*************************************************************
Synopsis [Computes area of the first level.]
Description [The cut need to be derefed.]
SideEffects []
SeeAlso []
***********************************************************************/
void Aig_CutDeref( Aig_Man_t * p, Dar_Cut_t * pCut )
{
Aig_Obj_t * pLeaf;
int i;
Dar_CutForEachLeaf( p, pCut, pLeaf, i )
{
assert( pLeaf->nRefs > 0 );
if ( --pLeaf->nRefs > 0 || !Aig_ObjIsAnd(pLeaf) )
continue;
Aig_CutDeref( p, Aig_ObjBestCut(pLeaf) );
}
}
/**Function*************************************************************
Synopsis [Computes area of the first level.]
Description [The cut need to be derefed.]
SideEffects []
SeeAlso []
***********************************************************************/
int Aig_CutRef( Aig_Man_t * p, Dar_Cut_t * pCut )
{
Aig_Obj_t * pLeaf;
int i, Area = pCut->Value;
Dar_CutForEachLeaf( p, pCut, pLeaf, i )
{
assert( pLeaf->nRefs >= 0 );
if ( pLeaf->nRefs++ > 0 || !Aig_ObjIsAnd(pLeaf) )
continue;
Area += Aig_CutRef( p, Aig_ObjBestCut(pLeaf) );
}
return Area;
}
/**Function*************************************************************
Synopsis [Computes exact area of the cut.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Cnf_CutArea( Aig_Man_t * p, Dar_Cut_t * pCut )
{
int Area;
Area = Aig_CutRef( p, pCut );
Aig_CutDeref( p, pCut );
return Area;
}
/**Function*************************************************************
Synopsis [Returns 1 if the second cut is better.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static inline int Cnf_CutCompare( Dar_Cut_t * pC0, Dar_Cut_t * pC1 )
{
if ( pC0->Area < pC1->Area - 0.0001 )
return -1;
if ( pC0->Area > pC1->Area + 0.0001 ) // smaller area flow is better
return 1;
// if ( pC0->NoRefs < pC1->NoRefs )
// return -1;
// if ( pC0->NoRefs > pC1->NoRefs ) // fewer non-referenced fanins is better
// return 1;
// if ( pC0->FanRefs / pC0->nLeaves > pC1->FanRefs / pC1->nLeaves )
// return -1;
// if ( pC0->FanRefs / pC0->nLeaves < pC1->FanRefs / pC1->nLeaves )
// return 1; // larger average fanin ref-counter is better
// return 0;
return 1;
}
/**Function*************************************************************
Synopsis [Returns the cut with the smallest area flow.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Dar_Cut_t * Cnf_ObjFindBestCut( Aig_Obj_t * pObj )
{
Dar_Cut_t * pCut, * pCutBest;
int i;
pCutBest = NULL;
Dar_ObjForEachCut( pObj, pCut, i )
if ( pCutBest == NULL || Cnf_CutCompare(pCutBest, pCut) == 1 )
pCutBest = pCut;
return pCutBest;
}
/**Function*************************************************************
Synopsis [Computes area flow of the cut.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Cnf_CutAssignArea( Cnf_Man_t * p, Dar_Cut_t * pCut )
{
Aig_Obj_t * pLeaf;
int i;
pCut->Area = (float)pCut->Cost;
pCut->NoRefs = 0;
pCut->FanRefs = 0;
Dar_CutForEachLeaf( p->pManAig, pCut, pLeaf, i )
{
if ( !Aig_ObjIsNode(pLeaf) )
continue;
if ( pLeaf->nRefs == 0 )
{
pCut->Area += Aig_ObjBestCut(pLeaf)->Cost;
pCut->NoRefs++;
}
else
{
if ( pCut->FanRefs + pLeaf->nRefs > 15 )
pCut->FanRefs = 15;
else
pCut->FanRefs += pLeaf->nRefs;
}
}
}
/**Function*************************************************************
Synopsis [Performs one round of "area recovery" using exact local area.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Cnf_ManMapForCnf( Cnf_Man_t * p )
{
Aig_Obj_t * pObj;
Dar_Cut_t * pCut, * pCutBest;
int i, k;
// visit the nodes in the topological order and update their best cuts
Aig_ManForEachNode( p->pManAig, pObj, i )
{
// find the old best cut
pCutBest = Aig_ObjBestCut(pObj);
Dar_ObjClearBestCut(pCutBest);
// if the node is used, dereference its cut
if ( pObj->nRefs )
Aig_CutDeref( p->pManAig, pCutBest );
// evaluate the cuts of this node
Dar_ObjForEachCut( pObj, pCut, k )
// Cnf_CutAssignAreaFlow( p, pCut );
pCut->Area = (float)Cnf_CutArea( p->pManAig, pCut );
// find the new best cut
pCutBest = Cnf_ObjFindBestCut(pObj);
Dar_ObjSetBestCut( pCutBest );
// if the node is used, reference its cut
if ( pObj->nRefs )
Aig_CutRef( p->pManAig, pCutBest );
}
return 1;
}
#endif
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
|
a0612d9e8676d33e1d10178bf4f686a5e1f5d801
|
035660e8cc10571ebbd0d4393fef063bb7eb98f6
|
/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.h
|
881a816a7f8b8fa05e90a389e3c72ea555c6d6fe
|
[] |
no_license
|
zeldaret/mm
|
f163a5e7c4314105777369fa7671ce9c2a99922a
|
4ae00e909e74044f05155683b49d2561f91de7ba
|
refs/heads/master
| 2023-08-06T07:22:04.912966
| 2023-08-04T20:36:03
| 2023-08-04T20:36:03
| 247,875,852
| 915
| 328
| null | 2023-09-14T11:48:59
| 2020-03-17T04:03:07
|
C
|
UTF-8
|
C
| false
| false
| 869
|
h
|
z_obj_spidertent.h
|
#ifndef Z_OBJ_SPIDERTENT_H
#define Z_OBJ_SPIDERTENT_H
#include "global.h"
struct ObjSpidertent;
typedef void (*ObjSpidertentActionFunc)(struct ObjSpidertent*, PlayState*);
#define OBJSPIDERTENT_GET_1(thisx) ((thisx)->params & 1)
#define OBJSPIDERTENT_GET_7F00(thisx) (((thisx)->params >> 8) & 0x7F)
typedef struct ObjSpidertent {
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ ColliderTris collider;
/* 0x17C */ ColliderTrisElement colliderElements[6];
/* 0x3A4 */ Vec3f unk_3A4;
/* 0x3B0 */ f32 unk_3B0[4];
/* 0x3C0 */ u8 unk_3C0;
/* 0x3C1 */ s8 unk_3C1;
/* 0x3C2 */ u8 unk_3C2;
/* 0x3C3 */ u8 unk_3C3;
/* 0x3C4 */ u8 unk_3C4;
/* 0x3C5 */ u8 unk_3C5;
/* 0x3C6 */ s8 unk_3C6;
/* 0x3C7 */ s8 unk_3C7;
/* 0x3C8 */ ObjSpidertentActionFunc actionFunc;
} ObjSpidertent; // size = 0x3CC
#endif // Z_OBJ_SPIDERTENT_H
|
067f7b13142f27e49915e1b3aa31adb86da2180b
|
9907672fcd81ab73ac63b2a83422a82bf31eadde
|
/gcj/tyama_gcj2014qB.c
|
8e897186c5c7787df0ce112ac8da55b4774c032a
|
[
"0BSD"
] |
permissive
|
cielavenir/procon
|
bbe1974b9bddb51b76d58722a0686a5b477c4456
|
746e1a91f574f20647e8aaaac0d9e6173f741176
|
refs/heads/master
| 2023-06-21T23:11:24.562546
| 2023-06-11T13:15:15
| 2023-06-11T13:15:15
| 7,557,464
| 137
| 136
| null | 2020-10-20T09:35:52
| 2013-01-11T09:40:26
|
C++
|
UTF-8
|
C
| false
| false
| 324
|
c
|
tyama_gcj2014qB.c
|
main(){
int T,I=0;
long double c,f,x;
long double ret,sum,cps,rettmp;
for(scanf("%d",&T);I<T;I++){
printf("Case #%d: ",I+1);
scanf("%Lf%Lf%Lf",&c,&f,&x);
sum=0;
cps=2;
ret=sum+x/cps;
for(;sum<ret;){
sum+=c/cps;
cps+=f;
rettmp=sum+x/cps;
if(ret>rettmp)ret=rettmp;
}
printf("%.9Lf\n",ret);
}
}
|
4b3f59b4438c93decf07b0755fa4e7e56dcd57c4
|
60f27032d05f5977ae6a871a968022b674a6ddd1
|
/mettle/src/utils.c
|
d6203d39b965f4bfbaaab26c28b46838b6efa7a2
|
[
"BSD-3-Clause"
] |
permissive
|
rapid7/mettle
|
bcd759a181fee81fa68c7cd15e0b84b71b2f0ff9
|
7274a2413952be0c612fcacf2eb1cc1119c2b840
|
refs/heads/master
| 2023-08-04T15:14:09.902863
| 2023-07-27T17:32:21
| 2023-07-27T17:32:21
| 31,543,393
| 411
| 137
| null | 2023-07-26T11:44:50
| 2015-03-02T14:14:41
|
C
|
UTF-8
|
C
| false
| false
| 1,441
|
c
|
utils.c
|
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
#else
#include <fcntl.h>
#include <stdlib.h>
#endif
#include <string.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include "utils.h"
int
make_socket_nonblocking(int fd)
{
#ifdef _WIN32
unsigned long nonblocking = 1;
if (ioctlsocket(fd, FIONBIO, &nonblocking) == SOCKET_ERROR) {
return -1;
}
#else
int flags;
if ((flags = fcntl(fd, F_GETFL, NULL)) < 0) {
return -1;
}
if (!(flags & O_NONBLOCK)) {
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) {
return -1;
}
}
#endif
return 0;
}
char *
parse_sockaddr(struct sockaddr_storage *addr, uint16_t *port)
{
char host[INET6_ADDRSTRLEN] = { 0 };
if (addr->ss_family == AF_INET) {
struct sockaddr_in *s = (struct sockaddr_in *)addr;
*port = ntohs(s->sin_port);
inet_ntop(AF_INET, &s->sin_addr, host, INET6_ADDRSTRLEN);
} else if (addr->ss_family == AF_INET6) {
struct sockaddr_in6 *s = (struct sockaddr_in6 *)addr;
*port = ntohs(s->sin6_port);
inet_ntop(AF_INET6, &s->sin6_addr, host, INET6_ADDRSTRLEN);
if (IN6_IS_ADDR_V4MAPPED(&s->sin6_addr)) {
struct sockaddr_in addr4;
memset(&addr4, 0, sizeof(addr4));
memcpy(&addr4.sin_addr.s_addr, s->sin6_addr.s6_addr + 12, sizeof(addr4.sin_addr.s_addr));
addr4.sin_family = AF_INET;
addr4.sin_port = s->sin6_port;
inet_ntop(AF_INET, &addr4.sin_addr, host, INET6_ADDRSTRLEN);
}
}
return strdup(host);
}
|
1d0aee8957ee019835b6279971e718ffd88bf7e1
|
8838eb997879add5759b6dfb23f9a646464e53ca
|
/src/compat/posix/include/term.h
|
69749fe45fe364ccc77bc7264d3cc3ebf1cadb6f
|
[
"BSD-2-Clause"
] |
permissive
|
embox/embox
|
d6aacec876978522f01cdc4b8de37a668c6f4c80
|
98e3c06e33f3fdac10a29c069c20775568e0a6d1
|
refs/heads/master
| 2023-09-04T03:02:20.165042
| 2023-09-02T14:55:31
| 2023-09-02T14:55:31
| 33,078,138
| 1,087
| 325
|
BSD-2-Clause
| 2023-09-14T16:58:34
| 2015-03-29T15:27:48
|
C
|
UTF-8
|
C
| false
| false
| 29,947
|
h
|
term.h
|
/**
* @file
* @brief https://pubs.opengroup.org/onlinepubs/7908799/xcurses/term.h.html
*
* @date 1.09.22
* @author Aleksey Zhmulin
*/
#ifndef TERM_H_
#define TERM_H_
#include <stdbool.h>
#include <stdint.h>
struct termtype {
char *term_names;
bool *flags;
int16_t *numbers;
int16_t *strings;
char *str_table;
};
#ifdef TERM_PRIV_H_
#undef TERMINAL
#define TERMINAL struct terminal
TERMINAL;
#else
typedef struct terminal {
struct termtype type;
} TERMINAL;
#endif /* TERM_PRIV_H_ */
extern TERMINAL *cur_term;
#define CUR_TERM_STRINGS(n) cur_term->type.str_table + cur_term->type.strings[n]
#define TINFO_AUTO_LEFT_MARGIN cur_term->type.flags[0]
#define TINFO_AUTO_RIGHT_MARGIN cur_term->type.flags[1]
#define TINFO_NO_ESC_CTLC cur_term->type.flags[2]
#define TINFO_CEOL_STANDOUT_GLITCH cur_term->type.flags[3]
#define TINFO_EAT_NEWLINE_GLITCH cur_term->type.flags[4]
#define TINFO_ERASE_OVERSTRIKE cur_term->type.flags[5]
#define TINFO_GENERIC_TYPE cur_term->type.flags[6]
#define TINFO_HARD_COPY cur_term->type.flags[7]
#define TINFO_HAS_META_KEY cur_term->type.flags[8]
#define TINFO_HAS_STATUS_LINE cur_term->type.flags[9]
#define TINFO_INSERT_NULL_GLITCH cur_term->type.flags[10]
#define TINFO_MEMORY_ABOVE cur_term->type.flags[11]
#define TINFO_MEMORY_BELOW cur_term->type.flags[12]
#define TINFO_MOVE_INSERT_MODE cur_term->type.flags[13]
#define TINFO_MOVE_STANDOUT_MODE cur_term->type.flags[14]
#define TINFO_OVER_STRIKE cur_term->type.flags[15]
#define TINFO_STATUS_LINE_ESC_OK cur_term->type.flags[16]
#define TINFO_DEST_TABS_MAGIC_SMSO cur_term->type.flags[17]
#define TINFO_TILDE_GLITCH cur_term->type.flags[18]
#define TINFO_TRANSPARENT_UNDERLINE cur_term->type.flags[19]
#define TINFO_XON_XOFF cur_term->type.flags[20]
#define TINFO_NEEDS_XON_XOFF cur_term->type.flags[21]
#define TINFO_PRTR_SILENT cur_term->type.flags[22]
#define TINFO_HARD_CURSOR cur_term->type.flags[23]
#define TINFO_NON_REV_RMCUP cur_term->type.flags[24]
#define TINFO_NO_PAD_CHAR cur_term->type.flags[25]
#define TINFO_NON_DEST_SCROLL_REGION cur_term->type.flags[26]
#define TINFO_CAN_CHANGE cur_term->type.flags[27]
#define TINFO_BACK_COLOR_ERASE cur_term->type.flags[28]
#define TINFO_HUE_LIGHTNESS_SATURATION cur_term->type.flags[29]
#define TINFO_COL_ADDR_GLITCH cur_term->type.flags[30]
#define TINFO_CR_CANCELS_MICRO_MODE cur_term->type.flags[31]
#define TINFO_HAS_PRINT_WHEEL cur_term->type.flags[32]
#define TINFO_ROW_ADDR_GLITCH cur_term->type.flags[33]
#define TINFO_SEMI_AUTO_RIGHT_MARGIN cur_term->type.flags[34]
#define TINFO_CPI_CHANGES_RES cur_term->type.flags[35]
#define TINFO_LPI_CHANGES_RES cur_term->type.flags[36]
#define TINFO_COLUMNS cur_term->type.numbers[0]
#define TINFO_INIT_TABS cur_term->type.numbers[1]
#define TINFO_LINES cur_term->type.numbers[2]
#define TINFO_LINES_OF_MEMORY cur_term->type.numbers[3]
#define TINFO_MAGIC_COOKIE_GLITCH cur_term->type.numbers[4]
#define TINFO_PADDING_BAUD_RATE cur_term->type.numbers[5]
#define TINFO_VIRTUAL_TERMINAL cur_term->type.numbers[6]
#define TINFO_WIDTH_STATUS_LINE cur_term->type.numbers[7]
#define TINFO_NUM_LABELS cur_term->type.numbers[8]
#define TINFO_LABEL_HEIGHT cur_term->type.numbers[9]
#define TINFO_LABEL_WIDTH cur_term->type.numbers[10]
#define TINFO_MAX_ATTRIBUTES cur_term->type.numbers[11]
#define TINFO_MAXIMUM_WINDOWS cur_term->type.numbers[12]
#define TINFO_MAX_COLORS cur_term->type.numbers[13]
#define TINFO_MAX_PAIRS cur_term->type.numbers[14]
#define TINFO_NO_COLOR_VIDEO cur_term->type.numbers[15]
#define TINFO_BUFFER_CAPACITY cur_term->type.numbers[16]
#define TINFO_DOT_VERT_SPACING cur_term->type.numbers[17]
#define TINFO_DOT_HORZ_SPACING cur_term->type.numbers[18]
#define TINFO_MAX_MICRO_ADDRESS cur_term->type.numbers[19]
#define TINFO_MAX_MICRO_JUMP cur_term->type.numbers[20]
#define TINFO_MICRO_COL_SIZE cur_term->type.numbers[21]
#define TINFO_MICRO_LINE_SIZE cur_term->type.numbers[22]
#define TINFO_NUMBER_OF_PINS cur_term->type.numbers[23]
#define TINFO_OUTPUT_RES_CHAR cur_term->type.numbers[24]
#define TINFO_OUTPUT_RES_LINE cur_term->type.numbers[25]
#define TINFO_OUTPUT_RES_HORZ_INCH cur_term->type.numbers[26]
#define TINFO_OUTPUT_RES_VERT_INCH cur_term->type.numbers[27]
#define TINFO_PRINT_RATE cur_term->type.numbers[28]
#define TINFO_WIDE_CHAR_SIZE cur_term->type.numbers[29]
#define TINFO_BUTTONS cur_term->type.numbers[30]
#define TINFO_BIT_IMAGE_ENTWINING cur_term->type.numbers[31]
#define TINFO_BIT_IMAGE_TYPE cur_term->type.numbers[32]
#define TINFO_BACK_TAB CUR_TERM_STRINGS(0)
#define TINFO_BELL CUR_TERM_STRINGS(1)
#define TINFO_CARRIAGE_RETURN CUR_TERM_STRINGS(2)
#define TINFO_CHANGE_SCROLL_REGION CUR_TERM_STRINGS(3)
#define TINFO_CLEAR_ALL_TABS CUR_TERM_STRINGS(4)
#define TINFO_CLEAR_SCREEN CUR_TERM_STRINGS(5)
#define TINFO_CLR_EOL CUR_TERM_STRINGS(6)
#define TINFO_CLR_EOS CUR_TERM_STRINGS(7)
#define TINFO_COLUMN_ADDRESS CUR_TERM_STRINGS(8)
#define TINFO_COMMAND_CHARACTER CUR_TERM_STRINGS(9)
#define TINFO_CURSOR_ADDRESS CUR_TERM_STRINGS(10)
#define TINFO_CURSOR_DOWN CUR_TERM_STRINGS(11)
#define TINFO_CURSOR_HOME CUR_TERM_STRINGS(12)
#define TINFO_CURSOR_INVISIBLE CUR_TERM_STRINGS(13)
#define TINFO_CURSOR_LEFT CUR_TERM_STRINGS(14)
#define TINFO_CURSOR_MEM_ADDRESS CUR_TERM_STRINGS(15)
#define TINFO_CURSOR_NORMAL CUR_TERM_STRINGS(16)
#define TINFO_CURSOR_RIGHT CUR_TERM_STRINGS(17)
#define TINFO_CURSOR_TO_LL CUR_TERM_STRINGS(18)
#define TINFO_CURSOR_UP CUR_TERM_STRINGS(19)
#define TINFO_CURSOR_VISIBLE CUR_TERM_STRINGS(20)
#define TINFO_DELETE_CHARACTER CUR_TERM_STRINGS(21)
#define TINFO_DELETE_LINE CUR_TERM_STRINGS(22)
#define TINFO_DIS_STATUS_LINE CUR_TERM_STRINGS(23)
#define TINFO_DOWN_HALF_LINE CUR_TERM_STRINGS(24)
#define TINFO_ENTER_ALT_CHARSET_MODE CUR_TERM_STRINGS(25)
#define TINFO_ENTER_BLINK_MODE CUR_TERM_STRINGS(26)
#define TINFO_ENTER_BOLD_MODE CUR_TERM_STRINGS(27)
#define TINFO_ENTER_CA_MODE CUR_TERM_STRINGS(28)
#define TINFO_ENTER_DELETE_MODE CUR_TERM_STRINGS(29)
#define TINFO_ENTER_DIM_MODE CUR_TERM_STRINGS(30)
#define TINFO_ENTER_INSERT_MODE CUR_TERM_STRINGS(31)
#define TINFO_ENTER_SECURE_MODE CUR_TERM_STRINGS(32)
#define TINFO_ENTER_PROTECTED_MODE CUR_TERM_STRINGS(33)
#define TINFO_ENTER_REVERSE_MODE CUR_TERM_STRINGS(34)
#define TINFO_ENTER_STANDOUT_MODE CUR_TERM_STRINGS(35)
#define TINFO_ENTER_UNDERLINE_MODE CUR_TERM_STRINGS(36)
#define TINFO_ERASE_CHARS CUR_TERM_STRINGS(37)
#define TINFO_EXIT_ALT_CHARSET_MODE CUR_TERM_STRINGS(38)
#define TINFO_EXIT_ATTRIBUTE_MODE CUR_TERM_STRINGS(39)
#define TINFO_EXIT_CA_MODE CUR_TERM_STRINGS(40)
#define TINFO_EXIT_DELETE_MODE CUR_TERM_STRINGS(41)
#define TINFO_EXIT_INSERT_MODE CUR_TERM_STRINGS(42)
#define TINFO_EXIT_STANDOUT_MODE CUR_TERM_STRINGS(43)
#define TINFO_EXIT_UNDERLINE_MODE CUR_TERM_STRINGS(44)
#define TINFO_FLASH_SCREEN CUR_TERM_STRINGS(45)
#define TINFO_FORM_FEED CUR_TERM_STRINGS(46)
#define TINFO_FROM_STATUS_LINE CUR_TERM_STRINGS(47)
#define TINFO_INIT_1STRING CUR_TERM_STRINGS(48)
#define TINFO_INIT_2STRING CUR_TERM_STRINGS(49)
#define TINFO_INIT_3STRING CUR_TERM_STRINGS(50)
#define TINFO_INIT_FILE CUR_TERM_STRINGS(51)
#define TINFO_INSERT_CHARACTER CUR_TERM_STRINGS(52)
#define TINFO_INSERT_LINE CUR_TERM_STRINGS(53)
#define TINFO_INSERT_PADDING CUR_TERM_STRINGS(54)
#define TINFO_KEY_BACKSPACE CUR_TERM_STRINGS(55)
#define TINFO_KEY_CATAB CUR_TERM_STRINGS(56)
#define TINFO_KEY_CLEAR CUR_TERM_STRINGS(57)
#define TINFO_KEY_CTAB CUR_TERM_STRINGS(58)
#define TINFO_KEY_DC CUR_TERM_STRINGS(59)
#define TINFO_KEY_DL CUR_TERM_STRINGS(60)
#define TINFO_KEY_DOWN CUR_TERM_STRINGS(61)
#define TINFO_KEY_EIC CUR_TERM_STRINGS(62)
#define TINFO_KEY_EOL CUR_TERM_STRINGS(63)
#define TINFO_KEY_EOS CUR_TERM_STRINGS(64)
#define TINFO_KEY_F0 CUR_TERM_STRINGS(65)
#define TINFO_KEY_F1 CUR_TERM_STRINGS(66)
#define TINFO_KEY_F10 CUR_TERM_STRINGS(67)
#define TINFO_KEY_F2 CUR_TERM_STRINGS(68)
#define TINFO_KEY_F3 CUR_TERM_STRINGS(69)
#define TINFO_KEY_F4 CUR_TERM_STRINGS(70)
#define TINFO_KEY_F5 CUR_TERM_STRINGS(71)
#define TINFO_KEY_F6 CUR_TERM_STRINGS(72)
#define TINFO_KEY_F7 CUR_TERM_STRINGS(73)
#define TINFO_KEY_F8 CUR_TERM_STRINGS(74)
#define TINFO_KEY_F9 CUR_TERM_STRINGS(75)
#define TINFO_KEY_HOME CUR_TERM_STRINGS(76)
#define TINFO_KEY_IC CUR_TERM_STRINGS(77)
#define TINFO_KEY_IL CUR_TERM_STRINGS(78)
#define TINFO_KEY_LEFT CUR_TERM_STRINGS(79)
#define TINFO_KEY_LL CUR_TERM_STRINGS(80)
#define TINFO_KEY_NPAGE CUR_TERM_STRINGS(81)
#define TINFO_KEY_PPAGE CUR_TERM_STRINGS(82)
#define TINFO_KEY_RIGHT CUR_TERM_STRINGS(83)
#define TINFO_KEY_SF CUR_TERM_STRINGS(84)
#define TINFO_KEY_SR CUR_TERM_STRINGS(85)
#define TINFO_KEY_STAB CUR_TERM_STRINGS(86)
#define TINFO_KEY_UP CUR_TERM_STRINGS(87)
#define TINFO_KEYPAD_LOCAL CUR_TERM_STRINGS(88)
#define TINFO_KEYPAD_XMIT CUR_TERM_STRINGS(89)
#define TINFO_LAB_F0 CUR_TERM_STRINGS(90)
#define TINFO_LAB_F1 CUR_TERM_STRINGS(91)
#define TINFO_LAB_F10 CUR_TERM_STRINGS(92)
#define TINFO_LAB_F2 CUR_TERM_STRINGS(93)
#define TINFO_LAB_F3 CUR_TERM_STRINGS(94)
#define TINFO_LAB_F4 CUR_TERM_STRINGS(95)
#define TINFO_LAB_F5 CUR_TERM_STRINGS(96)
#define TINFO_LAB_F6 CUR_TERM_STRINGS(97)
#define TINFO_LAB_F7 CUR_TERM_STRINGS(98)
#define TINFO_LAB_F8 CUR_TERM_STRINGS(99)
#define TINFO_LAB_F9 CUR_TERM_STRINGS(100)
#define TINFO_META_OFF CUR_TERM_STRINGS(101)
#define TINFO_META_ON CUR_TERM_STRINGS(102)
#define TINFO_NEWLINE CUR_TERM_STRINGS(103)
#define TINFO_PAD_CHAR CUR_TERM_STRINGS(104)
#define TINFO_PARM_DCH CUR_TERM_STRINGS(105)
#define TINFO_PARM_DELETE_LINE CUR_TERM_STRINGS(106)
#define TINFO_PARM_DOWN_CURSOR CUR_TERM_STRINGS(107)
#define TINFO_PARM_ICH CUR_TERM_STRINGS(108)
#define TINFO_PARM_INDEX CUR_TERM_STRINGS(109)
#define TINFO_PARM_INSERT_LINE CUR_TERM_STRINGS(110)
#define TINFO_PARM_LEFT_CURSOR CUR_TERM_STRINGS(111)
#define TINFO_PARM_RIGHT_CURSOR CUR_TERM_STRINGS(112)
#define TINFO_PARM_RINDEX CUR_TERM_STRINGS(113)
#define TINFO_PARM_UP_CURSOR CUR_TERM_STRINGS(114)
#define TINFO_PKEY_KEY CUR_TERM_STRINGS(115)
#define TINFO_PKEY_LOCAL CUR_TERM_STRINGS(116)
#define TINFO_PKEY_XMIT CUR_TERM_STRINGS(117)
#define TINFO_PRINT_SCREEN CUR_TERM_STRINGS(118)
#define TINFO_PRTR_OFF CUR_TERM_STRINGS(119)
#define TINFO_PRTR_ON CUR_TERM_STRINGS(120)
#define TINFO_REPEAT_CHAR CUR_TERM_STRINGS(121)
#define TINFO_RESET_1STRING CUR_TERM_STRINGS(122)
#define TINFO_RESET_2STRING CUR_TERM_STRINGS(123)
#define TINFO_RESET_3STRING CUR_TERM_STRINGS(124)
#define TINFO_RESET_FILE CUR_TERM_STRINGS(125)
#define TINFO_RESTORE_CURSOR CUR_TERM_STRINGS(126)
#define TINFO_ROW_ADDRESS CUR_TERM_STRINGS(127)
#define TINFO_SAVE_CURSOR CUR_TERM_STRINGS(128)
#define TINFO_SCROLL_FORWARD CUR_TERM_STRINGS(129)
#define TINFO_SCROLL_REVERSE CUR_TERM_STRINGS(130)
#define TINFO_SET_ATTRIBUTES CUR_TERM_STRINGS(131)
#define TINFO_SET_TAB CUR_TERM_STRINGS(132)
#define TINFO_SET_WINDOW CUR_TERM_STRINGS(133)
#define TINFO_TAB CUR_TERM_STRINGS(134)
#define TINFO_TO_STATUS_LINE CUR_TERM_STRINGS(135)
#define TINFO_UNDERLINE_CHAR CUR_TERM_STRINGS(136)
#define TINFO_UP_HALF_LINE CUR_TERM_STRINGS(137)
#define TINFO_INIT_PROG CUR_TERM_STRINGS(138)
#define TINFO_KEY_A1 CUR_TERM_STRINGS(139)
#define TINFO_KEY_A3 CUR_TERM_STRINGS(140)
#define TINFO_KEY_B2 CUR_TERM_STRINGS(141)
#define TINFO_KEY_C1 CUR_TERM_STRINGS(142)
#define TINFO_KEY_C3 CUR_TERM_STRINGS(143)
#define TINFO_PRTR_NON CUR_TERM_STRINGS(144)
#define TINFO_CHAR_PADDING CUR_TERM_STRINGS(145)
#define TINFO_ACS_CHARS CUR_TERM_STRINGS(146)
#define TINFO_PLAB_NORM CUR_TERM_STRINGS(147)
#define TINFO_KEY_BTAB CUR_TERM_STRINGS(148)
#define TINFO_ENTER_XON_MODE CUR_TERM_STRINGS(149)
#define TINFO_EXIT_XON_MODE CUR_TERM_STRINGS(150)
#define TINFO_ENTER_AM_MODE CUR_TERM_STRINGS(151)
#define TINFO_EXIT_AM_MODE CUR_TERM_STRINGS(152)
#define TINFO_XON_CHARACTER CUR_TERM_STRINGS(153)
#define TINFO_XOFF_CHARACTER CUR_TERM_STRINGS(154)
#define TINFO_ENA_ACS CUR_TERM_STRINGS(155)
#define TINFO_LABEL_ON CUR_TERM_STRINGS(156)
#define TINFO_LABEL_OFF CUR_TERM_STRINGS(157)
#define TINFO_KEY_BEG CUR_TERM_STRINGS(158)
#define TINFO_KEY_CANCEL CUR_TERM_STRINGS(159)
#define TINFO_KEY_CLOSE CUR_TERM_STRINGS(160)
#define TINFO_KEY_COMMAND CUR_TERM_STRINGS(161)
#define TINFO_KEY_COPY CUR_TERM_STRINGS(162)
#define TINFO_KEY_CREATE CUR_TERM_STRINGS(163)
#define TINFO_KEY_END CUR_TERM_STRINGS(164)
#define TINFO_KEY_ENTER CUR_TERM_STRINGS(165)
#define TINFO_KEY_EXIT CUR_TERM_STRINGS(166)
#define TINFO_KEY_FIND CUR_TERM_STRINGS(167)
#define TINFO_KEY_HELP CUR_TERM_STRINGS(168)
#define TINFO_KEY_MARK CUR_TERM_STRINGS(169)
#define TINFO_KEY_MESSAGE CUR_TERM_STRINGS(170)
#define TINFO_KEY_MOVE CUR_TERM_STRINGS(171)
#define TINFO_KEY_NEXT CUR_TERM_STRINGS(172)
#define TINFO_KEY_OPEN CUR_TERM_STRINGS(173)
#define TINFO_KEY_OPTIONS CUR_TERM_STRINGS(174)
#define TINFO_KEY_PREVIOUS CUR_TERM_STRINGS(175)
#define TINFO_KEY_PRINT CUR_TERM_STRINGS(176)
#define TINFO_KEY_REDO CUR_TERM_STRINGS(177)
#define TINFO_KEY_REFERENCE CUR_TERM_STRINGS(178)
#define TINFO_KEY_REFRESH CUR_TERM_STRINGS(179)
#define TINFO_KEY_REPLACE CUR_TERM_STRINGS(180)
#define TINFO_KEY_RESTART CUR_TERM_STRINGS(181)
#define TINFO_KEY_RESUME CUR_TERM_STRINGS(182)
#define TINFO_KEY_SAVE CUR_TERM_STRINGS(183)
#define TINFO_KEY_SUSPEND CUR_TERM_STRINGS(184)
#define TINFO_KEY_UNDO CUR_TERM_STRINGS(185)
#define TINFO_KEY_SBEG CUR_TERM_STRINGS(186)
#define TINFO_KEY_SCANCEL CUR_TERM_STRINGS(187)
#define TINFO_KEY_SCOMMAND CUR_TERM_STRINGS(188)
#define TINFO_KEY_SCOPY CUR_TERM_STRINGS(189)
#define TINFO_KEY_SCREATE CUR_TERM_STRINGS(190)
#define TINFO_KEY_SDC CUR_TERM_STRINGS(191)
#define TINFO_KEY_SDL CUR_TERM_STRINGS(192)
#define TINFO_KEY_SELECT CUR_TERM_STRINGS(193)
#define TINFO_KEY_SEND CUR_TERM_STRINGS(194)
#define TINFO_KEY_SEOL CUR_TERM_STRINGS(195)
#define TINFO_KEY_SEXIT CUR_TERM_STRINGS(196)
#define TINFO_KEY_SFIND CUR_TERM_STRINGS(197)
#define TINFO_KEY_SHELP CUR_TERM_STRINGS(198)
#define TINFO_KEY_SHOME CUR_TERM_STRINGS(199)
#define TINFO_KEY_SIC CUR_TERM_STRINGS(200)
#define TINFO_KEY_SLEFT CUR_TERM_STRINGS(201)
#define TINFO_KEY_SMESSAGE CUR_TERM_STRINGS(202)
#define TINFO_KEY_SMOVE CUR_TERM_STRINGS(203)
#define TINFO_KEY_SNEXT CUR_TERM_STRINGS(204)
#define TINFO_KEY_SOPTIONS CUR_TERM_STRINGS(205)
#define TINFO_KEY_SPREVIOUS CUR_TERM_STRINGS(206)
#define TINFO_KEY_SPRINT CUR_TERM_STRINGS(207)
#define TINFO_KEY_SREDO CUR_TERM_STRINGS(208)
#define TINFO_KEY_SREPLACE CUR_TERM_STRINGS(209)
#define TINFO_KEY_SRIGHT CUR_TERM_STRINGS(210)
#define TINFO_KEY_SRSUME CUR_TERM_STRINGS(211)
#define TINFO_KEY_SSAVE CUR_TERM_STRINGS(212)
#define TINFO_KEY_SSUSPEND CUR_TERM_STRINGS(213)
#define TINFO_KEY_SUNDO CUR_TERM_STRINGS(214)
#define TINFO_REQ_FOR_INPUT CUR_TERM_STRINGS(215)
#define TINFO_KEY_F11 CUR_TERM_STRINGS(216)
#define TINFO_KEY_F12 CUR_TERM_STRINGS(217)
#define TINFO_KEY_F13 CUR_TERM_STRINGS(218)
#define TINFO_KEY_F14 CUR_TERM_STRINGS(219)
#define TINFO_KEY_F15 CUR_TERM_STRINGS(220)
#define TINFO_KEY_F16 CUR_TERM_STRINGS(221)
#define TINFO_KEY_F17 CUR_TERM_STRINGS(222)
#define TINFO_KEY_F18 CUR_TERM_STRINGS(223)
#define TINFO_KEY_F19 CUR_TERM_STRINGS(224)
#define TINFO_KEY_F20 CUR_TERM_STRINGS(225)
#define TINFO_KEY_F21 CUR_TERM_STRINGS(226)
#define TINFO_KEY_F22 CUR_TERM_STRINGS(227)
#define TINFO_KEY_F23 CUR_TERM_STRINGS(228)
#define TINFO_KEY_F24 CUR_TERM_STRINGS(229)
#define TINFO_KEY_F25 CUR_TERM_STRINGS(230)
#define TINFO_KEY_F26 CUR_TERM_STRINGS(231)
#define TINFO_KEY_F27 CUR_TERM_STRINGS(232)
#define TINFO_KEY_F28 CUR_TERM_STRINGS(233)
#define TINFO_KEY_F29 CUR_TERM_STRINGS(234)
#define TINFO_KEY_F30 CUR_TERM_STRINGS(235)
#define TINFO_KEY_F31 CUR_TERM_STRINGS(236)
#define TINFO_KEY_F32 CUR_TERM_STRINGS(237)
#define TINFO_KEY_F33 CUR_TERM_STRINGS(238)
#define TINFO_KEY_F34 CUR_TERM_STRINGS(239)
#define TINFO_KEY_F35 CUR_TERM_STRINGS(240)
#define TINFO_KEY_F36 CUR_TERM_STRINGS(241)
#define TINFO_KEY_F37 CUR_TERM_STRINGS(242)
#define TINFO_KEY_F38 CUR_TERM_STRINGS(243)
#define TINFO_KEY_F39 CUR_TERM_STRINGS(244)
#define TINFO_KEY_F40 CUR_TERM_STRINGS(245)
#define TINFO_KEY_F41 CUR_TERM_STRINGS(246)
#define TINFO_KEY_F42 CUR_TERM_STRINGS(247)
#define TINFO_KEY_F43 CUR_TERM_STRINGS(248)
#define TINFO_KEY_F44 CUR_TERM_STRINGS(249)
#define TINFO_KEY_F45 CUR_TERM_STRINGS(250)
#define TINFO_KEY_F46 CUR_TERM_STRINGS(251)
#define TINFO_KEY_F47 CUR_TERM_STRINGS(252)
#define TINFO_KEY_F48 CUR_TERM_STRINGS(253)
#define TINFO_KEY_F49 CUR_TERM_STRINGS(254)
#define TINFO_KEY_F50 CUR_TERM_STRINGS(255)
#define TINFO_KEY_F51 CUR_TERM_STRINGS(256)
#define TINFO_KEY_F52 CUR_TERM_STRINGS(257)
#define TINFO_KEY_F53 CUR_TERM_STRINGS(258)
#define TINFO_KEY_F54 CUR_TERM_STRINGS(259)
#define TINFO_KEY_F55 CUR_TERM_STRINGS(260)
#define TINFO_KEY_F56 CUR_TERM_STRINGS(261)
#define TINFO_KEY_F57 CUR_TERM_STRINGS(262)
#define TINFO_KEY_F58 CUR_TERM_STRINGS(263)
#define TINFO_KEY_F59 CUR_TERM_STRINGS(264)
#define TINFO_KEY_F60 CUR_TERM_STRINGS(265)
#define TINFO_KEY_F61 CUR_TERM_STRINGS(266)
#define TINFO_KEY_F62 CUR_TERM_STRINGS(267)
#define TINFO_KEY_F63 CUR_TERM_STRINGS(268)
#define TINFO_CLR_BOL CUR_TERM_STRINGS(269)
#define TINFO_CLEAR_MARGINS CUR_TERM_STRINGS(270)
#define TINFO_SET_LEFT_MARGIN CUR_TERM_STRINGS(271)
#define TINFO_SET_RIGHT_MARGIN CUR_TERM_STRINGS(272)
#define TINFO_LABEL_FORMAT CUR_TERM_STRINGS(273)
#define TINFO_SET_CLOCK CUR_TERM_STRINGS(274)
#define TINFO_DISPLAY_CLOCK CUR_TERM_STRINGS(275)
#define TINFO_REMOVE_CLOCK CUR_TERM_STRINGS(276)
#define TINFO_CREATE_WINDOW CUR_TERM_STRINGS(277)
#define TINFO_GOTO_WINDOW CUR_TERM_STRINGS(278)
#define TINFO_HANGUP CUR_TERM_STRINGS(279)
#define TINFO_DIAL_PHONE CUR_TERM_STRINGS(280)
#define TINFO_QUICK_DIAL CUR_TERM_STRINGS(281)
#define TINFO_TONE CUR_TERM_STRINGS(282)
#define TINFO_PULSE CUR_TERM_STRINGS(283)
#define TINFO_FLASH_HOOK CUR_TERM_STRINGS(284)
#define TINFO_FIXED_PAUSE CUR_TERM_STRINGS(285)
#define TINFO_WAIT_TONE CUR_TERM_STRINGS(286)
#define TINFO_USER0 CUR_TERM_STRINGS(287)
#define TINFO_USER1 CUR_TERM_STRINGS(288)
#define TINFO_USER2 CUR_TERM_STRINGS(289)
#define TINFO_USER3 CUR_TERM_STRINGS(290)
#define TINFO_USER4 CUR_TERM_STRINGS(291)
#define TINFO_USER5 CUR_TERM_STRINGS(292)
#define TINFO_USER6 CUR_TERM_STRINGS(293)
#define TINFO_USER7 CUR_TERM_STRINGS(294)
#define TINFO_USER8 CUR_TERM_STRINGS(295)
#define TINFO_USER9 CUR_TERM_STRINGS(296)
#define TINFO_ORIG_PAIR CUR_TERM_STRINGS(297)
#define TINFO_ORIG_COLORS CUR_TERM_STRINGS(298)
#define TINFO_INITIALIZE_COLOR CUR_TERM_STRINGS(299)
#define TINFO_INITIALIZE_PAIR CUR_TERM_STRINGS(300)
#define TINFO_SET_COLOR_PAIR CUR_TERM_STRINGS(301)
#define TINFO_SET_FOREGROUND CUR_TERM_STRINGS(302)
#define TINFO_SET_BACKGROUND CUR_TERM_STRINGS(303)
#define TINFO_CHANGE_CHAR_PITCH CUR_TERM_STRINGS(304)
#define TINFO_CHANGE_LINE_PITCH CUR_TERM_STRINGS(305)
#define TINFO_CHANGE_RES_HORZ CUR_TERM_STRINGS(306)
#define TINFO_CHANGE_RES_VERT CUR_TERM_STRINGS(307)
#define TINFO_DEFINE_CHAR CUR_TERM_STRINGS(308)
#define TINFO_ENTER_DOUBLEWIDE_MODE CUR_TERM_STRINGS(309)
#define TINFO_ENTER_DRAFT_QUALITY CUR_TERM_STRINGS(310)
#define TINFO_ENTER_ITALICS_MODE CUR_TERM_STRINGS(311)
#define TINFO_ENTER_LEFTWARD_MODE CUR_TERM_STRINGS(312)
#define TINFO_ENTER_MICRO_MODE CUR_TERM_STRINGS(313)
#define TINFO_ENTER_NEAR_LETTER_QUALITy CUR_TERM_STRINGS(314)
#define TINFO_ENTER_NORMAL_QUALITY CUR_TERM_STRINGS(315)
#define TINFO_ENTER_SHADOW_MODE CUR_TERM_STRINGS(316)
#define TINFO_ENTER_SUBSCRIPT_MODE CUR_TERM_STRINGS(317)
#define TINFO_ENTER_SUPERSCRIPT_MODE CUR_TERM_STRINGS(318)
#define TINFO_ENTER_UPWARD_MODE CUR_TERM_STRINGS(319)
#define TINFO_EXIT_DOUBLEWIDE_MODE CUR_TERM_STRINGS(320)
#define TINFO_EXIT_ITALICS_MODE CUR_TERM_STRINGS(321)
#define TINFO_EXIT_LEFTWARD_MODE CUR_TERM_STRINGS(322)
#define TINFO_EXIT_MICRO_MODE CUR_TERM_STRINGS(323)
#define TINFO_EXIT_SHADOW_MODE CUR_TERM_STRINGS(324)
#define TINFO_EXIT_SUBSCRIPT_MODE CUR_TERM_STRINGS(325)
#define TINFO_EXIT_SUPERSCRIPT_MODE CUR_TERM_STRINGS(326)
#define TINFO_EXIT_UPWARD_MODE CUR_TERM_STRINGS(327)
#define TINFO_MICRO_COLUMN_ADDRESS CUR_TERM_STRINGS(328)
#define TINFO_MICRO_DOWN CUR_TERM_STRINGS(329)
#define TINFO_MICRO_LEFT CUR_TERM_STRINGS(330)
#define TINFO_MICRO_RIGHT CUR_TERM_STRINGS(331)
#define TINFO_MICRO_ROW_ADDRESS CUR_TERM_STRINGS(332)
#define TINFO_MICRO_UP CUR_TERM_STRINGS(333)
#define TINFO_ORDER_OF_PINS CUR_TERM_STRINGS(334)
#define TINFO_PARM_DOWN_MICRO CUR_TERM_STRINGS(335)
#define TINFO_PARM_LEFT_MICRO CUR_TERM_STRINGS(336)
#define TINFO_PARM_RIGHT_MICRO CUR_TERM_STRINGS(337)
#define TINFO_PARM_UP_MICRO CUR_TERM_STRINGS(338)
#define TINFO_SELECT_CHAR_SET CUR_TERM_STRINGS(339)
#define TINFO_SET_BOTTOM_MARGIN CUR_TERM_STRINGS(340)
#define TINFO_SET_BOTTOM_MARGIN_PARM CUR_TERM_STRINGS(341)
#define TINFO_SET_LEFT_MARGIN_PARM CUR_TERM_STRINGS(342)
#define TINFO_SET_RIGHT_MARGIN_PARM CUR_TERM_STRINGS(343)
#define TINFO_SET_TOP_MARGIN CUR_TERM_STRINGS(344)
#define TINFO_SET_TOP_MARGIN_PARM CUR_TERM_STRINGS(345)
#define TINFO_START_BIT_IMAGE CUR_TERM_STRINGS(346)
#define TINFO_START_CHAR_SET_DEF CUR_TERM_STRINGS(347)
#define TINFO_STOP_BIT_IMAGE CUR_TERM_STRINGS(348)
#define TINFO_STOP_CHAR_SET_DEF CUR_TERM_STRINGS(349)
#define TINFO_SUBSCRIPT_CHARACTERS CUR_TERM_STRINGS(350)
#define TINFO_SUPERSCRIPT_CHARACTERS CUR_TERM_STRINGS(351)
#define TINFO_THESE_CAUSE_CR CUR_TERM_STRINGS(352)
#define TINFO_ZERO_MOTION CUR_TERM_STRINGS(353)
#define TINFO_CHAR_SET_NAMES CUR_TERM_STRINGS(354)
#define TINFO_KEY_MOUSE CUR_TERM_STRINGS(355)
#define TINFO_MOUSE_INFO CUR_TERM_STRINGS(356)
#define TINFO_REQ_MOUSE_POS CUR_TERM_STRINGS(357)
#define TINFO_GET_MOUSE CUR_TERM_STRINGS(358)
#define TINFO_SET_A_FOREGROUND CUR_TERM_STRINGS(359)
#define TINFO_SET_A_BACKGROUND CUR_TERM_STRINGS(360)
#define TINFO_PKEY_PLAB CUR_TERM_STRINGS(361)
#define TINFO_DEVICE_TYPE CUR_TERM_STRINGS(362)
#define TINFO_CODE_SET_INIT CUR_TERM_STRINGS(363)
#define TINFO_SET0_DES_SEQ CUR_TERM_STRINGS(364)
#define TINFO_SET1_DES_SEQ CUR_TERM_STRINGS(365)
#define TINFO_SET2_DES_SEQ CUR_TERM_STRINGS(366)
#define TINFO_SET3_DES_SEQ CUR_TERM_STRINGS(367)
#define TINFO_SET_LR_MARGIN CUR_TERM_STRINGS(368)
#define TINFO_SET_TB_MARGIN CUR_TERM_STRINGS(369)
#define TINFO_BIT_IMAGE_REPEAT CUR_TERM_STRINGS(370)
#define TINFO_BIT_IMAGE_NEWLINE CUR_TERM_STRINGS(371)
#define TINFO_BIT_IMAGE_CARRIAGE_RETURn CUR_TERM_STRINGS(372)
#define TINFO_COLOR_NAMES CUR_TERM_STRINGS(373)
#define TINFO_DEFINE_BIT_IMAGE_REGION CUR_TERM_STRINGS(374)
#define TINFO_END_BIT_IMAGE_REGION CUR_TERM_STRINGS(375)
#define TINFO_SET_COLOR_BAND CUR_TERM_STRINGS(376)
#define TINFO_SET_PAGE_LENGTH CUR_TERM_STRINGS(377)
#define TINFO_DISPLAY_PC_CHAR CUR_TERM_STRINGS(378)
#define TINFO_ENTER_PC_CHARSET_MODE CUR_TERM_STRINGS(379)
#define TINFO_EXIT_PC_CHARSET_MODE CUR_TERM_STRINGS(380)
#define TINFO_ENTER_SCANCODE_MODE CUR_TERM_STRINGS(381)
#define TINFO_EXIT_SCANCODE_MODE CUR_TERM_STRINGS(382)
#define TINFO_PC_TINFO_OPTIONS CUR_TERM_STRINGS(383)
#define TINFO_SCANCODE_ESCAPE CUR_TERM_STRINGS(384)
#define TINFO_ALT_SCANCODE_ESC CUR_TERM_STRINGS(385)
#define TINFO_ENTER_HORIZONTAL_HL_MODE CUR_TERM_STRINGS(386)
#define TINFO_ENTER_LEFT_HL_MODE CUR_TERM_STRINGS(387)
#define TINFO_ENTER_LOW_HL_MODE CUR_TERM_STRINGS(388)
#define TINFO_ENTER_RIGHT_HL_MODE CUR_TERM_STRINGS(389)
#define TINFO_ENTER_TOP_HL_MODE CUR_TERM_STRINGS(390)
#define TINFO_ENTER_VERTICAL_HL_MODE CUR_TERM_STRINGS(391)
#define TINFO_SET_A_ATTRIBUTES CUR_TERM_STRINGS(392)
#define TINFO_SET_PGLEN_INCH CUR_TERM_STRINGS(393)
extern int setupterm(char *term, int fildes, int *errret);
extern TERMINAL *set_curterm(TERMINAL *nterm);
extern int del_curterm(TERMINAL *oterm);
#define setterm(term) setupterm(term, 1, NULL)
extern char *tparm(char *str, long p1, long p2, long p3, long p4, long p5,
long p6, long p7, long p8, long p9);
extern int tputs(char *str, int affcnt, int (*putc)(int));
extern int putp(char *str);
#endif /* TERM_H_ */
|
ddd298fd52f4309a86e01a980d0b46f7a20b892a
|
78dc9f153549b281be709227bc9897931b06260d
|
/generation/WinSDK/RecompiledIdlHeaders/um/edevdefs.h
|
61ba77a6adf9639a1de557bbbb5ddeb6078f9b81
|
[
"MIT"
] |
permissive
|
microsoft/win32metadata
|
dff35b4fe904d556162cee5133294c4498f1a79a
|
5bf233f04d45f7a697e112e9639722551103eb07
|
refs/heads/main
| 2023-09-01T19:51:22.972899
| 2023-08-30T21:39:44
| 2023-08-30T21:39:44
| 270,838,404
| 1,240
| 107
|
NOASSERTION
| 2023-09-14T18:49:44
| 2020-06-08T21:52:10
|
C++
|
UTF-8
|
C
| false
| false
| 22,506
|
h
|
edevdefs.h
|
//------------------------------------------------------------------------------
// File: EDevDefs.h
//
// Desc: External Device (such as a VCR) control interface parameter and
// value definitions.
//
// Note: new constants added: ED_BASE+800L -> ED_BASE+811L
//
// Copyright (c) 1992 - 2002, Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#ifndef __EDEVDEFS__
#define __EDEVDEFS__
#include <winapifamily.h>
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#define ED_BASE 0x1000L
// this is used to tell the device communications object which
// physical communications port to use.
#define DEV_PORT_SIM 1
#define DEV_PORT_COM1 2 // standard serial ports
#define DEV_PORT_COM2 3
#define DEV_PORT_COM3 4
#define DEV_PORT_COM4 5
#define DEV_PORT_DIAQ 6 // Diaquest driver
#define DEV_PORT_ARTI 7 // ARTI driver
#define DEV_PORT_1394 8 // IEEE 1394 Serial Bus
#define DEV_PORT_USB 9 // Universal Serial Bus
#define DEV_PORT_MIN DEV_PORT_SIM
#define DEV_PORT_MAX DEV_PORT_USB
// IAMExtDevice Capability Items: unless otherwise specified, these items return
// OATRUE or OAFALSE. All return values are in pdwValue unless otherwise specified:
#define ED_DEVCAP_CAN_RECORD ED_BASE+1L
#define ED_DEVCAP_CAN_RECORD_STROBE ED_BASE+2L // for multitrack devices:
// switches currently recording tracks off
// and selected non-recording tracks into record
#define ED_DEVCAP_HAS_AUDIO ED_BASE+3L
#define ED_DEVCAP_HAS_VIDEO ED_BASE+4L
#define ED_DEVCAP_USES_FILES ED_BASE+5L
#define ED_DEVCAP_CAN_SAVE ED_BASE+6L
#define ED_DEVCAP_DEVICE_TYPE ED_BASE+7L // returns one of the following:
#define ED_DEVTYPE_VCR ED_BASE+8L
#define ED_DEVTYPE_LASERDISK ED_BASE+9L
#define ED_DEVTYPE_ATR ED_BASE+10L
#define ED_DEVTYPE_DDR ED_BASE+11L
#define ED_DEVTYPE_ROUTER ED_BASE+12L
#define ED_DEVTYPE_KEYER ED_BASE+13L
#define ED_DEVTYPE_MIXER_VIDEO ED_BASE+14L
#define ED_DEVTYPE_DVE ED_BASE+15L
#define ED_DEVTYPE_WIPEGEN ED_BASE+16L
#define ED_DEVTYPE_MIXER_AUDIO ED_BASE+17L
#define ED_DEVTYPE_CG ED_BASE+18L
#define ED_DEVTYPE_TBC ED_BASE+19L
#define ED_DEVTYPE_TCG ED_BASE+20L
#define ED_DEVTYPE_GPI ED_BASE+21L
#define ED_DEVTYPE_JOYSTICK ED_BASE+22L
#define ED_DEVTYPE_KEYBOARD ED_BASE+23L
// returns mfr-specific ID from external device.
#define ED_DEVCAP_EXTERNAL_DEVICE_ID ED_BASE+24L
#define ED_DEVCAP_TIMECODE_READ ED_BASE+25L
#define ED_DEVCAP_TIMECODE_WRITE ED_BASE+26L
// used for seekable non-timecode enabled devices
#define ED_DEVCAP_CTLTRK_READ ED_BASE+27L
// used for seekable non-timecode enabled devices
#define ED_DEVCAP_INDEX_READ ED_BASE+28L
// returns device preroll time in current time format
#define ED_DEVCAP_PREROLL ED_BASE+29L
// returns device postroll time in current time format
#define ED_DEVCAP_POSTROLL ED_BASE+30L
// returns indication of device's synchronization accuracy.
#define ED_DEVCAP_SYNC_ACCURACY ED_BASE+31L // returns one of the following:
#define ED_SYNCACC_PRECISE ED_BASE+32L
#define ED_SYNCACC_FRAME ED_BASE+33L
#define ED_SYNCACC_ROUGH ED_BASE+34L
// returns device's normal framerate.
#define ED_DEVCAP_NORMAL_RATE ED_BASE+35L // returns one of the following:
#define ED_RATE_24 ED_BASE+36L
#define ED_RATE_25 ED_BASE+37L
#define ED_RATE_2997 ED_BASE+38L
#define ED_RATE_30 ED_BASE+39L
#define ED_DEVCAP_CAN_PREVIEW ED_BASE+40L
#define ED_DEVCAP_CAN_MONITOR_SOURCES ED_BASE+41L
// indicates implementation allows testing of methods/parameters by
// setting the hi bit of a parm that makes sense - see individual methods
// for details.
#define ED_DEVCAP_CAN_TEST ED_BASE+42L
// indicates device accepts video as an input.
#define ED_DEVCAP_VIDEO_INPUTS ED_BASE+43L
// indicates device accepts audio as an input.
#define ED_DEVCAP_AUDIO_INPUTS ED_BASE+44L
#define ED_DEVCAP_NEEDS_CALIBRATING ED_BASE+45L
#define ED_DEVCAP_SEEK_TYPE ED_BASE+46L // returns one of the following:
#define ED_SEEK_PERFECT ED_BASE+47L // indicates device can execute seek
// within 1 video frames without signal
// break (like a DDR)
#define ED_SEEK_FAST ED_BASE+48L // indicates device can move pretty quick
// with short break in signal
#define ED_SEEK_SLOW ED_BASE+49L // seeks like a tape transport
#define ED_POWER_ON ED_BASE+50L
#define ED_POWER_OFF ED_BASE+51L
#define ED_POWER_STANDBY ED_BASE+52L
#define ED_ACTIVE ED_BASE+53L
#define ED_INACTIVE ED_BASE+54L
#define ED_ALL ED_BASE+55L
#define ED_TEST ED_BASE+56L
// IAMExtTransport Capability Items: unless otherwise specified, these items return
// OATRUE or OAFALSE. All return values are in pdwValue unless otherwise specified:
#define ED_TRANSCAP_CAN_EJECT ED_BASE+100L
#define ED_TRANSCAP_CAN_BUMP_PLAY ED_BASE+101L // variable speed for synchronizing
#define ED_TRANSCAP_CAN_PLAY_BACKWARDS ED_BASE+102L // servo locked for use during an edit
#define ED_TRANSCAP_CAN_SET_EE ED_BASE+103L // show device's input on its output
#define ED_TRANSCAP_CAN_SET_PB ED_BASE+104L // show media playback on device's output
#define ED_TRANSCAP_CAN_DELAY_VIDEO_IN ED_BASE+105L // transport can do delayed-in video edits
#define ED_TRANSCAP_CAN_DELAY_VIDEO_OUT ED_BASE+106L // transport can do delayed-out video edits
#define ED_TRANSCAP_CAN_DELAY_AUDIO_IN ED_BASE+107L // transport can do delayed-in audio edits
#define ED_TRANSCAP_CAN_DELAY_AUDIO_OUT ED_BASE+108L // transport can do delayed-out audio edits
#define ED_TRANSCAP_FWD_VARIABLE_MAX ED_BASE+109L // max forward speed (multiple of play speed)
// in pdblValue
#define ED_TRANSCAP_FWD_VARIABLE_MIN ED_BASE+800L // min forward speed (multiple of play speed)
// in pdblValue
#define ED_TRANSCAP_REV_VARIABLE_MAX ED_BASE+110L // max reverse speed (multiple of play speed) in
// pdblValue
#define ED_TRANSCAP_REV_VARIABLE_MIN ED_BASE+801L // min reverse speed (multiple of play speed)
// in pdblValue
#define ED_TRANSCAP_FWD_SHUTTLE_MAX ED_BASE+802L // max forward speed in Shuttle mode (multiple
// of play speed) in pdblValue
#define ED_TRANSCAP_FWD_SHUTTLE_MIN ED_BASE+803L // min forward speed in Shuttle mode (multiple
// of play speed) in pdblValue
#define ED_TRANSCAP_REV_SHUTTLE_MAX ED_BASE+804L // max reverse speed in Shuttle mode (multiple
// of play speed) in pdblValue
#define ED_TRANSCAP_REV_SHUTTLE_MIN ED_BASE+805L // min reverse speed in Shuttle mode (multiple
// of play speed) in pdblValue
#define ED_TRANSCAP_NUM_AUDIO_TRACKS ED_BASE+111L // returns number of audio tracks
#define ED_TRANSCAP_LTC_TRACK ED_BASE+112L // returns track number of LTC timecode track.
// ED_ALL means no dedicated timecode track
#define ED_TRANSCAP_NEEDS_TBC ED_BASE+113L // device's output not stable
#define ED_TRANSCAP_NEEDS_CUEING ED_BASE+114L // device must be cued prior to performing edit
#define ED_TRANSCAP_CAN_INSERT ED_BASE+115L
#define ED_TRANSCAP_CAN_ASSEMBLE ED_BASE+116L
#define ED_TRANSCAP_FIELD_STEP ED_BASE+117L // device responds to Frame Advance command by
// advancing one field
#define ED_TRANSCAP_CLOCK_INC_RATE ED_BASE+118L // VISCA command - keep for compatibility
#define ED_TRANSCAP_CAN_DETECT_LENGTH ED_BASE+119L
#define ED_TRANSCAP_CAN_FREEZE ED_BASE+120L
#define ED_TRANSCAP_HAS_TUNER ED_BASE+121L
#define ED_TRANSCAP_HAS_TIMER ED_BASE+122L
#define ED_TRANSCAP_HAS_CLOCK ED_BASE+123L
#define ED_TRANSCAP_MULTIPLE_EDITS ED_BASE+806L // OATRUE means device/filter can support
// multiple edit events
#define ED_TRANSCAP_IS_MASTER ED_BASE+807L // OATRUE means device is the master clock
// for synchronizing (this sets timecode-to-
// reference clock offset for editing)
#define ED_TRANSCAP_HAS_DT ED_BASE+814L // OATRUE means device has Dynamic Tracking
// IAMExtTransport Media States
#define ED_MEDIA_SPIN_UP ED_BASE+130L
#define ED_MEDIA_SPIN_DOWN ED_BASE+131L
#define ED_MEDIA_UNLOAD ED_BASE+132L
// IAMExtTransport Modes
#define ED_MODE_PLAY ED_BASE+200L
#define ED_MODE_STOP ED_BASE+201L
#define ED_MODE_FREEZE ED_BASE+202L // really "pause"
#define ED_MODE_THAW ED_BASE+203L
#define ED_MODE_FF ED_BASE+204L
#define ED_MODE_REW ED_BASE+205L
#define ED_MODE_RECORD ED_BASE+206L
#define ED_MODE_RECORD_STROBE ED_BASE+207L
#define ED_MODE_RECORD_FREEZE ED_BASE+808L // pause recording
#define ED_MODE_STEP ED_BASE+208L // same as "jog"
#define ED_MODE_STEP_FWD ED_BASE+208L // same as ED_MODE_STEP
#define ED_MODE_STEP_REV ED_BASE+809L
#define ED_MODE_SHUTTLE ED_BASE+209L
#define ED_MODE_EDIT_CUE ED_BASE+210L
#define ED_MODE_VAR_SPEED ED_BASE+211L
#define ED_MODE_PERFORM ED_BASE+212L // returned status only
#define ED_MODE_LINK_ON ED_BASE+280L
#define ED_MODE_LINK_OFF ED_BASE+281L
#define ED_MODE_NOTIFY_ENABLE ED_BASE+810L
#define ED_MODE_NOTIFY_DISABLE ED_BASE+811L
#define ED_MODE_SHOT_SEARCH ED_BASE+812L
// IAMTimecodeReader/Generator/Display defines
//
// Timecode Generator Mode params and values:
//
#define ED_TCG_TIMECODE_TYPE ED_BASE+400L // can be one of the following:
#define ED_TCG_SMPTE_LTC ED_BASE+401L
#define ED_TCG_SMPTE_VITC ED_BASE+402L
#define ED_TCG_MIDI_QF ED_BASE+403L
#define ED_TCG_MIDI_FULL ED_BASE+404L
#define ED_TCG_FRAMERATE ED_BASE+405L // can be one of the following:
#define ED_FORMAT_SMPTE_30 ED_BASE+406L
#define ED_FORMAT_SMPTE_30DROP ED_BASE+407L
#define ED_FORMAT_SMPTE_25 ED_BASE+408L
#define ED_FORMAT_SMPTE_24 ED_BASE+409L
#define ED_TCG_SYNC_SOURCE ED_BASE+410L // can be one of the following:
#define ED_TCG_VIDEO ED_BASE+411L
#define ED_TCG_READER ED_BASE+412L
#define ED_TCG_FREE ED_BASE+413L
#define ED_TCG_REFERENCE_SOURCE ED_BASE+414L // can have one these values:
// ED_TCG_FREE || ED_TCG_READER
// (for regen/jamsync)
// TimeCodeReader Mode params and values:
#define ED_TCR_SOURCE ED_BASE+416L // can be one of the following:
// ED_TCG (already defined)
#define ED_TCR_LTC ED_BASE+417L
#define ED_TCR_VITC ED_BASE+418L
#define ED_TCR_CT ED_BASE+419L // Control Track
#define ED_TCR_FTC ED_BASE+420L // File TimeCode - for file-based devices
// that wish they were transports
// ED_MODE_NOTIFY_ENABLE can be OATRUE or OAFALSE (defined in transport mode
// section of this file).
#define ED_TCR_LAST_VALUE ED_BASE+421L // for notification mode -
// successive calls to GetTimecode
// return the last read value
// TimeCode Display Mode params and values:
//
#define ED_TCD_SOURCE ED_BASE+422L // can be one of the following:
#define ED_TCR ED_BASE+423L
#define ED_TCG ED_BASE+424L
#define ED_TCD_SIZE ED_BASE+425L // can be one of the following:
#define ED_SMALL ED_BASE+426L
#define ED_MED ED_BASE+427L
#define ED_LARGE ED_BASE+428L
#define ED_TCD_POSITION ED_BASE+429L // can be one of the following:
#define ED_TOP 0x0001
#define ED_MIDDLE 0x0002
#define ED_BOTTOM 0x0004 // or'd with
#define ED_LEFT 0x0100
#define ED_CENTER 0x0200
#define ED_RIGHT 0x0400
#define ED_TCD_INTENSITY ED_BASE+436L // can be one of the following:
#define ED_HIGH ED_BASE+437L
#define ED_LOW ED_BASE+438L
#define ED_TCD_TRANSPARENCY ED_BASE+439L // 0-4, 0 is opaque
#define ED_TCD_INVERT ED_BASE+440L // OATRUE=black on white
// OAFALSE=white on black
// IAMExtTransport defines
//
// Transport status, params and values
//
// IAMExtTransport Status items and and values:
#define ED_MODE ED_BASE+500L // see ED_MODE_xxx values above
#define ED_ERROR ED_BASE+501L
#define ED_LOCAL ED_BASE+502L
#define ED_RECORD_INHIBIT ED_BASE+503L
#define ED_SERVO_LOCK ED_BASE+504L
#define ED_MEDIA_PRESENT ED_BASE+505L
#define ED_MEDIA_LENGTH ED_BASE+506L
#define ED_MEDIA_SIZE ED_BASE+507L
#define ED_MEDIA_TRACK_COUNT ED_BASE+508L
#define ED_MEDIA_TRACK_LENGTH ED_BASE+509L
#define ED_MEDIA_SIDE ED_BASE+510L
#define ED_MEDIA_TYPE ED_BASE+511L // can be one of the following:
#define ED_MEDIA_VHS ED_BASE+512L
#define ED_MEDIA_SVHS ED_BASE+513L
#define ED_MEDIA_HI8 ED_BASE+514L
#define ED_MEDIA_UMATIC ED_BASE+515L
#define ED_MEDIA_DVC ED_BASE+516L
#define ED_MEDIA_1_INCH ED_BASE+517L
#define ED_MEDIA_D1 ED_BASE+518L
#define ED_MEDIA_D2 ED_BASE+519L
#define ED_MEDIA_D3 ED_BASE+520L
#define ED_MEDIA_D5 ED_BASE+521L
#define ED_MEDIA_DBETA ED_BASE+522L
#define ED_MEDIA_BETA ED_BASE+523L
#define ED_MEDIA_8MM ED_BASE+524L
#define ED_MEDIA_DDR ED_BASE+525L
#define ED_MEDIA_SX ED_BASE+813L
#define ED_MEDIA_OTHER ED_BASE+526L
#define ED_MEDIA_CLV ED_BASE+527L
#define ED_MEDIA_CAV ED_BASE+528L
#define ED_MEDIA_POSITION ED_BASE+529L
#define ED_LINK_MODE ED_BASE+530L // OATRUE if transport controls
// are linked to graph's RUN,
// STOP, and PAUSE methods
// IAMExtTransport Basic Parms
#define ED_TRANSBASIC_TIME_FORMAT ED_BASE+540L // can be one of the following:
#define ED_FORMAT_MILLISECONDS ED_BASE+541L
#define ED_FORMAT_FRAMES ED_BASE+542L
#define ED_FORMAT_REFERENCE_TIME ED_BASE+543L
#define ED_FORMAT_HMSF ED_BASE+547L
#define ED_FORMAT_TMSF ED_BASE+548L
#define ED_TRANSBASIC_TIME_REFERENCE ED_BASE+549L // can be one of the following:
#define ED_TIMEREF_TIMECODE ED_BASE+550L
#define ED_TIMEREF_CONTROL_TRACK ED_BASE+551L
#define ED_TIMEREF_INDEX ED_BASE+552L
#define ED_TRANSBASIC_SUPERIMPOSE ED_BASE+553L // enable/disable onscreen display
#define ED_TRANSBASIC_END_STOP_ACTION ED_BASE+554L // can be one of: ED_MODE_STOP |
// ED_MODE_REWIND | ED_MODE_FREEZE
#define ED_TRANSBASIC_RECORD_FORMAT ED_BASE+555L // can be one of the following:
#define ED_RECORD_FORMAT_SP ED_BASE+556L
#define ED_RECORD_FORMAT_LP ED_BASE+557L
#define ED_RECORD_FORMAT_EP ED_BASE+558L
#define ED_TRANSBASIC_STEP_COUNT ED_BASE+559L
#define ED_TRANSBASIC_STEP_UNIT ED_BASE+560L // can be one of the following:
#define ED_STEP_FIELD ED_BASE+561L
#define ED_STEP_FRAME ED_BASE+562L
#define ED_STEP_3_2 ED_BASE+563L
#define ED_TRANSBASIC_PREROLL ED_BASE+564L
#define ED_TRANSBASIC_RECPREROLL ED_BASE+565L
#define ED_TRANSBASIC_POSTROLL ED_BASE+566L
#define ED_TRANSBASIC_EDIT_DELAY ED_BASE+567L
#define ED_TRANSBASIC_PLAYTC_DELAY ED_BASE+568L
#define ED_TRANSBASIC_RECTC_DELAY ED_BASE+569L
#define ED_TRANSBASIC_EDIT_FIELD ED_BASE+570L
#define ED_TRANSBASIC_FRAME_SERVO ED_BASE+571L
#define ED_TRANSBASIC_CF_SERVO ED_BASE+572L
#define ED_TRANSBASIC_SERVO_REF ED_BASE+573L // can be one of the following:
#define ED_REF_EXTERNAL ED_BASE+574L
#define ED_REF_INPUT ED_BASE+575L
#define ED_REF_INTERNAL ED_BASE+576L
#define ED_REF_AUTO ED_BASE+577L
#define ED_TRANSBASIC_WARN_GL ED_BASE+578L
#define ED_TRANSBASIC_SET_TRACKING ED_BASE+579L // can be one of the following:
#define ED_TRACKING_PLUS ED_BASE+580L
#define ED_TRACKING_MINUS ED_BASE+581L
#define ED_TRACKING_RESET ED_BASE+582L
#define ED_TRANSBASIC_SET_FREEZE_TIMEOUT ED_BASE+583L
#define ED_TRANSBASIC_VOLUME_NAME ED_BASE+584L
#define ED_TRANSBASIC_BALLISTIC_1 ED_BASE+585L // space for proprietary data
#define ED_TRANSBASIC_BALLISTIC_2 ED_BASE+586L
#define ED_TRANSBASIC_BALLISTIC_3 ED_BASE+587L
#define ED_TRANSBASIC_BALLISTIC_4 ED_BASE+588L
#define ED_TRANSBASIC_BALLISTIC_5 ED_BASE+589L
#define ED_TRANSBASIC_BALLISTIC_6 ED_BASE+590L
#define ED_TRANSBASIC_BALLISTIC_7 ED_BASE+591L
#define ED_TRANSBASIC_BALLISTIC_8 ED_BASE+592L
#define ED_TRANSBASIC_BALLISTIC_9 ED_BASE+593L
#define ED_TRANSBASIC_BALLISTIC_10 ED_BASE+594L
#define ED_TRANSBASIC_BALLISTIC_11 ED_BASE+595L
#define ED_TRANSBASIC_BALLISTIC_12 ED_BASE+596L
#define ED_TRANSBASIC_BALLISTIC_13 ED_BASE+597L
#define ED_TRANSBASIC_BALLISTIC_14 ED_BASE+598L
#define ED_TRANSBASIC_BALLISTIC_15 ED_BASE+599L
#define ED_TRANSBASIC_BALLISTIC_16 ED_BASE+600L
#define ED_TRANSBASIC_BALLISTIC_17 ED_BASE+601L
#define ED_TRANSBASIC_BALLISTIC_18 ED_BASE+602L
#define ED_TRANSBASIC_BALLISTIC_19 ED_BASE+603L
#define ED_TRANSBASIC_BALLISTIC_20 ED_BASE+604L
// consumer VCR items
#define ED_TRANSBASIC_SETCLOCK ED_BASE+605L
#define ED_TRANSBASIC_SET_COUNTER_FORMAT ED_BASE+606L // uses time format flags
#define ED_TRANSBASIC_SET_COUNTER_VALUE ED_BASE+607L
#define ED_TRANSBASIC_SETTUNER_CH_UP ED_BASE+608L
#define ED_TRANSBASIC_SETTUNER_CH_DN ED_BASE+609L
#define ED_TRANSBASIC_SETTUNER_SK_UP ED_BASE+610L
#define ED_TRANSBASIC_SETTUNER_SK_DN ED_BASE+611L
#define ED_TRANSBASIC_SETTUNER_CH ED_BASE+612L
#define ED_TRANSBASIC_SETTUNER_NUM ED_BASE+613L
#define ED_TRANSBASIC_SETTIMER_EVENT ED_BASE+614L
#define ED_TRANSBASIC_SETTIMER_STARTDAY ED_BASE+615L
#define ED_TRANSBASIC_SETTIMER_STARTTIME ED_BASE+616L
#define ED_TRANSBASIC_SETTIMER_STOPDAY ED_BASE+617L
#define ED_TRANSBASIC_SETTIMER_STOPTIME ED_BASE+618L
// IAMExtTransport video parameters
#define ED_TRANSVIDEO_SET_OUTPUT ED_BASE+630L // can be one of the following:
#define ED_E2E ED_BASE+631L
#define ED_PLAYBACK ED_BASE+632L
#define ED_OFF ED_BASE+633L
#define ED_TRANSVIDEO_SET_SOURCE ED_BASE+634L
// IAMExtTransport audio parameters
#define ED_TRANSAUDIO_ENABLE_OUTPUT ED_BASE+640L // can be the following:
#define ED_AUDIO_ALL 0x10000000 // or any of the following OR'd together
#define ED_AUDIO_1 0x0000001L
#define ED_AUDIO_2 0x0000002L
#define ED_AUDIO_3 0x0000004L
#define ED_AUDIO_4 0x0000008L
#define ED_AUDIO_5 0x0000010L
#define ED_AUDIO_6 0x0000020L
#define ED_AUDIO_7 0x0000040L
#define ED_AUDIO_8 0x0000080L
#define ED_AUDIO_9 0x0000100L
#define ED_AUDIO_10 0x0000200L
#define ED_AUDIO_11 0x0000400L
#define ED_AUDIO_12 0x0000800L
#define ED_AUDIO_13 0x0001000L
#define ED_AUDIO_14 0x0002000L
#define ED_AUDIO_15 0x0004000L
#define ED_AUDIO_16 0x0008000L
#define ED_AUDIO_17 0x0010000L
#define ED_AUDIO_18 0x0020000L
#define ED_AUDIO_19 0x0040000L
#define ED_AUDIO_20 0x0080000L
#define ED_AUDIO_21 0x0100000L
#define ED_AUDIO_22 0x0200000L
#define ED_AUDIO_23 0x0400000L
#define ED_AUDIO_24 0x0800000L
#define ED_VIDEO 0x2000000L // for Edit props below
#define ED_TRANSAUDIO_ENABLE_RECORD ED_BASE+642L
#define ED_TRANSAUDIO_ENABLE_SELSYNC ED_BASE+643L
#define ED_TRANSAUDIO_SET_SOURCE ED_BASE+644L
#define ED_TRANSAUDIO_SET_MONITOR ED_BASE+645L
// Edit Property Set-related defs
// The following values reflect (and control) the state of an
// edit property set
#define ED_INVALID ED_BASE+652L
#define ED_EXECUTING ED_BASE+653L
#define ED_REGISTER ED_BASE+654L
#define ED_DELETE ED_BASE+655L
// Edit property set parameters and values
#define ED_EDIT_HEVENT ED_BASE+656L // event handle to signal event
// completion
#define ED_EDIT_TEST ED_BASE+657L // returns OAFALSE if filter thinks
// edit can be done, OATRUE if not
#define ED_EDIT_IMMEDIATE ED_BASE+658L // OATRUE means start put the
// device into edit mode (editing
// "on the fly") immediately upon
// execution of Mode(ED_MODE_EDIT_CUE)
#define ED_EDIT_MODE ED_BASE+659L
// can be one of the following values:
#define ED_EDIT_MODE_ASSEMBLE ED_BASE+660L
#define ED_EDIT_MODE_INSERT ED_BASE+661L
#define ED_EDIT_MODE_CRASH_RECORD ED_BASE+662L
#define ED_EDIT_MODE_BOOKMARK_TIME ED_BASE+663L // these two are for
#define ED_EDIT_MODE_BOOKMARK_CHAPTER ED_BASE+664L // laserdisks
#define ED_EDIT_MASTER ED_BASE+666L // OATRUE causes device
// not to synchronize
#define ED_EDIT_TRACK ED_BASE+667L
// can be one of the following possible OR'd values:
// ED_VIDEO, ED_AUDIO_1 thru ED_AUDIO_24 (or ED_AUDIO_ALL)
#define ED_EDIT_SRC_INPOINT ED_BASE+668L // in current time format
#define ED_EDIT_SRC_OUTPOINT ED_BASE+669L // in current time format
#define ED_EDIT_REC_INPOINT ED_BASE+670L // in current time format
#define ED_EDIT_REC_OUTPOINT ED_BASE+671L // in current time format
#define ED_EDIT_REHEARSE_MODE ED_BASE+672L
// can be one of the following possible values:
#define ED_EDIT_BVB ED_BASE+673L // means rehearse the edit with
// "black-video-black"
#define ED_EDIT_VBV ED_BASE+674L
#define ED_EDIT_VVV ED_BASE+675L
#define ED_EDIT_PERFORM ED_BASE+676L // means perform the edit with no
// rehearsal.
// Set this property to OATRUE to kill the edit if in progress
#define ED_EDIT_ABORT ED_BASE+677L
// how long to wait for edit to complete
#define ED_EDIT_TIMEOUT ED_BASE+678L // in current time format
// This property causes the device to seek to a point specified by
// ED_EDIT_SEEK_MODE (see below). NOTE: Only one event at a time can seek.
#define ED_EDIT_SEEK ED_BASE+679L // OATRUE means do it now.
#define ED_EDIT_SEEK_MODE ED_BASE+680L
//possible values:
#define ED_EDIT_SEEK_EDIT_IN ED_BASE+681L // seek to edit's inpoint
#define ED_EDIT_SEEK_EDIT_OUT ED_BASE+682L // seek to edit's outpoint
#define ED_EDIT_SEEK_PREROLL ED_BASE+683L // seek to edit's
// inpoint-preroll
#define ED_EDIT_SEEK_PREROLL_CT ED_BASE+684L // seek to preroll point
// using control track (used for tapes with
// discontinuoustimecode before edit point: seek
// to inpoint using timecode, then backup to
// preroll point using control track)
#define ED_EDIT_SEEK_BOOKMARK ED_BASE+685L // seek to bookmark (just like
// timecode search)
// This property is used for multiple-VCR systems where each machine must
// cue to a different location relative to the graph's reference clock. The
// basic idea is that an edit event is setup with an ED_EDIT_OFFSET property
// that tells the VCR what offset to maintain between it's timecode (converted
// to reference clock units) and the reference clock.
#define ED_EDIT_OFFSET ED_BASE+686L // in current time format
#define ED_EDIT_PREREAD ED_BASE+815L // OATRUE means device supports
// pre-read (recorder can also be
// player
//
// Some error codes:
//
// device could be in local mode
#define ED_ERR_DEVICE_NOT_READY ED_BASE+700L
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif // __EDEVDEFS__
// eof edevdefs.h
|
633d32da5497cb408a843d78bf773b7dbc1f3338
|
79d343002bb63a44f8ab0dbac0c9f4ec54078c3a
|
/lib/libc/include/generic-glibc/envz.h
|
f58aae10ee9ac3dce732279ae201e3ca108cc6f6
|
[
"MIT"
] |
permissive
|
ziglang/zig
|
4aa75d8d3bcc9e39bf61d265fd84b7f005623fc5
|
f4c9e19bc3213c2bc7e03d7b06d7129882f39f6c
|
refs/heads/master
| 2023-08-31T13:16:45.980913
| 2023-08-31T05:50:29
| 2023-08-31T05:50:29
| 40,276,274
| 25,560
| 2,399
|
MIT
| 2023-09-14T21:09:50
| 2015-08-06T00:51:28
|
Zig
|
UTF-8
|
C
| false
| false
| 2,866
|
h
|
envz.h
|
/* Routines for dealing with '\0' separated environment vectors
Copyright (C) 1995-2021 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
#ifndef _ENVZ_H
#define _ENVZ_H 1
#include <features.h>
#include <errno.h>
/* Envz's are argz's too, and should be created etc., using the same
routines. */
#include <argz.h>
__BEGIN_DECLS
/* Returns a pointer to the entry in ENVZ for NAME, or 0 if there is none. */
extern char *envz_entry (const char *__restrict __envz, size_t __envz_len,
const char *__restrict __name)
__THROW __attribute_pure__;
/* Returns a pointer to the value portion of the entry in ENVZ for NAME, or 0
if there is none. */
extern char *envz_get (const char *__restrict __envz, size_t __envz_len,
const char *__restrict __name)
__THROW __attribute_pure__;
/* Adds an entry for NAME with value VALUE to ENVZ & ENVZ_LEN. If an entry
with the same name already exists in ENVZ, it is removed. If VALUE is
NULL, then the new entry will a special null one, for which envz_get will
return NULL, although envz_entry will still return an entry; this is handy
because when merging with another envz, the null entry can override an
entry in the other one. Null entries can be removed with envz_strip (). */
extern error_t envz_add (char **__restrict __envz,
size_t *__restrict __envz_len,
const char *__restrict __name,
const char *__restrict __value) __THROW;
/* Adds each entry in ENVZ2 to ENVZ & ENVZ_LEN, as if with envz_add(). If
OVERRIDE is true, then values in ENVZ2 will supersede those with the same
name in ENV, otherwise not. */
extern error_t envz_merge (char **__restrict __envz,
size_t *__restrict __envz_len,
const char *__restrict __envz2,
size_t __envz2_len, int __override) __THROW;
/* Remove the entry for NAME from ENVZ & ENVZ_LEN, if any. */
extern void envz_remove (char **__restrict __envz,
size_t *__restrict __envz_len,
const char *__restrict __name) __THROW;
/* Remove null entries. */
extern void envz_strip (char **__restrict __envz,
size_t *__restrict __envz_len) __THROW;
__END_DECLS
#endif /* envz.h */
|
cedf77f012ad4e01926f4c34d7cd7904567699fb
|
489eb0b3166cfdf770d3a93ec9c4adaf7515de25
|
/support/c/idris_file.h
|
e3b1eed17aee7181b440f268155216cb0bed5412
|
[
"BSD-2-Clause"
] |
permissive
|
idris-lang/Idris2
|
215b256b2e7ac4cebe2d871017798cd60e79271f
|
a4ccb27c83807f42cf6edd83875ea73218e91ab5
|
refs/heads/main
| 2023-08-30T23:47:37.884405
| 2023-08-25T09:41:11
| 2023-08-28T12:53:59
| 264,775,694
| 2,179
| 478
|
NOASSERTION
| 2023-09-14T13:29:43
| 2020-05-17T23:25:25
|
Idris
|
UTF-8
|
C
| false
| false
| 1,478
|
h
|
idris_file.h
|
#pragma once
#include <stdint.h>
#include <stdio.h>
#include <sys/stat.h>
#ifdef _WIN32
#include <io.h>
#endif
FILE *idris2_openFile(char *name, char *mode);
void idris2_closeFile(FILE *f);
int idris2_fileError(FILE *f);
// Turn errno into an integer understandable by System.File
int idris2_fileErrno();
int idris2_chmod(const char *path, mode_t mode);
int idris2_removeFile(const char *filename);
int idris2_fileSize(FILE *h);
int idris2_fpoll(FILE *f);
void *idris2_popen(const char *cmd, const char *mode);
int idris2_pclose(void *stream);
// Seek through the next newline without
// saving anything along the way
int idris2_seekLine(FILE *f);
// Treat as a Ptr String (might be NULL)
char *idris2_readLine(FILE *f);
char *idris2_readChars(int num, FILE *f);
size_t idris2_readBufferData(FILE *h, char *buffer, size_t loc, size_t max);
int idris2_writeLine(FILE *f, char *str);
size_t idris2_writeBufferData(FILE *h, const char *buffer, size_t loc,
size_t len);
int idris2_eof(FILE *f);
int idris2_fileAccessTime(FILE *f);
int idris2_fileModifiedTime(FILE *f);
int idris2_fileStatusTime(FILE *f);
int idris2_fileIsTTY(FILE *f);
FILE *idris2_stdin();
FILE *idris2_stdout();
FILE *idris2_stderr();
struct child_process;
struct child_process *idris2_popen2(char *cmd);
int idris2_popen2ChildPid(struct child_process *ptr);
FILE *idris2_popen2FileIn(struct child_process *ptr);
FILE *idris2_popen2FileOut(struct child_process *ptr);
|
2f98100e06bf93bb3ce540782af1ce367d58eaa5
|
f9e7d65cb784c01a0200145ba8d289afe41d4a56
|
/test/printf.c
|
ae85837cd503ccbe11ebe993b0c0735e169b205a
|
[
"BSD-3-Clause"
] |
permissive
|
FrameworkComputer/EmbeddedController
|
ad7086769e87d0a4179eae96a7c9ff5e383ff54e
|
f6d6b927eed71550d3475411cfc3e59abe5cef2a
|
refs/heads/hx20-hx30
| 2023-08-08T20:45:10.621169
| 2023-05-26T07:03:59
| 2023-05-26T07:03:59
| 447,021,040
| 846
| 48
|
BSD-3-Clause
| 2023-05-26T07:04:59
| 2022-01-12T00:11:14
|
C
|
UTF-8
|
C
| false
| false
| 9,342
|
c
|
printf.c
|
/* Copyright 2019 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include "common.h"
#include "printf.h"
#include "test_util.h"
#include "util.h"
#define INIT_VALUE 0x5E
#define NO_BYTES_TOUCHED NULL
static const char err_str[] = "ERROR";
static char output[1024];
int run(int expect_ret, const char *expect,
bool output_null, size_t size_limit,
const char *format, va_list args)
{
size_t expect_size = expect ? strlen(expect) + 1 : 0;
int rv;
ccprintf("\n");
ccprintf("size_limit=%-4zd | format='%s'\n", size_limit, format);
ccprintf("expect ='%s' | expect_status=%d\n",
expect ? expect : "NO_BYTES_TOUCHED", expect_ret);
TEST_ASSERT(expect_size <= sizeof(output));
TEST_ASSERT(expect_size <= size_limit);
memset(output, INIT_VALUE, sizeof(output));
rv = vsnprintf(output_null ? NULL : output, size_limit,
format, args);
ccprintf("received='%.*s' | ret =%d\n",
30, output, rv);
TEST_ASSERT_ARRAY_EQ(output, expect, expect_size);
TEST_ASSERT_MEMSET(&output[expect_size], INIT_VALUE,
sizeof(output) - expect_size);
if (rv >= 0) {
TEST_ASSERT(rv == expect_size - 1);
TEST_ASSERT(EC_SUCCESS == expect_ret);
} else {
TEST_ASSERT(rv == -expect_ret);
}
return EC_SUCCESS;
}
int expect_success(const char *expect, const char *format, ...)
{
va_list args;
int rv;
va_start(args, format);
rv = run(EC_SUCCESS, expect,
false, sizeof(output),
format, args);
va_end(args);
return rv;
}
int expect(int expect_ret, const char *expect,
bool output_null, size_t size_limit,
const char *format, ...)
{
va_list args;
int rv;
va_start(args, format);
rv = run(expect_ret, expect,
output_null, size_limit,
format, args);
va_end(args);
return rv;
}
#define T(n) \
do { \
int rv = (n); \
if (rv != EC_SUCCESS) \
return rv; \
} while (0)
test_static int test_vsnprintf_args(void)
{
T(expect_success("", ""));
T(expect_success("a", "a"));
T(expect(/* expect an invalid args error */
EC_ERROR_INVAL, NO_BYTES_TOUCHED,
/* given -1 as output size limit */
false, -1, ""));
T(expect(/* expect an invalid args error */
EC_ERROR_INVAL, NO_BYTES_TOUCHED,
/* given 0 as output size limit */
false, 0, ""));
T(expect(/* expect SUCCESS */
EC_SUCCESS, "",
/* given 1 as output size limit and a blank format */
false, 1, ""));
T(expect(/* expect an overflow error */
EC_ERROR_OVERFLOW, "",
/* given 1 as output size limit with a non-blank format */
false, 1, "a"));
T(expect(/* expect an invalid args error */
EC_ERROR_INVAL, NO_BYTES_TOUCHED,
/* given NULL as the output buffer */
true, sizeof(output), ""));
T(expect(/* expect an invalid args error */
EC_ERROR_INVAL, NO_BYTES_TOUCHED,
/* given a NULL format string */
false, sizeof(output), NULL));
return EC_SUCCESS;
}
test_static int test_vsnprintf_int(void)
{
T(expect_success("123", "%d", 123));
T(expect_success("-123", "%d", -123));
T(expect_success("+123", "%+d", 123));
T(expect_success("-123", "%+d", -123));
T(expect_success("123", "%-d", 123));
T(expect_success("-123", "%-d", -123));
T(expect_success(" 123", "%5d", 123));
T(expect_success(" +123", "%+5d", 123));
T(expect_success("00123", "%05d", 123));
T(expect_success("00123", "%005d", 123));
/*
* TODO(crbug.com/974084): This odd behavior should be fixed.
* T(expect_success("+0123", "%+05d", 123));
* Actual: "0+123"
* T(expect_success("+0123", "%+005d", 123));
* Actual: "0+123"
*/
T(expect_success(" 123", "%*d", 5, 123));
T(expect_success(" +123", "%+*d", 5, 123));
T(expect_success("00123", "%0*d", 5, 123));
/*
* TODO(crbug.com/974084): This odd behavior should be fixed.
* T(expect_success("00123", "%00*d", 5, 123));
* Actual: "ERROR"
*/
T(expect_success("0+123", "%+0*d", 5, 123));
/*
* TODO(crbug.com/974084): This odd behavior should be fixed.
* T(expect_success("0+123", "%+00*d", 5, 123));
* Actual: "ERROR"
*/
T(expect_success("123 ", "%-5d", 123));
T(expect_success("+123 ", "%-+5d", 123));
T(expect_success(err_str, "%+-5d", 123));
T(expect_success("123 ", "%-05d", 123));
T(expect_success("123 ", "%-005d", 123));
T(expect_success("+123 ", "%-+05d", 123));
T(expect_success("+123 ", "%-+005d", 123));
T(expect_success("0.00123", "%.5d", 123));
T(expect_success("+0.00123", "%+.5d", 123));
T(expect_success("0.00123", "%7.5d", 123));
T(expect_success(" 0.00123", "%9.5d", 123));
T(expect_success(" +0.00123", "%+9.5d", 123));
T(expect_success("123", "%u", 123));
T(expect_success("4294967295", "%u", -1));
T(expect_success("18446744073709551615", "%llu", (uint64_t)-1));
T(expect_success("0", "%x", 0));
T(expect_success("0", "%X", 0));
T(expect_success("5e", "%x", 0X5E));
T(expect_success("5E", "%X", 0X5E));
/*
* %l is deprecated on 32-bit systems (see crbug.com/984041), but is
* is still functional on 64-bit systems.
*/
if (sizeof(long) == sizeof(uint32_t)) {
T(expect_success(err_str, "%lx", 0x7b));
T(expect_success(err_str, "%08lu", 0x7b));
T(expect_success("13ERROR", "%d%lu", 13, 14));
} else {
T(expect_success("7b", "%lx", 0x7b));
T(expect_success("00000123", "%08lu", 123));
T(expect_success("131415", "%d%lu%d", 13, 14L, 15));
}
return EC_SUCCESS;
}
test_static int test_vsnprintf_pointers(void)
{
void *ptr = (void *)0x55005E00;
unsigned int val = 0;
T(expect_success("55005e00", "%pP", ptr));
T(expect_success(err_str, "%P", ptr));
/* %p by itself is invalid */
T(expect(EC_ERROR_INVAL, NO_BYTES_TOUCHED,
false, -1, "%p"));
/* %p with an unknown suffix is invalid */
T(expect(EC_ERROR_INVAL, NO_BYTES_TOUCHED,
false, -1, "%p "));
/* %p with an unknown suffix is invalid */
T(expect(EC_ERROR_INVAL, NO_BYTES_TOUCHED,
false, -1, "%pQ"));
/* Test %pb, binary format */
T(expect_success("0", "%pb", BINARY_VALUE(val, 0)));
val = 0x5E;
T(expect_success("1011110", "%pb", BINARY_VALUE(val, 0)));
T(expect_success("0000000001011110", "%pb", BINARY_VALUE(val, 16)));
val = 0x12345678;
T(expect_success("10010001101000101011001111000", "%pb",
BINARY_VALUE(val, 0)));
val = 0xFEDCBA90;
/* Test a number that makes the longest string possible */
T(expect_success("11111110110111001011101010010000", "%pb",
BINARY_VALUE(val, 0)));
return EC_SUCCESS;
}
test_static int test_vsnprintf_chars(void)
{
T(expect_success("a", "%c", 'a'));
T(expect_success("*", "%c", '*'));
return EC_SUCCESS;
}
test_static int test_vsnprintf_strings(void)
{
T(expect_success("abc", "%s", "abc"));
T(expect_success(" abc", "%5s", "abc"));
T(expect_success("abc", "%0s", "abc"));
T(expect_success("abc ", "%-5s", "abc"));
T(expect_success("abc", "%*s", 0, "abc"));
T(expect_success("a", "%.1s", "abc"));
T(expect_success("a", "%.*s", 1, "abc"));
T(expect_success("", "%.0s", "abc"));
T(expect_success("", "%.*s", 0, "abc"));
/*
* TODO(crbug.com/974084):
* Ignoring the padding parameter is slightly
* odd behavior and could use a review.
*/
T(expect_success("ab", "%5.2s", "abc"));
T(expect_success("abc", "%.4s", "abc"));
/*
* Given a malformed string (address 0x1 is a good example),
* if we ask for zero precision, expect no bytes to be read
* from the malformed address and a blank output string.
*/
T(expect_success("", "%.0s", (char *)1));
return EC_SUCCESS;
}
test_static int test_vsnprintf_timestamps(void)
{
uint64_t ts = 0;
T(expect_success("0.000000", "%pT", &ts));
ts = 123456;
T(expect_success("0.123456", "%pT", &ts));
ts = 9999999000000;
T(expect_success("9999999.000000", "%pT", &ts));
return EC_SUCCESS;
}
test_static int test_vsnprintf_hexdump(void)
{
const char bytes[] = {0x00, 0x5E};
T(expect_success("005e", "%ph", HEX_BUF(bytes, 2)));
T(expect_success("", "%ph", HEX_BUF(bytes, 0)));
T(expect_success("00", "%ph", HEX_BUF(bytes, 1)));
return EC_SUCCESS;
}
test_static int test_vsnprintf_combined(void)
{
T(expect_success("abc", "%c%s", 'a', "bc"));
T(expect_success("12\tbc", "%d\t%s", 12, "bc"));
return EC_SUCCESS;
}
void run_test(int argc, char **argv)
{
test_reset();
RUN_TEST(test_vsnprintf_args);
RUN_TEST(test_vsnprintf_int);
RUN_TEST(test_vsnprintf_pointers);
RUN_TEST(test_vsnprintf_chars);
RUN_TEST(test_vsnprintf_strings);
RUN_TEST(test_vsnprintf_timestamps);
RUN_TEST(test_vsnprintf_hexdump);
RUN_TEST(test_vsnprintf_combined);
test_print_result();
}
|
8dd0c3a122e7615fad849283ad4b2470a1d6f185
|
03666e5f961946fc1a0ac67781ac1425562ef0d7
|
/src/gui/MovieSequenceRotate.C
|
985def96e0dcc39c42026d9b6872287e0577b3be
|
[
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
visit-dav/visit
|
e9f81b4d4b9b9930a0db9d5282cd1bcabf465e2e
|
601ae46e0bef2e18425b482a755d03490ade0493
|
refs/heads/develop
| 2023-09-06T08:19:38.397058
| 2023-09-05T21:29:32
| 2023-09-05T21:29:32
| 165,565,988
| 335
| 120
|
BSD-3-Clause
| 2023-09-14T00:53:37
| 2019-01-13T23:27:26
|
C
|
UTF-8
|
C
| false
| false
| 6,862
|
c
|
MovieSequenceRotate.C
|
// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
// Project developers. See the top-level LICENSE file for dates and other
// details. No copyright assignment is required to contribute to VisIt.
#include <MovieSequenceRotate.h>
#include <WidgetDataNode.h>
#include <QvisRotationTransition.h>
#include <DebugStream.h>
#include <icons/ms_srotx.xpm>
#include <icons/ms_sroty.xpm>
#include <icons/ms_srotz.xpm>
#include <icons/ms_rotx.xpm>
#include <icons/ms_roty.xpm>
#include <icons/ms_rotz.xpm>
// ****************************************************************************
// Method: MovieSequenceRotate::MovieSequenceRotate
//
// Purpose:
// Constructor for the MovieSequenceRotate base class.
//
// Programmer: Brad Whitlock
// Creation: Tue Nov 14 10:53:43 PDT 2006
//
// Modifications:
//
// ****************************************************************************
MovieSequenceRotate::MovieSequenceRotate() : MovieSequence()
{
}
// ****************************************************************************
// Method: MovieSequenceRotate::~MovieSequenceRotate
//
// Purpose:
// Destructor for the MovieSequenceRotate base class.
//
// Programmer: Brad Whitlock
// Creation: Tue Nov 14 10:53:43 PDT 2006
//
// Modifications:
//
// ****************************************************************************
MovieSequenceRotate::~MovieSequenceRotate()
{
}
// ****************************************************************************
// Method: MovieSequenceRotate::CreateUI
//
// Purpose:
// Creates the user interface for the sequence.
//
// Returns: A pointer to a new widget that can be used as the sequence's
// user interface within the movie wizard.
//
// Note:
//
// Programmer: Brad Whitlock
// Creation: Tue Nov 14 10:40:11 PDT 2006
//
// Modifications:
// Brad Whitlock, Tue Apr 8 10:34:24 PDT 2008
// SequenceMenuName now returns QString.
//
// Brad Whitlock, Tue Oct 7 11:21:26 PDT 2008
// Qt 4.
//
// ****************************************************************************
QWidget *
MovieSequenceRotate::CreateUI()
{
QvisRotationTransition *ui = new QvisRotationTransition(Pixmap(), 0);
ui->setObjectName(GetName().c_str());
ui->setTitle(SequenceMenuName());
return ui;
}
// ****************************************************************************
// Method: MovieSequenceRotate::ReadUIValues
//
// Purpose:
// Gets the values from the data node and updates the user interface.
//
// Arguments:
// ui : The user interface.
// node : The node in which to insert the sequence's data values.
//
// Programmer: Brad Whitlock
// Creation: Tue Nov 14 10:40:58 PDT 2006
//
// Modifications:
//
// ****************************************************************************
void
MovieSequenceRotate::ReadUIValues(QWidget *ui, DataNode *node)
{
const char *mName = "MovieSequenceRotate::ReadUIValues: ";
if(node != 0)
{
QvisRotationTransition *UI = (QvisRotationTransition *)ui;
// Read the start angle and put it into the UI.
DataNode *saNode = node->GetNode("startAngle");
if(saNode != 0 && saNode->GetNodeType() == FLOAT_NODE)
UI->setStartAngle(saNode->AsFloat());
else
{
debug4 << mName << "startAngle not found or it was the "
<< "wrong type." << endl;
}
// Read the start angle and put it into the UI.
DataNode *eaNode = node->GetNode("endAngle");
if(eaNode != 0 && eaNode->GetNodeType() == FLOAT_NODE)
UI->setEndAngle(eaNode->AsFloat());
else
{
debug4 << mName << "endAngle not found or it was the "
<< "wrong type." << endl;
}
// Read the number of steps.
DataNode *nStepsNode = node->GetNode("nSteps");
if(nStepsNode !=0 && nStepsNode->GetNodeType() == INT_NODE)
{
UI->setNSteps(nStepsNode->AsInt());
}
else
{
debug4 << mName << "nSteps not found in node." << endl;
}
}
}
// ****************************************************************************
// Method: MovieSequenceRotate::WriteUIValues
//
// Purpose:
// Gets data values from the user interface and inserts them into the
// data node representation where they can be written to the template
// specification file.
//
// Arguments:
// ui : The user interface.
// node : The node in which to insert the sequence's data values.
//
// Programmer: Brad Whitlock
// Creation: Tue Nov 14 10:40:58 PDT 2006
//
// Modifications:
//
// ****************************************************************************
void
MovieSequenceRotate::WriteUIValues(QWidget *ui, DataNode *node)
{
if(node != 0)
{
QvisRotationTransition *UI = (QvisRotationTransition *)ui;
float sa, ea;
int nSteps;
nSteps = UI->getNSteps();
UI->getAngles(sa, ea);
node->RemoveNode("startAngle");
node->AddNode(new DataNode("startAngle", sa));
node->RemoveNode("endAngle");
node->AddNode(new DataNode("endAngle", ea));
node->RemoveNode("nSteps");
node->AddNode(new DataNode("nSteps", nSteps));
}
}
//
// Pixmap methods for the derived classes.
//
QPixmap
MovieSequenceScreenRotationX::Pixmap()
{
return QPixmap(ms_srotx_xpm);
}
QString
MovieSequenceScreenRotationX::SequenceMenuName() const
{
return tr("Screen rotate X");
}
////////////////////////////////////////////////////////////////////////////////
QPixmap
MovieSequenceScreenRotationY::Pixmap()
{
return QPixmap(ms_sroty_xpm);
}
QString
MovieSequenceScreenRotationY::SequenceMenuName() const
{
return tr("Screen rotate Y");
}
////////////////////////////////////////////////////////////////////////////////
QPixmap
MovieSequenceScreenRotationZ::Pixmap()
{
return QPixmap(ms_srotz_xpm);
}
QString
MovieSequenceScreenRotationZ::SequenceMenuName() const
{
return tr("Screen rotate Z");
}
////////////////////////////////////////////////////////////////////////////////
QPixmap
MovieSequenceRotationX::Pixmap()
{
return QPixmap(ms_rotx_xpm);
}
QString
MovieSequenceRotationX::SequenceMenuName() const
{
return tr("Rotate X");
}
////////////////////////////////////////////////////////////////////////////////
QPixmap
MovieSequenceRotationY::Pixmap()
{
return QPixmap(ms_roty_xpm);
}
QString
MovieSequenceRotationY::SequenceMenuName() const
{
return tr("Rotate Y");
}
////////////////////////////////////////////////////////////////////////////////
QPixmap
MovieSequenceRotationZ::Pixmap()
{
return QPixmap(ms_rotz_xpm);
}
QString
MovieSequenceRotationZ::SequenceMenuName() const
{
return tr("Rotate Z");
}
|
c4921a6af76e322097985a8397baaf733ea989a3
|
35c04ea32351dc95bc18d46e5c70dda9c1e08668
|
/Examples/KDS/tinyK20/tinyK20_Bootloader/Sources/RTL.h
|
131e226567928cd82d29da04f520a2b16e145111
|
[
"LicenseRef-scancode-warranty-disclaimer"
] |
no_license
|
ErichStyger/mcuoneclipse
|
0f8e7a2056a26ed79d9d4a0afd64777ff0b2b2fe
|
04ad311b11860ae5f8285316010961a87fa06d0c
|
refs/heads/master
| 2023-08-28T22:54:08.501719
| 2023-08-25T15:11:44
| 2023-08-25T15:11:44
| 7,446,094
| 620
| 1,191
|
NOASSERTION
| 2020-10-16T03:13:28
| 2013-01-04T19:38:12
|
Batchfile
|
UTF-8
|
C
| false
| false
| 175
|
h
|
RTL.h
|
/*
* RTL.h
*
* Created on: 16.07.2015
* Author: tastyger
*/
#ifndef SOURCES_RTL_H_
#define SOURCES_RTL_H_
/* dummy include file */
#endif /* SOURCES_RTL_H_ */
|
cb09e75403e2dbe2c9929f06a235e74a5d9686ab
|
321d11eaee885ceb3a74db0a062f9bbdf282148c
|
/ssl/statem/statem_dtls.c
|
31dc9f3511ea2985607220057414454a55cf689f
|
[
"Apache-2.0",
"OpenSSL",
"LicenseRef-scancode-proprietary-license"
] |
permissive
|
openssl/openssl
|
75691ebaae957793f2ff0673f77545277dfb3988
|
5318c012885a5382eadbf95aa9c1d35664bca819
|
refs/heads/master
| 2023-09-03T15:22:52.727123
| 2023-09-01T07:10:49
| 2023-09-02T14:30:01
| 7,634,677
| 24,148
| 11,569
|
Apache-2.0
| 2023-09-14T19:48:11
| 2013-01-15T22:34:48
|
C
|
UTF-8
|
C
| false
| false
| 44,864
|
c
|
statem_dtls.c
|
/*
* Copyright 2005-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include <assert.h>
#include <limits.h>
#include <string.h>
#include <stdio.h>
#include "../ssl_local.h"
#include "statem_local.h"
#include "internal/cryptlib.h"
#include <openssl/buffer.h>
#include <openssl/objects.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
#define RSMBLY_BITMASK_SIZE(msg_len) (((msg_len) + 7) / 8)
#define RSMBLY_BITMASK_MARK(bitmask, start, end) { \
if ((end) - (start) <= 8) { \
long ii; \
for (ii = (start); ii < (end); ii++) bitmask[((ii) >> 3)] |= (1 << ((ii) & 7)); \
} else { \
long ii; \
bitmask[((start) >> 3)] |= bitmask_start_values[((start) & 7)]; \
for (ii = (((start) >> 3) + 1); ii < ((((end) - 1)) >> 3); ii++) bitmask[ii] = 0xff; \
bitmask[(((end) - 1) >> 3)] |= bitmask_end_values[((end) & 7)]; \
} }
#define RSMBLY_BITMASK_IS_COMPLETE(bitmask, msg_len, is_complete) { \
long ii; \
is_complete = 1; \
if (bitmask[(((msg_len) - 1) >> 3)] != bitmask_end_values[((msg_len) & 7)]) is_complete = 0; \
if (is_complete) for (ii = (((msg_len) - 1) >> 3) - 1; ii >= 0 ; ii--) \
if (bitmask[ii] != 0xff) { is_complete = 0; break; } }
static unsigned char bitmask_start_values[] =
{ 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80 };
static unsigned char bitmask_end_values[] =
{ 0xff, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f };
static void dtls1_fix_message_header(SSL_CONNECTION *s, size_t frag_off,
size_t frag_len);
static unsigned char *dtls1_write_message_header(SSL_CONNECTION *s,
unsigned char *p);
static void dtls1_set_message_header_int(SSL_CONNECTION *s, unsigned char mt,
size_t len,
unsigned short seq_num,
size_t frag_off,
size_t frag_len);
static int dtls_get_reassembled_message(SSL_CONNECTION *s, int *errtype,
size_t *len);
static hm_fragment *dtls1_hm_fragment_new(size_t frag_len, int reassembly)
{
hm_fragment *frag = NULL;
unsigned char *buf = NULL;
unsigned char *bitmask = NULL;
if ((frag = OPENSSL_malloc(sizeof(*frag))) == NULL)
return NULL;
if (frag_len) {
if ((buf = OPENSSL_malloc(frag_len)) == NULL) {
OPENSSL_free(frag);
return NULL;
}
}
/* zero length fragment gets zero frag->fragment */
frag->fragment = buf;
/* Initialize reassembly bitmask if necessary */
if (reassembly) {
bitmask = OPENSSL_zalloc(RSMBLY_BITMASK_SIZE(frag_len));
if (bitmask == NULL) {
OPENSSL_free(buf);
OPENSSL_free(frag);
return NULL;
}
}
frag->reassembly = bitmask;
return frag;
}
void dtls1_hm_fragment_free(hm_fragment *frag)
{
if (!frag)
return;
if (frag->msg_header.is_ccs) {
/*
* If we're freeing the CCS then we're done with the old wrl and it
* can bee freed
*/
if (frag->msg_header.saved_retransmit_state.wrlmethod != NULL)
frag->msg_header.saved_retransmit_state.wrlmethod->free(frag->msg_header.saved_retransmit_state.wrl);
}
OPENSSL_free(frag->fragment);
OPENSSL_free(frag->reassembly);
OPENSSL_free(frag);
}
/*
* send s->init_buf in records of type 'type' (SSL3_RT_HANDSHAKE or
* SSL3_RT_CHANGE_CIPHER_SPEC)
*/
int dtls1_do_write(SSL_CONNECTION *s, uint8_t type)
{
int ret;
size_t written;
size_t curr_mtu;
int retry = 1;
size_t len, frag_off, overhead, used_len;
SSL *ssl = SSL_CONNECTION_GET_SSL(s);
if (!dtls1_query_mtu(s))
return -1;
if (s->d1->mtu < dtls1_min_mtu(s))
/* should have something reasonable now */
return -1;
if (s->init_off == 0 && type == SSL3_RT_HANDSHAKE) {
if (!ossl_assert(s->init_num ==
s->d1->w_msg_hdr.msg_len + DTLS1_HM_HEADER_LENGTH))
return -1;
}
overhead = s->rlayer.wrlmethod->get_max_record_overhead(s->rlayer.wrl);
frag_off = 0;
s->rwstate = SSL_NOTHING;
/* s->init_num shouldn't ever be < 0...but just in case */
while (s->init_num > 0) {
if (type == SSL3_RT_HANDSHAKE && s->init_off != 0) {
/* We must be writing a fragment other than the first one */
if (frag_off > 0) {
/* This is the first attempt at writing out this fragment */
if (s->init_off <= DTLS1_HM_HEADER_LENGTH) {
/*
* Each fragment that was already sent must at least have
* contained the message header plus one other byte.
* Therefore |init_off| must have progressed by at least
* |DTLS1_HM_HEADER_LENGTH + 1| bytes. If not something went
* wrong.
*/
return -1;
}
/*
* Adjust |init_off| and |init_num| to allow room for a new
* message header for this fragment.
*/
s->init_off -= DTLS1_HM_HEADER_LENGTH;
s->init_num += DTLS1_HM_HEADER_LENGTH;
} else {
/*
* We must have been called again after a retry so use the
* fragment offset from our last attempt. We do not need
* to adjust |init_off| and |init_num| as above, because
* that should already have been done before the retry.
*/
frag_off = s->d1->w_msg_hdr.frag_off;
}
}
used_len = BIO_wpending(s->wbio) + overhead;
if (s->d1->mtu > used_len)
curr_mtu = s->d1->mtu - used_len;
else
curr_mtu = 0;
if (curr_mtu <= DTLS1_HM_HEADER_LENGTH) {
/*
* grr.. we could get an error if MTU picked was wrong
*/
ret = BIO_flush(s->wbio);
if (ret <= 0) {
s->rwstate = SSL_WRITING;
return ret;
}
if (s->d1->mtu > overhead + DTLS1_HM_HEADER_LENGTH) {
curr_mtu = s->d1->mtu - overhead;
} else {
/* Shouldn't happen */
return -1;
}
}
/*
* We just checked that s->init_num > 0 so this cast should be safe
*/
if (((unsigned int)s->init_num) > curr_mtu)
len = curr_mtu;
else
len = s->init_num;
if (len > ssl_get_max_send_fragment(s))
len = ssl_get_max_send_fragment(s);
/*
* XDTLS: this function is too long. split out the CCS part
*/
if (type == SSL3_RT_HANDSHAKE) {
if (len < DTLS1_HM_HEADER_LENGTH) {
/*
* len is so small that we really can't do anything sensible
* so fail
*/
return -1;
}
dtls1_fix_message_header(s, frag_off, len - DTLS1_HM_HEADER_LENGTH);
dtls1_write_message_header(s,
(unsigned char *)&s->init_buf->
data[s->init_off]);
}
ret = dtls1_write_bytes(s, type, &s->init_buf->data[s->init_off], len,
&written);
if (ret <= 0) {
/*
* might need to update MTU here, but we don't know which
* previous packet caused the failure -- so can't really
* retransmit anything. continue as if everything is fine and
* wait for an alert to handle the retransmit
*/
if (retry && BIO_ctrl(SSL_get_wbio(ssl),
BIO_CTRL_DGRAM_MTU_EXCEEDED, 0, NULL) > 0) {
if (!(SSL_get_options(ssl) & SSL_OP_NO_QUERY_MTU)) {
if (!dtls1_query_mtu(s))
return -1;
/* Have one more go */
retry = 0;
} else
return -1;
} else {
return -1;
}
} else {
/*
* bad if this assert fails, only part of the handshake message
* got sent. but why would this happen?
*/
if (!ossl_assert(len == written))
return -1;
/*
* We should not exceed the MTU size. If compression is in use
* then the max record overhead calculation is unreliable so we do
* not check in that case. We use assert rather than ossl_assert
* because in a production build, if this assert were ever to fail,
* then the best thing to do is probably carry on regardless.
*/
assert(s->s3.tmp.new_compression != NULL
|| BIO_wpending(s->wbio) <= (int)s->d1->mtu);
if (type == SSL3_RT_HANDSHAKE && !s->d1->retransmitting) {
/*
* should not be done for 'Hello Request's, but in that case
* we'll ignore the result anyway
*/
unsigned char *p =
(unsigned char *)&s->init_buf->data[s->init_off];
const struct hm_header_st *msg_hdr = &s->d1->w_msg_hdr;
size_t xlen;
if (frag_off == 0 && s->version != DTLS1_BAD_VER) {
/*
* reconstruct message header is if it is being sent in
* single fragment
*/
*p++ = msg_hdr->type;
l2n3(msg_hdr->msg_len, p);
s2n(msg_hdr->seq, p);
l2n3(0, p);
l2n3(msg_hdr->msg_len, p);
p -= DTLS1_HM_HEADER_LENGTH;
xlen = written;
} else {
p += DTLS1_HM_HEADER_LENGTH;
xlen = written - DTLS1_HM_HEADER_LENGTH;
}
if (!ssl3_finish_mac(s, p, xlen))
return -1;
}
if (written == s->init_num) {
if (s->msg_callback)
s->msg_callback(1, s->version, type, s->init_buf->data,
(size_t)(s->init_off + s->init_num), ssl,
s->msg_callback_arg);
s->init_off = 0; /* done writing this message */
s->init_num = 0;
return 1;
}
s->init_off += written;
s->init_num -= written;
written -= DTLS1_HM_HEADER_LENGTH;
frag_off += written;
/*
* We save the fragment offset for the next fragment so we have it
* available in case of an IO retry. We don't know the length of the
* next fragment yet so just set that to 0 for now. It will be
* updated again later.
*/
dtls1_fix_message_header(s, frag_off, 0);
}
}
return 0;
}
int dtls_get_message(SSL_CONNECTION *s, int *mt)
{
struct hm_header_st *msg_hdr;
unsigned char *p;
size_t msg_len;
size_t tmplen;
int errtype;
msg_hdr = &s->d1->r_msg_hdr;
memset(msg_hdr, 0, sizeof(*msg_hdr));
again:
if (!dtls_get_reassembled_message(s, &errtype, &tmplen)) {
if (errtype == DTLS1_HM_BAD_FRAGMENT
|| errtype == DTLS1_HM_FRAGMENT_RETRY) {
/* bad fragment received */
goto again;
}
return 0;
}
*mt = s->s3.tmp.message_type;
p = (unsigned char *)s->init_buf->data;
if (*mt == SSL3_MT_CHANGE_CIPHER_SPEC) {
if (s->msg_callback) {
s->msg_callback(0, s->version, SSL3_RT_CHANGE_CIPHER_SPEC,
p, 1, SSL_CONNECTION_GET_SSL(s),
s->msg_callback_arg);
}
/*
* This isn't a real handshake message so skip the processing below.
*/
return 1;
}
msg_len = msg_hdr->msg_len;
/* reconstruct message header */
*(p++) = msg_hdr->type;
l2n3(msg_len, p);
s2n(msg_hdr->seq, p);
l2n3(0, p);
l2n3(msg_len, p);
memset(msg_hdr, 0, sizeof(*msg_hdr));
s->d1->handshake_read_seq++;
s->init_msg = s->init_buf->data + DTLS1_HM_HEADER_LENGTH;
return 1;
}
/*
* Actually we already have the message body - but this is an opportunity for
* DTLS to do any further processing it wants at the same point that TLS would
* be asked for the message body.
*/
int dtls_get_message_body(SSL_CONNECTION *s, size_t *len)
{
unsigned char *msg = (unsigned char *)s->init_buf->data;
size_t msg_len = s->init_num + DTLS1_HM_HEADER_LENGTH;
if (s->s3.tmp.message_type == SSL3_MT_CHANGE_CIPHER_SPEC) {
/* Nothing to be done */
goto end;
}
/*
* If receiving Finished, record MAC of prior handshake messages for
* Finished verification.
*/
if (*(s->init_buf->data) == SSL3_MT_FINISHED && !ssl3_take_mac(s)) {
/* SSLfatal() already called */
return 0;
}
if (s->version == DTLS1_BAD_VER) {
msg += DTLS1_HM_HEADER_LENGTH;
msg_len -= DTLS1_HM_HEADER_LENGTH;
}
if (!ssl3_finish_mac(s, msg, msg_len))
return 0;
if (s->msg_callback)
s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE,
s->init_buf->data, s->init_num + DTLS1_HM_HEADER_LENGTH,
SSL_CONNECTION_GET_SSL(s), s->msg_callback_arg);
end:
*len = s->init_num;
return 1;
}
/*
* dtls1_max_handshake_message_len returns the maximum number of bytes
* permitted in a DTLS handshake message for |s|. The minimum is 16KB, but
* may be greater if the maximum certificate list size requires it.
*/
static size_t dtls1_max_handshake_message_len(const SSL_CONNECTION *s)
{
size_t max_len = DTLS1_HM_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH;
if (max_len < s->max_cert_list)
return s->max_cert_list;
return max_len;
}
static int dtls1_preprocess_fragment(SSL_CONNECTION *s,
struct hm_header_st *msg_hdr)
{
size_t frag_off, frag_len, msg_len;
msg_len = msg_hdr->msg_len;
frag_off = msg_hdr->frag_off;
frag_len = msg_hdr->frag_len;
/* sanity checking */
if ((frag_off + frag_len) > msg_len
|| msg_len > dtls1_max_handshake_message_len(s)) {
SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_EXCESSIVE_MESSAGE_SIZE);
return 0;
}
if (s->d1->r_msg_hdr.frag_off == 0) { /* first fragment */
/*
* msg_len is limited to 2^24, but is effectively checked against
* dtls_max_handshake_message_len(s) above
*/
if (!BUF_MEM_grow_clean(s->init_buf, msg_len + DTLS1_HM_HEADER_LENGTH)) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_BUF_LIB);
return 0;
}
s->s3.tmp.message_size = msg_len;
s->d1->r_msg_hdr.msg_len = msg_len;
s->s3.tmp.message_type = msg_hdr->type;
s->d1->r_msg_hdr.type = msg_hdr->type;
s->d1->r_msg_hdr.seq = msg_hdr->seq;
} else if (msg_len != s->d1->r_msg_hdr.msg_len) {
/*
* They must be playing with us! BTW, failure to enforce upper limit
* would open possibility for buffer overrun.
*/
SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_EXCESSIVE_MESSAGE_SIZE);
return 0;
}
return 1;
}
/*
* Returns 1 if there is a buffered fragment available, 0 if not, or -1 on a
* fatal error.
*/
static int dtls1_retrieve_buffered_fragment(SSL_CONNECTION *s, size_t *len)
{
/*-
* (0) check whether the desired fragment is available
* if so:
* (1) copy over the fragment to s->init_buf->data[]
* (2) update s->init_num
*/
pitem *item;
piterator iter;
hm_fragment *frag;
int ret;
int chretran = 0;
iter = pqueue_iterator(s->d1->buffered_messages);
do {
item = pqueue_next(&iter);
if (item == NULL)
return 0;
frag = (hm_fragment *)item->data;
if (frag->msg_header.seq < s->d1->handshake_read_seq) {
pitem *next;
hm_fragment *nextfrag;
if (!s->server
|| frag->msg_header.seq != 0
|| s->d1->handshake_read_seq != 1
|| s->statem.hand_state != DTLS_ST_SW_HELLO_VERIFY_REQUEST) {
/*
* This is a stale message that has been buffered so clear it.
* It is safe to pop this message from the queue even though
* we have an active iterator
*/
pqueue_pop(s->d1->buffered_messages);
dtls1_hm_fragment_free(frag);
pitem_free(item);
item = NULL;
frag = NULL;
} else {
/*
* We have fragments for a ClientHello without a cookie,
* even though we have sent a HelloVerifyRequest. It is possible
* that the HelloVerifyRequest got lost and this is a
* retransmission of the original ClientHello
*/
next = pqueue_next(&iter);
if (next != NULL) {
nextfrag = (hm_fragment *)next->data;
if (nextfrag->msg_header.seq == s->d1->handshake_read_seq) {
/*
* We have fragments for both a ClientHello without
* cookie and one with. Ditch the one without.
*/
pqueue_pop(s->d1->buffered_messages);
dtls1_hm_fragment_free(frag);
pitem_free(item);
item = next;
frag = nextfrag;
} else {
chretran = 1;
}
} else {
chretran = 1;
}
}
}
} while (item == NULL);
/* Don't return if reassembly still in progress */
if (frag->reassembly != NULL)
return 0;
if (s->d1->handshake_read_seq == frag->msg_header.seq || chretran) {
size_t frag_len = frag->msg_header.frag_len;
pqueue_pop(s->d1->buffered_messages);
/* Calls SSLfatal() as required */
ret = dtls1_preprocess_fragment(s, &frag->msg_header);
if (ret && frag->msg_header.frag_len > 0) {
unsigned char *p =
(unsigned char *)s->init_buf->data + DTLS1_HM_HEADER_LENGTH;
memcpy(&p[frag->msg_header.frag_off], frag->fragment,
frag->msg_header.frag_len);
}
dtls1_hm_fragment_free(frag);
pitem_free(item);
if (ret) {
if (chretran) {
/*
* We got a new ClientHello with a message sequence of 0.
* Reset the read/write sequences back to the beginning.
* We process it like this is the first time we've seen a
* ClientHello from the client.
*/
s->d1->handshake_read_seq = 0;
s->d1->next_handshake_write_seq = 0;
}
*len = frag_len;
return 1;
}
/* Fatal error */
s->init_num = 0;
return -1;
} else {
return 0;
}
}
static int dtls1_reassemble_fragment(SSL_CONNECTION *s,
const struct hm_header_st *msg_hdr)
{
hm_fragment *frag = NULL;
pitem *item = NULL;
int i = -1, is_complete;
unsigned char seq64be[8];
size_t frag_len = msg_hdr->frag_len;
size_t readbytes;
SSL *ssl = SSL_CONNECTION_GET_SSL(s);
if ((msg_hdr->frag_off + frag_len) > msg_hdr->msg_len ||
msg_hdr->msg_len > dtls1_max_handshake_message_len(s))
goto err;
if (frag_len == 0) {
return DTLS1_HM_FRAGMENT_RETRY;
}
/* Try to find item in queue */
memset(seq64be, 0, sizeof(seq64be));
seq64be[6] = (unsigned char)(msg_hdr->seq >> 8);
seq64be[7] = (unsigned char)msg_hdr->seq;
item = pqueue_find(s->d1->buffered_messages, seq64be);
if (item == NULL) {
frag = dtls1_hm_fragment_new(msg_hdr->msg_len, 1);
if (frag == NULL)
goto err;
memcpy(&(frag->msg_header), msg_hdr, sizeof(*msg_hdr));
frag->msg_header.frag_len = frag->msg_header.msg_len;
frag->msg_header.frag_off = 0;
} else {
frag = (hm_fragment *)item->data;
if (frag->msg_header.msg_len != msg_hdr->msg_len) {
item = NULL;
frag = NULL;
goto err;
}
}
/*
* If message is already reassembled, this must be a retransmit and can
* be dropped. In this case item != NULL and so frag does not need to be
* freed.
*/
if (frag->reassembly == NULL) {
unsigned char devnull[256];
while (frag_len) {
i = ssl->method->ssl_read_bytes(ssl, SSL3_RT_HANDSHAKE, NULL,
devnull,
frag_len >
sizeof(devnull) ? sizeof(devnull) :
frag_len, 0, &readbytes);
if (i <= 0)
goto err;
frag_len -= readbytes;
}
return DTLS1_HM_FRAGMENT_RETRY;
}
/* read the body of the fragment (header has already been read */
i = ssl->method->ssl_read_bytes(ssl, SSL3_RT_HANDSHAKE, NULL,
frag->fragment + msg_hdr->frag_off,
frag_len, 0, &readbytes);
if (i <= 0 || readbytes != frag_len)
i = -1;
if (i <= 0)
goto err;
RSMBLY_BITMASK_MARK(frag->reassembly, (long)msg_hdr->frag_off,
(long)(msg_hdr->frag_off + frag_len));
if (!ossl_assert(msg_hdr->msg_len > 0))
goto err;
RSMBLY_BITMASK_IS_COMPLETE(frag->reassembly, (long)msg_hdr->msg_len,
is_complete);
if (is_complete) {
OPENSSL_free(frag->reassembly);
frag->reassembly = NULL;
}
if (item == NULL) {
item = pitem_new(seq64be, frag);
if (item == NULL) {
i = -1;
goto err;
}
item = pqueue_insert(s->d1->buffered_messages, item);
/*
* pqueue_insert fails iff a duplicate item is inserted. However,
* |item| cannot be a duplicate. If it were, |pqueue_find|, above,
* would have returned it and control would never have reached this
* branch.
*/
if (!ossl_assert(item != NULL))
goto err;
}
return DTLS1_HM_FRAGMENT_RETRY;
err:
if (item == NULL)
dtls1_hm_fragment_free(frag);
return -1;
}
static int dtls1_process_out_of_seq_message(SSL_CONNECTION *s,
const struct hm_header_st *msg_hdr)
{
int i = -1;
hm_fragment *frag = NULL;
pitem *item = NULL;
unsigned char seq64be[8];
size_t frag_len = msg_hdr->frag_len;
size_t readbytes;
SSL *ssl = SSL_CONNECTION_GET_SSL(s);
if ((msg_hdr->frag_off + frag_len) > msg_hdr->msg_len)
goto err;
/* Try to find item in queue, to prevent duplicate entries */
memset(seq64be, 0, sizeof(seq64be));
seq64be[6] = (unsigned char)(msg_hdr->seq >> 8);
seq64be[7] = (unsigned char)msg_hdr->seq;
item = pqueue_find(s->d1->buffered_messages, seq64be);
/*
* If we already have an entry and this one is a fragment, don't discard
* it and rather try to reassemble it.
*/
if (item != NULL && frag_len != msg_hdr->msg_len)
item = NULL;
/*
* Discard the message if sequence number was already there, is too far
* in the future, already in the queue or if we received a FINISHED
* before the SERVER_HELLO, which then must be a stale retransmit.
*/
if (msg_hdr->seq <= s->d1->handshake_read_seq ||
msg_hdr->seq > s->d1->handshake_read_seq + 10 || item != NULL ||
(s->d1->handshake_read_seq == 0 && msg_hdr->type == SSL3_MT_FINISHED)) {
unsigned char devnull[256];
while (frag_len) {
i = ssl->method->ssl_read_bytes(ssl, SSL3_RT_HANDSHAKE, NULL,
devnull,
frag_len >
sizeof(devnull) ? sizeof(devnull) :
frag_len, 0, &readbytes);
if (i <= 0)
goto err;
frag_len -= readbytes;
}
} else {
if (frag_len != msg_hdr->msg_len) {
return dtls1_reassemble_fragment(s, msg_hdr);
}
if (frag_len > dtls1_max_handshake_message_len(s))
goto err;
frag = dtls1_hm_fragment_new(frag_len, 0);
if (frag == NULL)
goto err;
memcpy(&(frag->msg_header), msg_hdr, sizeof(*msg_hdr));
if (frag_len) {
/*
* read the body of the fragment (header has already been read
*/
i = ssl->method->ssl_read_bytes(ssl, SSL3_RT_HANDSHAKE, NULL,
frag->fragment, frag_len, 0,
&readbytes);
if (i<=0 || readbytes != frag_len)
i = -1;
if (i <= 0)
goto err;
}
item = pitem_new(seq64be, frag);
if (item == NULL)
goto err;
item = pqueue_insert(s->d1->buffered_messages, item);
/*
* pqueue_insert fails iff a duplicate item is inserted. However,
* |item| cannot be a duplicate. If it were, |pqueue_find|, above,
* would have returned it. Then, either |frag_len| !=
* |msg_hdr->msg_len| in which case |item| is set to NULL and it will
* have been processed with |dtls1_reassemble_fragment|, above, or
* the record will have been discarded.
*/
if (!ossl_assert(item != NULL))
goto err;
}
return DTLS1_HM_FRAGMENT_RETRY;
err:
if (item == NULL)
dtls1_hm_fragment_free(frag);
return 0;
}
static int dtls_get_reassembled_message(SSL_CONNECTION *s, int *errtype,
size_t *len)
{
unsigned char wire[DTLS1_HM_HEADER_LENGTH];
size_t mlen, frag_off, frag_len;
int i, ret;
uint8_t recvd_type;
struct hm_header_st msg_hdr;
size_t readbytes;
SSL *ssl = SSL_CONNECTION_GET_SSL(s);
int chretran = 0;
*errtype = 0;
redo:
/* see if we have the required fragment already */
ret = dtls1_retrieve_buffered_fragment(s, &frag_len);
if (ret < 0) {
/* SSLfatal() already called */
return 0;
}
if (ret > 0) {
s->init_num = frag_len;
*len = frag_len;
return 1;
}
/* read handshake message header */
i = ssl->method->ssl_read_bytes(ssl, SSL3_RT_HANDSHAKE, &recvd_type, wire,
DTLS1_HM_HEADER_LENGTH, 0, &readbytes);
if (i <= 0) { /* nbio, or an error */
s->rwstate = SSL_READING;
*len = 0;
return 0;
}
if (recvd_type == SSL3_RT_CHANGE_CIPHER_SPEC) {
if (wire[0] != SSL3_MT_CCS) {
SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE,
SSL_R_BAD_CHANGE_CIPHER_SPEC);
goto f_err;
}
memcpy(s->init_buf->data, wire, readbytes);
s->init_num = readbytes - 1;
s->init_msg = s->init_buf->data + 1;
s->s3.tmp.message_type = SSL3_MT_CHANGE_CIPHER_SPEC;
s->s3.tmp.message_size = readbytes - 1;
*len = readbytes - 1;
return 1;
}
/* Handshake fails if message header is incomplete */
if (readbytes != DTLS1_HM_HEADER_LENGTH) {
SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_UNEXPECTED_MESSAGE);
goto f_err;
}
/* parse the message fragment header */
dtls1_get_message_header(wire, &msg_hdr);
mlen = msg_hdr.msg_len;
frag_off = msg_hdr.frag_off;
frag_len = msg_hdr.frag_len;
/*
* We must have at least frag_len bytes left in the record to be read.
* Fragments must not span records.
*/
if (frag_len > s->rlayer.tlsrecs[s->rlayer.curr_rec].length) {
SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_LENGTH);
goto f_err;
}
/*
* if this is a future (or stale) message it gets buffered
* (or dropped)--no further processing at this time
* While listening, we accept seq 1 (ClientHello with cookie)
* although we're still expecting seq 0 (ClientHello)
*/
if (msg_hdr.seq != s->d1->handshake_read_seq) {
if (!s->server
|| msg_hdr.seq != 0
|| s->d1->handshake_read_seq != 1
|| wire[0] != SSL3_MT_CLIENT_HELLO
|| s->statem.hand_state != DTLS_ST_SW_HELLO_VERIFY_REQUEST) {
*errtype = dtls1_process_out_of_seq_message(s, &msg_hdr);
return 0;
}
/*
* We received a ClientHello and sent back a HelloVerifyRequest. We
* now seem to have received a retransmitted initial ClientHello. That
* is allowed (possibly our HelloVerifyRequest got lost).
*/
chretran = 1;
}
if (frag_len && frag_len < mlen) {
*errtype = dtls1_reassemble_fragment(s, &msg_hdr);
return 0;
}
if (!s->server
&& s->d1->r_msg_hdr.frag_off == 0
&& s->statem.hand_state != TLS_ST_OK
&& wire[0] == SSL3_MT_HELLO_REQUEST) {
/*
* The server may always send 'Hello Request' messages -- we are
* doing a handshake anyway now, so ignore them if their format is
* correct. Does not count for 'Finished' MAC.
*/
if (wire[1] == 0 && wire[2] == 0 && wire[3] == 0) {
if (s->msg_callback)
s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE,
wire, DTLS1_HM_HEADER_LENGTH, ssl,
s->msg_callback_arg);
s->init_num = 0;
goto redo;
} else { /* Incorrectly formatted Hello request */
SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_UNEXPECTED_MESSAGE);
goto f_err;
}
}
if (!dtls1_preprocess_fragment(s, &msg_hdr)) {
/* SSLfatal() already called */
goto f_err;
}
if (frag_len > 0) {
unsigned char *p =
(unsigned char *)s->init_buf->data + DTLS1_HM_HEADER_LENGTH;
i = ssl->method->ssl_read_bytes(ssl, SSL3_RT_HANDSHAKE, NULL,
&p[frag_off], frag_len, 0, &readbytes);
/*
* This shouldn't ever fail due to NBIO because we already checked
* that we have enough data in the record
*/
if (i <= 0) {
s->rwstate = SSL_READING;
*len = 0;
return 0;
}
} else {
readbytes = 0;
}
/*
* XDTLS: an incorrectly formatted fragment should cause the handshake
* to fail
*/
if (readbytes != frag_len) {
SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_LENGTH);
goto f_err;
}
if (chretran) {
/*
* We got a new ClientHello with a message sequence of 0.
* Reset the read/write sequences back to the beginning.
* We process it like this is the first time we've seen a ClientHello
* from the client.
*/
s->d1->handshake_read_seq = 0;
s->d1->next_handshake_write_seq = 0;
}
/*
* Note that s->init_num is *not* used as current offset in
* s->init_buf->data, but as a counter summing up fragments' lengths: as
* soon as they sum up to handshake packet length, we assume we have got
* all the fragments.
*/
*len = s->init_num = frag_len;
return 1;
f_err:
s->init_num = 0;
*len = 0;
return 0;
}
/*-
* for these 2 messages, we need to
* ssl->session->read_sym_enc assign
* ssl->session->read_compression assign
* ssl->session->read_hash assign
*/
CON_FUNC_RETURN dtls_construct_change_cipher_spec(SSL_CONNECTION *s,
WPACKET *pkt)
{
if (s->version == DTLS1_BAD_VER) {
s->d1->next_handshake_write_seq++;
if (!WPACKET_put_bytes_u16(pkt, s->d1->handshake_write_seq)) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
return CON_FUNC_ERROR;
}
}
return CON_FUNC_SUCCESS;
}
#ifndef OPENSSL_NO_SCTP
/*
* Wait for a dry event. Should only be called at a point in the handshake
* where we are not expecting any data from the peer except an alert.
*/
WORK_STATE dtls_wait_for_dry(SSL_CONNECTION *s)
{
int ret, errtype;
size_t len;
SSL *ssl = SSL_CONNECTION_GET_SSL(s);
/* read app data until dry event */
ret = BIO_dgram_sctp_wait_for_dry(SSL_get_wbio(ssl));
if (ret < 0) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
return WORK_ERROR;
}
if (ret == 0) {
/*
* We're not expecting any more messages from the peer at this point -
* but we could get an alert. If an alert is waiting then we will never
* return successfully. Therefore we attempt to read a message. This
* should never succeed but will process any waiting alerts.
*/
if (dtls_get_reassembled_message(s, &errtype, &len)) {
/* The call succeeded! This should never happen */
SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_UNEXPECTED_MESSAGE);
return WORK_ERROR;
}
s->s3.in_read_app_data = 2;
s->rwstate = SSL_READING;
BIO_clear_retry_flags(SSL_get_rbio(ssl));
BIO_set_retry_read(SSL_get_rbio(ssl));
return WORK_MORE_A;
}
return WORK_FINISHED_CONTINUE;
}
#endif
int dtls1_read_failed(SSL_CONNECTION *s, int code)
{
SSL *ssl = SSL_CONNECTION_GET_SSL(s);
if (code > 0) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
return 0;
}
if (!dtls1_is_timer_expired(s) || ossl_statem_in_error(s)) {
/*
* not a timeout, none of our business, let higher layers handle
* this. in fact it's probably an error
*/
return code;
}
/* done, no need to send a retransmit */
if (!SSL_in_init(ssl))
{
BIO_set_flags(SSL_get_rbio(ssl), BIO_FLAGS_READ);
return code;
}
return dtls1_handle_timeout(s);
}
int dtls1_get_queue_priority(unsigned short seq, int is_ccs)
{
/*
* The index of the retransmission queue actually is the message sequence
* number, since the queue only contains messages of a single handshake.
* However, the ChangeCipherSpec has no message sequence number and so
* using only the sequence will result in the CCS and Finished having the
* same index. To prevent this, the sequence number is multiplied by 2.
* In case of a CCS 1 is subtracted. This does not only differ CSS and
* Finished, it also maintains the order of the index (important for
* priority queues) and fits in the unsigned short variable.
*/
return seq * 2 - is_ccs;
}
int dtls1_retransmit_buffered_messages(SSL_CONNECTION *s)
{
pqueue *sent = s->d1->sent_messages;
piterator iter;
pitem *item;
hm_fragment *frag;
int found = 0;
iter = pqueue_iterator(sent);
for (item = pqueue_next(&iter); item != NULL; item = pqueue_next(&iter)) {
frag = (hm_fragment *)item->data;
if (dtls1_retransmit_message(s, (unsigned short)
dtls1_get_queue_priority
(frag->msg_header.seq,
frag->msg_header.is_ccs), &found) <= 0)
return -1;
}
return 1;
}
int dtls1_buffer_message(SSL_CONNECTION *s, int is_ccs)
{
pitem *item;
hm_fragment *frag;
unsigned char seq64be[8];
/*
* this function is called immediately after a message has been
* serialized
*/
if (!ossl_assert(s->init_off == 0))
return 0;
frag = dtls1_hm_fragment_new(s->init_num, 0);
if (frag == NULL)
return 0;
memcpy(frag->fragment, s->init_buf->data, s->init_num);
if (is_ccs) {
/* For DTLS1_BAD_VER the header length is non-standard */
if (!ossl_assert(s->d1->w_msg_hdr.msg_len +
((s->version ==
DTLS1_BAD_VER) ? 3 : DTLS1_CCS_HEADER_LENGTH)
== (unsigned int)s->init_num)) {
dtls1_hm_fragment_free(frag);
return 0;
}
} else {
if (!ossl_assert(s->d1->w_msg_hdr.msg_len +
DTLS1_HM_HEADER_LENGTH == (unsigned int)s->init_num)) {
dtls1_hm_fragment_free(frag);
return 0;
}
}
frag->msg_header.msg_len = s->d1->w_msg_hdr.msg_len;
frag->msg_header.seq = s->d1->w_msg_hdr.seq;
frag->msg_header.type = s->d1->w_msg_hdr.type;
frag->msg_header.frag_off = 0;
frag->msg_header.frag_len = s->d1->w_msg_hdr.msg_len;
frag->msg_header.is_ccs = is_ccs;
/* save current state */
frag->msg_header.saved_retransmit_state.wrlmethod = s->rlayer.wrlmethod;
frag->msg_header.saved_retransmit_state.wrl = s->rlayer.wrl;
memset(seq64be, 0, sizeof(seq64be));
seq64be[6] =
(unsigned
char)(dtls1_get_queue_priority(frag->msg_header.seq,
frag->msg_header.is_ccs) >> 8);
seq64be[7] =
(unsigned
char)(dtls1_get_queue_priority(frag->msg_header.seq,
frag->msg_header.is_ccs));
item = pitem_new(seq64be, frag);
if (item == NULL) {
dtls1_hm_fragment_free(frag);
return 0;
}
pqueue_insert(s->d1->sent_messages, item);
return 1;
}
int dtls1_retransmit_message(SSL_CONNECTION *s, unsigned short seq, int *found)
{
int ret;
/* XDTLS: for now assuming that read/writes are blocking */
pitem *item;
hm_fragment *frag;
unsigned long header_length;
unsigned char seq64be[8];
struct dtls1_retransmit_state saved_state;
/* XDTLS: the requested message ought to be found, otherwise error */
memset(seq64be, 0, sizeof(seq64be));
seq64be[6] = (unsigned char)(seq >> 8);
seq64be[7] = (unsigned char)seq;
item = pqueue_find(s->d1->sent_messages, seq64be);
if (item == NULL) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
*found = 0;
return 0;
}
*found = 1;
frag = (hm_fragment *)item->data;
if (frag->msg_header.is_ccs)
header_length = DTLS1_CCS_HEADER_LENGTH;
else
header_length = DTLS1_HM_HEADER_LENGTH;
memcpy(s->init_buf->data, frag->fragment,
frag->msg_header.msg_len + header_length);
s->init_num = frag->msg_header.msg_len + header_length;
dtls1_set_message_header_int(s, frag->msg_header.type,
frag->msg_header.msg_len,
frag->msg_header.seq, 0,
frag->msg_header.frag_len);
/* save current state */
saved_state.wrlmethod = s->rlayer.wrlmethod;
saved_state.wrl = s->rlayer.wrl;
s->d1->retransmitting = 1;
/* restore state in which the message was originally sent */
s->rlayer.wrlmethod = frag->msg_header.saved_retransmit_state.wrlmethod;
s->rlayer.wrl = frag->msg_header.saved_retransmit_state.wrl;
/*
* The old wrl may be still pointing at an old BIO. Update it to what we're
* using now.
*/
s->rlayer.wrlmethod->set1_bio(s->rlayer.wrl, s->wbio);
ret = dtls1_do_write(s, frag->msg_header.is_ccs ?
SSL3_RT_CHANGE_CIPHER_SPEC : SSL3_RT_HANDSHAKE);
/* restore current state */
s->rlayer.wrlmethod = saved_state.wrlmethod;
s->rlayer.wrl = saved_state.wrl;
s->d1->retransmitting = 0;
(void)BIO_flush(s->wbio);
return ret;
}
void dtls1_set_message_header(SSL_CONNECTION *s,
unsigned char mt, size_t len,
size_t frag_off, size_t frag_len)
{
if (frag_off == 0) {
s->d1->handshake_write_seq = s->d1->next_handshake_write_seq;
s->d1->next_handshake_write_seq++;
}
dtls1_set_message_header_int(s, mt, len, s->d1->handshake_write_seq,
frag_off, frag_len);
}
/* don't actually do the writing, wait till the MTU has been retrieved */
static void
dtls1_set_message_header_int(SSL_CONNECTION *s, unsigned char mt,
size_t len, unsigned short seq_num,
size_t frag_off, size_t frag_len)
{
struct hm_header_st *msg_hdr = &s->d1->w_msg_hdr;
msg_hdr->type = mt;
msg_hdr->msg_len = len;
msg_hdr->seq = seq_num;
msg_hdr->frag_off = frag_off;
msg_hdr->frag_len = frag_len;
}
static void
dtls1_fix_message_header(SSL_CONNECTION *s, size_t frag_off, size_t frag_len)
{
struct hm_header_st *msg_hdr = &s->d1->w_msg_hdr;
msg_hdr->frag_off = frag_off;
msg_hdr->frag_len = frag_len;
}
static unsigned char *dtls1_write_message_header(SSL_CONNECTION *s,
unsigned char *p)
{
struct hm_header_st *msg_hdr = &s->d1->w_msg_hdr;
*p++ = msg_hdr->type;
l2n3(msg_hdr->msg_len, p);
s2n(msg_hdr->seq, p);
l2n3(msg_hdr->frag_off, p);
l2n3(msg_hdr->frag_len, p);
return p;
}
void dtls1_get_message_header(const unsigned char *data, struct
hm_header_st *msg_hdr)
{
memset(msg_hdr, 0, sizeof(*msg_hdr));
msg_hdr->type = *(data++);
n2l3(data, msg_hdr->msg_len);
n2s(data, msg_hdr->seq);
n2l3(data, msg_hdr->frag_off);
n2l3(data, msg_hdr->frag_len);
}
int dtls1_set_handshake_header(SSL_CONNECTION *s, WPACKET *pkt, int htype)
{
unsigned char *header;
if (htype == SSL3_MT_CHANGE_CIPHER_SPEC) {
s->d1->handshake_write_seq = s->d1->next_handshake_write_seq;
dtls1_set_message_header_int(s, SSL3_MT_CCS, 0,
s->d1->handshake_write_seq, 0, 0);
if (!WPACKET_put_bytes_u8(pkt, SSL3_MT_CCS))
return 0;
} else {
dtls1_set_message_header(s, htype, 0, 0, 0);
/*
* We allocate space at the start for the message header. This gets
* filled in later
*/
if (!WPACKET_allocate_bytes(pkt, DTLS1_HM_HEADER_LENGTH, &header)
|| !WPACKET_start_sub_packet(pkt))
return 0;
}
return 1;
}
int dtls1_close_construct_packet(SSL_CONNECTION *s, WPACKET *pkt, int htype)
{
size_t msglen;
if ((htype != SSL3_MT_CHANGE_CIPHER_SPEC && !WPACKET_close(pkt))
|| !WPACKET_get_length(pkt, &msglen)
|| msglen > INT_MAX)
return 0;
if (htype != SSL3_MT_CHANGE_CIPHER_SPEC) {
s->d1->w_msg_hdr.msg_len = msglen - DTLS1_HM_HEADER_LENGTH;
s->d1->w_msg_hdr.frag_len = msglen - DTLS1_HM_HEADER_LENGTH;
}
s->init_num = (int)msglen;
s->init_off = 0;
if (htype != DTLS1_MT_HELLO_VERIFY_REQUEST) {
/* Buffer the message to handle re-xmits */
if (!dtls1_buffer_message(s, htype == SSL3_MT_CHANGE_CIPHER_SPEC
? 1 : 0))
return 0;
}
return 1;
}
|
968ac305d3f2920de7a677349de38988221f0f51
|
50e95229b9a1161ac294137120aaba94c9eb06bc
|
/sources/ippcp/pcpaes_gcmreset.c
|
835a857258c2dd449cd7721b6a35fc06ad293222
|
[
"Apache-2.0",
"Intel"
] |
permissive
|
intel/ipp-crypto
|
f0f05b87203705e82603db67bed5f8def13a5ee8
|
36e76e2388f3dd10cc440e213dfcf6ef59a0dfb8
|
refs/heads/develop
| 2023-09-04T08:15:06.851373
| 2023-07-27T12:47:12
| 2023-07-27T12:47:12
| 140,034,345
| 304
| 81
|
Apache-2.0
| 2023-08-30T17:18:36
| 2018-07-06T22:16:28
|
C
|
UTF-8
|
C
| false
| false
| 2,342
|
c
|
pcpaes_gcmreset.c
|
/*******************************************************************************
* Copyright (C) 2013 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions
* and limitations under the License.
*
*******************************************************************************/
/*
//
// Purpose:
// Cryptography Primitive.
// AES-GCM
//
// Contents:
// ippsAES_GCMReset()
//
*/
#include "owndefs.h"
#include "owncp.h"
#include "pcpaesm.h"
#include "pcptool.h"
#if(_IPP32E>=_IPP32E_K0)
#include "pcpaesauthgcm_avx512.h"
#else
#include "pcpaesauthgcm.h"
#endif /* #if(_IPP32E>=_IPP32E_K0) */
/*F*
// Name: ippsAES_GCMReset
//
// Purpose: Resets AES_GCM context.
//
// Returns: Reason:
// ippStsNullPtrErr pState== NULL
// ippStsContextMatchErr pState points on invalid context
// ippStsNoErr no errors
//
// Parameters:
// pState pointer to the context
//
*F*/
IPPFUN(IppStatus, ippsAES_GCMReset,(IppsAES_GCMState* pState))
{
/* test pState pointer */
IPP_BAD_PTR1_RET(pState);
/* use aligned context */
pState = (IppsAES_GCMState*)( IPP_ALIGNED_PTR(pState, AESGCM_ALIGNMENT) );
/* test context validity */
IPP_BADARG_RET(!AESGCM_VALID_ID(pState), ippStsContextMatchErr);
/* reset GCM */
AESGCM_STATE(pState) = GcmInit;
AESGCM_IV_LEN(pState) = CONST_64(0);
AESGCM_AAD_LEN(pState) = CONST_64(0);
AESGCM_TXT_LEN(pState) = CONST_64(0);
AESGCM_BUFLEN(pState) = 0;
PadBlock(0, AESGCM_COUNTER(pState), BLOCK_SIZE);
PadBlock(0, AESGCM_ECOUNTER(pState), BLOCK_SIZE);
PadBlock(0, AESGCM_ECOUNTER0(pState), BLOCK_SIZE);
PadBlock(0, AESGCM_GHASH(pState), BLOCK_SIZE);
#if(_IPP32E>=_IPP32E_K0)
PadBlock(0, (void*)&AES_GCM_CONTEXT_DATA(pState), sizeof(struct gcm_context_data));
#endif /* #if(_IPP32E>=_IPP32E_K0) */
return ippStsNoErr;
}
|
3da850e1a99a2d577a668c3338924d11e26ba5a9
|
3bd385b466cb035fecd2b0c11ae054d42bf44fc2
|
/src/annotationsketch/element.c
|
b6fdcb764bd236eef20326cdc6d3bfbdaa855acd
|
[
"LicenseRef-scancode-unknown-license-reference",
"ISC",
"BSD-2-Clause",
"LicenseRef-scancode-mit-old-style",
"Zlib",
"MIT",
"BSD-3-Clause",
"bzip2-1.0.6"
] |
permissive
|
genometools/genometools
|
c366dff04f6baa887f6b3be3ec55bce824b2bae1
|
df1df94b8c05a9c9bf848ffc6755c87b58573da5
|
refs/heads/master
| 2023-04-13T13:57:18.748796
| 2023-04-09T21:29:53
| 2023-04-09T21:29:53
| 11,177,980
| 237
| 63
|
NOASSERTION
| 2023-04-09T21:29:54
| 2013-07-04T13:39:38
|
C
|
UTF-8
|
C
| false
| false
| 4,814
|
c
|
element.c
|
/*
Copyright (c) 2007 Christin Schaerfer <schaerfer@zbh.uni-hamburg.de>
Copyright (c) 2008 Sascha Steinbiss <steinbiss@zbh.uni-hamburg.de>
Copyright (c) 2007-2008 Center for Bioinformatics, University of Hamburg
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <string.h>
#include "annotationsketch/element.h"
#include "annotationsketch/style.h"
#include "core/array.h"
#include "core/ensure_api.h"
#include "core/ma_api.h"
#include "core/strand_api.h"
#include "extended/feature_node.h"
struct GtElement {
const char *type;
GtUword refcount;
GtStrand strand;
GtFeatureNode *gn;
GtRange range;
GtDrawingRange drange;
bool mark;
};
GtElement* gt_element_new(GtFeatureNode *node)
{
GtElement *element;
gt_assert(node);
element = gt_element_new_empty();
gt_element_set_type(element, gt_feature_node_get_type(node));
gt_element_set_range(element, gt_genome_node_get_range((GtGenomeNode*) node));
element->strand = gt_feature_node_get_strand(node);
element->mark = gt_feature_node_is_marked(node);
element->gn = (GtFeatureNode*) gt_genome_node_ref((GtGenomeNode*) node);
return element;
}
GtElement* gt_element_ref(GtElement *elem)
{
gt_assert(elem);
elem->refcount++;
return elem;
}
GtElement* gt_element_new_empty(void)
{
return gt_calloc(1, sizeof (GtElement));
}
GtRange gt_element_get_range(const GtElement *element)
{
gt_assert(element);
return element->range;
}
void gt_element_set_range(GtElement *element, GtRange r)
{
gt_assert(element);
element->range = r;
}
const char* gt_element_get_type(const GtElement *element)
{
gt_assert(element);
return element->type;
}
void gt_element_set_type(GtElement *element, const char *type)
{
gt_assert(element);
element->type = type;
}
GtStrand gt_element_get_strand(const GtElement *element)
{
gt_assert(element);
return element->strand;
}
bool gt_element_is_marked(const GtElement *element)
{
gt_assert(element);
return element->mark;
}
static bool elements_are_equal(const GtElement *e1, const GtElement *e2)
{
gt_assert(e1 && e2);
if (e1->type == e2->type && !gt_range_compare(&e1->range, &e2->range))
return true;
return false;
}
int gt_element_sketch(GtElement *elem, GtCanvas *canvas, GtError *err)
{
int had_err = 0;
gt_assert(elem && canvas);
had_err = gt_canvas_visit_element(canvas, elem, err);
return had_err;
}
GtFeatureNode* gt_element_get_node_ref(const GtElement *elem)
{
gt_assert(elem);
return elem->gn;
}
int gt_element_unit_test(GtError *err)
{
GtRange r1, r2, r_temp;
GtGenomeNode *gn, *gn2;
GtElement *e, *e2, *e3;
GtStr *seqid;
int had_err = 0;
gt_error_check(err);
r1.start = 10UL;
r1.end = 50UL;
r2.start = 20UL;
r2.end = 50UL;
seqid = gt_str_new_cstr("seqid");
gn = gt_feature_node_new(seqid, gt_ft_exon, r1.start, r1.end, GT_STRAND_BOTH);
gn2 = gt_feature_node_new(seqid, gt_ft_exon, r2.start, r2.end,
GT_STRAND_BOTH);
e = gt_element_new((GtFeatureNode*) gn);
e2 = gt_element_new((GtFeatureNode*)gn);
e3 = gt_element_new((GtFeatureNode*)gn2);
/* tests gt_element_get_range */
r_temp = gt_element_get_range(e);
gt_ensure((0 == gt_range_compare(&r1, &r_temp)));
gt_ensure((1 == gt_range_compare(&r2, &r_temp)));
/* tests gt_element_get_type and gt_element_set_type*/
gt_ensure(!strcmp(gt_ft_exon, gt_element_get_type(e)));
gt_ensure(strcmp(gt_ft_intron, gt_element_get_type(e)));
gt_element_set_type(e, gt_ft_intron);
gt_ensure(!strcmp(gt_ft_intron, gt_element_get_type(e)));
gt_element_set_type(e2, gt_ft_intron);
/* tests elements_are_equal */
gt_ensure(elements_are_equal(e, e2));
gt_ensure(!elements_are_equal(e, e3));
gt_ensure(!elements_are_equal(e2, e3));
gt_element_delete(e);
gt_element_delete(e2);
gt_element_delete(e3);
gt_genome_node_delete(gn);
gt_genome_node_delete(gn2);
gt_str_delete(seqid);
return had_err;
}
void gt_element_delete(GtElement *element)
{
if (!element) return;
if (element->refcount) {
element->refcount--;
return;
}
gt_genome_node_delete((GtGenomeNode*) element->gn);
gt_free(element);
}
|
d5a3191ac4ffa775487b07cb192ec4eff21fd11b
|
382a4dacbf7d6e6da096ddac660ba7a40af350cf
|
/src/libraries/TFT_eSPI/TFT_Drivers/ST7796_Init.h
|
39ac4f72cc3398cffb24dc57166cbf9f27df37d9
|
[
"BSD-3-Clause",
"MIT",
"GPL-1.0-or-later",
"BSD-2-Clause-Views",
"BSD-2-Clause"
] |
permissive
|
Xinyuan-LilyGO/TTGO_TWatch_Library
|
84b1a580ad931caac7407bf110fde5b9248be3c4
|
6a07f3762a4d11c8e5c0c2d6f9340ee4fdaa5fcb
|
refs/heads/master
| 2023-08-18T15:36:22.029944
| 2023-07-03T01:27:29
| 2023-07-03T01:27:29
| 202,286,916
| 776
| 293
|
MIT
| 2023-08-31T05:18:44
| 2019-08-14T06:17:29
|
C
|
UTF-8
|
C
| false
| false
| 3,011
|
h
|
ST7796_Init.h
|
// This is the command sequence that initialises the ST7796 driver
//
// This setup information uses simple 8 bit SPI writecommand() and writedata() functions
//
// See ST7735_Setup.h file for an alternative format
{
delay(120);
writecommand(0x01); //Software reset
delay(120);
writecommand(0x11); //Sleep exit
delay(120);
writecommand(0xF0); //Command Set control
writedata(0xC3); //Enable extension command 2 partI
writecommand(0xF0); //Command Set control
writedata(0x96); //Enable extension command 2 partII
writecommand(0x36); //Memory Data Access Control MX, MY, RGB mode
writedata(0x48); //X-Mirror, Top-Left to right-Buttom, RGB
writecommand(0x3A); //Interface Pixel Format
writedata(0x55); //Control interface color format set to 16
writecommand(0xB4); //Column inversion
writedata(0x01); //1-dot inversion
writecommand(0xB6); //Display Function Control
writedata(0x80); //Bypass
writedata(0x02); //Source Output Scan from S1 to S960, Gate Output scan from G1 to G480, scan cycle=2
writedata(0x3B); //LCD Drive Line=8*(59+1)
writecommand(0xE8); //Display Output Ctrl Adjust
writedata(0x40);
writedata(0x8A);
writedata(0x00);
writedata(0x00);
writedata(0x29); //Source eqaulizing period time= 22.5 us
writedata(0x19); //Timing for "Gate start"=25 (Tclk)
writedata(0xA5); //Timing for "Gate End"=37 (Tclk), Gate driver EQ function ON
writedata(0x33);
writecommand(0xC1); //Power control2
writedata(0x06); //VAP(GVDD)=3.85+( vcom+vcom offset), VAN(GVCL)=-3.85+( vcom+vcom offset)
writecommand(0xC2); //Power control 3
writedata(0xA7); //Source driving current level=low, Gamma driving current level=High
writecommand(0xC5); //VCOM Control
writedata(0x18); //VCOM=0.9
delay(120);
//ST7796 Gamma Sequence
writecommand(0xE0); //Gamma"+"
writedata(0xF0);
writedata(0x09);
writedata(0x0b);
writedata(0x06);
writedata(0x04);
writedata(0x15);
writedata(0x2F);
writedata(0x54);
writedata(0x42);
writedata(0x3C);
writedata(0x17);
writedata(0x14);
writedata(0x18);
writedata(0x1B);
writecommand(0xE1); //Gamma"-"
writedata(0xE0);
writedata(0x09);
writedata(0x0B);
writedata(0x06);
writedata(0x04);
writedata(0x03);
writedata(0x2B);
writedata(0x43);
writedata(0x42);
writedata(0x3B);
writedata(0x16);
writedata(0x14);
writedata(0x17);
writedata(0x1B);
delay(120);
writecommand(0xF0); //Command Set control
writedata(0x3C); //Disable extension command 2 partI
writecommand(0xF0); //Command Set control
writedata(0x69); //Disable extension command 2 partII
end_tft_write();
delay(120);
begin_tft_write();
writecommand(0x29); //Display on
}
|
bc6ffb2fcb8121d3aba05ac06a87439af7ef227a
|
99bdb3251fecee538e0630f15f6574054dfc1468
|
/bsp/airm2m/air105/libraries/HAL_Driver/Src/core_i2c.c
|
f0f17c3dec53f62f2f702a00a192e6d6e964fc6f
|
[
"Zlib",
"LicenseRef-scancode-proprietary-license",
"MIT",
"BSD-3-Clause",
"X11",
"BSD-4-Clause-UC",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] |
permissive
|
RT-Thread/rt-thread
|
03a7c52c2aeb1b06a544143b0e803d72f47d1ece
|
3602f891211904a27dcbd51e5ba72fefce7326b2
|
refs/heads/master
| 2023-09-01T04:10:20.295801
| 2023-08-31T16:20:55
| 2023-08-31T16:20:55
| 7,408,108
| 9,599
| 5,805
|
Apache-2.0
| 2023-09-14T13:37:26
| 2013-01-02T14:49:21
|
C
|
UTF-8
|
C
| false
| false
| 13,040
|
c
|
core_i2c.c
|
/*
* Copyright (c) 2022 OpenLuat & AirM2M
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "user.h"
#define IIC_DBG DBG
enum
{
I2C_STATE_FREE,
I2C_STATE_INIT_STOP,
I2C_STATE_ERROR_STOP,
I2C_STATE_WRITE_ADDRESS,
I2C_STATE_WRITE_REG,
I2C_STATE_WRITE_DATA,
I2C_STATE_WRITE_STOP,
I2C_STATE_READ_ADDRESS_WR,
I2C_STATE_READ_REG_WR,
I2C_STATE_READ_ADDRESS_RD,
I2C_STATE_READ_DATA_RD,
I2C_STATE_READ_STOP,
};
typedef struct
{
const I2C_TypeDef *RegBase;
const int IrqLine;
Buffer_Struct DataBuf;
CBFuncEx_t Callback;
void *pParam;
HANDLE Sem;
I2C_CommonRegDataStruct *RegQueue;
uint32_t TotalQueueNum;
uint32_t CurQueuePos;
int32_t Result;
uint16_t TimeoutMs;
uint16_t ChipAddress;
uint8_t ChipAddressLen;
uint8_t RegAddress;
uint8_t State;
uint8_t IsBusy;
uint8_t IsBlockMode;
}I2C_CtrlStruct;
static I2C_CtrlStruct prvI2C = {
I2C0,
I2C0_IRQn,
};
static void prvI2C_Done(int32_t Result)
{
prvI2C.State = I2C_STATE_FREE;
prvI2C.Result = Result;
prvI2C.IsBusy = 0;
#ifdef __BUILD_OS__
if (prvI2C.IsBlockMode) OS_MutexRelease(prvI2C.Sem);
#endif
prvI2C.Callback(I2C_ID0, prvI2C.pParam);
}
static int32_t prvI2C_DummyCB(void *pData, void *pParam)
{
prvI2C.IsBusy = 0;
}
static void I2C_IrqHandle(int32_t IrqLine, void *pData)
{
int32_t result = ERROR_NONE;
I2C_TypeDef *I2C = prvI2C.RegBase;
uint32_t Source = I2C->IC_TX_ABRT_SOURCE;
uint32_t State = I2C->IC_RAW_INTR_STAT;
uint32_t RegValue = I2C->IC_CLR_INTR;
if (Source & 0x0000ffff)
{
result = -ERROR_OPERATION_FAILED;
goto I2C_DONE;
}
switch(prvI2C.State)
{
case I2C_STATE_WRITE_ADDRESS:
case I2C_STATE_WRITE_REG:
case I2C_STATE_WRITE_DATA:
if (State & I2C_IT_TXE)
{
if (prvI2C.DataBuf.Pos >= prvI2C.DataBuf.MaxLen)
{
goto I2C_DONE;
}
else if ((prvI2C.DataBuf.MaxLen - prvI2C.DataBuf.Pos) > 1)
{
I2C->IC_DATA_CMD = prvI2C.DataBuf.Data[prvI2C.DataBuf.Pos];
}
else
{
I2C->IC_DATA_CMD = prvI2C.DataBuf.Data[prvI2C.DataBuf.Pos]|I2C_IC_DATA_CMD_STOP;
}
prvI2C.DataBuf.Pos++;
}
break;
case I2C_STATE_READ_ADDRESS_WR:
if (State & I2C_IT_TXE)
{
prvI2C.State = I2C_STATE_READ_ADDRESS_RD;
if ((prvI2C.DataBuf.MaxLen - prvI2C.DataBuf.Pos) > 1)
{
I2C->IC_DATA_CMD = I2C_IC_DATA_CMD_CMD;
}
else
{
I2C->IC_DATA_CMD = I2C_IC_DATA_CMD_CMD|I2C_IC_DATA_CMD_STOP;
}
I2C->IC_INTR_MASK = I2C_IC_INTR_MASK_M_RX_FULL|I2C_IC_INTR_MASK_M_STOP_DET;
}
break;
case I2C_STATE_READ_ADDRESS_RD:
prvI2C.State = I2C_STATE_READ_DATA_RD;
case I2C_STATE_READ_DATA_RD:
if (State & I2C_IT_RXF)
{
prvI2C.DataBuf.Data[prvI2C.DataBuf.Pos] = I2C->IC_DATA_CMD & 0x00ff;
prvI2C.DataBuf.Pos++;
if (prvI2C.DataBuf.Pos >= prvI2C.DataBuf.MaxLen)
{
goto I2C_DONE;
}
else if ((prvI2C.DataBuf.MaxLen - prvI2C.DataBuf.Pos) > 1)
{
I2C->IC_DATA_CMD = I2C_IC_DATA_CMD_CMD;
}
else
{
I2C->IC_DATA_CMD = I2C_IC_DATA_CMD_CMD|I2C_IC_DATA_CMD_STOP;
}
}
break;
default:
break;
}
return;
I2C_DONE:
I2C->IC_INTR_MASK = 0;
prvI2C_Done(result);
}
static void I2C_IrqHandleRegQueue(int32_t IrqLine, void *pData)
{
int32_t result = ERROR_NONE;
I2C_TypeDef *I2C = prvI2C.RegBase;
uint32_t Source = I2C->IC_TX_ABRT_SOURCE;
uint32_t State = I2C->IC_RAW_INTR_STAT;
uint32_t RegValue = I2C->IC_CLR_INTR;
if (Source & 0x0000ffff)
{
result = -ERROR_OPERATION_FAILED;
goto I2C_DONE;
}
if (State & I2C_IT_TXE)
{
if (prvI2C.DataBuf.Pos >= prvI2C.DataBuf.MaxLen)
{
prvI2C.CurQueuePos++;
if (prvI2C.CurQueuePos >= prvI2C.TotalQueueNum)
{
goto I2C_DONE;
}
else
{
Buffer_StaticInit(&prvI2C.DataBuf, prvI2C.RegQueue[prvI2C.CurQueuePos].Data, 2);
I2C->IC_DATA_CMD = prvI2C.DataBuf.Data[0];
prvI2C.DataBuf.Pos++;
I2C->IC_INTR_MASK = I2C_IC_INTR_MASK_M_TX_EMPTY|I2C_IC_INTR_MASK_M_STOP_DET;
}
}
else if ((prvI2C.DataBuf.MaxLen - prvI2C.DataBuf.Pos) > 1)
{
I2C->IC_DATA_CMD = prvI2C.DataBuf.Data[prvI2C.DataBuf.Pos];
}
else
{
I2C->IC_DATA_CMD = prvI2C.DataBuf.Data[prvI2C.DataBuf.Pos]|I2C_IC_DATA_CMD_STOP;
}
prvI2C.DataBuf.Pos++;
}
return;
I2C_DONE:
I2C->IC_INTR_MASK = 0;
prvI2C_Done(result);
}
void I2C_GlobalInit(void)
{
prvI2C.Callback = prvI2C_DummyCB;
ISR_SetHandler(prvI2C.IrqLine, I2C_IrqHandle, NULL);
#ifdef __BUILD_OS__
prvI2C.Sem = OS_MutexCreate();
ISR_SetPriority(prvI2C.IrqLine, configLIBRARY_LOWEST_INTERRUPT_PRIORITY - 1);
#else
ISR_SetPriority(prvI2C.IrqLine, 7);
#endif
}
void I2C_MasterSetup(uint8_t I2CID, uint32_t Speed)
{
I2C_TypeDef *I2C = prvI2C.RegBase;
uint32_t Cnt = ((SystemCoreClock >> 3) / Speed);
I2C->IC_ENABLE = 0;
while(I2C->IC_ENABLE_STATUS & I2C_IC_ENABLE_STATUS_IC_EN){;}
I2C->IC_SDA_HOLD = 5;
I2C->IC_SDA_SETUP = Cnt/3;
switch(Speed)
{
case 100000:
I2C->IC_SS_SCL_HCNT = Cnt - I2C->IC_FS_SPKLEN;
I2C->IC_SS_SCL_LCNT = Cnt;
I2C->IC_CON = I2C_IC_CON_RESTART_EN|I2C_IC_CON_SPEED_0|I2C_IC_CON_MASTER_MODE|I2C_IC_CON_SLAVE_DISABLE;
break;
case 400000:
I2C->IC_FS_SCL_HCNT = Cnt - I2C->IC_FS_SPKLEN;
I2C->IC_FS_SCL_LCNT = Cnt;
I2C->IC_CON = I2C_IC_CON_RESTART_EN|I2C_IC_CON_SPEED_1|I2C_IC_CON_MASTER_MODE|I2C_IC_CON_SLAVE_DISABLE;
break;
}
I2C->IC_ENABLE = 1;
I2C->IC_RX_TL = 0;
I2C->IC_TX_TL = 0;
I2C->IC_INTR_MASK = 0;
return;
}
void I2C_Prepare(uint8_t I2CID, uint16_t ChipAddress, uint8_t ChipAddressLen, CBFuncEx_t CB, void *pParam)
{
I2C_TypeDef *I2C = prvI2C.RegBase;
I2C->IC_ENABLE = 0;
while(I2C->IC_ENABLE_STATUS & I2C_IC_ENABLE_STATUS_IC_EN){;}
switch(ChipAddressLen)
{
case 1:
I2C->IC_TAR = ChipAddress & 0x00ff;
I2C->IC_SAR = ChipAddress & 0x00ff;
break;
case 2:
I2C->IC_TAR = I2C_IC_TAR_10BITADDR_MASTER | (ChipAddress & I2C_IC_TAR_TAR);
I2C->IC_SAR = ChipAddress;
break;
}
I2C->IC_ENABLE = 1;
if (CB)
{
prvI2C.Callback = CB;
}
else
{
prvI2C.Callback = prvI2C_DummyCB;
}
prvI2C.pParam = pParam;
}
void I2C_MasterXfer(uint8_t I2CID, uint8_t Operate, uint8_t RegAddress, uint8_t *Data, uint32_t Len, uint16_t Toms)
{
I2C_TypeDef *I2C = prvI2C.RegBase;
uint32_t RegValue;
I2C->IC_INTR_MASK = 0;
ISR_OnOff(prvI2C.IrqLine, 0);
if (prvI2C.IsBusy)
{
I2C->IC_ENABLE |= I2C_IC_ENABLE_ABORT;
prvI2C.IsBusy = 0;
prvI2C.Result = -ERROR_OPERATION_FAILED;
prvI2C.Callback(I2C_ID0, prvI2C.pParam);
while(I2C->IC_ENABLE & I2C_IC_ENABLE_ABORT){;}
}
ISR_SetHandler(prvI2C.IrqLine, I2C_IrqHandle, NULL);
prvI2C.IsBusy = 1;
if (Toms)
{
prvI2C.TimeoutMs = Toms;
}
else
{
prvI2C.TimeoutMs = 50;
}
Buffer_StaticInit(&prvI2C.DataBuf, Data, Len);
prvI2C.RegQueue = NULL;
RegValue = I2C->IC_CLR_INTR;
switch(Operate)
{
case I2C_OP_READ_REG:
prvI2C.State = I2C_STATE_READ_ADDRESS_WR;
I2C->IC_DATA_CMD = I2C_IC_DATA_CMD_RESTART|RegAddress;
I2C->IC_INTR_MASK = I2C_IC_INTR_MASK_M_TX_EMPTY|I2C_IC_INTR_MASK_M_STOP_DET;
break;
case I2C_OP_READ:
prvI2C.State = I2C_STATE_READ_ADDRESS_RD;
if ((prvI2C.DataBuf.MaxLen - prvI2C.DataBuf.Pos) > 1)
{
I2C->IC_DATA_CMD = I2C_IC_DATA_CMD_CMD;
}
else
{
I2C->IC_DATA_CMD = I2C_IC_DATA_CMD_CMD|I2C_IC_DATA_CMD_STOP;
}
I2C->IC_INTR_MASK = I2C_IC_INTR_MASK_M_RX_FULL|I2C_IC_INTR_MASK_M_STOP_DET;
break;
case I2C_OP_WRITE:
prvI2C.State = I2C_STATE_WRITE_ADDRESS;
if ((prvI2C.DataBuf.MaxLen - prvI2C.DataBuf.Pos) > 1)
{
I2C->IC_DATA_CMD = prvI2C.DataBuf.Data[0];
}
else
{
I2C->IC_DATA_CMD = prvI2C.DataBuf.Data[0]|I2C_IC_DATA_CMD_STOP;
}
prvI2C.DataBuf.Pos++;
I2C->IC_INTR_MASK = I2C_IC_INTR_MASK_M_TX_EMPTY|I2C_IC_INTR_MASK_M_STOP_DET;
break;
default:
prvI2C.IsBusy = 0;
prvI2C.Result = -ERROR_PARAM_INVALID;
prvI2C.Callback(I2C_ID0, prvI2C.pParam);
return;
}
ISR_OnOff(prvI2C.IrqLine, 1);
}
int32_t I2C_MasterWriteRegQueue(uint8_t I2CID, I2C_CommonRegDataStruct *RegQueue, uint32_t TotalNum, uint16_t Toms, uint8_t IsBlock)
{
I2C_TypeDef *I2C = prvI2C.RegBase;
uint32_t RegValue;
int32_t Result;
I2C->IC_INTR_MASK = 0;
ISR_OnOff(prvI2C.IrqLine, 0);
if (prvI2C.IsBusy)
{
I2C->IC_ENABLE |= I2C_IC_ENABLE_ABORT;
prvI2C.IsBusy = 0;
prvI2C.Result = -ERROR_OPERATION_FAILED;
prvI2C.Callback(I2C_ID0, prvI2C.pParam);
while(I2C->IC_ENABLE & I2C_IC_ENABLE_ABORT){;}
}
ISR_SetHandler(prvI2C.IrqLine, I2C_IrqHandleRegQueue, NULL);
prvI2C.IsBusy = 1;
if (Toms)
{
prvI2C.TimeoutMs = Toms;
}
else
{
prvI2C.TimeoutMs = 50;
}
prvI2C.RegQueue = RegQueue;
prvI2C.TotalQueueNum = TotalNum;
prvI2C.CurQueuePos = 0;
RegValue = I2C->IC_CLR_INTR;
Buffer_StaticInit(&prvI2C.DataBuf, prvI2C.RegQueue[prvI2C.CurQueuePos].Data, 2);
I2C->IC_DATA_CMD = prvI2C.DataBuf.Data[0];
prvI2C.DataBuf.Pos++;
I2C->IC_INTR_MASK = I2C_IC_INTR_MASK_M_TX_EMPTY|I2C_IC_INTR_MASK_M_STOP_DET;
ISR_OnOff(prvI2C.IrqLine, 1);
if (IsBlock)
{
while(!I2C_WaitResult(I2CID, &Result)) {;}
return Result;
}
else
{
return 0;
}
}
int I2C_WaitResult(uint8_t I2CID, int32_t *Result)
{
if (prvI2C.IsBusy) return 0;
*Result = prvI2C.Result;
return 1;
}
int32_t I2C_BlockWrite(uint8_t I2CID, uint8_t ChipAddress, const uint8_t *Data, uint32_t Len, uint16_t Toms, CBFuncEx_t CB, void *pParam)
{
int32_t Result;
while(!I2C_WaitResult(I2CID, &Result)) {;}
prvI2C.IsBlockMode = !OS_CheckInIrq();
I2C_Prepare(I2CID, ChipAddress, 1, CB, pParam);
I2C_MasterXfer(I2CID, I2C_OP_WRITE, 0, Data, Len, Toms);
#ifdef __BUILD_OS__
if (!OS_CheckInIrq())
{
OS_MutexLock(prvI2C.Sem);
}
#endif
while(!I2C_WaitResult(I2CID, &Result)) {;}
return Result;
}
int32_t I2C_BlockRead(uint8_t I2CID, uint8_t ChipAddress, uint8_t *Reg, uint8_t *Data, uint32_t Len, uint16_t Toms, CBFuncEx_t CB, void *pParam)
{
int32_t Result;
while(!I2C_WaitResult(I2CID, &Result)) {;}
prvI2C.IsBlockMode = !OS_CheckInIrq();
I2C_Prepare(I2CID, ChipAddress, 1, CB, pParam);
if (Reg)
{
I2C_MasterXfer(I2CID, I2C_OP_READ_REG, *Reg, Data, Len, Toms);
}
else
{
I2C_MasterXfer(I2CID, I2C_OP_READ, 0, Data, Len, Toms);
}
#ifdef __BUILD_OS__
if (!OS_CheckInIrq())
{
OS_MutexLock(prvI2C.Sem);
}
#endif
while(!I2C_WaitResult(I2CID, &Result)) {;}
return Result;
}
void I2C_ForceStop(uint8_t I2CID)
{
I2C_TypeDef *I2C = prvI2C.RegBase;
IIC_DBG("%d,%x",prvI2C.State, I2C->IC_RAW_INTR_STAT);
I2C->IC_ENABLE |= I2C_IC_ENABLE_ABORT;
I2C->IC_INTR_MASK = 0;
prvI2C_Done(-ERROR_TIMEOUT);
while(I2C->IC_ENABLE & I2C_IC_ENABLE_ABORT){;}
}
|
845614af1873a2e7cf35c1288e18f58e5da88031
|
bb90ad20468f9fe2039b8c16858bd8eae8bbc050
|
/3rdparty/exported/t_cose/src/t_cose_util.h
|
da529a6bd4877ae18d0bc721f0c3311f75e59aec
|
[
"BSD-3-Clause",
"LicenseRef-scancode-proprietary-license",
"Apache-2.0"
] |
permissive
|
microsoft/CCF
|
0997fd81a924d36d775b219720b26b4ff196b18a
|
2fbf87840b9e8334c141f4a9c9b25aae979b0540
|
refs/heads/main
| 2023-09-05T15:39:37.265089
| 2023-09-05T15:27:25
| 2023-09-05T15:27:25
| 180,112,558
| 687
| 229
|
Apache-2.0
| 2023-09-14T14:28:39
| 2019-04-08T09:13:04
|
C++
|
UTF-8
|
C
| false
| false
| 7,427
|
h
|
t_cose_util.h
|
/*
* t_cose_util.h
*
* Copyright 2019-2021, Laurence Lundblade
*
* SPDX-License-Identifier: BSD-3-Clause
*
* See BSD-3-Clause license in README.md
*/
#ifndef __T_COSE_UTIL_H__
#define __T_COSE_UTIL_H__
#include <stdint.h>
#include "t_cose/q_useful_buf.h"
#include "t_cose/t_cose_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* \file t_cose_util.h
*
* \brief Utility functions used internally by the t_cose implementation.
*
*/
/**
* This value represents an invalid or in-error algorithm ID. The
* value selected is 0 as this is reserved in the IANA COSE algorithm
* registry and is very unlikely to ever be used. (It would take am
* IETF standards-action to put it to use).
*/
#define T_COSE_INVALID_ALGORITHM_ID COSE_ALGORITHM_RESERVED
/**
* \brief Check whether a signature algorithm is valid and supported
* by the library.
*
* \param[in] cose_algorithm_id A COSE signature algorithm identifier.
*
* \return \c true if the algorithm is supported.
*
* What algorithms are supported can change as more algorithms are
* added to the library, and depend on the build configuration. Even
* if a signature algorithm is supported by the t_cose library and
* this function returns true, using an algorithm can fail for other
* reasons, for example if the crypto adapter does not support it.
*
*/
bool signature_algorithm_id_is_supported(int32_t cose_algorithm_id);
/**
* \brief Return hash algorithm ID from a signature algorithm ID
*
* \param[in] cose_algorithm_id A COSE signature algorithm identifier.
*
* \return \c T_COSE_INVALID_ALGORITHM_ID when the signature algorithm ID
is not known, or if the signature algorithm does not have
an associated hash algorithm (eg. EDDSA).
*
* This works off of algorithm identifiers defined in the
* [IANA COSE Registry](https://www.iana.org/assignments/cose/cose.xhtml).
* Corresponding local integer constants are defined in
* t_cose_standard_constants.h.
*
* COSE signing algorithms are the combination of public key
* algorithm, hash algorithm and hash size and imply an appropriate
* key size. They are simple integers making them convenient for
* direct use in code.
*
* This function returns an identifier for only the hash algorithm
* from the combined identifier.
*
* If the needed algorithm identifiers are not in the IANA registry,
* they can be added to it. This will take some time and work. It is
* also fine to use algorithms in the COSE proprietary space.
*/
int32_t hash_alg_id_from_sig_alg_id(int32_t cose_algorithm_id);
/**
* \brief Create the hash of the to-be-signed (TBS) bytes for COSE.
*
* \param[in] cose_algorithm_id The COSE signing algorithm ID. Used to
* determine which hash function to use.
* \param[in] protected_parameters Full, CBOR encoded, protected parameters.
* \param[in] aad Additional Authenitcated Data to be
* included in TBS.
* \param[in] payload The CBOR-encoded payload.
* \param[in] buffer_for_hash Pointer and length of buffer into which
* the resulting hash is put.
* \param[out] hash Pointer and length of the
* resulting hash.
*
* \return This returns one of the error codes defined by \ref t_cose_err_t.
*
* \retval T_COSE_ERR_SIG_STRUCT
* Most likely this is because the protected_parameters passed in
* is larger than \c T_COSE_SIGN1_MAX_SIZE_PROTECTED_PARAMETERS.
* \retval T_COSE_ERR_UNSUPPORTED_HASH
* If the hash algorithm is not known.
* \retval T_COSE_ERR_HASH_GENERAL_FAIL
* In case of some general hash failure.
*
* The input to the public key signature algorithm in COSE is a CBOR
* encoded structure containing the protected parameters algorithm ID
* and a few other things. These are known as the to-be-signed or "TBS"
* bytes. The exact specification is in [RFC 8152 section
* 4.4](https://tools.ietf.org/html/rfc8152#section-4.4).
*
* Most algorithms use a hash of these bytes, which this function
* computes incrementally. If the entire TBS structure is needed
* (for signing with EdDSA for example), the \ref create_tbs function
* can be used instead.
*
* \c aad can be \ref NULL_Q_USEFUL_BUF_C if not present.
*/
enum t_cose_err_t create_tbs_hash(int32_t cose_algorithm_id,
struct q_useful_buf_c protected_parameters,
struct q_useful_buf_c aad,
struct q_useful_buf_c payload,
struct q_useful_buf buffer_for_hash,
struct q_useful_buf_c *hash);
/**
* Serialize the to-be-signed (TBS) bytes for COSE.
*
* \param[in] protected_parameters Full, CBOR encoded, protected parameters.
* \param[in] aad Additional Authenitcated Data to be
* included in TBS.
* \param[in] payload The CBOR-encoded payload.
* \param[in] buffer_for_tbs Pointer and length of buffer into which
* the resulting TBS bytes is put.
* \param[out] tbs Pointer and length of the
* resulting TBS bytes.
*
* \return This returns one of the error codes defined by \ref t_cose_err_t.
* \retval T_COSE_ERR_TOO_SMALL
* The output buffer is too small.
* \retval T_COSE_ERR_CBOR_FORMATTING
* Something went wrong formatting the CBOR.
*
* The input to the public key signature algorithm in COSE is a CBOR
* encoded structure containing the protected parameters algorithm ID
* and a few other things. These are known as the to-be-signed or "TBS"
* bytes. The exact specification is in [RFC 8152 section
* 4.4](https://tools.ietf.org/html/rfc8152#section-4.4).
*
* \c aad can be \ref NULL_Q_USEFUL_BUF_C if not present.
*/
enum t_cose_err_t create_tbs(struct q_useful_buf_c protected_parameters,
struct q_useful_buf_c aad,
struct q_useful_buf_c payload,
struct q_useful_buf buffer_for_tbs,
struct q_useful_buf_c *tbs);
#ifndef T_COSE_DISABLE_SHORT_CIRCUIT_SIGN
/**
* Size of the key returned by get_short_circuit_kid(). It is always
* this size.
*/
#define T_COSE_SHORT_CIRCUIT_KID_SIZE 32
/**
* \brief Get the special kid for short-circuit signing.
*
* \returns Buffer with the kid.
*
* This always returns the same kid. It always indicates short-circuit
* signing. It is OK to hard code this kid value as the probability of
* collision with this ID is extremely low and the same as for
* collision between any two key IDs (kids) of any sort.
*
* This always returns a pointer to the same memory as the result
* returned by this never changes.
*
* This is the value of the kid.
*
* 0xef, 0x95, 0x4b, 0x4b, 0xd9, 0xbd, 0xf6, 0x70,
* 0xd0, 0x33, 0x60, 0x82, 0xf5, 0xef, 0x15, 0x2a,
* 0xf8, 0xf3, 0x5b, 0x6a, 0x6c, 0x00, 0xef, 0xa6,
* 0xa9, 0xa7, 0x1f, 0x49, 0x51, 0x7e, 0x18, 0xc6
*
*/
struct q_useful_buf_c get_short_circuit_kid(void);
#endif
#ifdef __cplusplus
}
#endif
#endif /* __T_COSE_UTIL_H__ */
|
1e693f757ac324a5f051100868858d043dd46191
|
e338fad18e9bdd6f0252c9306b05ad7b336c2ecd
|
/examples/c/mcc172/data_logger/logger/logger.c
|
79c9f33826fa1bdaadd830769ee3bbdaab4182a3
|
[
"BSD-3-Clause",
"MIT"
] |
permissive
|
mccdaq/daqhats
|
fd22172bf89adff9e2f6d2c4a9198c9d39918ed7
|
e6d96c8fb621c83696536a037f1c4fa373c46068
|
refs/heads/master
| 2022-12-01T16:47:45.491181
| 2022-11-18T15:05:17
| 2022-11-18T15:05:17
| 144,043,320
| 112
| 83
|
NOASSERTION
| 2022-06-24T18:42:34
| 2018-08-08T16:57:41
|
C
|
UTF-8
|
C
| false
| false
| 37,763
|
c
|
logger.c
|
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <gtkdatabox.h>
#include <gtkdatabox_util.h>
#include <gtkdatabox_lines.h>
#include "log_file.h"
#include "errors.h"
#include "fft.h"
#include "logger.h"
#define MAX_CHANNELS 2 // MCC172 Channel Count
#define READ_ALL_AVAILABLE -1
// Global Variables
GtkWidget *window;
GMainContext *context;
uint8_t g_hat_addr = 0;
uint8_t g_chan_mask;
uint32_t g_sample_count = 0;
int g_fft_size = 2048;
double g_zoom_level = 1.0;
double g_sample_rate = 2048.0;
gdouble g_sensitivity = 1000.0;
gboolean g_done = TRUE;
gboolean g_continuous = TRUE;
const char *colors[8] = {"#DD3222", "#3482CB", "#75B54A", "#9966ff",
"#FFC000", "#FF6A00", "#808080", "#6E1911"};
GtkWidget *labelFile, *dataBox, *fftBox, *rbContinuous, *rbFinite, *spinRate,
*comboFftSize, *btnSelectLogFile, *chkChan[MAX_CHANNELS],
*chkIepe, *spinSensitivity, *btnStart_Stop;
GMutex data_mutex;
pthread_t threadh;
pthread_mutex_t allocate_arrays_mutex;
pthread_cond_t allocate_arrays_cond;
typedef struct graph_channel_info
{
GtkDataboxGraph* graph;
GtkDataboxGraph* fft_graph;
GdkRGBA* color;
uint channelNumber;
gfloat* X;
gfloat* Y;
gfloat* fft_X;
gfloat* fft_Y;
gint buffSize;
} GraphChannelInfo;
GraphChannelInfo graphChannelInfo[MAX_CHANNELS];
// Function Prototypes
static int open_first_hat_device(uint8_t* hat_address);
static void app_activate_handler(GtkApplication *app, gpointer user_data);
static gboolean stop_scan(void);
int main(void)
{
int retval = 0;
int i = 0;
GtkApplication *app;
GdkRGBA legendColor[MAX_CHANNELS];
// Set the default filename.
getcwd(csv_filename, sizeof(csv_filename));
strcat(csv_filename, "/LogFiles/data.csv");
// Initialize channel info array
for (i=0; i< MAX_CHANNELS; i++)
{
gdk_rgba_parse (&legendColor[i], colors[i]);
graphChannelInfo[i].color = &legendColor[i];
graphChannelInfo[i].channelNumber = i;
}
// Create the application structure and set the activate event handler.
app = gtk_application_new("mcc172.dataLogger", G_APPLICATION_FLAGS_NONE);
g_signal_connect(app, "activate", G_CALLBACK(app_activate_handler), NULL);
// Start running the GTK application.
g_application_run(G_APPLICATION(app), 0, NULL);
g_object_unref(app);
// Find the hat devices and open the first one.
retval = open_first_hat_device(&g_hat_addr);
if (retval == 0)
{
context = g_main_context_default();
// Start the GTK message loop.
gtk_main();
// Stop any scan that may be running
mcc172_a_in_scan_stop(g_hat_addr);
// Clean up after the scan completes
mcc172_a_in_scan_cleanup(g_hat_addr);
// Close the device
mcc172_close(g_hat_addr);
}
return 0;
}
// Allocate arrays for the indices and data for each channel in the scan.
static gboolean allocate_channel_xy_arrays(int *channel)
{
int chan = *channel;
int fft_buffer_size = g_fft_size / 2 + 1;
gfloat frequency_interval = g_sample_rate / g_fft_size;
gfloat freq_val = 0.0;
gint i = 0;
int buff_size = 0;
pthread_mutex_lock(&allocate_arrays_mutex);
buff_size = g_sample_count < g_fft_size ? g_sample_count : g_fft_size;
// Delete the previous arrays for each of the channels (if they exist)
if (graphChannelInfo[chan].graph != NULL)
{
gtk_databox_graph_remove (GTK_DATABOX(dataBox),
GTK_DATABOX_GRAPH(graphChannelInfo[chan].graph));
graphChannelInfo[chan].graph= NULL;
}
if (graphChannelInfo[chan].fft_graph != NULL)
{
gtk_databox_graph_remove (GTK_DATABOX(fftBox),
GTK_DATABOX_GRAPH(graphChannelInfo[chan].fft_graph));
graphChannelInfo[chan].fft_graph= NULL;
}
// Free any existing data arrays
if(graphChannelInfo[chan].X != NULL)
{
g_free(graphChannelInfo[chan].X);
graphChannelInfo[chan].X = NULL;
}
if(graphChannelInfo[chan].Y != NULL)
{
g_free(graphChannelInfo[chan].Y);
graphChannelInfo[chan].Y = NULL;
}
if(graphChannelInfo[chan].fft_X != NULL)
{
g_free(graphChannelInfo[chan].fft_X);
graphChannelInfo[chan].fft_X = NULL;
}
if(graphChannelInfo[chan].fft_Y != NULL)
{
g_free(graphChannelInfo[chan].fft_Y);
graphChannelInfo[chan].fft_Y = NULL;
}
// Allocate arrays for the data graph data and initialize to zero
graphChannelInfo[chan].Y = g_new0(gfloat, buff_size);
graphChannelInfo[chan].X = g_new0(gfloat, buff_size);
graphChannelInfo[chan].buffSize = buff_size;
if(buff_size > 0)
{
graphChannelInfo[chan].graph = gtk_databox_lines_new
((guint)buff_size, graphChannelInfo[chan].X,
graphChannelInfo[chan].Y,
graphChannelInfo[chan].color, 1);
gtk_databox_graph_add(GTK_DATABOX (dataBox),
GTK_DATABOX_GRAPH(graphChannelInfo[chan].graph));
}
// Allocate arrays for the FFT graph and initialized to zero
graphChannelInfo[chan].fft_Y = g_new0(gfloat, fft_buffer_size);
graphChannelInfo[chan].fft_X = g_new0(gfloat, fft_buffer_size);
freq_val = 0.0;
for (i = 0; i < fft_buffer_size; i++)
{
graphChannelInfo[chan].fft_X[i] = freq_val;
freq_val += frequency_interval;
}
graphChannelInfo[chan].fft_graph = gtk_databox_lines_new
((guint)fft_buffer_size, graphChannelInfo[chan].fft_X,
graphChannelInfo[chan].fft_Y,
graphChannelInfo[chan].color, 1);
gtk_databox_graph_add(GTK_DATABOX (fftBox),
GTK_DATABOX_GRAPH(graphChannelInfo[chan].fft_graph));
// Set the limits for the FFT graph - only needs to be done once per scan
gtk_databox_set_total_limits(GTK_DATABOX (fftBox), 0.0,
(gfloat)g_sample_rate/2, 10.0, -150.0);
pthread_cond_signal(&allocate_arrays_cond);
pthread_mutex_unlock(&allocate_arrays_mutex);
return FALSE;
}
// Add each checked channel to the channel mask
static int create_selected_channel_mask()
{
gboolean checked = FALSE;
int selected_channel_mask = 0;
int i = 0;
for (i = 0; i < MAX_CHANNELS; i++)
{
// Is the channel checked?
checked = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(chkChan[i]));
// If checked, add the channel to the mask
if (checked == TRUE)
{
selected_channel_mask |= 1<<i;
}
}
// return the channel mask
return selected_channel_mask;
}
// Set te IEPE power configuration
static void set_iepe_configuration()
{
gboolean checked = FALSE;
uint8_t i = 0;
// Is the IEPE enable checked?
checked = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(chkIepe));
for (i = 0; i < MAX_CHANNELS; i++)
{
mcc172_iepe_config_write(g_hat_addr, i, checked);
mcc172_a_in_sensitivity_write(g_hat_addr, i, g_sensitivity);
}
return;
}
// Enable/disable the controls in the main window.
// Controls are disabled when the acquisition is running
// and re-enabled when the acquisition is stopped.
static void set_enable_state_for_controls(gboolean state)
{
int i = 0;
for (i = 0; i < MAX_CHANNELS; i++)
{
gtk_widget_set_sensitive (chkChan[i], state);
}
gtk_widget_set_sensitive (chkIepe, state);
gtk_widget_set_sensitive (spinRate, state);
gtk_widget_set_sensitive (comboFftSize, state);
gtk_widget_set_sensitive (spinSensitivity, state);
gtk_widget_set_sensitive (rbFinite, state);
gtk_widget_set_sensitive (rbContinuous, state);
gtk_widget_set_sensitive (btnSelectLogFile, state);
}
// Copy data from the hat read buffer to the display buffer
static int copy_hat_data_to_display_buffer(double* hat_read_buf,
int samples_per_chan_read,
double* display_buf,
int samples_per_chan_displayed,
int display_buf_size_samples,
int num_chans)
{
size_t copy_size = 0;
int samples_to_keep = 0;
int start_idx = 0;
if (samples_per_chan_read > 0) {
// There are samples to be copied
if((samples_per_chan_displayed + samples_per_chan_read)
<= display_buf_size_samples)
{
// All of the samples read will fit in the display buffer
// so copy all of the samples
copy_size = samples_per_chan_read * num_chans * sizeof(double);
memcpy(&display_buf[samples_per_chan_displayed * num_chans],
hat_read_buf, copy_size);
samples_per_chan_displayed += samples_per_chan_read;
}
else if (samples_per_chan_read > display_buf_size_samples) {
// The number of samples read is larger than the size of the
// display buffer, so overwrite the entire display buffer with the
// last samples read
copy_size = display_buf_size_samples * num_chans * sizeof(double);
start_idx = ((samples_per_chan_read - display_buf_size_samples)
* num_chans);
memcpy(display_buf, &hat_read_buf[start_idx], copy_size);
samples_per_chan_displayed = display_buf_size_samples;
}
else {
// The number of samples read is larger than the remaining space in
// the display buffer, but less than the display buffer size.
// Therefore, the display buffer values must first be shifted.
samples_to_keep = display_buf_size_samples - samples_per_chan_read;
copy_size = samples_to_keep * num_chans * sizeof(double);
start_idx = ((samples_per_chan_displayed - samples_to_keep)
* num_chans);
memcpy(display_buf, &display_buf[start_idx], copy_size);
samples_per_chan_displayed = samples_to_keep;
copy_size = samples_per_chan_read * num_chans * sizeof(double);
memcpy(&display_buf[samples_per_chan_displayed * num_chans],
hat_read_buf, copy_size);
samples_per_chan_displayed += samples_per_chan_read;
}
}
return samples_per_chan_displayed;
}
// Copy the data for the specified channel from the interleaved
// HAT buffer to the array for the specified channel.
static void copy_data_to_xy_arrays(double* display_buf,
int read_buf_start_index, int channel,
int stride, uint32_t start_sample)
{
uint32_t sample = start_sample;
uint32_t data_array_idx = 0;
int i = read_buf_start_index;
if(graphChannelInfo[channel].buffSize < g_fft_size)
{
pthread_mutex_lock(&allocate_arrays_mutex);
g_main_context_invoke(context, (GSourceFunc)allocate_channel_xy_arrays,
&channel);
pthread_cond_wait(&allocate_arrays_cond, &allocate_arrays_mutex);
pthread_mutex_unlock(&allocate_arrays_mutex);
}
// Set indices and data
for (sample = start_sample; sample < g_sample_count; sample++)
{
graphChannelInfo[channel].X[data_array_idx] = (gfloat)sample;
graphChannelInfo[channel].Y[data_array_idx] = (gfloat)display_buf[i];
data_array_idx++;
i+=stride;
}
}
// Refresh the graph with the new data.
static gboolean refresh_graph()
{
int start_sample = 0;
gdouble yMin, yMax;
gfloat start, end;
g_mutex_lock (&data_mutex);
start_sample = g_sample_count >= g_fft_size ?
(g_sample_count - g_fft_size) : 0;
// Set the new limits on the time domain graph
start = (gfloat)start_sample;
end = (gfloat)(start_sample + g_fft_size - 1);
yMin = -6000.0 / g_sensitivity * g_zoom_level;
yMax = 6000.0 / g_sensitivity * g_zoom_level;
gtk_databox_set_total_limits(GTK_DATABOX (dataBox), start, end, yMax, yMin);
// Re-draw the graphs
gtk_widget_queue_draw(dataBox);
gtk_widget_queue_draw(fftBox);
// release the mutex
g_mutex_unlock (&data_mutex);
return FALSE;
}
// While the scan is running, read the data, write it to a
// CSV file, and plot it in the graphs.
// This function runs as a background thread for the duration of the scan.
static void * read_and_display_data ()
{
uint16_t read_status;
uint32_t samples_read_per_channel = 0;
uint32_t display_buf_size_samples, read_buf_size_samples, samples_to_read;
int chanMask = g_chan_mask;
int channel = 0;
int retval = 0;
int start_sample = 0;
int num_channels = 0;
int samples_in_display_buf = 0;
int read_buf_index = 0;
int chan_index = 0;
double *hat_read_buf, *display_buf;
g_sample_count = 0;
// Get the channel count
while (chanMask > 0)
{
if (chanMask & 1)
{
num_channels++;
}
graphChannelInfo[channel].buffSize = 0;
channel++;
chanMask >>= 1;
}
// Write channel numbers to file header
retval = init_log_file(log_file_ptr, g_chan_mask, MAX_CHANNELS);
if (retval < 0)
{
// Call the Start/Stop event handler to reset the UI
g_main_context_invoke(context, (GSourceFunc)stop_scan, NULL);
return NULL;
}
// Allocate the data buffers
display_buf_size_samples = g_fft_size * num_channels;
read_buf_size_samples = g_sample_rate * num_channels * 5;
hat_read_buf = (double*)malloc(read_buf_size_samples * sizeof(double));
display_buf = (double*)malloc(display_buf_size_samples * sizeof(double));
memset(display_buf, 0, display_buf_size_samples * sizeof(double));
// Loop to read data continuously
while (g_done != TRUE)
{
// Read the data from the device
samples_read_per_channel = 0;
samples_to_read = read_buf_size_samples;
if(!g_continuous) {
samples_to_read = (g_fft_size - g_sample_count) * num_channels;
}
retval = mcc172_a_in_scan_read(g_hat_addr, &read_status,
READ_ALL_AVAILABLE, 0, hat_read_buf,
samples_to_read, &samples_read_per_channel);
g_sample_count += samples_read_per_channel;
if(retval == RESULT_SUCCESS && (read_status & STATUS_BUFFER_OVERRUN))
{
retval = BUFFER_OVERRUN;
}
else if(retval == RESULT_SUCCESS && (read_status & STATUS_HW_OVERRUN))
{
retval = HW_OVERRUN;
}
if (retval != RESULT_SUCCESS)
{
show_error_in_main_thread(retval);
// Call the Start/Stop event handler to reset the UI
g_main_context_invoke(context, (GSourceFunc)stop_scan, NULL);
}
// Write the data to a log file as CSV data
retval = write_log_file(log_file_ptr, hat_read_buf,
samples_read_per_channel, num_channels);
if (retval < 0)
{
// Call the Start/Stop event handler to reset the UI
g_main_context_invoke(context, (GSourceFunc)stop_scan, NULL);
}
samples_in_display_buf = copy_hat_data_to_display_buffer(
hat_read_buf, samples_read_per_channel,
display_buf, samples_in_display_buf,
g_fft_size, num_channels);
// Set a mutex to prevent the data from changing while we plot it
g_mutex_lock (&data_mutex);
chanMask = g_chan_mask;
channel = 0;
read_buf_index = 0;
chan_index = 0;
start_sample = g_sample_count >= g_fft_size ?
(g_sample_count - g_fft_size) : 0;
// While there are channels to plot.
while (chanMask > 0)
{
// If this channel is included in the acquisition, plot its data.
if (chanMask & 1)
{
copy_data_to_xy_arrays(display_buf, read_buf_index++,
channel, num_channels, start_sample);
if (samples_in_display_buf >= g_fft_size)
{
// Calculate and display the FFT.
calculate_real_fft(display_buf, g_fft_size, num_channels,
chan_index++,
mcc172_info()->AI_MAX_RANGE / (g_sensitivity / 1000.0),
graphChannelInfo[channel].fft_Y);
}
}
channel++;
chanMask >>= 1;
}
// Update the display.
g_main_context_invoke(context, (GSourceFunc)refresh_graph, NULL);
// Release the mutex
g_mutex_unlock(&data_mutex);
if(!g_continuous && g_sample_count == g_fft_size) {
g_main_context_invoke(context, (GSourceFunc)stop_scan, NULL);
}
// Allow 200 msec idle time between each read
usleep(200000);
}
free(hat_read_buf);
free(display_buf);
return NULL;
}
// Event handler for the Start/Stop button.
// If starting, change the button text to "Stop" and start the acquisition.
// If stopping, change the button text to "Start" and stop the acquisition.
static void start_stop_event_handler(GtkWidget *widget, gpointer data)
{
uint8_t clock_source;
uint8_t synced;
uint16_t options = 0;
int retval = 0;
double actual_rate_per_channel;
const gchar* StartStopBtnLbl;
struct thread_info *tinfo;
StartStopBtnLbl = gtk_button_get_label(GTK_BUTTON(widget));
if (strcmp(StartStopBtnLbl , "Start") == 0)
{
set_enable_state_for_controls(FALSE);
// Change the label on the start button to "Stop".
gtk_button_set_label(GTK_BUTTON(widget), "Stop");
g_done = FALSE;
// Set variables based on the UI settings.
g_chan_mask = create_selected_channel_mask();
gchar *fftText = gtk_combo_box_text_get_active_text(
GTK_COMBO_BOX_TEXT(comboFftSize));
g_fft_size = atoi(fftText);
g_sample_rate = gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinRate));
set_iepe_configuration();
mcc172_a_in_clock_config_write(g_hat_addr, SOURCE_LOCAL, g_sample_rate);
mcc172_a_in_clock_config_read(g_hat_addr, &clock_source,
&actual_rate_per_channel, &synced);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinRate),
actual_rate_per_channel);
// Set the continuous option based on the UI setting.
g_continuous = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(rbContinuous));
if (g_continuous == TRUE)
{
options |= OPTS_CONTINUOUS;
}
// Open the log file.
log_file_ptr = open_log_file(csv_filename);
if (log_file_ptr == NULL)
{
retval = UNABLE_TO_OPEN_FILE;
show_error(&retval);
g_done = TRUE;
return;
}
// Start the analog scan
retval = mcc172_a_in_scan_start(g_hat_addr, g_chan_mask,
10 * g_sample_rate, options);
if(retval == RESULT_SUCCESS)
{
// Start a thread to read the data from the device
retval = pthread_create(&threadh, NULL, &read_and_display_data,
&tinfo);
if(retval != RESULT_SUCCESS)
{
retval = THREAD_ERROR;
}
}
if (retval != RESULT_SUCCESS)
{
show_error(&retval);
gtk_button_set_label(GTK_BUTTON(btnStart_Stop), "Start");
set_enable_state_for_controls(TRUE);
g_done = TRUE;
}
}
else
{
// Set the done flag and wait for the worker thread to complete
g_done = TRUE;
pthread_join(threadh, NULL);
// Stop the scan
retval = mcc172_a_in_scan_stop(g_hat_addr);
if(retval != RESULT_SUCCESS)
{
show_error(&retval);
}
// Clean up after the scan completes
retval = mcc172_a_in_scan_cleanup(g_hat_addr);
if(retval != RESULT_SUCCESS)
{
show_error(&retval);
}
set_enable_state_for_controls(TRUE);
// Change the label on the stop button to "Start"
gtk_button_set_label(GTK_BUTTON(widget), "Start");
}
return;
}
// A function to stop the acquisisiont that can be invoked
// from the worker thread
static gboolean stop_scan()
{
// Simulate a stop button press
start_stop_event_handler(btnStart_Stop, NULL);
return FALSE;
}
// Event handler for the Select Log File button.
// Displays a file select dialog to choose the log file to be opened.
// The file name will be shown in footer of the main window.
static void select_log_file_event_handler(GtkWidget* widget, char* user_data)
{
// Select the log file.
strcpy(csv_filename, choose_log_file(window, user_data));
// Display the CSV log file name.
gtk_label_set_text(GTK_LABEL(labelFile), csv_filename);
}
// Event handler for the time domain plot Y Zoom + button
static void zoom_in_handler(GtkWidget* widget, gpointer user_dat)
{
g_zoom_level *= 0.8;
refresh_graph();
}
// Event handler for the time domain plot Y Zoom - button
static void zoom_out_handler(GtkWidget* widget, gpointer user_dat)
{
g_zoom_level /= 0.8;
if(g_zoom_level > 1.0)
{
g_zoom_level = 1.0;
}
refresh_graph();
}
// Event handler to set the global sensitivity value
// when the Sensor Sensitivity input is changed
static void sensitivity_changed_handler (GtkWidget* widget, gpointer user_dat)
{
// Get the current sensor sensitivity setting
g_sensitivity = gtk_spin_button_get_value(GTK_SPIN_BUTTON(widget));
refresh_graph();
}
// Event handler that is called when the application is launched to create
// the main window and its controls.
static void app_activate_handler(GtkApplication *app, gpointer user_data)
{
GtkCssProvider* cssProvider;
GtkWidget *hboxMain, *vboxMain, *hboxFile, *vboxConfig, *vboxSampleRate,
*vboxFftSize, *vboxAcquireMode, *vboxGraph, *label, *hboxChannel,
*hboxIepe, *hboxSensitivity1, *hboxSensitivity2, *hboxRate1,
*hboxRate2, *hboxFftSize1, *hboxFftSize2, *hboxLogFile,
*hboxZoom, *vboxChannel, *vboxLegend, *vboxSensitivity,
*acqSeparator, *logFileSeparator, *chanSeparator, *endSeparator,
*dispSeparator, *dataTable, *fftTable, *btnZoomInY, *btnZoomOutY,
*separator;
GtkWidget *legend[MAX_CHANNELS];
GtkDataboxRuler *rulerY, *rulerX;
GdkRGBA background_color;
PangoAttrList *titleAttrs;
PangoAttribute *bold;
GtkStyleContext *styleContext;
int i = 0;
char chanName[20];
char legendName[20];
char chan_css[100] = "";
char css_str[1024] = "#startStop.circular {border-color: #3B5998; "
"background-color: #3B5998;}\n";
// Set CSS styling for the legend
for(i=0; i<MAX_CHANNELS; i++)
{
sprintf(chan_css, "#Chan%d block.filled {background-color: %s; "
"border-color: %s;}\n", i, colors[i], colors[i]);
strcat(css_str, chan_css);
}
// Set CSS styling for channel legend
cssProvider = gtk_css_provider_new();
gtk_css_provider_load_from_data(GTK_CSS_PROVIDER (cssProvider), css_str,
-1, NULL);
gtk_style_context_add_provider_for_screen(gdk_screen_get_default(),
GTK_STYLE_PROVIDER(cssProvider),
GTK_STYLE_PROVIDER_PRIORITY_USER);
// Create attribute list for section headings
titleAttrs = pango_attr_list_new ();
bold = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
pango_attr_list_insert (titleAttrs, bold);
// Create the top level gtk window.
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
gtk_widget_set_size_request(window, 900, 700);
gtk_container_set_border_width(GTK_CONTAINER(window), 10);
// Create the GDK resources for the main window
gtk_widget_realize(window);
// Connect the event handler to the "delete_event" event
g_signal_connect(window, "delete_event", G_CALLBACK (gtk_main_quit), NULL);
vboxMain = gtk_box_new(GTK_ORIENTATION_VERTICAL, 20);
gtk_container_add(GTK_CONTAINER(window), vboxMain);
hboxMain = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
gtk_container_add(GTK_CONTAINER(vboxMain), hboxMain);
vboxConfig = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);
gtk_container_add(GTK_CONTAINER(hboxMain), vboxConfig);
/******** Actions Section ********/
// Start/Stop Button
btnStart_Stop = gtk_button_new_with_label("Start");
g_signal_connect(btnStart_Stop, "clicked",
G_CALLBACK(start_stop_event_handler), NULL);
gtk_box_pack_start(GTK_BOX(vboxConfig), btnStart_Stop, FALSE, FALSE, 0);
gtk_widget_set_name(GTK_WIDGET(btnStart_Stop), "startStop");
styleContext = gtk_widget_get_style_context(GTK_WIDGET(btnStart_Stop));
gtk_style_context_add_class(styleContext, "circular");
/******** Display Settings ********/
dispSeparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start(GTK_BOX(vboxConfig), dispSeparator, FALSE, FALSE, 0);
label = gtk_label_new("Display Settings (Time)");
gtk_label_set_attributes (GTK_LABEL(label), titleAttrs);
gtk_box_pack_start(GTK_BOX(vboxConfig), label, FALSE, FALSE, 0);
// Time Domain Zoom Buttons
hboxZoom = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add(GTK_CONTAINER(vboxConfig), hboxZoom);
label = gtk_label_new("Zoom Y:");
gtk_box_pack_start(GTK_BOX(hboxZoom), label, FALSE, FALSE, 0);
btnZoomOutY = gtk_button_new_with_label ( "-");
gtk_box_pack_start(GTK_BOX(hboxZoom), btnZoomOutY, TRUE, FALSE, 3);
styleContext = gtk_widget_get_style_context(GTK_WIDGET(btnZoomOutY));
gtk_style_context_add_class(styleContext, "circular");
g_signal_connect(btnZoomOutY, "clicked", G_CALLBACK(zoom_out_handler),
NULL);
btnZoomInY = gtk_button_new_with_label ( "+");
gtk_box_pack_start(GTK_BOX(hboxZoom), btnZoomInY, TRUE, FALSE, 0);
styleContext = gtk_widget_get_style_context(GTK_WIDGET(btnZoomInY));
gtk_style_context_add_class(styleContext, "circular");
g_signal_connect(btnZoomInY, "clicked", G_CALLBACK(zoom_in_handler), NULL);
/******** Channel Settings ********/
chanSeparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start(GTK_BOX(vboxConfig), chanSeparator, FALSE, FALSE, 0);
label = gtk_label_new("Channel Settings");
gtk_label_set_attributes (GTK_LABEL(label), titleAttrs);
gtk_box_pack_start(GTK_BOX(vboxConfig), label, FALSE, FALSE, 0);
hboxChannel = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add(GTK_CONTAINER(vboxConfig), hboxChannel);
// Channel Select
vboxChannel = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add(GTK_CONTAINER(hboxChannel), vboxChannel);
vboxLegend=gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add(GTK_CONTAINER(hboxChannel), vboxLegend);
for (i = 0; i < MAX_CHANNELS; i++)
{
sprintf(chanName, "Channel %d", i);
chkChan[i] = gtk_check_button_new_with_label(chanName);
gtk_box_pack_start(GTK_BOX(vboxChannel), chkChan[i], FALSE, FALSE, 0);
legend[i] = gtk_level_bar_new_for_interval(0.0, 100.0);
gtk_level_bar_set_value(GTK_LEVEL_BAR(legend[i]), 100.0);
gtk_box_pack_start(GTK_BOX(vboxLegend), legend[i], TRUE, FALSE, 0);
sprintf(legendName, "Chan%d", i);
gtk_widget_set_name(legend[i], legendName);
}
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chkChan[0]), TRUE);
// IEPE Enable
hboxIepe = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add(GTK_CONTAINER(vboxConfig), hboxIepe);
chkIepe = gtk_check_button_new_with_label("Enable IEPE");
gtk_box_pack_start(GTK_BOX(hboxIepe), chkIepe, FALSE, FALSE, 0);
// Sensor Sensitivity
vboxSensitivity = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add(GTK_CONTAINER(vboxConfig), vboxSensitivity);
hboxSensitivity1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add(GTK_CONTAINER(vboxSensitivity), hboxSensitivity1);
label = gtk_label_new("Sensor Sensitivity:");
gtk_box_pack_start(GTK_BOX(hboxSensitivity1), label, FALSE, FALSE, 5);
hboxSensitivity2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add(GTK_CONTAINER(vboxSensitivity), hboxSensitivity2);
spinSensitivity = gtk_spin_button_new_with_range (0, 10000, 1);
gtk_box_pack_start(GTK_BOX(hboxSensitivity2), spinSensitivity, FALSE, FALSE,
5);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinSensitivity), 1000.);
label = gtk_label_new("mV/unit");
gtk_box_pack_start(GTK_BOX(hboxSensitivity2), label, FALSE, FALSE, 5);
g_signal_connect(spinSensitivity, "value-changed",
G_CALLBACK(sensitivity_changed_handler), NULL);
/******** Acquisition Settings ********/
acqSeparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start(GTK_BOX(vboxConfig), acqSeparator, FALSE, FALSE, 0);
label = gtk_label_new("Acquisition Settings");
gtk_label_set_attributes (GTK_LABEL(label), titleAttrs);
gtk_box_pack_start(GTK_BOX(vboxConfig), label, FALSE, FALSE, 0);
// Sample Rate
vboxSampleRate = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add(GTK_CONTAINER(vboxConfig), vboxSampleRate);
hboxRate1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
gtk_container_add(GTK_CONTAINER(vboxSampleRate), hboxRate1);
label = gtk_label_new("Sample Rate:");
gtk_box_pack_start(GTK_BOX(hboxRate1), label, FALSE, FALSE, 0);
hboxRate2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
gtk_container_add(GTK_CONTAINER(vboxSampleRate), hboxRate2);
spinRate = gtk_spin_button_new_with_range (10, 100000, 10);
gtk_box_pack_start(GTK_BOX(hboxRate2), spinRate, FALSE, FALSE, 0);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinRate), 2048.);
label = gtk_label_new("samples/s");
gtk_box_pack_start(GTK_BOX(hboxRate2), label, FALSE, FALSE, 0);
// FFT Size
vboxFftSize = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add(GTK_CONTAINER(vboxConfig), vboxFftSize);
hboxFftSize1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
gtk_container_add(GTK_CONTAINER(vboxFftSize), hboxFftSize1);
label = gtk_label_new("FFT Size:");
gtk_box_pack_start(GTK_BOX(hboxFftSize1), label, FALSE, FALSE, 0);
hboxFftSize2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
gtk_container_add(GTK_CONTAINER(vboxFftSize), hboxFftSize2);
// Define FFT Size options
comboFftSize = gtk_combo_box_text_new();
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(comboFftSize), NULL, "256");
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(comboFftSize), NULL, "512");
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(comboFftSize), NULL, "1024");
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(comboFftSize), NULL, "2048");
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(comboFftSize), NULL, "4096");
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(comboFftSize), NULL, "8192");
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(comboFftSize), NULL, "16384");
gtk_combo_box_set_active(GTK_COMBO_BOX(comboFftSize), 3);
gtk_box_pack_start(GTK_BOX(hboxFftSize2), comboFftSize, FALSE, FALSE, 0);
label = gtk_label_new("samples");
gtk_box_pack_start(GTK_BOX(hboxFftSize2), label, FALSE, FALSE, 0);
// Acquisition Mode (Continuous or Finite)
vboxAcquireMode= gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add(GTK_CONTAINER(vboxConfig), vboxAcquireMode);
rbContinuous = gtk_radio_button_new_with_label(NULL, "Continuous");
gtk_box_pack_start(GTK_BOX(vboxAcquireMode), rbContinuous, FALSE, FALSE, 0);
rbFinite = gtk_radio_button_new_with_label(NULL, "Finite");
gtk_box_pack_start(GTK_BOX(vboxAcquireMode), rbFinite, FALSE, FALSE, 0);
gtk_radio_button_join_group((GtkRadioButton*)rbFinite,
(GtkRadioButton*)rbContinuous);
/******** Log File Settings ********/
logFileSeparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start(GTK_BOX(vboxConfig), logFileSeparator, FALSE, FALSE, 0);
label = gtk_label_new("Log File Settings");
gtk_label_set_attributes (GTK_LABEL(label), titleAttrs);
gtk_box_pack_start(GTK_BOX(vboxConfig), label, FALSE, FALSE, 0);
hboxLogFile = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add(GTK_CONTAINER(vboxConfig), hboxLogFile);
btnSelectLogFile = gtk_button_new_with_label ( "Select Log File ...");
g_signal_connect(btnSelectLogFile, "clicked",
G_CALLBACK(select_log_file_event_handler), csv_filename);
gtk_box_pack_start(GTK_BOX(hboxLogFile), btnSelectLogFile, FALSE, FALSE, 0);
styleContext = gtk_widget_get_style_context(GTK_WIDGET(btnSelectLogFile));
gtk_style_context_add_class(styleContext, "circular");
/******** Graphs ********/
// Separators from the configuration controls
endSeparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start(GTK_BOX(vboxConfig), endSeparator, FALSE, FALSE, 0);
separator = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
gtk_container_add(GTK_CONTAINER(hboxMain), separator);
// Add the time domain graph
vboxGraph = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add(GTK_CONTAINER(hboxMain), vboxGraph);
label = gtk_label_new("Time Domain Data (sensor units)");
gtk_label_set_attributes (GTK_LABEL(label), titleAttrs);
gtk_box_pack_start(GTK_BOX(vboxGraph), label, FALSE, FALSE, 0);
gtk_databox_create_box_with_scrollbars_and_rulers_positioned (&dataBox,
&dataTable, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE);
gtk_box_pack_start(GTK_BOX(vboxGraph), dataTable, TRUE, TRUE, 10);
rulerY = gtk_databox_get_ruler_y(GTK_DATABOX(dataBox));
gtk_databox_ruler_set_text_orientation(rulerY, GTK_ORIENTATION_HORIZONTAL);
gtk_databox_ruler_set_max_length(rulerY, 7);
rulerX = gtk_databox_get_ruler_x(GTK_DATABOX(dataBox));
gtk_databox_ruler_set_max_length(rulerX, 9);
gtk_databox_ruler_set_linear_label_format(rulerX, "%%.0f");
// Set the default limits
gtk_databox_ruler_set_range(rulerY, 6.0, -6.0, 0.0);
gtk_databox_ruler_set_range(rulerX, 0.0, 2047.0, 0.0);
gtk_databox_ruler_set_draw_subticks(rulerX, FALSE);
// Add the FFT graph
label = gtk_label_new("FFT Data (dBFS)");
gtk_label_set_attributes (GTK_LABEL(label), titleAttrs);
gtk_box_pack_start(GTK_BOX(vboxGraph), label, FALSE, FALSE, 0);
gtk_databox_create_box_with_scrollbars_and_rulers_positioned (&fftBox,
&fftTable, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE);
gtk_box_pack_start(GTK_BOX(vboxGraph), fftTable, TRUE, TRUE, 0);
rulerY = gtk_databox_get_ruler_y(GTK_DATABOX(fftBox));
gtk_databox_ruler_set_text_orientation(rulerY, GTK_ORIENTATION_HORIZONTAL);
rulerX = gtk_databox_get_ruler_x(GTK_DATABOX(fftBox));
gtk_databox_ruler_set_linear_label_format(rulerX, "%%.0f");
gtk_databox_ruler_set_draw_subticks(rulerX, FALSE);
// Set the default limits
gtk_databox_ruler_set_range(rulerY, 10.0, -150.0, 0.0);
gtk_databox_ruler_set_range(rulerX, 0.0, 1024.0, 0.0);
// Set the background color for the graphs
gdk_rgba_parse (&background_color, "#d9d9d9");
pgtk_widget_override_background_color(dataBox, GTK_STATE_FLAG_NORMAL,
&background_color);
pgtk_widget_override_background_color(fftBox, GTK_STATE_FLAG_NORMAL,
&background_color);
/******** Log file name display ********/
hboxFile = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add(GTK_CONTAINER(vboxMain), hboxFile);
labelFile = gtk_label_new(csv_filename);
gtk_box_pack_start(GTK_BOX(hboxFile), labelFile, TRUE, FALSE, 0);
// Show the top level window and all of its controls
gtk_widget_show_all(window);
}
// Find all of the MCC172 HAT devices that are installed
// and open a connection to the first one.
static int open_first_hat_device(uint8_t* hat_address)
{
int hat_count = 0;
struct HatInfo* hat_info_list = NULL;
int retval = 0;
// Get the number of MCC 172 devices so that we can determine
// how much memory to allocate for the hat_info_list
hat_count = hat_list(HAT_ID_MCC_172, NULL);
if (hat_count > 0)
{
// Allocate memory for the hat_info_list
hat_info_list = (struct HatInfo*)malloc(
hat_count * sizeof(struct HatInfo));
// Get the list of MCC 172 devices
hat_list(HAT_ID_MCC_172, hat_info_list);
// Choose the first one
*hat_address = hat_info_list[0].address;
// Open the hat device
retval = mcc172_open(*hat_address);
if(retval != RESULT_SUCCESS)
{
show_error(&retval);
}
}
else
{
retval = NO_HAT_DEVICES_FOUND;
show_error(&retval);
}
if (hat_info_list != NULL)
free(hat_info_list);
// Return the address of the first HAT device.
return retval;
}
|
63bbc08b082952ef6c2d2cd3d5acbbf916d53afe
|
bb7a80648bf830c2fb813cdb335032142cbee06d
|
/mod/mpp/3531d/inc/common/audio_aac_adp.h
|
00279a9292a77a7326cb3f3427afb5a78efc7202
|
[] |
no_license
|
openhisilicon/HIVIEW
|
44574a29da60e3bb400c7ce97c722dfc9f2959e6
|
60bbfa5cb66cc82f0cdc0bba1242dbc9491b0f37
|
refs/heads/master
| 2023-09-01T01:42:19.069724
| 2023-08-31T09:57:39
| 2023-08-31T09:57:39
| 189,036,134
| 336
| 121
| null | 2023-01-07T14:10:22
| 2019-05-28T13:41:40
|
C
|
UTF-8
|
C
| false
| false
| 3,520
|
h
|
audio_aac_adp.h
|
/*
* Copyright (c) Hisilicon Technologies Co., Ltd. 2019-2020. All rights reserved.
* Description: audio aac adapt
* Author: Hisilicon multimedia software group
* Create: 2019-10-10
*/
#ifndef __AUDIO_AAC_ADP_H__
#define __AUDIO_AAC_ADP_H__
#include <stdio.h>
#include "hi_mpi_audio.h"
#include "hi_common_aenc.h"
#include "hi_common_adec.h"
#include "hi_common_aio.h"
#include "hi_aacdec.h"
#include "hi_aacenc.h"
/* samples per frame for AACLC and aacPlus */
#define AACLD_SAMPLES_PER_FRAME 512
#define AACLC_SAMPLES_PER_FRAME 1024
#define AACPLUS_SAMPLES_PER_FRAME 2048
/* max length of AAC stream by bytes */
#define MAX_AAC_MAINBUF_SIZE (768 * 2)
typedef enum {
HI_AAC_TYPE_AACLC = 0, /* AAC LC */
HI_AAC_TYPE_EAAC = 1, /* EAAC(HEAAC or AAC+ or aac_plus_v1) */
HI_AAC_TYPE_EAACPLUS = 2, /* EAAC+(AAC++ or aac_plus_v2) */
HI_AAC_TYPE_AACLD = 3,
HI_AAC_TYPE_AACELD = 4,
HI_AAC_TYPE_BUTT,
} hi_aac_type;
typedef enum {
HI_AAC_BPS_8K = 8000,
HI_AAC_BPS_16K = 16000,
HI_AAC_BPS_22K = 22000,
HI_AAC_BPS_24K = 24000,
HI_AAC_BPS_32K = 32000,
HI_AAC_BPS_48K = 48000,
HI_AAC_BPS_64K = 64000,
HI_AAC_BPS_96K = 96000,
HI_AAC_BPS_128K = 128000,
HI_AAC_BPS_256K = 256000,
HI_AAC_BPS_320K = 320000,
HI_AAC_BPS_BUTT
} hi_aac_bps;
typedef enum {
HI_AAC_TRANSPORT_TYPE_ADTS = 0,
HI_AAC_TRANSPORT_TYPE_LOAS = 1,
HI_AAC_TRANSPORT_TYPE_LATM_MCP1 = 2,
HI_AAC_TRANSPORT_TYPE_BUTT
} hi_aac_transport_type;
typedef struct {
hi_s32 sample_rate; /* sample rate */
hi_s32 bit_rate; /* bitrate */
hi_s32 profile; /* profile */
hi_s32 tns_used; /* TNS tools */
hi_s32 pns_used; /* PNS tools */
} aacdec_frame_info;
/*
* AAC commendatory parameter:
* sampling rate(HZ) LC bit_rate(kbit/s) EAAC bit_rate (kbit/s) EAAC+ bit_rate (kbit/s)
* 48000 128 48 32,24
* 44100 128 48 32,24
* 32000 96 22 16
* 24000 64
* 22050 64
* 16000 48
*/
typedef struct {
hi_aac_type aac_type; /* AAC profile type */
hi_aac_bps bit_rate; /* AAC bitrate(LC:16~320, EAAC:24~128, EAAC+:16~64, AACLD:16~320, AACELD:32~320) */
hi_audio_sample_rate sample_rate; /* AAC sample rate(LC:8~48, EAAC:16~48, EAAC+:16~48, AACLD:8~48, AACELD:8~48) */
hi_audio_bit_width bit_width; /* AAC bit width (only support 16bit) */
hi_audio_snd_mode snd_mode; /* sound mode of inferent audio frame */
hi_aac_transport_type transport_type;
hi_s16 band_width; /* targeted audio bandwidth in hz (0 or 1000~smp_rate/2), the default is 0 */
} hi_aenc_attr_aac;
typedef struct {
hi_aac_encoder *aac_state;
hi_aenc_attr_aac aac_attr;
} aenc_aac_encoder;
typedef struct {
hi_aac_transport_type transport_type;
} hi_adec_attr_aac;
typedef struct {
hi_aac_decoder aac_state;
hi_adec_attr_aac aac_attr;
} adec_aac_decoder;
hi_s32 hi_mpi_aenc_aac_init(hi_void);
hi_s32 hi_mpi_aenc_aac_deinit(hi_void);
hi_s32 hi_mpi_adec_aac_init(hi_void);
hi_s32 hi_mpi_adec_aac_deinit(hi_void);
#endif
|
5cbe16ef0db19b6b5ca976945498eb9076d527aa
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/net/core/iovec.c
|
1117a26a854809b6c89eff531b7784f25a353191
|
[
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later",
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 4,870
|
c
|
iovec.c
|
/*
* iovec manipulation routines.
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* Fixes:
* Andrew Lunn : Errors in iovec copying.
* Pedro Roque : Added memcpy_fromiovecend and
* csum_..._fromiovecend.
* Andi Kleen : fixed error handling for 2.1
* Alexey Kuznetsov: 2.1 optimisations
* Andi Kleen : Fix csum*fromiovecend for IPv6.
*/
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/net.h>
#include <linux/in6.h>
#include <asm/uaccess.h>
#include <asm/byteorder.h>
#include <net/checksum.h>
#include <net/sock.h>
/*
* Verify iovec. The caller must ensure that the iovec is big enough
* to hold the message iovec.
*
* Save time not doing access_ok. copy_*_user will make this work
* in any case.
*/
int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr_storage *address, int mode)
{
int size, ct, err;
if (m->msg_name && m->msg_namelen) {
if (mode == VERIFY_READ) {
void __user *namep;
namep = (void __user __force *) m->msg_name;
err = move_addr_to_kernel(namep, m->msg_namelen,
address);
if (err < 0)
return err;
}
m->msg_name = address;
} else {
m->msg_name = NULL;
m->msg_namelen = 0;
}
size = m->msg_iovlen * sizeof(struct iovec);
if (copy_from_user(iov, (void __user __force *) m->msg_iov, size))
return -EFAULT;
m->msg_iov = iov;
err = 0;
for (ct = 0; ct < m->msg_iovlen; ct++) {
size_t len = iov[ct].iov_len;
if (len > INT_MAX - err) {
len = INT_MAX - err;
iov[ct].iov_len = len;
}
err += len;
}
return err;
}
/*
* Copy kernel to iovec. Returns -EFAULT on error.
*/
int memcpy_toiovecend(const struct iovec *iov, unsigned char *kdata,
int offset, int len)
{
int copy;
for (; len > 0; ++iov) {
/* Skip over the finished iovecs */
if (unlikely(offset >= iov->iov_len)) {
offset -= iov->iov_len;
continue;
}
copy = min_t(unsigned int, iov->iov_len - offset, len);
if (copy_to_user(iov->iov_base + offset, kdata, copy))
return -EFAULT;
offset = 0;
kdata += copy;
len -= copy;
}
return 0;
}
EXPORT_SYMBOL(memcpy_toiovecend);
/*
* Copy iovec from kernel. Returns -EFAULT on error.
*/
int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,
int offset, int len)
{
/* No data? Done! */
if (len == 0)
return 0;
/* Skip over the finished iovecs */
while (offset >= iov->iov_len) {
offset -= iov->iov_len;
iov++;
}
while (len > 0) {
u8 __user *base = iov->iov_base + offset;
int copy = min_t(unsigned int, len, iov->iov_len - offset);
offset = 0;
if (copy_from_user(kdata, base, copy))
return -EFAULT;
len -= copy;
kdata += copy;
iov++;
}
return 0;
}
EXPORT_SYMBOL(memcpy_fromiovecend);
/*
* And now for the all-in-one: copy and checksum from a user iovec
* directly to a datagram
* Calls to csum_partial but the last must be in 32 bit chunks
*
* ip_build_xmit must ensure that when fragmenting only the last
* call to this function will be unaligned also.
*/
int csum_partial_copy_fromiovecend(unsigned char *kdata, struct iovec *iov,
int offset, unsigned int len, __wsum *csump)
{
__wsum csum = *csump;
int partial_cnt = 0, err = 0;
/* Skip over the finished iovecs */
while (offset >= iov->iov_len) {
offset -= iov->iov_len;
iov++;
}
while (len > 0) {
u8 __user *base = iov->iov_base + offset;
int copy = min_t(unsigned int, len, iov->iov_len - offset);
offset = 0;
/* There is a remnant from previous iov. */
if (partial_cnt) {
int par_len = 4 - partial_cnt;
/* iov component is too short ... */
if (par_len > copy) {
if (copy_from_user(kdata, base, copy))
goto out_fault;
kdata += copy;
base += copy;
partial_cnt += copy;
len -= copy;
iov++;
if (len)
continue;
*csump = csum_partial(kdata - partial_cnt,
partial_cnt, csum);
goto out;
}
if (copy_from_user(kdata, base, par_len))
goto out_fault;
csum = csum_partial(kdata - partial_cnt, 4, csum);
kdata += par_len;
base += par_len;
copy -= par_len;
len -= par_len;
partial_cnt = 0;
}
if (len > copy) {
partial_cnt = copy % 4;
if (partial_cnt) {
copy -= partial_cnt;
if (copy_from_user(kdata + copy, base + copy,
partial_cnt))
goto out_fault;
}
}
if (copy) {
csum = csum_and_copy_from_user(base, kdata, copy,
csum, &err);
if (err)
goto out;
}
len -= copy + partial_cnt;
kdata += copy + partial_cnt;
iov++;
}
*csump = csum;
out:
return err;
out_fault:
err = -EFAULT;
goto out;
}
EXPORT_SYMBOL(csum_partial_copy_fromiovecend);
|
30d8efc71fb191e7d142dd74361809efb01ca057
|
a831bb046bdc40567682f01f2dc8e73a3803120e
|
/libs/mpf/src/mpf_codec_amr.c
|
4bea0690f4caeb19058a0682b971474e8b25c6ac
|
[
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"LGPL-2.1-or-later"
] |
permissive
|
unispeech/unimrcp
|
5d9567c63d849c0e50bf0ee7b11259a798648d3e
|
9913f23691b3a1b8a7e84be5ba25478031352158
|
refs/heads/master
| 2023-08-05T08:22:40.918060
| 2023-08-01T17:35:29
| 2023-08-01T17:35:29
| 38,894,063
| 363
| 159
|
Apache-2.0
| 2023-05-17T12:50:27
| 2015-07-10T17:49:42
|
C
|
UTF-8
|
C
| false
| false
| 11,593
|
c
|
mpf_codec_amr.c
|
/*
* Copyright 2022 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdlib.h>
#include "mpf_codec.h"
#include "mpf_trace.h"
#include <opencore-amrwb/dec_if.h>
#include <vo-amrwbenc/enc_if.h>
#if ENABLE_AMR_TRACE == 1
#define AMR_TRACE printf
#elif ENABLE_AMR_TRACE == 2
#define AMR_TRACE mpf_debug_output_trace
#elif ENABLE_AMR_TRACE == 3
#define AMR_TRACE(msg, args...) \
apt_log(MPF_LOG_MARK, APT_PRIO_INFO, msg, ##args);
#else
#define AMR_TRACE mpf_null_trace
#endif
#define AMR_WB_CODEC_NAME "AMR-WB"
#define AMR_WB_CODEC_NAME_LENGTH (sizeof(AMR_WB_CODEC_NAME)-1)
#define AMR_WB_SID 9
#define DEFAULT_AMR_WB_MODE 8
/* AMR-WB frame lengths in bytes */
static const apr_byte_t mpf_amr_wb_framelen[16] = { 17, 23, 32, 37, 40, 46, 50, 58, 60, 5, 0, 0, 0, 0, 0, 0 };
typedef struct mpf_amr_wb_encoder_t mpf_amr_wb_encoder_t;
typedef struct mpf_amr_wb_decoder_t mpf_amr_wb_decoder_t;
struct mpf_amr_wb_encoder_t {
void *state;
apr_byte_t mode;
apt_bool_t octet_aligned;
apr_int16_t *silence_buf;
apr_size_t silence_buf_len;
};
struct mpf_amr_wb_decoder_t {
void *state;
apt_bool_t octet_aligned;
};
static apt_bool_t mpf_amr_wb_format_params_get(const apt_pair_arr_t *format_params, apt_bool_t *octet_aligned, apr_byte_t *mode);
static apt_bool_t mpf_amr_wb_encoder_open(mpf_codec_t *codec, mpf_codec_descriptor_t *descriptor)
{
mpf_amr_wb_encoder_t *encoder = (mpf_amr_wb_encoder_t*)apr_palloc(codec->pool, sizeof(mpf_amr_wb_encoder_t));
apt_log(MPF_LOG_MARK, APT_PRIO_INFO, "Init AMR-WB Encoder");
encoder->state = E_IF_init();
if (!encoder->state) {
apt_log(MPF_LOG_MARK, APT_PRIO_WARNING, "Failed to Init AMR-WB Encoder");
return FALSE;
}
encoder->silence_buf = NULL;
encoder->silence_buf_len = 0;
encoder->mode = DEFAULT_AMR_WB_MODE;
encoder->octet_aligned = FALSE;
if (descriptor) {
mpf_amr_wb_format_params_get(descriptor->format_params, &encoder->octet_aligned, &encoder->mode);
}
apt_log(MPF_LOG_MARK, APT_PRIO_INFO, "AMR-WB mode [%d] octet-aligned [%d]", encoder->mode, encoder->octet_aligned);
if (encoder->octet_aligned == FALSE) {
/* only octet-aligned mode is currently supported */
apt_log(MPF_LOG_MARK, APT_PRIO_WARNING, "Only octet-aligned AMR-WB mode supported");
E_IF_exit(encoder->state);
encoder->state = NULL;
return FALSE;
}
codec->encoder_obj = encoder;
return TRUE;
}
static apt_bool_t mpf_amr_wb_encoder_close(mpf_codec_t *codec)
{
mpf_amr_wb_encoder_t *encoder = codec->encoder_obj;
if (!encoder)
return FALSE;
apt_log(MPF_LOG_MARK, APT_PRIO_INFO, "Deinit AMR-WB Encoder");
if (encoder->state) {
E_IF_exit(encoder->state);
encoder->state = NULL;
}
codec->encoder_obj = NULL;
return TRUE;
}
static apt_bool_t mpf_amr_wb_decoder_open(mpf_codec_t *codec, mpf_codec_descriptor_t *descriptor)
{
mpf_amr_wb_decoder_t *decoder = (mpf_amr_wb_decoder_t*)apr_palloc(codec->pool, sizeof(mpf_amr_wb_decoder_t));
apt_log(MPF_LOG_MARK, APT_PRIO_INFO, "Init AMR-WB Decoder");
decoder->state = D_IF_init();
if (!decoder->state) {
apt_log(MPF_LOG_MARK, APT_PRIO_WARNING, "Failed to Init AMR-WB Decoder");
return FALSE;
}
decoder->octet_aligned = FALSE;
if (descriptor) {
mpf_amr_wb_format_params_get(descriptor->format_params, &decoder->octet_aligned, NULL);
}
apt_log(MPF_LOG_MARK, APT_PRIO_INFO, "AMR-WB octet-aligned [%d]", decoder->octet_aligned);
if (decoder->octet_aligned == FALSE) {
/* only octet-aligned mode is currently supported */
apt_log(MPF_LOG_MARK, APT_PRIO_WARNING, "Only octet-aligned AMR-WB mode supported");
D_IF_exit(decoder->state);
decoder->state = NULL;
return FALSE;
}
codec->decoder_obj = decoder;
return TRUE;
}
static apt_bool_t mpf_amr_wb_decoder_close(mpf_codec_t *codec)
{
mpf_amr_wb_decoder_t *decoder = codec->decoder_obj;
if (!decoder)
return FALSE;
apt_log(MPF_LOG_MARK, APT_PRIO_INFO, "Deinit AMR-WB Decoder");
if (decoder->state) {
D_IF_exit(decoder->state);
decoder->state = NULL;
}
codec->decoder_obj = NULL;
return TRUE;
}
static apt_bool_t mpf_amr_wb_encode(mpf_codec_t *codec, const mpf_codec_frame_t *frame_in, mpf_codec_frame_t *frame_out)
{
int size;
apr_int16_t *speech;
mpf_amr_wb_encoder_t *encoder = codec->encoder_obj;
if (!encoder)
return FALSE;
AMR_TRACE("AMR-WB Encode frame in [%d bytes]\n", frame_in->size);
speech = frame_in->buffer;
size = E_IF_encode(encoder->state, encoder->mode, speech, frame_out->buffer, 0);
if (size <= 0) {
apt_log(MPF_LOG_MARK, APT_PRIO_WARNING, "Failed to AMR-WB Encode [%d]", size);
return FALSE;
}
frame_out->size = size;
AMR_TRACE("AMR-WB Encode frame out [%d bytes]\n", frame_out->size);
return TRUE;
}
static apt_bool_t mpf_amr_wb_decode(mpf_codec_t *codec, const mpf_codec_frame_t *frame_in, mpf_codec_frame_t *frame_out)
{
apr_int16_t *decode_buf;
mpf_amr_wb_decoder_t *decoder = codec->decoder_obj;
if (!decoder)
return FALSE;
AMR_TRACE("AMR-WB Decode frame in [%d bytes]\n", frame_in->size);
decode_buf = frame_out->buffer;
D_IF_decode(decoder->state, frame_in->buffer, decode_buf, 0);
frame_out->size = 640; /* 16000 * 20 / 1000 * 2 */
AMR_TRACE("AMR-WB Decode frame out [%d bytes]\n", frame_out->size);
return TRUE;
}
static apt_bool_t mpf_amr_wb_pack(mpf_codec_t *codec, const mpf_codec_frame_t frames[], apr_uint16_t frame_count, apr_size_t *size)
{
if(!frame_count)
return FALSE;
AMR_TRACE("AMR-WB Pack frame count [%d]\n", frame_count);
if (frame_count == 1) {
char* buffer = frames[0].buffer;
memmove(buffer + 1, buffer, frames[0].size);
/* Code Mode Request (CMR) */
buffer[0] = 0xF0; /* 1111 0000 */
*size += 1;
}
else {
char* buffer;
char *read_ptr;
char *write_ptr;
char amr_header[128];
apr_byte_t f_bit;
apr_byte_t frame_type;
apr_byte_t good_quality;
apr_byte_t toc;
apr_size_t header_size = 0;
const mpf_codec_frame_t *frame;
apr_uint16_t i;
write_ptr = &amr_header[0];
/* Code Mode Request (CMR) */
*write_ptr = 0xF0; /* 1111 0000 */
write_ptr++;
/* Table Of Contents (TOC) */
f_bit = 1;
for (i = 0; i < frame_count; i++) {
read_ptr = frames[i].buffer;
frame_type = ((*read_ptr >> 3) & 0x0F);
good_quality = ((*read_ptr >> 2) & 0x01);
if (i == frame_count - 1) {
f_bit = 0;
}
toc = (apr_byte_t)((f_bit << 5) | (frame_type << 1) | good_quality);
*write_ptr = (toc << 2);
++write_ptr;
}
header_size = write_ptr - &amr_header[0]; /* 1 (CMR) + 1 (TOC entry) * frame count */
buffer = frames[0].buffer;
/* Compose payload by moving individual frames accordingly */
for (i = frame_count; i > 0; i--) {
frame = &frames[i-1];
memmove((char*)frame->buffer + header_size - i, (char*)frame->buffer + 1, frame->size - 1);
}
/* Copy header */
memcpy(buffer, amr_header, header_size);
*size += header_size - frame_count;
}
return TRUE;
}
static apt_bool_t mpf_amr_wb_dissect(mpf_codec_t *codec, void *buffer, apr_size_t buffer_size, apr_size_t frame_size, mpf_codec_frame_t frames[], apr_uint16_t *frame_count)
{
apr_byte_t *toc;
apr_byte_t f_bit = 1;
apr_byte_t frame_type;
apr_byte_t *read_ptr = buffer;
apr_byte_t *write_ptr = buffer;
mpf_codec_frame_t *frame;
apr_uint16_t cur_frame = 0;
apr_uint16_t i;
if (!buffer_size)
return FALSE;
AMR_TRACE("AMR-WB Dissect [%d bytes]\n", buffer_size);
/* Code Mode Request (CMR) */
read_ptr++; /* Skip CMR */
buffer_size--;
/* Table Of Contents (TOC) */
toc = read_ptr;
while (buffer_size && cur_frame < *frame_count && f_bit) {
frame_type = ((toc[cur_frame] >> 3) & 0xF);
f_bit = ((toc[cur_frame] >> 7) & 0x01);
if (frame_type < AMR_WB_SID) {
/* Speech */
}
else if (frame_type == AMR_WB_SID) {
/* Silence */
}
else {
/* Invalid frame type */
return FALSE;
}
frame = &frames[cur_frame];
frame->size = mpf_amr_wb_framelen[frame_type];
AMR_TRACE("AMR-WB frame type [%d] size [%d] f bit [%d]\n", frame_type, frame->size+1, f_bit);
cur_frame++;
buffer_size--;
}
if (f_bit) {
/* the last frame still has f_bit set */
}
read_ptr += cur_frame;
*frame_count = cur_frame;
/* Payload */
for (i=0; i<cur_frame; i++) {
frame = &frames[i];
/* Copy TOC by having F bit cleared */
*write_ptr = toc[i] & 0x7F;
/* Align frame with TOC */
memmove(write_ptr+1,read_ptr,frame->size);
read_ptr += frame->size;
frame->size++;
frame->buffer = write_ptr;
write_ptr += frame->size;
}
return TRUE;
}
static apt_bool_t mpf_amr_wb_fill(mpf_codec_t *codec, mpf_codec_frame_t *frame_out)
{
int size;
mpf_amr_wb_encoder_t *encoder = codec->encoder_obj;
if (!encoder)
return FALSE;
AMR_TRACE("AMR-WB Fill\n");
if (!encoder->silence_buf) {
encoder->silence_buf_len = 160;
encoder->silence_buf = (apr_int16_t*)apr_pcalloc(codec->pool, sizeof(apr_int16_t) * encoder->silence_buf_len);
}
size = E_IF_encode(encoder->state, encoder->mode, encoder->silence_buf, frame_out->buffer, 0);
if (size <= 0) {
apt_log(MPF_LOG_MARK, APT_PRIO_WARNING, "Failed to AMR-WB Fill [%d]", size);
return FALSE;
}
frame_out->size = size;
return TRUE;
}
static apt_bool_t mpf_amr_wb_format_params_get(const apt_pair_arr_t *format_params, apt_bool_t *octet_aligned, apr_byte_t *mode)
{
int i;
if (octet_aligned)
*octet_aligned = FALSE;
if (mode)
*mode = DEFAULT_AMR_WB_MODE;
if (format_params) {
for (i = 0; i < format_params->nelts; i++) {
apt_pair_t* pair = &APR_ARRAY_IDX(format_params, i, apt_pair_t);
if (pair && pair->name.buf && pair->value.buf) {
if (octet_aligned && strcasecmp(pair->name.buf, "octet-align") == 0) {
if (pair->value.buf[0] == '1') {
*octet_aligned = TRUE;
}
}
else if (mode && strcasecmp(pair->name.buf, "mode-set") == 0) {
*mode = (apr_byte_t) atoi(pair->value.buf);
if (*mode >= AMR_WB_SID) {
*mode = DEFAULT_AMR_WB_MODE;
}
}
}
}
}
return TRUE;
}
static apt_bool_t mpf_amr_wb_format_match(const apt_pair_arr_t *format_params1, const apt_pair_arr_t *format_params2)
{
apt_bool_t octet_aligned1;
apt_bool_t octet_aligned2;
mpf_amr_wb_format_params_get(format_params1, &octet_aligned1,NULL);
mpf_amr_wb_format_params_get(format_params2, &octet_aligned2,NULL);
if (octet_aligned1 != octet_aligned2) {
return FALSE;
}
return TRUE;
}
static const mpf_codec_vtable_t mpf_amr_wb_vtable = {
mpf_amr_wb_encoder_open,
mpf_amr_wb_encoder_close,
mpf_amr_wb_decoder_open,
mpf_amr_wb_decoder_close,
mpf_amr_wb_encode,
mpf_amr_wb_decode,
mpf_amr_wb_pack,
mpf_amr_wb_dissect,
mpf_amr_wb_fill,
mpf_amr_wb_format_match
};
static const mpf_codec_attribs_t mpf_amr_wb_attribs = {
{AMR_WB_CODEC_NAME, AMR_WB_CODEC_NAME_LENGTH}, /* codec name */
2, /* bits per sample */
MPF_SAMPLE_RATE_16000, /* supported sampling rates */
20 /* base frame duration */
};
mpf_codec_t* mpf_codec_amr_wb_create(apr_pool_t *pool)
{
return mpf_codec_create(&mpf_amr_wb_vtable,&mpf_amr_wb_attribs,NULL,pool);
}
|
816f912b1f1e0625cd83b164f60e1d3768ff78a9
|
fa8b9ca710602c44ec391953348b2644f68dd321
|
/bench/espresso/utility.c
|
3c140a15921131102c7d7d0bb631aec0e6c7f0f3
|
[
"MIT"
] |
permissive
|
daanx/mimalloc-bench
|
de574c4d6c8e2042cb0096a3c63708a8ef958cf7
|
833b1663ef274f204b0011641aac6e78d96f8cee
|
refs/heads/master
| 2023-08-30T19:48:50.036029
| 2023-08-30T17:51:46
| 2023-08-30T17:51:46
| 192,573,707
| 268
| 48
|
MIT
| 2023-09-08T11:50:23
| 2019-06-18T16:09:59
|
C
|
UTF-8
|
C
| false
| false
| 2,827
|
c
|
utility.c
|
/* LINTLIBRARY */
#include "espresso.h"
#include "copyright.h"
#include "port.h"
#include "utility.h"
#ifdef IBM_WATC /* IBM Waterloo-C compiler (same as bsd 4.2) */
#ifndef BSD
#define BSD
#endif
#ifndef void
#define void int
#endif
#endif
#ifdef ultrix
#ifndef BSD
#define BSD
#endif
#endif
#ifdef hpux
#ifndef UNIX50
#define UNIX50
#endif
#endif
#ifdef aiws
#ifndef UNIX10
#define UNIX10
#endif
#endif
#ifdef vms /* VAX/C compiler -- times() with 100 HZ clock */
#ifndef UNIX100
#define UNIX100
#endif
#endif
/* default */
#if !defined(BSD) && !defined(UNIX10) && !defined(UNIX60) && !defined(UNIX100) && !defined(UNIX50) && !defined(_WIN32)
#define UNIX10
#endif
#ifdef BSD
#include <sys/time.h>
#include <sys/rusage.h>
#endif
#ifdef UNIX10
#include <sys/times.h>
#endif
#ifdef UNIX50
#include <sys/times.h>
#endif
#ifdef UNIX60
#include <sys/times.h>
#endif
#ifdef UNIX100
#include <sys/times.h>
#endif
#ifdef _MSC_VER
#include <windows.h>
#include <stdint.h>
#endif
/*
* util_cpu_time -- return a long which represents the elapsed processor
* time in milliseconds since some constant reference
*/
long
util_cpu_time()
{
long t = 0;
#ifdef _MSC_VER
static uint64_t frec = 0;
if (frec == 0)
{
LARGE_INTEGER val;
BOOL ok = QueryPerformanceFrequency(&val);
assert(ok);
frec = val.QuadPart / 1000;
}
LARGE_INTEGER val;
BOOL ok = QueryPerformanceCounter(&val);
assert(ok);
t = val.QuadPart / frec;
#endif
#ifdef BSD
struct rusage rusage;
(void) getrusage(RUSAGE_SELF, &rusage);
t = (long) rusage.ru_utime.tv_sec*1000 + rusage.ru_utime.tv_usec/1000;
#endif
#ifdef IBMPC
long ltime;
(void) time(<ime);
t = ltime * 1000;
#endif
#ifdef UNIX10 /* times() with 10 Hz resolution */
struct tms buffer;
(void) times(&buffer);
t = buffer.tms_utime * 100;
#endif
#ifdef UNIX50 /* times() with 50 Hz resolution */
struct tms buffer;
times(&buffer);
t = buffer.tms_utime * 20;
#endif
#ifdef UNIX60 /* times() with 60 Hz resolution */
struct tms buffer;
times(&buffer);
t = buffer.tms_utime * 16.6667;
#endif
#ifdef UNIX100
struct tms buffer; /* times() with 100 Hz resolution */
times(&buffer);
t = buffer.tms_utime * 10;
#endif
return t;
}
/*
* util_print_time -- massage a long which represents a time interval in
* milliseconds, into a string suitable for output
*
* Hack for IBM/PC -- avoids using floating point
*/
char *
util_print_time(t)
long t;
{
static char s[40];
//(void) sprintf(s, "%ld.%02ld sec", 0/1000, (0%1000)/10);
(void) sprintf(s, "%ld.%03ld sec", t/1000, (t%1000));
return s;
}
/*
* util_strsav -- save a copy of a string
*/
char *
util_strsav(s)
char *s;
{
return strcpy(ALLOC(char, strlen(s)+1), s);
}
|
05e582e204684adb10bcb30813b692d2eabad3fd
|
8cd51b4885680c073566f16236cd68d3f4296399
|
/inputcontext/QskInputContextGlobal.h
|
2e1437e6b9018909114a9c318a3b26215d0cd383
|
[
"BSD-3-Clause"
] |
permissive
|
uwerat/qskinny
|
0e0c6552afa020382bfa08453a5636b19ae8ff49
|
bf2c2b981e3a6ea1187826645da4fab75723222c
|
refs/heads/master
| 2023-08-21T16:27:56.371179
| 2023-08-10T17:54:06
| 2023-08-10T17:54:06
| 97,966,439
| 1,074
| 226
|
BSD-3-Clause
| 2023-08-10T17:12:01
| 2017-07-21T16:16:18
|
C++
|
UTF-8
|
C
| false
| false
| 682
|
h
|
QskInputContextGlobal.h
|
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#ifndef QSK_INPUTCONTEXT_GLOBAL_H
#define QSK_INPUTCONTEXT_GLOBAL_H
#include "QskGlobal.h"
#ifdef QSK_DLL
#if defined( QSK_INPUTCONTEXT_MAKEDLL ) // create a DLL library
#define QSK_INPUTCONTEXT_EXPORT Q_DECL_EXPORT
#else // use a DLL library
#define QSK_INPUTCONTEXT_EXPORT Q_DECL_IMPORT
#endif
#endif // QSK_DLL
#ifndef QSK_INPUTCONTEXT_EXPORT
#define QSK_INPUTCONTEXT_EXPORT
#endif
#endif
|
e4ee5ed2e10d9101a7ec6f87b89355528e545474
|
28d0f8c01599f8f6c711bdde0b59f9c2cd221203
|
/sys/sys/mbuf.h
|
07597e59dd53eb585d0759330baa651b2a5d971a
|
[
"BSD-2-Clause"
] |
permissive
|
NetBSD/src
|
1a9cbc22ed778be638b37869ed4fb5c8dd616166
|
23ee83f7c0aea0777bd89d8ebd7f0cde9880d13c
|
refs/heads/trunk
| 2023-08-31T13:24:58.105962
| 2023-08-27T15:50:47
| 2023-08-27T15:50:47
| 88,439,547
| 656
| 348
| null | 2023-07-20T20:07:24
| 2017-04-16T20:03:43
| null |
UTF-8
|
C
| false
| false
| 31,938
|
h
|
mbuf.h
|
/* $NetBSD: mbuf.h,v 1.238 2023/04/12 06:48:08 riastradh Exp $ */
/*
* Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
* NASA Ames Research Center and Matt Thomas of 3am Software Foundry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Copyright (c) 1982, 1986, 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)mbuf.h 8.5 (Berkeley) 2/19/95
*/
#ifndef _SYS_MBUF_H_
#define _SYS_MBUF_H_
#ifdef _KERNEL_OPT
#include "opt_mbuftrace.h"
#endif
#ifndef M_WAITOK
#include <sys/malloc.h>
#endif
#include <sys/pool.h>
#include <sys/queue.h>
#if defined(_KERNEL)
#include <sys/percpu_types.h>
#include <sys/socket.h> /* for AF_UNSPEC */
#include <sys/psref.h>
#endif /* defined(_KERNEL) */
/* For offsetof() */
#if defined(_KERNEL) || defined(_STANDALONE)
#include <sys/systm.h>
#else
#include <stddef.h>
#endif
#include <uvm/uvm_param.h> /* for MIN_PAGE_SIZE */
#include <net/if.h>
/*
* Mbufs are of a single size, MSIZE (machine/param.h), which
* includes overhead. An mbuf may add a single "mbuf cluster" of size
* MCLBYTES (also in machine/param.h), which has no additional overhead
* and is used instead of the internal data area; this is done when
* at least MINCLSIZE of data must be stored.
*/
/* Packet tags structure */
struct m_tag {
SLIST_ENTRY(m_tag) m_tag_link; /* List of packet tags */
uint16_t m_tag_id; /* Tag ID */
uint16_t m_tag_len; /* Length of data */
};
/* mbuf ownership structure */
struct mowner {
char mo_name[16]; /* owner name (fxp0) */
char mo_descr[16]; /* owner description (input) */
LIST_ENTRY(mowner) mo_link; /* */
struct percpu *mo_counters;
};
#define MOWNER_INIT(x, y) { .mo_name = x, .mo_descr = y }
enum mowner_counter_index {
MOWNER_COUNTER_CLAIMS, /* # of small mbuf claimed */
MOWNER_COUNTER_RELEASES, /* # of small mbuf released */
MOWNER_COUNTER_CLUSTER_CLAIMS, /* # of cluster mbuf claimed */
MOWNER_COUNTER_CLUSTER_RELEASES,/* # of cluster mbuf released */
MOWNER_COUNTER_EXT_CLAIMS, /* # of M_EXT mbuf claimed */
MOWNER_COUNTER_EXT_RELEASES, /* # of M_EXT mbuf released */
MOWNER_COUNTER_NCOUNTERS,
};
#if defined(_KERNEL)
struct mowner_counter {
u_long mc_counter[MOWNER_COUNTER_NCOUNTERS];
};
#endif
/* userland-exported version of struct mowner */
struct mowner_user {
char mo_name[16]; /* owner name (fxp0) */
char mo_descr[16]; /* owner description (input) */
LIST_ENTRY(mowner) mo_link; /* unused padding; for compatibility */
u_long mo_counter[MOWNER_COUNTER_NCOUNTERS]; /* counters */
};
/*
* Macros for type conversion
* mtod(m,t) - convert mbuf pointer to data pointer of correct type
*/
#define mtod(m, t) ((t)((m)->m_data))
/* header at beginning of each mbuf */
struct m_hdr {
struct mbuf *mh_next; /* next buffer in chain */
struct mbuf *mh_nextpkt; /* next chain in queue/record */
char *mh_data; /* location of data */
struct mowner *mh_owner; /* mbuf owner */
int mh_len; /* amount of data in this mbuf */
int mh_flags; /* flags; see below */
paddr_t mh_paddr; /* physical address of mbuf */
short mh_type; /* type of data in this mbuf */
};
/*
* record/packet header in first mbuf of chain; valid if M_PKTHDR set
*
* A note about csum_data:
*
* o For the out-bound direction, the low 16 bits indicates the offset after
* the L4 header where the final L4 checksum value is to be stored and the
* high 16 bits is the length of the L3 header (the start of the data to
* be checksummed).
*
* o For the in-bound direction, it is only valid if the M_CSUM_DATA flag is
* set. In this case, an L4 checksum has been calculated by hardware and
* is stored in csum_data, but it is up to software to perform final
* verification.
*
* Note for in-bound TCP/UDP checksums: we expect the csum_data to NOT
* be bit-wise inverted (the final step in the calculation of an IP
* checksum) -- this is so we can accumulate the checksum for fragmented
* packets during reassembly.
*
* Size ILP32: 40
* LP64: 56
*/
struct pkthdr {
union {
void *ctx; /* for M_GETCTX/M_SETCTX */
if_index_t index; /* rcv interface index */
} _rcvif;
#define rcvif_index _rcvif.index
SLIST_HEAD(packet_tags, m_tag) tags; /* list of packet tags */
int len; /* total packet length */
int csum_flags; /* checksum flags */
uint32_t csum_data; /* checksum data */
u_int segsz; /* segment size */
uint16_t ether_vtag; /* ethernet 802.1p+q vlan tag */
uint16_t pkthdr_flags; /* flags for pkthdr, see blow */
#define PKTHDR_FLAG_IPSEC_SKIP_PFIL 0x0001 /* skip pfil_run_hooks() after ipsec decrypt */
/*
* Following three fields are open-coded struct altq_pktattr
* to rearrange struct pkthdr fields flexibly.
*/
int pattr_af; /* ALTQ: address family */
void *pattr_class; /* ALTQ: sched class set by classifier */
void *pattr_hdr; /* ALTQ: saved header position in mbuf */
};
/* Checksumming flags (csum_flags). */
#define M_CSUM_TCPv4 0x00000001 /* TCP header/payload */
#define M_CSUM_UDPv4 0x00000002 /* UDP header/payload */
#define M_CSUM_TCP_UDP_BAD 0x00000004 /* TCP/UDP checksum bad */
#define M_CSUM_DATA 0x00000008 /* consult csum_data */
#define M_CSUM_TCPv6 0x00000010 /* IPv6 TCP header/payload */
#define M_CSUM_UDPv6 0x00000020 /* IPv6 UDP header/payload */
#define M_CSUM_IPv4 0x00000040 /* IPv4 header */
#define M_CSUM_IPv4_BAD 0x00000080 /* IPv4 header checksum bad */
#define M_CSUM_TSOv4 0x00000100 /* TCPv4 segmentation offload */
#define M_CSUM_TSOv6 0x00000200 /* TCPv6 segmentation offload */
/* Checksum-assist quirks: keep separate from jump-table bits. */
#define M_CSUM_BLANK 0x40000000 /* csum is missing */
#define M_CSUM_NO_PSEUDOHDR 0x80000000 /* Rx csum_data does not include
* the UDP/TCP pseudo-hdr, and
* is not yet 1s-complemented.
*/
#define M_CSUM_BITS \
"\20\1TCPv4\2UDPv4\3TCP_UDP_BAD\4DATA\5TCPv6\6UDPv6\7IPv4\10IPv4_BAD" \
"\11TSOv4\12TSOv6\39BLANK\40NO_PSEUDOHDR"
/*
* Macros for manipulating csum_data on outgoing packets. These are
* used to pass information down from the L4/L3 to the L2.
*
* _IPHL: Length of the IPv{4/6} header, plus the options; in other
* words the offset of the UDP/TCP header in the packet.
* _OFFSET: Offset of the checksum field in the UDP/TCP header.
*/
#define M_CSUM_DATA_IPv4_IPHL(x) ((x) >> 16)
#define M_CSUM_DATA_IPv4_OFFSET(x) ((x) & 0xffff)
#define M_CSUM_DATA_IPv6_IPHL(x) ((x) >> 16)
#define M_CSUM_DATA_IPv6_OFFSET(x) ((x) & 0xffff)
#define M_CSUM_DATA_IPv6_SET(x, v) (x) = ((x) & 0xffff) | ((v) << 16)
/*
* Max # of pages we can attach to m_ext. This is carefully chosen
* to be able to handle SOSEND_LOAN_CHUNK with our minimum sized page.
*/
#ifdef MIN_PAGE_SIZE
#define M_EXT_MAXPAGES ((65536 / MIN_PAGE_SIZE) + 1)
#endif
/*
* Description of external storage mapped into mbuf, valid if M_EXT set.
*/
struct _m_ext_storage {
unsigned int ext_refcnt;
char *ext_buf; /* start of buffer */
void (*ext_free) /* free routine if not the usual */
(struct mbuf *, void *, size_t, void *);
void *ext_arg; /* argument for ext_free */
size_t ext_size; /* size of buffer, for ext_free */
union {
/* M_EXT_CLUSTER: physical address */
paddr_t extun_paddr;
#ifdef M_EXT_MAXPAGES
/* M_EXT_PAGES: pages */
struct vm_page *extun_pgs[M_EXT_MAXPAGES];
#endif
} ext_un;
#define ext_paddr ext_un.extun_paddr
#define ext_pgs ext_un.extun_pgs
};
struct _m_ext {
struct mbuf *ext_ref;
struct _m_ext_storage ext_storage;
};
#define M_PADDR_INVALID POOL_PADDR_INVALID
/*
* Definition of "struct mbuf".
* Don't change this without understanding how MHLEN/MLEN are defined.
*/
#define MBUF_DEFINE(name, mhlen, mlen) \
struct name { \
struct m_hdr m_hdr; \
union { \
struct { \
struct pkthdr MH_pkthdr; \
union { \
struct _m_ext MH_ext; \
char MH_databuf[(mhlen)]; \
} MH_dat; \
} MH; \
char M_databuf[(mlen)]; \
} M_dat; \
}
#define m_next m_hdr.mh_next
#define m_len m_hdr.mh_len
#define m_data m_hdr.mh_data
#define m_owner m_hdr.mh_owner
#define m_type m_hdr.mh_type
#define m_flags m_hdr.mh_flags
#define m_nextpkt m_hdr.mh_nextpkt
#define m_paddr m_hdr.mh_paddr
#define m_pkthdr M_dat.MH.MH_pkthdr
#define m_ext_storage M_dat.MH.MH_dat.MH_ext.ext_storage
#define m_ext_ref M_dat.MH.MH_dat.MH_ext.ext_ref
#define m_ext m_ext_ref->m_ext_storage
#define m_pktdat M_dat.MH.MH_dat.MH_databuf
#define m_dat M_dat.M_databuf
/*
* Dummy mbuf structure to calculate the right values for MLEN/MHLEN, taking
* into account inter-structure padding.
*/
MBUF_DEFINE(_mbuf_dummy, 1, 1);
/* normal data len */
#define MLEN ((int)(MSIZE - offsetof(struct _mbuf_dummy, m_dat)))
/* data len w/pkthdr */
#define MHLEN ((int)(MSIZE - offsetof(struct _mbuf_dummy, m_pktdat)))
#define MINCLSIZE (MHLEN+MLEN+1) /* smallest amount to put in cluster */
/*
* The *real* struct mbuf
*/
MBUF_DEFINE(mbuf, MHLEN, MLEN);
/* mbuf flags */
#define M_EXT 0x00000001 /* has associated external storage */
#define M_PKTHDR 0x00000002 /* start of record */
#define M_EOR 0x00000004 /* end of record */
#define M_PROTO1 0x00000008 /* protocol-specific */
/* mbuf pkthdr flags, also in m_flags */
#define M_AUTHIPHDR 0x00000010 /* authenticated (IPsec) */
#define M_DECRYPTED 0x00000020 /* decrypted (IPsec) */
#define M_LOOP 0x00000040 /* received on loopback */
#define M_BCAST 0x00000100 /* send/received as L2 broadcast */
#define M_MCAST 0x00000200 /* send/received as L2 multicast */
#define M_CANFASTFWD 0x00000400 /* packet can be fast-forwarded */
#define M_ANYCAST6 0x00000800 /* received as IPv6 anycast */
#define M_LINK0 0x00001000 /* link layer specific flag */
#define M_LINK1 0x00002000 /* link layer specific flag */
#define M_LINK2 0x00004000 /* link layer specific flag */
#define M_LINK3 0x00008000 /* link layer specific flag */
#define M_LINK4 0x00010000 /* link layer specific flag */
#define M_LINK5 0x00020000 /* link layer specific flag */
#define M_LINK6 0x00040000 /* link layer specific flag */
#define M_LINK7 0x00080000 /* link layer specific flag */
#define M_VLANTAG 0x00100000 /* ether_vtag is valid */
/* additional flags for M_EXT mbufs */
#define M_EXT_FLAGS 0xff000000
#define M_EXT_CLUSTER 0x01000000 /* ext is a cluster */
#define M_EXT_PAGES 0x02000000 /* ext_pgs is valid */
#define M_EXT_ROMAP 0x04000000 /* ext mapping is r-o at MMU */
#define M_EXT_RW 0x08000000 /* ext storage is writable */
/* for source-level compatibility */
#define M_NOTIFICATION M_PROTO1
#define M_FLAGS_BITS \
"\20\1EXT\2PKTHDR\3EOR\4PROTO1\5AUTHIPHDR\6DECRYPTED\7LOOP\10NONE" \
"\11BCAST\12MCAST\13CANFASTFWD\14ANYCAST6\15LINK0\16LINK1\17LINK2\20LINK3" \
"\21LINK4\22LINK5\23LINK6\24LINK7" \
"\25VLANTAG" \
"\31EXT_CLUSTER\32EXT_PAGES\33EXT_ROMAP\34EXT_RW"
/* flags copied when copying m_pkthdr */
#define M_COPYFLAGS (M_PKTHDR|M_EOR|M_BCAST|M_MCAST|M_CANFASTFWD| \
M_ANYCAST6|M_LINK0|M_LINK1|M_LINK2|M_AUTHIPHDR|M_DECRYPTED|M_LOOP| \
M_VLANTAG)
/* flag copied when shallow-copying external storage */
#define M_EXTCOPYFLAGS (M_EXT|M_EXT_FLAGS)
/* mbuf types */
#define MT_FREE 0 /* should be on free list */
#define MT_DATA 1 /* dynamic (data) allocation */
#define MT_HEADER 2 /* packet header */
#define MT_SONAME 3 /* socket name */
#define MT_SOOPTS 4 /* socket options */
#define MT_FTABLE 5 /* fragment reassembly header */
#define MT_CONTROL 6 /* extra-data protocol message */
#define MT_OOBDATA 7 /* expedited data */
#ifdef MBUFTYPES
const char * const mbuftypes[] = {
"mbfree",
"mbdata",
"mbheader",
"mbsoname",
"mbsopts",
"mbftable",
"mbcontrol",
"mboobdata",
};
#else
extern const char * const mbuftypes[];
#endif
/* flags to m_get/MGET */
#define M_DONTWAIT M_NOWAIT
#define M_WAIT M_WAITOK
#ifdef MBUFTRACE
/* Mbuf allocation tracing. */
void mowner_init_owner(struct mowner *, const char *, const char *);
void mowner_init(struct mbuf *, int);
void mowner_ref(struct mbuf *, int);
void m_claim(struct mbuf *, struct mowner *);
void mowner_revoke(struct mbuf *, bool, int);
void mowner_attach(struct mowner *);
void mowner_detach(struct mowner *);
void m_claimm(struct mbuf *, struct mowner *);
#else
#define mowner_init_owner(mo, n, d) __nothing
#define mowner_init(m, type) __nothing
#define mowner_ref(m, flags) __nothing
#define mowner_revoke(m, all, flags) __nothing
#define m_claim(m, mowner) __nothing
#define mowner_attach(mo) __nothing
#define mowner_detach(mo) __nothing
#define m_claimm(m, mo) __nothing
#endif
#define MCLAIM(m, mo) m_claim((m), (mo))
#define MOWNER_ATTACH(mo) mowner_attach(mo)
#define MOWNER_DETACH(mo) mowner_detach(mo)
/*
* mbuf allocation/deallocation macros:
*
* MGET(struct mbuf *m, int how, int type)
* allocates an mbuf and initializes it to contain internal data.
*
* MGETHDR(struct mbuf *m, int how, int type)
* allocates an mbuf and initializes it to contain a packet header
* and internal data.
*
* If 'how' is M_WAIT, these macros (and the corresponding functions)
* are guaranteed to return successfully.
*/
#define MGET(m, how, type) m = m_get((how), (type))
#define MGETHDR(m, how, type) m = m_gethdr((how), (type))
#if defined(_KERNEL)
#define MCLINITREFERENCE(m) \
do { \
KASSERT(((m)->m_flags & M_EXT) == 0); \
(m)->m_ext_ref = (m); \
(m)->m_ext.ext_refcnt = 1; \
} while (/* CONSTCOND */ 0)
/*
* Macros for mbuf external storage.
*
* MCLGET allocates and adds an mbuf cluster to a normal mbuf;
* the flag M_EXT is set upon success.
*
* MEXTMALLOC allocates external storage and adds it to
* a normal mbuf; the flag M_EXT is set upon success.
*
* MEXTADD adds pre-allocated external storage to
* a normal mbuf; the flag M_EXT is set upon success.
*/
#define MCLGET(m, how) m_clget((m), (how))
#define MEXTMALLOC(m, size, how) \
do { \
(m)->m_ext_storage.ext_buf = malloc((size), 0, (how)); \
if ((m)->m_ext_storage.ext_buf != NULL) { \
MCLINITREFERENCE(m); \
(m)->m_data = (m)->m_ext.ext_buf; \
(m)->m_flags = ((m)->m_flags & ~M_EXTCOPYFLAGS) | \
M_EXT|M_EXT_RW; \
(m)->m_ext.ext_size = (size); \
(m)->m_ext.ext_free = NULL; \
(m)->m_ext.ext_arg = NULL; \
mowner_ref((m), M_EXT); \
} \
} while (/* CONSTCOND */ 0)
#define MEXTADD(m, buf, size, type, free, arg) \
do { \
MCLINITREFERENCE(m); \
(m)->m_data = (m)->m_ext.ext_buf = (char *)(buf); \
(m)->m_flags = ((m)->m_flags & ~M_EXTCOPYFLAGS) | M_EXT; \
(m)->m_ext.ext_size = (size); \
(m)->m_ext.ext_free = (free); \
(m)->m_ext.ext_arg = (arg); \
mowner_ref((m), M_EXT); \
} while (/* CONSTCOND */ 0)
#define M_BUFADDR(m) \
(((m)->m_flags & M_EXT) ? (m)->m_ext.ext_buf : \
((m)->m_flags & M_PKTHDR) ? (m)->m_pktdat : (m)->m_dat)
#define M_BUFSIZE(m) \
(((m)->m_flags & M_EXT) ? (m)->m_ext.ext_size : \
((m)->m_flags & M_PKTHDR) ? MHLEN : MLEN)
#define MRESETDATA(m) (m)->m_data = M_BUFADDR(m)
/*
* Compute the offset of the beginning of the data buffer of a non-ext
* mbuf.
*/
#define M_BUFOFFSET(m) \
(((m)->m_flags & M_PKTHDR) ? \
offsetof(struct mbuf, m_pktdat) : offsetof(struct mbuf, m_dat))
/*
* Determine if an mbuf's data area is read-only. This is true
* if external storage is read-only mapped, or not marked as R/W,
* or referenced by more than one mbuf.
*/
#define M_READONLY(m) \
(((m)->m_flags & M_EXT) != 0 && \
(((m)->m_flags & (M_EXT_ROMAP|M_EXT_RW)) != M_EXT_RW || \
(m)->m_ext.ext_refcnt > 1))
#define M_UNWRITABLE(__m, __len) \
((__m)->m_len < (__len) || M_READONLY((__m)))
/*
* Determine if an mbuf's data area is read-only at the MMU.
*/
#define M_ROMAP(m) \
(((m)->m_flags & (M_EXT|M_EXT_ROMAP)) == (M_EXT|M_EXT_ROMAP))
/*
* Compute the amount of space available before the current start of
* data in an mbuf.
*/
#define M_LEADINGSPACE(m) \
(M_READONLY((m)) ? 0 : ((m)->m_data - M_BUFADDR(m)))
/*
* Compute the amount of space available
* after the end of data in an mbuf.
*/
#define _M_TRAILINGSPACE(m) \
((m)->m_flags & M_EXT ? (m)->m_ext.ext_buf + (m)->m_ext.ext_size - \
((m)->m_data + (m)->m_len) : \
&(m)->m_dat[MLEN] - ((m)->m_data + (m)->m_len))
#define M_TRAILINGSPACE(m) \
(M_READONLY((m)) ? 0 : _M_TRAILINGSPACE((m)))
/*
* Arrange to prepend space of size plen to mbuf m.
* If a new mbuf must be allocated, how specifies whether to wait.
* If how is M_DONTWAIT and allocation fails, the original mbuf chain
* is freed and m is set to NULL.
*/
#define M_PREPEND(m, plen, how) \
do { \
if (M_LEADINGSPACE(m) >= (plen)) { \
(m)->m_data -= (plen); \
(m)->m_len += (plen); \
} else \
(m) = m_prepend((m), (plen), (how)); \
if ((m) && (m)->m_flags & M_PKTHDR) \
(m)->m_pkthdr.len += (plen); \
} while (/* CONSTCOND */ 0)
/* change mbuf to new type */
#define MCHTYPE(m, t) \
do { \
KASSERT((t) != MT_FREE); \
mbstat_type_add((m)->m_type, -1); \
mbstat_type_add(t, 1); \
(m)->m_type = t; \
} while (/* CONSTCOND */ 0)
#ifdef DIAGNOSTIC
#define M_VERIFY_PACKET(m) m_verify_packet(m)
#else
#define M_VERIFY_PACKET(m) __nothing
#endif
/* The "copy all" special length. */
#define M_COPYALL -1
/*
* Allow drivers and/or protocols to store private context information.
*/
#define M_GETCTX(m, t) ((t)(m)->m_pkthdr._rcvif.ctx)
#define M_SETCTX(m, c) ((void)((m)->m_pkthdr._rcvif.ctx = (void *)(c)))
#define M_CLEARCTX(m) M_SETCTX((m), NULL)
/*
* M_REGION_GET ensures that the "len"-sized region of type "typ" starting
* from "off" within "m" is located in a single mbuf, contiguously.
*
* The pointer to the region will be returned to pointer variable "val".
*/
#define M_REGION_GET(val, typ, m, off, len) \
do { \
struct mbuf *_t; \
int _tmp; \
if ((m)->m_len >= (off) + (len)) \
(val) = (typ)(mtod((m), char *) + (off)); \
else { \
_t = m_pulldown((m), (off), (len), &_tmp); \
if (_t) { \
if (_t->m_len < _tmp + (len)) \
panic("m_pulldown malfunction"); \
(val) = (typ)(mtod(_t, char *) + _tmp); \
} else { \
(val) = (typ)NULL; \
(m) = NULL; \
} \
} \
} while (/*CONSTCOND*/ 0)
#endif /* defined(_KERNEL) */
/*
* Simple mbuf queueing system
*
* this is basically a SIMPLEQ adapted to mbuf use (ie using
* m_nextpkt instead of field.sqe_next).
*
* m_next is ignored, so queueing chains of mbufs is possible
*/
#define MBUFQ_HEAD(name) \
struct name { \
struct mbuf *mq_first; \
struct mbuf **mq_last; \
}
#define MBUFQ_INIT(q) do { \
(q)->mq_first = NULL; \
(q)->mq_last = &(q)->mq_first; \
} while (/*CONSTCOND*/0)
#define MBUFQ_ENQUEUE(q, m) do { \
(m)->m_nextpkt = NULL; \
*(q)->mq_last = (m); \
(q)->mq_last = &(m)->m_nextpkt; \
} while (/*CONSTCOND*/0)
#define MBUFQ_PREPEND(q, m) do { \
if (((m)->m_nextpkt = (q)->mq_first) == NULL) \
(q)->mq_last = &(m)->m_nextpkt; \
(q)->mq_first = (m); \
} while (/*CONSTCOND*/0)
#define MBUFQ_DEQUEUE(q, m) do { \
if (((m) = (q)->mq_first) != NULL) { \
if (((q)->mq_first = (m)->m_nextpkt) == NULL) \
(q)->mq_last = &(q)->mq_first; \
else \
(m)->m_nextpkt = NULL; \
} \
} while (/*CONSTCOND*/0)
#define MBUFQ_DRAIN(q) do { \
struct mbuf *__m0; \
while ((__m0 = (q)->mq_first) != NULL) { \
(q)->mq_first = __m0->m_nextpkt; \
m_freem(__m0); \
} \
(q)->mq_last = &(q)->mq_first; \
} while (/*CONSTCOND*/0)
#define MBUFQ_FIRST(q) ((q)->mq_first)
#define MBUFQ_NEXT(m) ((m)->m_nextpkt)
#define MBUFQ_LAST(q) (*(q)->mq_last)
/*
* Mbuf statistics.
* For statistics related to mbuf and cluster allocations, see also the
* pool headers (mb_cache and mcl_cache).
*/
struct mbstat {
u_long _m_spare; /* formerly m_mbufs */
u_long _m_spare1; /* formerly m_clusters */
u_long _m_spare2; /* spare field */
u_long _m_spare3; /* formely m_clfree - free clusters */
u_long m_drops; /* times failed to find space */
u_long m_wait; /* times waited for space */
u_long m_drain; /* times drained protocols for space */
u_short m_mtypes[256]; /* type specific mbuf allocations */
};
struct mbstat_cpu {
u_int m_mtypes[256]; /* type specific mbuf allocations */
};
/*
* Mbuf sysctl variables.
*/
#define MBUF_MSIZE 1 /* int: mbuf base size */
#define MBUF_MCLBYTES 2 /* int: mbuf cluster size */
#define MBUF_NMBCLUSTERS 3 /* int: limit on the # of clusters */
#define MBUF_MBLOWAT 4 /* int: mbuf low water mark */
#define MBUF_MCLLOWAT 5 /* int: mbuf cluster low water mark */
#define MBUF_STATS 6 /* struct: mbstat */
#define MBUF_MOWNERS 7 /* struct: m_owner[] */
#define MBUF_NMBCLUSTERS_LIMIT 8 /* int: limit of nmbclusters */
#ifdef _KERNEL
extern struct mbstat mbstat;
extern int nmbclusters; /* limit on the # of clusters */
extern int mblowat; /* mbuf low water mark */
extern int mcllowat; /* mbuf cluster low water mark */
extern int max_linkhdr; /* largest link-level header */
extern int max_protohdr; /* largest protocol header */
extern int max_hdr; /* largest link+protocol header */
extern int max_datalen; /* MHLEN - max_hdr */
extern const int msize; /* mbuf base size */
extern const int mclbytes; /* mbuf cluster size */
extern pool_cache_t mb_cache;
#ifdef MBUFTRACE
LIST_HEAD(mownerhead, mowner);
extern struct mownerhead mowners;
extern struct mowner unknown_mowners[];
extern struct mowner revoked_mowner;
#endif
MALLOC_DECLARE(M_MBUF);
MALLOC_DECLARE(M_SONAME);
struct mbuf *m_copym(struct mbuf *, int, int, int);
struct mbuf *m_copypacket(struct mbuf *, int);
struct mbuf *m_devget(char *, int, int, struct ifnet *);
struct mbuf *m_dup(struct mbuf *, int, int, int);
struct mbuf *m_get(int, int);
struct mbuf *m_gethdr(int, int);
struct mbuf *m_get_n(int, int, size_t, size_t);
struct mbuf *m_gethdr_n(int, int, size_t, size_t);
struct mbuf *m_prepend(struct mbuf *,int, int);
struct mbuf *m_pulldown(struct mbuf *, int, int, int *);
struct mbuf *m_pullup(struct mbuf *, int);
struct mbuf *m_copyup(struct mbuf *, int, int);
struct mbuf *m_split(struct mbuf *,int, int);
struct mbuf *m_getptr(struct mbuf *, int, int *);
void m_adj(struct mbuf *, int);
struct mbuf *m_defrag(struct mbuf *, int);
int m_apply(struct mbuf *, int, int,
int (*)(void *, void *, unsigned int), void *);
void m_cat(struct mbuf *,struct mbuf *);
void m_clget(struct mbuf *, int);
void m_copyback(struct mbuf *, int, int, const void *);
struct mbuf *m_copyback_cow(struct mbuf *, int, int, const void *, int);
int m_makewritable(struct mbuf **, int, int, int);
struct mbuf *m_getcl(int, int, int);
void m_copydata(struct mbuf *, int, int, void *);
void m_verify_packet(struct mbuf *);
struct mbuf *m_free(struct mbuf *);
void m_freem(struct mbuf *);
void mbinit(void);
void m_remove_pkthdr(struct mbuf *);
void m_copy_pkthdr(struct mbuf *, struct mbuf *);
void m_move_pkthdr(struct mbuf *, struct mbuf *);
void m_align(struct mbuf *, int);
bool m_ensure_contig(struct mbuf **, int);
struct mbuf *m_add(struct mbuf *, struct mbuf *);
/* Inline routines. */
static __inline u_int m_length(const struct mbuf *) __unused;
/* Statistics */
void mbstat_type_add(int, int);
/* Packet tag routines */
struct m_tag *m_tag_get(int, int, int);
void m_tag_free(struct m_tag *);
void m_tag_prepend(struct mbuf *, struct m_tag *);
void m_tag_unlink(struct mbuf *, struct m_tag *);
void m_tag_delete(struct mbuf *, struct m_tag *);
void m_tag_delete_chain(struct mbuf *);
struct m_tag *m_tag_find(const struct mbuf *, int);
struct m_tag *m_tag_copy(struct m_tag *);
int m_tag_copy_chain(struct mbuf *, struct mbuf *);
/* Packet tag types */
#define PACKET_TAG_NONE 0 /* Nothing */
#define PACKET_TAG_SO 4 /* sending socket pointer */
#define PACKET_TAG_NPF 10 /* packet filter */
#define PACKET_TAG_PF 11 /* packet filter */
#define PACKET_TAG_ALTQ_QID 12 /* ALTQ queue id */
#define PACKET_TAG_IPSEC_OUT_DONE 18
#define PACKET_TAG_IPSEC_NAT_T_PORTS 25 /* two uint16_t */
#define PACKET_TAG_INET6 26 /* IPv6 info */
#define PACKET_TAG_TUNNEL_INFO 28 /* tunnel identification and
* protocol callback, for loop
* detection/recovery
*/
#define PACKET_TAG_MPLS 29 /* Indicate it's for MPLS */
#define PACKET_TAG_SRCROUTE 30 /* IPv4 source routing */
#define PACKET_TAG_ETHERNET_SRC 31 /* Ethernet source address */
/*
* Return the number of bytes in the mbuf chain, m.
*/
static __inline u_int
m_length(const struct mbuf *m)
{
const struct mbuf *m0;
u_int pktlen;
if ((m->m_flags & M_PKTHDR) != 0)
return m->m_pkthdr.len;
pktlen = 0;
for (m0 = m; m0 != NULL; m0 = m0->m_next)
pktlen += m0->m_len;
return pktlen;
}
static __inline void
m_set_rcvif(struct mbuf *m, const struct ifnet *ifp)
{
KASSERT(m->m_flags & M_PKTHDR);
m->m_pkthdr.rcvif_index = ifp->if_index;
}
static __inline void
m_reset_rcvif(struct mbuf *m)
{
KASSERT(m->m_flags & M_PKTHDR);
/* A caller may expect whole _rcvif union is zeroed */
/* m->m_pkthdr.rcvif_index = 0; */
m->m_pkthdr._rcvif.ctx = NULL;
}
static __inline void
m_copy_rcvif(struct mbuf *m, const struct mbuf *n)
{
KASSERT(m->m_flags & M_PKTHDR);
KASSERT(n->m_flags & M_PKTHDR);
m->m_pkthdr.rcvif_index = n->m_pkthdr.rcvif_index;
}
#define M_GET_ALIGNED_HDR(m, type, linkhdr) \
m_get_aligned_hdr((m), __alignof(type) - 1, sizeof(type), (linkhdr))
static __inline int
m_get_aligned_hdr(struct mbuf **m, int mask, size_t hlen, bool linkhdr)
{
#ifndef __NO_STRICT_ALIGNMENT
if (((uintptr_t)mtod(*m, void *) & mask) != 0)
*m = m_copyup(*m, hlen,
linkhdr ? (max_linkhdr + mask) & ~mask : 0);
else
#endif
if (__predict_false((size_t)(*m)->m_len < hlen))
*m = m_pullup(*m, hlen);
return *m == NULL;
}
void m_print(const struct mbuf *, const char *, void (*)(const char *, ...)
__printflike(1, 2));
/* from uipc_mbufdebug.c */
void m_examine(const struct mbuf *, int, const char *,
void (*)(const char *, ...) __printflike(1, 2));
/* parsers for m_examine() */
void m_examine_ether(const struct mbuf *, int, const char *,
void (*)(const char *, ...) __printflike(1, 2));
void m_examine_pppoe(const struct mbuf *, int, const char *,
void (*)(const char *, ...) __printflike(1, 2));
void m_examine_ppp(const struct mbuf *, int, const char *,
void (*)(const char *, ...) __printflike(1, 2));
void m_examine_arp(const struct mbuf *, int, const char *,
void (*)(const char *, ...) __printflike(1, 2));
void m_examine_ip(const struct mbuf *, int, const char *,
void (*)(const char *, ...) __printflike(1, 2));
void m_examine_icmp(const struct mbuf *, int, const char *,
void (*)(const char *, ...) __printflike(1, 2));
void m_examine_ip6(const struct mbuf *, int, const char *,
void (*)(const char *, ...) __printflike(1, 2));
void m_examine_icmp6(const struct mbuf *, int, const char *,
void (*)(const char *, ...) __printflike(1, 2));
void m_examine_tcp(const struct mbuf *, int, const char *,
void (*)(const char *, ...) __printflike(1, 2));
void m_examine_udp(const struct mbuf *, int, const char *,
void (*)(const char *, ...) __printflike(1, 2));
void m_examine_hex(const struct mbuf *, int, const char *,
void (*)(const char *, ...) __printflike(1, 2));
/*
* Get rcvif of a mbuf.
*
* The caller must call m_put_rcvif after using rcvif if the returned rcvif
* isn't NULL. If the returned rcvif is NULL, the caller doesn't need to call
* m_put_rcvif (although calling it is safe).
*
* The caller must not block or sleep while using rcvif. The API ensures a
* returned rcvif isn't freed until m_put_rcvif is called.
*/
static __inline struct ifnet *
m_get_rcvif(const struct mbuf *m, int *s)
{
struct ifnet *ifp;
KASSERT(m->m_flags & M_PKTHDR);
*s = pserialize_read_enter();
ifp = if_byindex(m->m_pkthdr.rcvif_index);
if (__predict_false(ifp == NULL))
pserialize_read_exit(*s);
return ifp;
}
static __inline void
m_put_rcvif(struct ifnet *ifp, int *s)
{
if (ifp == NULL)
return;
pserialize_read_exit(*s);
}
/*
* Get rcvif of a mbuf.
*
* The caller must call m_put_rcvif_psref after using rcvif. The API ensures
* a got rcvif isn't be freed until m_put_rcvif_psref is called.
*/
static __inline struct ifnet *
m_get_rcvif_psref(const struct mbuf *m, struct psref *psref)
{
KASSERT(m->m_flags & M_PKTHDR);
return if_get_byindex(m->m_pkthdr.rcvif_index, psref);
}
static __inline void
m_put_rcvif_psref(struct ifnet *ifp, struct psref *psref)
{
if (ifp == NULL)
return;
if_put(ifp, psref);
}
/*
* Get rcvif of a mbuf.
*
* This is NOT an MP-safe API and shouldn't be used at where we want MP-safe.
*/
static __inline struct ifnet *
m_get_rcvif_NOMPSAFE(const struct mbuf *m)
{
KASSERT(m->m_flags & M_PKTHDR);
return if_byindex(m->m_pkthdr.rcvif_index);
}
#endif /* _KERNEL */
#endif /* !_SYS_MBUF_H_ */
|
863b074e4d66859eaaf7e915800b6239a17c6f07
|
fb0f9abad373cd635c2635bbdf491ea0f32da5ff
|
/src/mono/mono/metadata/sgen-toggleref.h
|
3c9741017ed0e0038f9004f9e33f68968739c36e
|
[
"MIT"
] |
permissive
|
dotnet/runtime
|
f6fd23936752e202f8e4d6d94f3a4f3b0e77f58f
|
47bb554d298e1e34c4e3895d7731e18ad1c47d02
|
refs/heads/main
| 2023-09-03T15:35:46.493337
| 2023-09-03T08:13:23
| 2023-09-03T08:13:23
| 210,716,005
| 13,765
| 5,179
|
MIT
| 2023-09-14T21:58:52
| 2019-09-24T23:36:39
|
C#
|
UTF-8
|
C
| false
| false
| 704
|
h
|
sgen-toggleref.h
|
/**
* \file
* toggleref support for sgen
*
* Copyright 2011 Xamarin, Inc.
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
*
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#ifndef _MONO_SGEN_TOGGLEREF_H_
#define _MONO_SGEN_TOGGLEREF_H_
#include <mono/utils/mono-publib.h>
/* GC toggle ref support */
typedef enum {
MONO_TOGGLE_REF_DROP,
MONO_TOGGLE_REF_STRONG,
MONO_TOGGLE_REF_WEAK
} MonoToggleRefStatus;
MONO_API void mono_gc_toggleref_register_callback (MonoToggleRefStatus (*process_toggleref) (MonoObject *obj));
MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_toggleref_add (MonoObject *object, mono_bool strong_ref);
#endif
|
93873d408381b0943064adfdabb540d682a03e7d
|
450916eee7580beb928ed8f387db4f0a8c1aa508
|
/src/amuse/community/pikachu/src/force.h
|
6236b4e914f8993546dc9c9c9e85dd8cb615dd85
|
[
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] |
permissive
|
amusecode/amuse
|
42095545893f5a86ea79c2a52ce54d3ce8eb204f
|
b57c1e2fda1457d5025307be105c2aa59b19b574
|
refs/heads/main
| 2023-08-31T04:50:48.880044
| 2023-08-30T12:00:20
| 2023-08-30T12:00:20
| 18,516,331
| 158
| 118
|
Apache-2.0
| 2023-08-30T12:00:22
| 2014-04-07T12:35:07
|
AMPL
|
UTF-8
|
C
| false
| false
| 3,106
|
h
|
force.h
|
#ifndef FORCE_H
#define FORCE_H
#include"Matrix3.h"
inline double duncan_function_4th(const double &rij,
const double &rout,
const double &rin){
//double K = 0.0;
double x = (rij - rin)/(rout - rin);
double K = 0.0;
if(x <= 0.0){
K = 0.0;
}
else if(1.0 <= x){
K = 1.0;
}
else{
double x2 = x*x;
double x4 = x2*x2;
double x5 = x4*x;
double x6 = x4*x2;
double x7 = x6*x;
K = -20.0*x7 + 70.0*x6 - 84.0*x5 + 35.0*x4;
}
return K;
}
inline double duncan_function_4th_dot(const double &rij,
const double &rijvij,
const double &rout,
const double &rin){
//double Kdot = 0.0;
double x = (rij - rin)/(rout - rin);
double xdot = rijvij/(rij*(rout - rin));
double Kdot = 0.0;
if(x <= 0.0){
Kdot = 0.0;
}
else if(1.0 <= x){
Kdot = 0.0;
}
else{
double x2 = x*x;
double x3 = x2*x;
double x4 = x2*x2;
double x5 = x4*x;
double x6 = x4*x2;
Kdot = (-140.0*x6 + 420.0*x5 - 420.0*x4 + 140.0*x3) * xdot;
}
return Kdot;
}
inline void pairwise_acc(const double massi,
const Vector3 &posi,
Vector3 &acci,
double &poti,
const double &massj,
const Vector3 &posj,
Vector3 &accj,
double &potj,
const double &eps2,
double &r2){
Vector3 rij = posi - posj;
r2 = rij * rij;
double R2 = 1.0 / (r2 + eps2);
double R = sqrt(R2);
double R3 = R * R2;
acci -= massj * R3 * rij;
accj += massi * R3 * rij;
poti -= massj * R;
potj -= massi * R;
}
inline void calc_acc_duncan4(const Vector3 &posi,
Vector3 &acci,
double &poti,
const Vector3 &posj,
const double &massj,
const double &eps2,
const double &rcut_in,
const double &rcut_out,
double &r2){
Vector3 rij = posi - posj;
r2 = rij * rij;
if(r2 <= rcut_out*rcut_out){
double r = sqrt(r2);
double r2_eps = r2 + eps2;
double R = 1.0/sqrt(r2_eps);
double R2 = R*R;
double R3 = R2*R;
double K = duncan_function_4th(r, rcut_out, rcut_in);
Vector3 F0 = -massj * R3 * rij * (1.0-K);
acci += F0;
poti -= massj * R * (1.0-K);
}
}
inline void calc_acc_jrk_duncan4(const Vector3 &posi,
const Vector3 &veli,
Vector3 &acci,
Vector3 &jrki,
double &poti,
const Vector3 &posj,
const Vector3 &velj,
const double &massj,
const double &eps2,
const double &rcut_in,
const double &rcut_out,
double &r2){
Vector3 rij = posi - posj;
r2 = rij * rij;
if(r2 <= rcut_out*rcut_out){
Vector3 vij = veli - velj;
double rijvij = rij * vij;
double r = sqrt(r2);
double r2_eps = r2 + eps2;
double R = 1.0/sqrt(r2_eps);
double R2 = R*R;
double R3 = R2*R;
double A = (rijvij)*R2;
double K = duncan_function_4th(r, rcut_out, rcut_in);
double Kdot = duncan_function_4th_dot(r, rijvij, rcut_out, rcut_in);
Vector3 F0 = -massj * R3 * rij * (1.0-K);
Vector3 F1 = -massj * R3 * vij * (1.0-K) - 3.0 * A * F0 + massj * R3 * rij * Kdot;
acci += F0;
jrki += F1;
poti -= massj * R * (1.0-K);
}
}
#endif //FORCE_H
|
2623e869a803b4ca5631891d40eea31d6274571f
|
f9e7d65cb784c01a0200145ba8d289afe41d4a56
|
/board/twinkie/gpio.inc
|
551cb7374873261c72969ab2f9558c017774af25
|
[
"BSD-3-Clause"
] |
permissive
|
FrameworkComputer/EmbeddedController
|
ad7086769e87d0a4179eae96a7c9ff5e383ff54e
|
f6d6b927eed71550d3475411cfc3e59abe5cef2a
|
refs/heads/hx20-hx30
| 2023-08-08T20:45:10.621169
| 2023-05-26T07:03:59
| 2023-05-26T07:03:59
| 447,021,040
| 846
| 48
|
BSD-3-Clause
| 2023-05-26T07:04:59
| 2022-01-12T00:11:14
|
C
|
UTF-8
|
C
| false
| false
| 2,108
|
inc
|
gpio.inc
|
/* -*- mode:c -*-
*
* Copyright 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Declare symbolic names for all the GPIOs that we care about.
* Note: Those with interrupt handlers must be declared first. */
GPIO_INT(CC2_ALERT_L, PIN(A, 7), GPIO_INT_BOTH | GPIO_PULL_UP, cc2_event)
GPIO_INT(VBUS_ALERT_L, PIN(B, 2), GPIO_INT_BOTH | GPIO_PULL_UP, vbus_event)
GPIO(CC1_EN, PIN(A, 0), GPIO_OUT_HIGH)
GPIO(CC1_PD, PIN(A, 1), GPIO_ANALOG)
GPIO(CC2_EN, PIN(A, 2), GPIO_OUT_HIGH)
GPIO(CC2_PD, PIN(A, 3), GPIO_ANALOG)
GPIO(DAC, PIN(A, 4), GPIO_ANALOG)
GPIO(CC2_TX_DATA, PIN(A, 6), GPIO_OUT_LOW)
GPIO(CC1_RA, PIN(A, 8), GPIO_ODR_HIGH)
GPIO(USB_DM, PIN(A, 11), GPIO_ANALOG)
GPIO(USB_DP, PIN(A, 12), GPIO_ANALOG)
GPIO(CC1_RPUSB, PIN(A, 13), GPIO_ODR_HIGH)
GPIO(CC1_RP1A5, PIN(A, 14), GPIO_ODR_HIGH)
GPIO(CC1_RP3A0, PIN(A, 15), GPIO_ODR_HIGH)
GPIO(CC2_RPUSB, PIN(B, 0), GPIO_ODR_HIGH)
GPIO(CC1_TX_EN, PIN(B, 1), GPIO_OUT_LOW)
GPIO(CC2_TX_EN, PIN(B, 3), GPIO_OUT_LOW)
GPIO(CC1_TX_DATA, PIN(B, 4), GPIO_OUT_LOW)
GPIO(CC1_RD, PIN(B, 5), GPIO_ODR_HIGH)
GPIO(I2C_SCL, PIN(B, 6), GPIO_INPUT)
GPIO(I2C_SDA, PIN(B, 7), GPIO_INPUT)
GPIO(CC2_RD, PIN(B, 8), GPIO_ODR_HIGH)
GPIO(LED_G_L, PIN(B, 11), GPIO_ODR_HIGH)
GPIO(LED_R_L, PIN(B, 13), GPIO_ODR_HIGH)
GPIO(LED_B_L, PIN(B, 14), GPIO_ODR_HIGH)
GPIO(CC2_RA, PIN(B, 15), GPIO_ODR_HIGH)
GPIO(CC2_RP1A5, PIN(C, 14), GPIO_ODR_HIGH)
GPIO(CC2_RP3A0, PIN(C, 15), GPIO_ODR_HIGH)
/* Unimplemented signals which we need to emulate for now */
UNIMPLEMENTED(ENTERING_RW)
UNIMPLEMENTED(WP_L)
ALTERNATE(PIN_MASK(A, 0x0020), 0, MODULE_USB_PD, 0) /* SPI1: SCK(PA5) */
ALTERNATE(PIN_MASK(B, 0x0200), 2, MODULE_USB_PD, 0) /* TIM17_CH1: PB9 */
ALTERNATE(PIN_MASK(A, 0x0600), 1, MODULE_UART, GPIO_PULL_UP) /* USART1: PA9/PA10 */
ALTERNATE(PIN_MASK(B, 0x00C0), 1, MODULE_I2C, 0) /* I2C1 MASTER:PB6/7 */
|
3deda199a18c041a56a83afddd8721d5f97494d5
|
4da66ea2be83b62a46d77bf53f690b5146ac996d
|
/modules/opengl/native/bbopengl.c
|
46e45661775873f59f9008129d5c7014b32bbb34
|
[
"Zlib"
] |
permissive
|
blitz-research/monkey2
|
620855b08b6f41b40ff328da71d2e0d05d943855
|
3f6be81d73388b800a39ee53acaa7f4a0c6a9f42
|
refs/heads/develop
| 2021-04-09T17:13:34.240441
| 2020-06-28T04:26:30
| 2020-06-28T04:26:30
| 53,753,109
| 146
| 76
|
Zlib
| 2019-09-07T21:28:05
| 2016-03-12T20:59:51
|
Monkey
|
UTF-8
|
C
| false
| false
| 35,589
|
c
|
bbopengl.c
|
#define GLAPI
#include "bbopengl.h"
#include <stdio.h>
void *SDL_GL_GetProcAddress( const char *proc );
int SDL_GL_ExtensionSupported( const char *ext );
int SDL_GL_GetAttribute( int attr,int *value );
#if __EMSCRIPTEN__
void GLAPIENTRY glClearDepthf( GLclampf depth );
void GLAPIENTRY bbglClearDepth( GLclampd depth ){
glClearDepthf( (GLclampf)depth );
}
#else
#define SDL_GL_CONTEXT_PROFILE_MASK 21
#define SDL_GL_CONTEXT_PROFILE_ES 0x0004
void (GLAPIENTRY*bbglClearDepthf)( GLclampf depth );
void GLAPIENTRY bbglClearDepthd( GLclampd depth ){
bbglClearDepthf( (GLclampf)depth );
}
#endif
void bbglInit(){
#if __EMSCRIPTEN__
BBGL_ES=1;
BBGL_draw_buffers=SDL_GL_ExtensionSupported( "GL_WEBGL_draw_buffers" );
#else
bbglAccum=SDL_GL_GetProcAddress("glAccum");
bbglAlphaFunc=SDL_GL_GetProcAddress("glAlphaFunc");
bbglAreTexturesResident=SDL_GL_GetProcAddress("glAreTexturesResident");
bbglArrayElement=SDL_GL_GetProcAddress("glArrayElement");
bbglBegin=SDL_GL_GetProcAddress("glBegin");
bbglBindTexture=SDL_GL_GetProcAddress("glBindTexture");
bbglBitmap=SDL_GL_GetProcAddress("glBitmap");
bbglBlendFunc=SDL_GL_GetProcAddress("glBlendFunc");
bbglCallList=SDL_GL_GetProcAddress("glCallList");
bbglCallLists=SDL_GL_GetProcAddress("glCallLists");
bbglClear=SDL_GL_GetProcAddress("glClear");
bbglClearAccum=SDL_GL_GetProcAddress("glClearAccum");
bbglClearColor=SDL_GL_GetProcAddress("glClearColor");
bbglClearDepth=SDL_GL_GetProcAddress("glClearDepth");
bbglClearIndex=SDL_GL_GetProcAddress("glClearIndex");
bbglClearStencil=SDL_GL_GetProcAddress("glClearStencil");
bbglClipPlane=SDL_GL_GetProcAddress("glClipPlane");
bbglColor3b=SDL_GL_GetProcAddress("glColor3b");
bbglColor3bv=SDL_GL_GetProcAddress("glColor3bv");
bbglColor3d=SDL_GL_GetProcAddress("glColor3d");
bbglColor3dv=SDL_GL_GetProcAddress("glColor3dv");
bbglColor3f=SDL_GL_GetProcAddress("glColor3f");
bbglColor3fv=SDL_GL_GetProcAddress("glColor3fv");
bbglColor3i=SDL_GL_GetProcAddress("glColor3i");
bbglColor3iv=SDL_GL_GetProcAddress("glColor3iv");
bbglColor3s=SDL_GL_GetProcAddress("glColor3s");
bbglColor3sv=SDL_GL_GetProcAddress("glColor3sv");
bbglColor3ub=SDL_GL_GetProcAddress("glColor3ub");
bbglColor3ubv=SDL_GL_GetProcAddress("glColor3ubv");
bbglColor3ui=SDL_GL_GetProcAddress("glColor3ui");
bbglColor3uiv=SDL_GL_GetProcAddress("glColor3uiv");
bbglColor3us=SDL_GL_GetProcAddress("glColor3us");
bbglColor3usv=SDL_GL_GetProcAddress("glColor3usv");
bbglColor4b=SDL_GL_GetProcAddress("glColor4b");
bbglColor4bv=SDL_GL_GetProcAddress("glColor4bv");
bbglColor4d=SDL_GL_GetProcAddress("glColor4d");
bbglColor4dv=SDL_GL_GetProcAddress("glColor4dv");
bbglColor4f=SDL_GL_GetProcAddress("glColor4f");
bbglColor4fv=SDL_GL_GetProcAddress("glColor4fv");
bbglColor4i=SDL_GL_GetProcAddress("glColor4i");
bbglColor4iv=SDL_GL_GetProcAddress("glColor4iv");
bbglColor4s=SDL_GL_GetProcAddress("glColor4s");
bbglColor4sv=SDL_GL_GetProcAddress("glColor4sv");
bbglColor4ub=SDL_GL_GetProcAddress("glColor4ub");
bbglColor4ubv=SDL_GL_GetProcAddress("glColor4ubv");
bbglColor4ui=SDL_GL_GetProcAddress("glColor4ui");
bbglColor4uiv=SDL_GL_GetProcAddress("glColor4uiv");
bbglColor4us=SDL_GL_GetProcAddress("glColor4us");
bbglColor4usv=SDL_GL_GetProcAddress("glColor4usv");
bbglColorMask=SDL_GL_GetProcAddress("glColorMask");
bbglColorMaterial=SDL_GL_GetProcAddress("glColorMaterial");
bbglColorPointer=SDL_GL_GetProcAddress("glColorPointer");
bbglCopyPixels=SDL_GL_GetProcAddress("glCopyPixels");
bbglCopyTexImage1D=SDL_GL_GetProcAddress("glCopyTexImage1D");
bbglCopyTexImage2D=SDL_GL_GetProcAddress("glCopyTexImage2D");
bbglCopyTexSubImage1D=SDL_GL_GetProcAddress("glCopyTexSubImage1D");
bbglCopyTexSubImage2D=SDL_GL_GetProcAddress("glCopyTexSubImage2D");
bbglCullFace=SDL_GL_GetProcAddress("glCullFace");
bbglDeleteLists=SDL_GL_GetProcAddress("glDeleteLists");
bbglDeleteTextures=SDL_GL_GetProcAddress("glDeleteTextures");
bbglDepthFunc=SDL_GL_GetProcAddress("glDepthFunc");
bbglDepthMask=SDL_GL_GetProcAddress("glDepthMask");
bbglDepthRange=SDL_GL_GetProcAddress("glDepthRange");
bbglDisable=SDL_GL_GetProcAddress("glDisable");
bbglDisableClientState=SDL_GL_GetProcAddress("glDisableClientState");
bbglDrawArrays=SDL_GL_GetProcAddress("glDrawArrays");
bbglDrawBuffer=SDL_GL_GetProcAddress("glDrawBuffer");
bbglDrawElements=SDL_GL_GetProcAddress("glDrawElements");
bbglDrawPixels=SDL_GL_GetProcAddress("glDrawPixels");
bbglEdgeFlag=SDL_GL_GetProcAddress("glEdgeFlag");
bbglEdgeFlagPointer=SDL_GL_GetProcAddress("glEdgeFlagPointer");
bbglEdgeFlagv=SDL_GL_GetProcAddress("glEdgeFlagv");
bbglEnable=SDL_GL_GetProcAddress("glEnable");
bbglEnableClientState=SDL_GL_GetProcAddress("glEnableClientState");
bbglEnd=SDL_GL_GetProcAddress("glEnd");
bbglEndList=SDL_GL_GetProcAddress("glEndList");
bbglEvalCoord1d=SDL_GL_GetProcAddress("glEvalCoord1d");
bbglEvalCoord1dv=SDL_GL_GetProcAddress("glEvalCoord1dv");
bbglEvalCoord1f=SDL_GL_GetProcAddress("glEvalCoord1f");
bbglEvalCoord1fv=SDL_GL_GetProcAddress("glEvalCoord1fv");
bbglEvalCoord2d=SDL_GL_GetProcAddress("glEvalCoord2d");
bbglEvalCoord2dv=SDL_GL_GetProcAddress("glEvalCoord2dv");
bbglEvalCoord2f=SDL_GL_GetProcAddress("glEvalCoord2f");
bbglEvalCoord2fv=SDL_GL_GetProcAddress("glEvalCoord2fv");
bbglEvalMesh1=SDL_GL_GetProcAddress("glEvalMesh1");
bbglEvalMesh2=SDL_GL_GetProcAddress("glEvalMesh2");
bbglEvalPoint1=SDL_GL_GetProcAddress("glEvalPoint1");
bbglEvalPoint2=SDL_GL_GetProcAddress("glEvalPoint2");
bbglFeedbackBuffer=SDL_GL_GetProcAddress("glFeedbackBuffer");
bbglFinish=SDL_GL_GetProcAddress("glFinish");
bbglFlush=SDL_GL_GetProcAddress("glFlush");
bbglFogf=SDL_GL_GetProcAddress("glFogf");
bbglFogfv=SDL_GL_GetProcAddress("glFogfv");
bbglFogi=SDL_GL_GetProcAddress("glFogi");
bbglFogiv=SDL_GL_GetProcAddress("glFogiv");
bbglFrontFace=SDL_GL_GetProcAddress("glFrontFace");
bbglFrustum=SDL_GL_GetProcAddress("glFrustum");
bbglGenLists=SDL_GL_GetProcAddress("glGenLists");
bbglGenTextures=SDL_GL_GetProcAddress("glGenTextures");
bbglGetBooleanv=SDL_GL_GetProcAddress("glGetBooleanv");
bbglGetClipPlane=SDL_GL_GetProcAddress("glGetClipPlane");
bbglGetDoublev=SDL_GL_GetProcAddress("glGetDoublev");
bbglGetError=SDL_GL_GetProcAddress("glGetError");
bbglGetFloatv=SDL_GL_GetProcAddress("glGetFloatv");
bbglGetIntegerv=SDL_GL_GetProcAddress("glGetIntegerv");
bbglGetLightfv=SDL_GL_GetProcAddress("glGetLightfv");
bbglGetLightiv=SDL_GL_GetProcAddress("glGetLightiv");
bbglGetMapdv=SDL_GL_GetProcAddress("glGetMapdv");
bbglGetMapfv=SDL_GL_GetProcAddress("glGetMapfv");
bbglGetMapiv=SDL_GL_GetProcAddress("glGetMapiv");
bbglGetMaterialfv=SDL_GL_GetProcAddress("glGetMaterialfv");
bbglGetMaterialiv=SDL_GL_GetProcAddress("glGetMaterialiv");
bbglGetPixelMapfv=SDL_GL_GetProcAddress("glGetPixelMapfv");
bbglGetPixelMapuiv=SDL_GL_GetProcAddress("glGetPixelMapuiv");
bbglGetPixelMapusv=SDL_GL_GetProcAddress("glGetPixelMapusv");
bbglGetPointerv=SDL_GL_GetProcAddress("glGetPointerv");
bbglGetPolygonStipple=SDL_GL_GetProcAddress("glGetPolygonStipple");
bbglGetString=SDL_GL_GetProcAddress("glGetString");
bbglGetTexEnvfv=SDL_GL_GetProcAddress("glGetTexEnvfv");
bbglGetTexEnviv=SDL_GL_GetProcAddress("glGetTexEnviv");
bbglGetTexGendv=SDL_GL_GetProcAddress("glGetTexGendv");
bbglGetTexGenfv=SDL_GL_GetProcAddress("glGetTexGenfv");
bbglGetTexGeniv=SDL_GL_GetProcAddress("glGetTexGeniv");
bbglGetTexImage=SDL_GL_GetProcAddress("glGetTexImage");
bbglGetTexLevelParameterfv=SDL_GL_GetProcAddress("glGetTexLevelParameterfv");
bbglGetTexLevelParameteriv=SDL_GL_GetProcAddress("glGetTexLevelParameteriv");
bbglGetTexParameterfv=SDL_GL_GetProcAddress("glGetTexParameterfv");
bbglGetTexParameteriv=SDL_GL_GetProcAddress("glGetTexParameteriv");
bbglHint=SDL_GL_GetProcAddress("glHint");
bbglIndexMask=SDL_GL_GetProcAddress("glIndexMask");
bbglIndexPointer=SDL_GL_GetProcAddress("glIndexPointer");
bbglIndexd=SDL_GL_GetProcAddress("glIndexd");
bbglIndexdv=SDL_GL_GetProcAddress("glIndexdv");
bbglIndexf=SDL_GL_GetProcAddress("glIndexf");
bbglIndexfv=SDL_GL_GetProcAddress("glIndexfv");
bbglIndexi=SDL_GL_GetProcAddress("glIndexi");
bbglIndexiv=SDL_GL_GetProcAddress("glIndexiv");
bbglIndexs=SDL_GL_GetProcAddress("glIndexs");
bbglIndexsv=SDL_GL_GetProcAddress("glIndexsv");
bbglIndexub=SDL_GL_GetProcAddress("glIndexub");
bbglIndexubv=SDL_GL_GetProcAddress("glIndexubv");
bbglInitNames=SDL_GL_GetProcAddress("glInitNames");
bbglInterleavedArrays=SDL_GL_GetProcAddress("glInterleavedArrays");
bbglIsEnabled=SDL_GL_GetProcAddress("glIsEnabled");
bbglIsList=SDL_GL_GetProcAddress("glIsList");
bbglIsTexture=SDL_GL_GetProcAddress("glIsTexture");
bbglLightModelf=SDL_GL_GetProcAddress("glLightModelf");
bbglLightModelfv=SDL_GL_GetProcAddress("glLightModelfv");
bbglLightModeli=SDL_GL_GetProcAddress("glLightModeli");
bbglLightModeliv=SDL_GL_GetProcAddress("glLightModeliv");
bbglLightf=SDL_GL_GetProcAddress("glLightf");
bbglLightfv=SDL_GL_GetProcAddress("glLightfv");
bbglLighti=SDL_GL_GetProcAddress("glLighti");
bbglLightiv=SDL_GL_GetProcAddress("glLightiv");
bbglLineStipple=SDL_GL_GetProcAddress("glLineStipple");
bbglLineWidth=SDL_GL_GetProcAddress("glLineWidth");
bbglListBase=SDL_GL_GetProcAddress("glListBase");
bbglLoadIdentity=SDL_GL_GetProcAddress("glLoadIdentity");
bbglLoadMatrixd=SDL_GL_GetProcAddress("glLoadMatrixd");
bbglLoadMatrixf=SDL_GL_GetProcAddress("glLoadMatrixf");
bbglLoadName=SDL_GL_GetProcAddress("glLoadName");
bbglLogicOp=SDL_GL_GetProcAddress("glLogicOp");
bbglMap1d=SDL_GL_GetProcAddress("glMap1d");
bbglMap1f=SDL_GL_GetProcAddress("glMap1f");
bbglMap2d=SDL_GL_GetProcAddress("glMap2d");
bbglMap2f=SDL_GL_GetProcAddress("glMap2f");
bbglMapGrid1d=SDL_GL_GetProcAddress("glMapGrid1d");
bbglMapGrid1f=SDL_GL_GetProcAddress("glMapGrid1f");
bbglMapGrid2d=SDL_GL_GetProcAddress("glMapGrid2d");
bbglMapGrid2f=SDL_GL_GetProcAddress("glMapGrid2f");
bbglMaterialf=SDL_GL_GetProcAddress("glMaterialf");
bbglMaterialfv=SDL_GL_GetProcAddress("glMaterialfv");
bbglMateriali=SDL_GL_GetProcAddress("glMateriali");
bbglMaterialiv=SDL_GL_GetProcAddress("glMaterialiv");
bbglMatrixMode=SDL_GL_GetProcAddress("glMatrixMode");
bbglMultMatrixd=SDL_GL_GetProcAddress("glMultMatrixd");
bbglMultMatrixf=SDL_GL_GetProcAddress("glMultMatrixf");
bbglNewList=SDL_GL_GetProcAddress("glNewList");
bbglNormal3b=SDL_GL_GetProcAddress("glNormal3b");
bbglNormal3bv=SDL_GL_GetProcAddress("glNormal3bv");
bbglNormal3d=SDL_GL_GetProcAddress("glNormal3d");
bbglNormal3dv=SDL_GL_GetProcAddress("glNormal3dv");
bbglNormal3f=SDL_GL_GetProcAddress("glNormal3f");
bbglNormal3fv=SDL_GL_GetProcAddress("glNormal3fv");
bbglNormal3i=SDL_GL_GetProcAddress("glNormal3i");
bbglNormal3iv=SDL_GL_GetProcAddress("glNormal3iv");
bbglNormal3s=SDL_GL_GetProcAddress("glNormal3s");
bbglNormal3sv=SDL_GL_GetProcAddress("glNormal3sv");
bbglNormalPointer=SDL_GL_GetProcAddress("glNormalPointer");
bbglOrtho=SDL_GL_GetProcAddress("glOrtho");
bbglPassThrough=SDL_GL_GetProcAddress("glPassThrough");
bbglPixelMapfv=SDL_GL_GetProcAddress("glPixelMapfv");
bbglPixelMapuiv=SDL_GL_GetProcAddress("glPixelMapuiv");
bbglPixelMapusv=SDL_GL_GetProcAddress("glPixelMapusv");
bbglPixelStoref=SDL_GL_GetProcAddress("glPixelStoref");
bbglPixelStorei=SDL_GL_GetProcAddress("glPixelStorei");
bbglPixelTransferf=SDL_GL_GetProcAddress("glPixelTransferf");
bbglPixelTransferi=SDL_GL_GetProcAddress("glPixelTransferi");
bbglPixelZoom=SDL_GL_GetProcAddress("glPixelZoom");
bbglPointSize=SDL_GL_GetProcAddress("glPointSize");
bbglPolygonMode=SDL_GL_GetProcAddress("glPolygonMode");
bbglPolygonOffset=SDL_GL_GetProcAddress("glPolygonOffset");
bbglPolygonStipple=SDL_GL_GetProcAddress("glPolygonStipple");
bbglPopAttrib=SDL_GL_GetProcAddress("glPopAttrib");
bbglPopClientAttrib=SDL_GL_GetProcAddress("glPopClientAttrib");
bbglPopMatrix=SDL_GL_GetProcAddress("glPopMatrix");
bbglPopName=SDL_GL_GetProcAddress("glPopName");
bbglPrioritizeTextures=SDL_GL_GetProcAddress("glPrioritizeTextures");
bbglPushAttrib=SDL_GL_GetProcAddress("glPushAttrib");
bbglPushClientAttrib=SDL_GL_GetProcAddress("glPushClientAttrib");
bbglPushMatrix=SDL_GL_GetProcAddress("glPushMatrix");
bbglPushName=SDL_GL_GetProcAddress("glPushName");
bbglRasterPos2d=SDL_GL_GetProcAddress("glRasterPos2d");
bbglRasterPos2dv=SDL_GL_GetProcAddress("glRasterPos2dv");
bbglRasterPos2f=SDL_GL_GetProcAddress("glRasterPos2f");
bbglRasterPos2fv=SDL_GL_GetProcAddress("glRasterPos2fv");
bbglRasterPos2i=SDL_GL_GetProcAddress("glRasterPos2i");
bbglRasterPos2iv=SDL_GL_GetProcAddress("glRasterPos2iv");
bbglRasterPos2s=SDL_GL_GetProcAddress("glRasterPos2s");
bbglRasterPos2sv=SDL_GL_GetProcAddress("glRasterPos2sv");
bbglRasterPos3d=SDL_GL_GetProcAddress("glRasterPos3d");
bbglRasterPos3dv=SDL_GL_GetProcAddress("glRasterPos3dv");
bbglRasterPos3f=SDL_GL_GetProcAddress("glRasterPos3f");
bbglRasterPos3fv=SDL_GL_GetProcAddress("glRasterPos3fv");
bbglRasterPos3i=SDL_GL_GetProcAddress("glRasterPos3i");
bbglRasterPos3iv=SDL_GL_GetProcAddress("glRasterPos3iv");
bbglRasterPos3s=SDL_GL_GetProcAddress("glRasterPos3s");
bbglRasterPos3sv=SDL_GL_GetProcAddress("glRasterPos3sv");
bbglRasterPos4d=SDL_GL_GetProcAddress("glRasterPos4d");
bbglRasterPos4dv=SDL_GL_GetProcAddress("glRasterPos4dv");
bbglRasterPos4f=SDL_GL_GetProcAddress("glRasterPos4f");
bbglRasterPos4fv=SDL_GL_GetProcAddress("glRasterPos4fv");
bbglRasterPos4i=SDL_GL_GetProcAddress("glRasterPos4i");
bbglRasterPos4iv=SDL_GL_GetProcAddress("glRasterPos4iv");
bbglRasterPos4s=SDL_GL_GetProcAddress("glRasterPos4s");
bbglRasterPos4sv=SDL_GL_GetProcAddress("glRasterPos4sv");
bbglReadBuffer=SDL_GL_GetProcAddress("glReadBuffer");
bbglReadPixels=SDL_GL_GetProcAddress("glReadPixels");
bbglRectd=SDL_GL_GetProcAddress("glRectd");
bbglRectdv=SDL_GL_GetProcAddress("glRectdv");
bbglRectf=SDL_GL_GetProcAddress("glRectf");
bbglRectfv=SDL_GL_GetProcAddress("glRectfv");
bbglRecti=SDL_GL_GetProcAddress("glRecti");
bbglRectiv=SDL_GL_GetProcAddress("glRectiv");
bbglRects=SDL_GL_GetProcAddress("glRects");
bbglRectsv=SDL_GL_GetProcAddress("glRectsv");
bbglRenderMode=SDL_GL_GetProcAddress("glRenderMode");
bbglRotated=SDL_GL_GetProcAddress("glRotated");
bbglRotatef=SDL_GL_GetProcAddress("glRotatef");
bbglScaled=SDL_GL_GetProcAddress("glScaled");
bbglScalef=SDL_GL_GetProcAddress("glScalef");
bbglScissor=SDL_GL_GetProcAddress("glScissor");
bbglSelectBuffer=SDL_GL_GetProcAddress("glSelectBuffer");
bbglShadeModel=SDL_GL_GetProcAddress("glShadeModel");
bbglStencilFunc=SDL_GL_GetProcAddress("glStencilFunc");
bbglStencilMask=SDL_GL_GetProcAddress("glStencilMask");
bbglStencilOp=SDL_GL_GetProcAddress("glStencilOp");
bbglTexCoord1d=SDL_GL_GetProcAddress("glTexCoord1d");
bbglTexCoord1dv=SDL_GL_GetProcAddress("glTexCoord1dv");
bbglTexCoord1f=SDL_GL_GetProcAddress("glTexCoord1f");
bbglTexCoord1fv=SDL_GL_GetProcAddress("glTexCoord1fv");
bbglTexCoord1i=SDL_GL_GetProcAddress("glTexCoord1i");
bbglTexCoord1iv=SDL_GL_GetProcAddress("glTexCoord1iv");
bbglTexCoord1s=SDL_GL_GetProcAddress("glTexCoord1s");
bbglTexCoord1sv=SDL_GL_GetProcAddress("glTexCoord1sv");
bbglTexCoord2d=SDL_GL_GetProcAddress("glTexCoord2d");
bbglTexCoord2dv=SDL_GL_GetProcAddress("glTexCoord2dv");
bbglTexCoord2f=SDL_GL_GetProcAddress("glTexCoord2f");
bbglTexCoord2fv=SDL_GL_GetProcAddress("glTexCoord2fv");
bbglTexCoord2i=SDL_GL_GetProcAddress("glTexCoord2i");
bbglTexCoord2iv=SDL_GL_GetProcAddress("glTexCoord2iv");
bbglTexCoord2s=SDL_GL_GetProcAddress("glTexCoord2s");
bbglTexCoord2sv=SDL_GL_GetProcAddress("glTexCoord2sv");
bbglTexCoord3d=SDL_GL_GetProcAddress("glTexCoord3d");
bbglTexCoord3dv=SDL_GL_GetProcAddress("glTexCoord3dv");
bbglTexCoord3f=SDL_GL_GetProcAddress("glTexCoord3f");
bbglTexCoord3fv=SDL_GL_GetProcAddress("glTexCoord3fv");
bbglTexCoord3i=SDL_GL_GetProcAddress("glTexCoord3i");
bbglTexCoord3iv=SDL_GL_GetProcAddress("glTexCoord3iv");
bbglTexCoord3s=SDL_GL_GetProcAddress("glTexCoord3s");
bbglTexCoord3sv=SDL_GL_GetProcAddress("glTexCoord3sv");
bbglTexCoord4d=SDL_GL_GetProcAddress("glTexCoord4d");
bbglTexCoord4dv=SDL_GL_GetProcAddress("glTexCoord4dv");
bbglTexCoord4f=SDL_GL_GetProcAddress("glTexCoord4f");
bbglTexCoord4fv=SDL_GL_GetProcAddress("glTexCoord4fv");
bbglTexCoord4i=SDL_GL_GetProcAddress("glTexCoord4i");
bbglTexCoord4iv=SDL_GL_GetProcAddress("glTexCoord4iv");
bbglTexCoord4s=SDL_GL_GetProcAddress("glTexCoord4s");
bbglTexCoord4sv=SDL_GL_GetProcAddress("glTexCoord4sv");
bbglTexCoordPointer=SDL_GL_GetProcAddress("glTexCoordPointer");
bbglTexEnvf=SDL_GL_GetProcAddress("glTexEnvf");
bbglTexEnvfv=SDL_GL_GetProcAddress("glTexEnvfv");
bbglTexEnvi=SDL_GL_GetProcAddress("glTexEnvi");
bbglTexEnviv=SDL_GL_GetProcAddress("glTexEnviv");
bbglTexGend=SDL_GL_GetProcAddress("glTexGend");
bbglTexGendv=SDL_GL_GetProcAddress("glTexGendv");
bbglTexGenf=SDL_GL_GetProcAddress("glTexGenf");
bbglTexGenfv=SDL_GL_GetProcAddress("glTexGenfv");
bbglTexGeni=SDL_GL_GetProcAddress("glTexGeni");
bbglTexGeniv=SDL_GL_GetProcAddress("glTexGeniv");
bbglTexImage1D=SDL_GL_GetProcAddress("glTexImage1D");
bbglTexImage2D=SDL_GL_GetProcAddress("glTexImage2D");
bbglTexParameterf=SDL_GL_GetProcAddress("glTexParameterf");
bbglTexParameterfv=SDL_GL_GetProcAddress("glTexParameterfv");
bbglTexParameteri=SDL_GL_GetProcAddress("glTexParameteri");
bbglTexParameteriv=SDL_GL_GetProcAddress("glTexParameteriv");
bbglTexSubImage1D=SDL_GL_GetProcAddress("glTexSubImage1D");
bbglTexSubImage2D=SDL_GL_GetProcAddress("glTexSubImage2D");
bbglTranslated=SDL_GL_GetProcAddress("glTranslated");
bbglTranslatef=SDL_GL_GetProcAddress("glTranslatef");
bbglVertex2d=SDL_GL_GetProcAddress("glVertex2d");
bbglVertex2dv=SDL_GL_GetProcAddress("glVertex2dv");
bbglVertex2f=SDL_GL_GetProcAddress("glVertex2f");
bbglVertex2fv=SDL_GL_GetProcAddress("glVertex2fv");
bbglVertex2i=SDL_GL_GetProcAddress("glVertex2i");
bbglVertex2iv=SDL_GL_GetProcAddress("glVertex2iv");
bbglVertex2s=SDL_GL_GetProcAddress("glVertex2s");
bbglVertex2sv=SDL_GL_GetProcAddress("glVertex2sv");
bbglVertex3d=SDL_GL_GetProcAddress("glVertex3d");
bbglVertex3dv=SDL_GL_GetProcAddress("glVertex3dv");
bbglVertex3f=SDL_GL_GetProcAddress("glVertex3f");
bbglVertex3fv=SDL_GL_GetProcAddress("glVertex3fv");
bbglVertex3i=SDL_GL_GetProcAddress("glVertex3i");
bbglVertex3iv=SDL_GL_GetProcAddress("glVertex3iv");
bbglVertex3s=SDL_GL_GetProcAddress("glVertex3s");
bbglVertex3sv=SDL_GL_GetProcAddress("glVertex3sv");
bbglVertex4d=SDL_GL_GetProcAddress("glVertex4d");
bbglVertex4dv=SDL_GL_GetProcAddress("glVertex4dv");
bbglVertex4f=SDL_GL_GetProcAddress("glVertex4f");
bbglVertex4fv=SDL_GL_GetProcAddress("glVertex4fv");
bbglVertex4i=SDL_GL_GetProcAddress("glVertex4i");
bbglVertex4iv=SDL_GL_GetProcAddress("glVertex4iv");
bbglVertex4s=SDL_GL_GetProcAddress("glVertex4s");
bbglVertex4sv=SDL_GL_GetProcAddress("glVertex4sv");
bbglVertexPointer=SDL_GL_GetProcAddress("glVertexPointer");
bbglViewport=SDL_GL_GetProcAddress("glViewport");
bbglCopyTexSubImage3D=SDL_GL_GetProcAddress("glCopyTexSubImage3D");
bbglDrawRangeElements=SDL_GL_GetProcAddress("glDrawRangeElements");
bbglTexImage3D=SDL_GL_GetProcAddress("glTexImage3D");
bbglTexSubImage3D=SDL_GL_GetProcAddress("glTexSubImage3D");
bbglActiveTexture=SDL_GL_GetProcAddress("glActiveTexture");
bbglClientActiveTexture=SDL_GL_GetProcAddress("glClientActiveTexture");
bbglCompressedTexImage1D=SDL_GL_GetProcAddress("glCompressedTexImage1D");
bbglCompressedTexImage2D=SDL_GL_GetProcAddress("glCompressedTexImage2D");
bbglCompressedTexImage3D=SDL_GL_GetProcAddress("glCompressedTexImage3D");
bbglCompressedTexSubImage1D=SDL_GL_GetProcAddress("glCompressedTexSubImage1D");
bbglCompressedTexSubImage2D=SDL_GL_GetProcAddress("glCompressedTexSubImage2D");
bbglCompressedTexSubImage3D=SDL_GL_GetProcAddress("glCompressedTexSubImage3D");
bbglGetCompressedTexImage=SDL_GL_GetProcAddress("glGetCompressedTexImage");
bbglLoadTransposeMatrixd=SDL_GL_GetProcAddress("glLoadTransposeMatrixd");
bbglLoadTransposeMatrixf=SDL_GL_GetProcAddress("glLoadTransposeMatrixf");
bbglMultTransposeMatrixd=SDL_GL_GetProcAddress("glMultTransposeMatrixd");
bbglMultTransposeMatrixf=SDL_GL_GetProcAddress("glMultTransposeMatrixf");
bbglMultiTexCoord1d=SDL_GL_GetProcAddress("glMultiTexCoord1d");
bbglMultiTexCoord1dv=SDL_GL_GetProcAddress("glMultiTexCoord1dv");
bbglMultiTexCoord1f=SDL_GL_GetProcAddress("glMultiTexCoord1f");
bbglMultiTexCoord1fv=SDL_GL_GetProcAddress("glMultiTexCoord1fv");
bbglMultiTexCoord1i=SDL_GL_GetProcAddress("glMultiTexCoord1i");
bbglMultiTexCoord1iv=SDL_GL_GetProcAddress("glMultiTexCoord1iv");
bbglMultiTexCoord1s=SDL_GL_GetProcAddress("glMultiTexCoord1s");
bbglMultiTexCoord1sv=SDL_GL_GetProcAddress("glMultiTexCoord1sv");
bbglMultiTexCoord2d=SDL_GL_GetProcAddress("glMultiTexCoord2d");
bbglMultiTexCoord2dv=SDL_GL_GetProcAddress("glMultiTexCoord2dv");
bbglMultiTexCoord2f=SDL_GL_GetProcAddress("glMultiTexCoord2f");
bbglMultiTexCoord2fv=SDL_GL_GetProcAddress("glMultiTexCoord2fv");
bbglMultiTexCoord2i=SDL_GL_GetProcAddress("glMultiTexCoord2i");
bbglMultiTexCoord2iv=SDL_GL_GetProcAddress("glMultiTexCoord2iv");
bbglMultiTexCoord2s=SDL_GL_GetProcAddress("glMultiTexCoord2s");
bbglMultiTexCoord2sv=SDL_GL_GetProcAddress("glMultiTexCoord2sv");
bbglMultiTexCoord3d=SDL_GL_GetProcAddress("glMultiTexCoord3d");
bbglMultiTexCoord3dv=SDL_GL_GetProcAddress("glMultiTexCoord3dv");
bbglMultiTexCoord3f=SDL_GL_GetProcAddress("glMultiTexCoord3f");
bbglMultiTexCoord3fv=SDL_GL_GetProcAddress("glMultiTexCoord3fv");
bbglMultiTexCoord3i=SDL_GL_GetProcAddress("glMultiTexCoord3i");
bbglMultiTexCoord3iv=SDL_GL_GetProcAddress("glMultiTexCoord3iv");
bbglMultiTexCoord3s=SDL_GL_GetProcAddress("glMultiTexCoord3s");
bbglMultiTexCoord3sv=SDL_GL_GetProcAddress("glMultiTexCoord3sv");
bbglMultiTexCoord4d=SDL_GL_GetProcAddress("glMultiTexCoord4d");
bbglMultiTexCoord4dv=SDL_GL_GetProcAddress("glMultiTexCoord4dv");
bbglMultiTexCoord4f=SDL_GL_GetProcAddress("glMultiTexCoord4f");
bbglMultiTexCoord4fv=SDL_GL_GetProcAddress("glMultiTexCoord4fv");
bbglMultiTexCoord4i=SDL_GL_GetProcAddress("glMultiTexCoord4i");
bbglMultiTexCoord4iv=SDL_GL_GetProcAddress("glMultiTexCoord4iv");
bbglMultiTexCoord4s=SDL_GL_GetProcAddress("glMultiTexCoord4s");
bbglMultiTexCoord4sv=SDL_GL_GetProcAddress("glMultiTexCoord4sv");
bbglSampleCoverage=SDL_GL_GetProcAddress("glSampleCoverage");
bbglBlendColor=SDL_GL_GetProcAddress("glBlendColor");
bbglBlendEquation=SDL_GL_GetProcAddress("glBlendEquation");
bbglBlendFuncSeparate=SDL_GL_GetProcAddress("glBlendFuncSeparate");
bbglFogCoordPointer=SDL_GL_GetProcAddress("glFogCoordPointer");
bbglFogCoordd=SDL_GL_GetProcAddress("glFogCoordd");
bbglFogCoorddv=SDL_GL_GetProcAddress("glFogCoorddv");
bbglFogCoordf=SDL_GL_GetProcAddress("glFogCoordf");
bbglFogCoordfv=SDL_GL_GetProcAddress("glFogCoordfv");
bbglMultiDrawArrays=SDL_GL_GetProcAddress("glMultiDrawArrays");
bbglMultiDrawElements=SDL_GL_GetProcAddress("glMultiDrawElements");
bbglPointParameterf=SDL_GL_GetProcAddress("glPointParameterf");
bbglPointParameterfv=SDL_GL_GetProcAddress("glPointParameterfv");
bbglPointParameteri=SDL_GL_GetProcAddress("glPointParameteri");
bbglPointParameteriv=SDL_GL_GetProcAddress("glPointParameteriv");
bbglSecondaryColor3b=SDL_GL_GetProcAddress("glSecondaryColor3b");
bbglSecondaryColor3bv=SDL_GL_GetProcAddress("glSecondaryColor3bv");
bbglSecondaryColor3d=SDL_GL_GetProcAddress("glSecondaryColor3d");
bbglSecondaryColor3dv=SDL_GL_GetProcAddress("glSecondaryColor3dv");
bbglSecondaryColor3f=SDL_GL_GetProcAddress("glSecondaryColor3f");
bbglSecondaryColor3fv=SDL_GL_GetProcAddress("glSecondaryColor3fv");
bbglSecondaryColor3i=SDL_GL_GetProcAddress("glSecondaryColor3i");
bbglSecondaryColor3iv=SDL_GL_GetProcAddress("glSecondaryColor3iv");
bbglSecondaryColor3s=SDL_GL_GetProcAddress("glSecondaryColor3s");
bbglSecondaryColor3sv=SDL_GL_GetProcAddress("glSecondaryColor3sv");
bbglSecondaryColor3ub=SDL_GL_GetProcAddress("glSecondaryColor3ub");
bbglSecondaryColor3ubv=SDL_GL_GetProcAddress("glSecondaryColor3ubv");
bbglSecondaryColor3ui=SDL_GL_GetProcAddress("glSecondaryColor3ui");
bbglSecondaryColor3uiv=SDL_GL_GetProcAddress("glSecondaryColor3uiv");
bbglSecondaryColor3us=SDL_GL_GetProcAddress("glSecondaryColor3us");
bbglSecondaryColor3usv=SDL_GL_GetProcAddress("glSecondaryColor3usv");
bbglSecondaryColorPointer=SDL_GL_GetProcAddress("glSecondaryColorPointer");
bbglWindowPos2d=SDL_GL_GetProcAddress("glWindowPos2d");
bbglWindowPos2dv=SDL_GL_GetProcAddress("glWindowPos2dv");
bbglWindowPos2f=SDL_GL_GetProcAddress("glWindowPos2f");
bbglWindowPos2fv=SDL_GL_GetProcAddress("glWindowPos2fv");
bbglWindowPos2i=SDL_GL_GetProcAddress("glWindowPos2i");
bbglWindowPos2iv=SDL_GL_GetProcAddress("glWindowPos2iv");
bbglWindowPos2s=SDL_GL_GetProcAddress("glWindowPos2s");
bbglWindowPos2sv=SDL_GL_GetProcAddress("glWindowPos2sv");
bbglWindowPos3d=SDL_GL_GetProcAddress("glWindowPos3d");
bbglWindowPos3dv=SDL_GL_GetProcAddress("glWindowPos3dv");
bbglWindowPos3f=SDL_GL_GetProcAddress("glWindowPos3f");
bbglWindowPos3fv=SDL_GL_GetProcAddress("glWindowPos3fv");
bbglWindowPos3i=SDL_GL_GetProcAddress("glWindowPos3i");
bbglWindowPos3iv=SDL_GL_GetProcAddress("glWindowPos3iv");
bbglWindowPos3s=SDL_GL_GetProcAddress("glWindowPos3s");
bbglWindowPos3sv=SDL_GL_GetProcAddress("glWindowPos3sv");
bbglBeginQuery=SDL_GL_GetProcAddress("glBeginQuery");
bbglBindBuffer=SDL_GL_GetProcAddress("glBindBuffer");
bbglBufferData=SDL_GL_GetProcAddress("glBufferData");
bbglBufferSubData=SDL_GL_GetProcAddress("glBufferSubData");
bbglDeleteBuffers=SDL_GL_GetProcAddress("glDeleteBuffers");
bbglDeleteQueries=SDL_GL_GetProcAddress("glDeleteQueries");
bbglEndQuery=SDL_GL_GetProcAddress("glEndQuery");
bbglGenBuffers=SDL_GL_GetProcAddress("glGenBuffers");
bbglGenQueries=SDL_GL_GetProcAddress("glGenQueries");
bbglGetBufferParameteriv=SDL_GL_GetProcAddress("glGetBufferParameteriv");
bbglGetBufferPointerv=SDL_GL_GetProcAddress("glGetBufferPointerv");
bbglGetBufferSubData=SDL_GL_GetProcAddress("glGetBufferSubData");
bbglGetQueryObjectiv=SDL_GL_GetProcAddress("glGetQueryObjectiv");
bbglGetQueryObjectuiv=SDL_GL_GetProcAddress("glGetQueryObjectuiv");
bbglGetQueryiv=SDL_GL_GetProcAddress("glGetQueryiv");
bbglIsBuffer=SDL_GL_GetProcAddress("glIsBuffer");
bbglIsQuery=SDL_GL_GetProcAddress("glIsQuery");
bbglMapBuffer=SDL_GL_GetProcAddress("glMapBuffer");
bbglUnmapBuffer=SDL_GL_GetProcAddress("glUnmapBuffer");
bbglAttachShader=SDL_GL_GetProcAddress("glAttachShader");
bbglBindAttribLocation=SDL_GL_GetProcAddress("glBindAttribLocation");
bbglBlendEquationSeparate=SDL_GL_GetProcAddress("glBlendEquationSeparate");
bbglCompileShader=SDL_GL_GetProcAddress("glCompileShader");
bbglCreateProgram=SDL_GL_GetProcAddress("glCreateProgram");
bbglCreateShader=SDL_GL_GetProcAddress("glCreateShader");
bbglDeleteProgram=SDL_GL_GetProcAddress("glDeleteProgram");
bbglDeleteShader=SDL_GL_GetProcAddress("glDeleteShader");
bbglDetachShader=SDL_GL_GetProcAddress("glDetachShader");
bbglDisableVertexAttribArray=SDL_GL_GetProcAddress("glDisableVertexAttribArray");
bbglDrawBuffers=SDL_GL_GetProcAddress("glDrawBuffers");
bbglEnableVertexAttribArray=SDL_GL_GetProcAddress("glEnableVertexAttribArray");
bbglGetActiveAttrib=SDL_GL_GetProcAddress("glGetActiveAttrib");
bbglGetActiveUniform=SDL_GL_GetProcAddress("glGetActiveUniform");
bbglGetAttachedShaders=SDL_GL_GetProcAddress("glGetAttachedShaders");
bbglGetAttribLocation=SDL_GL_GetProcAddress("glGetAttribLocation");
bbglGetProgramInfoLog=SDL_GL_GetProcAddress("glGetProgramInfoLog");
bbglGetProgramiv=SDL_GL_GetProcAddress("glGetProgramiv");
bbglGetShaderInfoLog=SDL_GL_GetProcAddress("glGetShaderInfoLog");
bbglGetShaderSource=SDL_GL_GetProcAddress("glGetShaderSource");
bbglGetShaderiv=SDL_GL_GetProcAddress("glGetShaderiv");
bbglGetUniformLocation=SDL_GL_GetProcAddress("glGetUniformLocation");
bbglGetUniformfv=SDL_GL_GetProcAddress("glGetUniformfv");
bbglGetUniformiv=SDL_GL_GetProcAddress("glGetUniformiv");
bbglGetVertexAttribPointerv=SDL_GL_GetProcAddress("glGetVertexAttribPointerv");
bbglGetVertexAttribdv=SDL_GL_GetProcAddress("glGetVertexAttribdv");
bbglGetVertexAttribfv=SDL_GL_GetProcAddress("glGetVertexAttribfv");
bbglGetVertexAttribiv=SDL_GL_GetProcAddress("glGetVertexAttribiv");
bbglIsProgram=SDL_GL_GetProcAddress("glIsProgram");
bbglIsShader=SDL_GL_GetProcAddress("glIsShader");
bbglLinkProgram=SDL_GL_GetProcAddress("glLinkProgram");
bbglShaderSource=SDL_GL_GetProcAddress("glShaderSource");
bbglStencilFuncSeparate=SDL_GL_GetProcAddress("glStencilFuncSeparate");
bbglStencilMaskSeparate=SDL_GL_GetProcAddress("glStencilMaskSeparate");
bbglStencilOpSeparate=SDL_GL_GetProcAddress("glStencilOpSeparate");
bbglUniform1f=SDL_GL_GetProcAddress("glUniform1f");
bbglUniform1fv=SDL_GL_GetProcAddress("glUniform1fv");
bbglUniform1i=SDL_GL_GetProcAddress("glUniform1i");
bbglUniform1iv=SDL_GL_GetProcAddress("glUniform1iv");
bbglUniform2f=SDL_GL_GetProcAddress("glUniform2f");
bbglUniform2fv=SDL_GL_GetProcAddress("glUniform2fv");
bbglUniform2i=SDL_GL_GetProcAddress("glUniform2i");
bbglUniform2iv=SDL_GL_GetProcAddress("glUniform2iv");
bbglUniform3f=SDL_GL_GetProcAddress("glUniform3f");
bbglUniform3fv=SDL_GL_GetProcAddress("glUniform3fv");
bbglUniform3i=SDL_GL_GetProcAddress("glUniform3i");
bbglUniform3iv=SDL_GL_GetProcAddress("glUniform3iv");
bbglUniform4f=SDL_GL_GetProcAddress("glUniform4f");
bbglUniform4fv=SDL_GL_GetProcAddress("glUniform4fv");
bbglUniform4i=SDL_GL_GetProcAddress("glUniform4i");
bbglUniform4iv=SDL_GL_GetProcAddress("glUniform4iv");
bbglUniformMatrix2fv=SDL_GL_GetProcAddress("glUniformMatrix2fv");
bbglUniformMatrix3fv=SDL_GL_GetProcAddress("glUniformMatrix3fv");
bbglUniformMatrix4fv=SDL_GL_GetProcAddress("glUniformMatrix4fv");
bbglUseProgram=SDL_GL_GetProcAddress("glUseProgram");
bbglValidateProgram=SDL_GL_GetProcAddress("glValidateProgram");
bbglVertexAttrib1d=SDL_GL_GetProcAddress("glVertexAttrib1d");
bbglVertexAttrib1dv=SDL_GL_GetProcAddress("glVertexAttrib1dv");
bbglVertexAttrib1f=SDL_GL_GetProcAddress("glVertexAttrib1f");
bbglVertexAttrib1fv=SDL_GL_GetProcAddress("glVertexAttrib1fv");
bbglVertexAttrib1s=SDL_GL_GetProcAddress("glVertexAttrib1s");
bbglVertexAttrib1sv=SDL_GL_GetProcAddress("glVertexAttrib1sv");
bbglVertexAttrib2d=SDL_GL_GetProcAddress("glVertexAttrib2d");
bbglVertexAttrib2dv=SDL_GL_GetProcAddress("glVertexAttrib2dv");
bbglVertexAttrib2f=SDL_GL_GetProcAddress("glVertexAttrib2f");
bbglVertexAttrib2fv=SDL_GL_GetProcAddress("glVertexAttrib2fv");
bbglVertexAttrib2s=SDL_GL_GetProcAddress("glVertexAttrib2s");
bbglVertexAttrib2sv=SDL_GL_GetProcAddress("glVertexAttrib2sv");
bbglVertexAttrib3d=SDL_GL_GetProcAddress("glVertexAttrib3d");
bbglVertexAttrib3dv=SDL_GL_GetProcAddress("glVertexAttrib3dv");
bbglVertexAttrib3f=SDL_GL_GetProcAddress("glVertexAttrib3f");
bbglVertexAttrib3fv=SDL_GL_GetProcAddress("glVertexAttrib3fv");
bbglVertexAttrib3s=SDL_GL_GetProcAddress("glVertexAttrib3s");
bbglVertexAttrib3sv=SDL_GL_GetProcAddress("glVertexAttrib3sv");
bbglVertexAttrib4Nbv=SDL_GL_GetProcAddress("glVertexAttrib4Nbv");
bbglVertexAttrib4Niv=SDL_GL_GetProcAddress("glVertexAttrib4Niv");
bbglVertexAttrib4Nsv=SDL_GL_GetProcAddress("glVertexAttrib4Nsv");
bbglVertexAttrib4Nub=SDL_GL_GetProcAddress("glVertexAttrib4Nub");
bbglVertexAttrib4Nubv=SDL_GL_GetProcAddress("glVertexAttrib4Nubv");
bbglVertexAttrib4Nuiv=SDL_GL_GetProcAddress("glVertexAttrib4Nuiv");
bbglVertexAttrib4Nusv=SDL_GL_GetProcAddress("glVertexAttrib4Nusv");
bbglVertexAttrib4bv=SDL_GL_GetProcAddress("glVertexAttrib4bv");
bbglVertexAttrib4d=SDL_GL_GetProcAddress("glVertexAttrib4d");
bbglVertexAttrib4dv=SDL_GL_GetProcAddress("glVertexAttrib4dv");
bbglVertexAttrib4f=SDL_GL_GetProcAddress("glVertexAttrib4f");
bbglVertexAttrib4fv=SDL_GL_GetProcAddress("glVertexAttrib4fv");
bbglVertexAttrib4iv=SDL_GL_GetProcAddress("glVertexAttrib4iv");
bbglVertexAttrib4s=SDL_GL_GetProcAddress("glVertexAttrib4s");
bbglVertexAttrib4sv=SDL_GL_GetProcAddress("glVertexAttrib4sv");
bbglVertexAttrib4ubv=SDL_GL_GetProcAddress("glVertexAttrib4ubv");
bbglVertexAttrib4uiv=SDL_GL_GetProcAddress("glVertexAttrib4uiv");
bbglVertexAttrib4usv=SDL_GL_GetProcAddress("glVertexAttrib4usv");
bbglVertexAttribPointer=SDL_GL_GetProcAddress("glVertexAttribPointer");
bbglUniformMatrix2x3fv=SDL_GL_GetProcAddress("glUniformMatrix2x3fv");
bbglUniformMatrix2x4fv=SDL_GL_GetProcAddress("glUniformMatrix2x4fv");
bbglUniformMatrix3x2fv=SDL_GL_GetProcAddress("glUniformMatrix3x2fv");
bbglUniformMatrix3x4fv=SDL_GL_GetProcAddress("glUniformMatrix3x4fv");
bbglUniformMatrix4x2fv=SDL_GL_GetProcAddress("glUniformMatrix4x2fv");
bbglUniformMatrix4x3fv=SDL_GL_GetProcAddress("glUniformMatrix4x3fv");
bbglBindFramebuffer=SDL_GL_GetProcAddress("glBindFramebuffer");
bbglBindRenderbuffer=SDL_GL_GetProcAddress("glBindRenderbuffer");
bbglBlitFramebuffer=SDL_GL_GetProcAddress("glBlitFramebuffer");
bbglCheckFramebufferStatus=SDL_GL_GetProcAddress("glCheckFramebufferStatus");
bbglDeleteFramebuffers=SDL_GL_GetProcAddress("glDeleteFramebuffers");
bbglDeleteRenderbuffers=SDL_GL_GetProcAddress("glDeleteRenderbuffers");
bbglFramebufferRenderbuffer=SDL_GL_GetProcAddress("glFramebufferRenderbuffer");
bbglFramebufferTexture1D=SDL_GL_GetProcAddress("glFramebufferTexture1D");
bbglFramebufferTexture2D=SDL_GL_GetProcAddress("glFramebufferTexture2D");
bbglFramebufferTexture3D=SDL_GL_GetProcAddress("glFramebufferTexture3D");
bbglFramebufferTextureLayer=SDL_GL_GetProcAddress("glFramebufferTextureLayer");
bbglGenFramebuffers=SDL_GL_GetProcAddress("glGenFramebuffers");
bbglGenRenderbuffers=SDL_GL_GetProcAddress("glGenRenderbuffers");
bbglGenerateMipmap=SDL_GL_GetProcAddress("glGenerateMipmap");
bbglGetFramebufferAttachmentParameteriv=SDL_GL_GetProcAddress("glGetFramebufferAttachmentParameteriv");
bbglGetRenderbufferParameteriv=SDL_GL_GetProcAddress("glGetRenderbufferParameteriv");
bbglIsFramebuffer=SDL_GL_GetProcAddress("glIsFramebuffer");
bbglIsRenderbuffer=SDL_GL_GetProcAddress("glIsRenderbuffer");
bbglRenderbufferStorage=SDL_GL_GetProcAddress("glRenderbufferStorage");
bbglRenderbufferStorageMultisample=SDL_GL_GetProcAddress("glRenderbufferStorageMultisample");
int profile=0;
SDL_GL_GetAttribute( SDL_GL_CONTEXT_PROFILE_MASK,&profile );
BBGL_ES=( profile==SDL_GL_CONTEXT_PROFILE_ES );
if( BBGL_ES ){
bbglClearDepthf=SDL_GL_GetProcAddress( "glClearDepthf" );
bbglClearDepth=bbglClearDepthd;
if( BBGL_draw_buffers=SDL_GL_ExtensionSupported( "GL_EXT_draw_buffers" ) ){ //For MRTSs
bbglDrawBuffers=SDL_GL_GetProcAddress( "glDrawBuffersEXT" );
}else if( BBGL_draw_buffers=SDL_GL_ExtensionSupported( "GL_NV_draw_buffers" ) ){ //For MRTs on nvidia shield!
bbglDrawBuffers=SDL_GL_GetProcAddress( "glDrawBuffersNV" );
}
}else if( bbglDrawBuffers ){
BBGL_draw_buffers=1;
}
#endif
BBGL_depth_texture=SDL_GL_ExtensionSupported( "GL_EXT_depth_texture" ) ||
SDL_GL_ExtensionSupported( "GL_ANGLE_depth_texture" ) ||
SDL_GL_ExtensionSupported( "GL_WEBGL_depth_texture" ) ||
SDL_GL_ExtensionSupported( "GL_OES_depth_texture" );
BBGL_seamless_cube_map=SDL_GL_ExtensionSupported( "GL_ARB_seamless_cube_map" );
BBGL_texture_filter_anisotropic=SDL_GL_ExtensionSupported( "GL_ARB_texture_filter_anisotropic" ) ||
SDL_GL_ExtensionSupported( "GL_EXT_texture_filter_anisotropic" );
BBGL_standard_derivatives=!BBGL_ES || SDL_GL_ExtensionSupported( "GL_OES_standard_derivatives" );
}
|
f808046d5ac380d091b1f7be716a64e820e5cef1
|
b732361d6b3405c3e79ac0a7d8361cf5b329b015
|
/ext/phalcon/mvc/view/engine/php.zep.c
|
3389e387fb55098ec610593df243457e6bf2edbe
|
[
"BSD-3-Clause"
] |
permissive
|
phalcon/cphalcon
|
4a5b26f47b5c2a4107541d7fd73c595c0d90ed73
|
fc183e11e8b96c43daf7d893244846206dc2aa73
|
refs/heads/master
| 2023-03-07T22:09:48.814291
| 2023-02-28T16:45:15
| 2023-02-28T16:45:15
| 2,854,337
| 8,135
| 2,343
|
BSD-3-Clause
| 2023-09-12T12:41:13
| 2011-11-26T05:52:50
|
PHP
|
UTF-8
|
C
| false
| true
| 4,155
|
c
|
php.zep.c
|
#ifdef HAVE_CONFIG_H
#include "../../../../ext_config.h"
#endif
#include <php.h>
#include "../../../../php_ext.h"
#include "../../../../ext.h"
#include <Zend/zend_operators.h>
#include <Zend/zend_exceptions.h>
#include <Zend/zend_interfaces.h>
#include "kernel/main.h"
#include "kernel/fcall.h"
#include "kernel/memory.h"
#include "kernel/require.h"
#include "kernel/object.h"
#include "ext/spl/spl_exceptions.h"
#include "kernel/exception.h"
#include "kernel/operators.h"
/**
* This file is part of the Phalcon Framework.
*
* (c) Phalcon Team <team@phalcon.io>
*
* For the full copyright and license information, please view the LICENSE.txt
* file that was distributed with this source code.
*/
/**
* Adapter to use PHP itself as templating engine
*/
ZEPHIR_INIT_CLASS(Phalcon_Mvc_View_Engine_Php)
{
ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc\\View\\Engine, Php, phalcon, mvc_view_engine_php, phalcon_mvc_view_engine_abstractengine_ce, phalcon_mvc_view_engine_php_method_entry, 0);
return SUCCESS;
}
/**
* Renders a view using the template engine
*/
PHP_METHOD(Phalcon_Mvc_View_Engine_Php, render)
{
zend_string *_3$$4;
zend_ulong _2$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zend_bool mustClean;
zval *path_param = NULL, *params, params_sub, *mustClean_param = NULL, key, value, *_0$$4, _1$$4, _4$$5, _5$$6, _6$$7, _7$$7;
zval path;
zval *this_ptr = getThis();
ZVAL_UNDEF(&path);
ZVAL_UNDEF(¶ms_sub);
ZVAL_UNDEF(&key);
ZVAL_UNDEF(&value);
ZVAL_UNDEF(&_1$$4);
ZVAL_UNDEF(&_4$$5);
ZVAL_UNDEF(&_5$$6);
ZVAL_UNDEF(&_6$$7);
ZVAL_UNDEF(&_7$$7);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_STR(path)
Z_PARAM_ZVAL(params)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(mustClean)
ZEND_PARSE_PARAMETERS_END();
#endif
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 2, 1, &path_param, ¶ms, &mustClean_param);
if (UNEXPECTED(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be of the type string"));
RETURN_MM_NULL();
}
if (EXPECTED(Z_TYPE_P(path_param) == IS_STRING)) {
zephir_get_strval(&path, path_param);
} else {
ZEPHIR_INIT_VAR(&path);
}
if (!mustClean_param) {
mustClean = 0;
} else {
mustClean = zephir_get_boolval(mustClean_param);
}
if (mustClean) {
ZEPHIR_CALL_FUNCTION(NULL, "ob_clean", NULL, 495);
zephir_check_call_status();
}
if (Z_TYPE_P(params) == IS_ARRAY) {
zephir_is_iterable(params, 0, "phalcon/Mvc/View/Engine/Php.zep", 36);
if (Z_TYPE_P(params) == IS_ARRAY) {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(params), _2$$4, _3$$4, _0$$4)
{
ZEPHIR_INIT_NVAR(&key);
if (_3$$4 != NULL) {
ZVAL_STR_COPY(&key, _3$$4);
} else {
ZVAL_LONG(&key, _2$$4);
}
ZEPHIR_INIT_NVAR(&value);
ZVAL_COPY(&value, _0$$4);
ZEPHIR_CPY_WRT(&_4$$5, &value);
if (zephir_set_symbol(&key, &_4$$5) == FAILURE) {
return;
}
} ZEND_HASH_FOREACH_END();
} else {
ZEPHIR_CALL_METHOD(NULL, params, "rewind", NULL, 0);
zephir_check_call_status();
while (1) {
ZEPHIR_CALL_METHOD(&_1$$4, params, "valid", NULL, 0);
zephir_check_call_status();
if (!zend_is_true(&_1$$4)) {
break;
}
ZEPHIR_CALL_METHOD(&key, params, "key", NULL, 0);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(&value, params, "current", NULL, 0);
zephir_check_call_status();
ZEPHIR_CPY_WRT(&_5$$6, &value);
if (zephir_set_symbol(&key, &_5$$6) == FAILURE) {
return;
}
ZEPHIR_CALL_METHOD(NULL, params, "next", NULL, 0);
zephir_check_call_status();
}
}
ZEPHIR_INIT_NVAR(&value);
ZEPHIR_INIT_NVAR(&key);
}
if (zephir_require_zval(&path) == FAILURE) {
RETURN_MM_NULL();
}
if (mustClean) {
zephir_read_property(&_6$$7, this_ptr, ZEND_STRL("view"), PH_NOISY_CC | PH_READONLY);
ZEPHIR_CALL_FUNCTION(&_7$$7, "ob_get_contents", NULL, 494);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(NULL, &_6$$7, "setcontent", NULL, 0, &_7$$7);
zephir_check_call_status();
}
ZEPHIR_MM_RESTORE();
}
|
3c0a4d4c977f6bcc81fbe4b587a49a572b597870
|
28d0f8c01599f8f6c711bdde0b59f9c2cd221203
|
/games/backgammon/common_source/fancy.c
|
a5288d04a57b903a48b836ca50aca0ae8548e723
|
[] |
no_license
|
NetBSD/src
|
1a9cbc22ed778be638b37869ed4fb5c8dd616166
|
23ee83f7c0aea0777bd89d8ebd7f0cde9880d13c
|
refs/heads/trunk
| 2023-08-31T13:24:58.105962
| 2023-08-27T15:50:47
| 2023-08-27T15:50:47
| 88,439,547
| 656
| 348
| null | 2023-07-20T20:07:24
| 2017-04-16T20:03:43
| null |
UTF-8
|
C
| false
| false
| 17,385
|
c
|
fancy.c
|
/* $NetBSD: fancy.c,v 1.17 2021/05/02 12:50:43 rillig Exp $ */
/*
* Copyright (c) 1980, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)fancy.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: fancy.c,v 1.17 2021/05/02 12:50:43 rillig Exp $");
#endif
#endif /* not lint */
#include "back.h"
static void bsect(int, int, int, int);
static void fixpos(int, int, int, int, int);
static void fixcol(int, int, int, int, int);
static void newline(void);
/*
* These need to be declared so they come out as commons, because
* termcap might or might not define some of them. Our termcap defines
* PC, BC, and UP only. This is gross.
*
* XXX: rewrite this crap using curses.
*/
#if 0
char PC; /* padding character */
char *BC; /* backspace sequence */
#endif
char *CD; /* clear to end of screen sequence */
char *CE; /* clear to end of line sequence */
char *CL; /* clear screen sequence */
char *CM; /* cursor movement instructions */
char *HO; /* home cursor sequence */
char *MC; /* column cursor movement map */
char *ML; /* row cursor movement map */
char *ND; /* forward cursor sequence */
#if 0
char *UP; /* up cursor sequence */
#endif
static int lHO; /* length of HO */
static int lBC; /* length of BC */
static int lND; /* length of ND */
static int lUP; /* length of UP */
static int CO; /* number of columns */
static int LI; /* number of lines */
static int *linect; /* array of lengths of lines on screen (the
* actual screen is not stored) */
/* two letter codes */
static char tcap[] = "bccdceclcmhomcmlndup";
/* corresponding strings */
static char **tstr[] = {&BC, &CD, &CE, &CL, &CM, &HO, &MC, &ML, &ND, &UP};
static char tbuf[1024]; /* buffer for decoded termcap entries */
static int oldb[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0};
static int oldr;
static int oldw;
/* "real" cursor positions, so it knows when to reposition. These are -1 if
* curr and curc are accurate */
static int realr;
static int realc;
void
fboard(void)
{
int i, j, l;
curmove(0, 0); /* do top line */
for (i = 0; i < 53; i++)
fancyc('_');
curmove(15, 0); /* do botttom line */
for (i = 0; i < 53; i++)
fancyc('_');
l = 1; /* do vertical lines */
for (i = 52; i > -1; i -= 28) {
curmove((l == 1 ? 1 : 15), i);
fancyc('|');
for (j = 0; j < 14; j++) {
curmove(curr + l, curc - 1);
fancyc('|');
}
if (i == 24)
i += 32;
l = -l; /* alternate directions */
}
curmove(2, 1); /* label positions 13-18 */
for (i = 13; i < 18; i++) {
fancyc('1');
fancyc((i % 10) + '0');
curmove(curr, curc + 2);
}
fancyc('1');
fancyc('8');
curmove(2, 29); /* label positions 19-24 */
fancyc('1');
fancyc('9');
for (i = 20; i < 25; i++) {
curmove(curr, curc + 2);
fancyc('2');
fancyc((i % 10) + '0');
}
curmove(14, 1); /* label positions 12-7 */
fancyc('1');
fancyc('2');
for (i = 11; i > 6; i--) {
curmove(curr, curc + 2);
fancyc(i > 9 ? '1' : ' ');
fancyc((i % 10) + '0');
}
curmove(14, 30); /* label positions 6-1 */
fancyc('6');
for (i = 5; i > 0; i--) {
curmove(curr, curc + 3);
fancyc(i + '0');
}
for (i = 12; i > 6; i--)/* print positions 12-7 */
if (board[i])
bsect(board[i], 13, 1 + 4 * (12 - i), -1);
if (board[0]) /* print red men on bar */
bsect(board[0], 13, 25, -1);
for (i = 6; i > 0; i--) /* print positions 6-1 */
if (board[i])
bsect(board[i], 13, 29 + 4 * (6 - i), -1);
l = (off[1] < 0 ? off[1] + 15 : off[1]); /* print white's home */
bsect(l, 3, 54, 1);
curmove(8, 25); /* print the word BAR */
fancyc('B');
fancyc('A');
fancyc('R');
for (i = 13; i < 19; i++) /* print positions 13-18 */
if (board[i])
bsect(board[i], 3, 1 + 4 * (i - 13), 1);
if (board[25]) /* print white's men on bar */
bsect(board[25], 3, 25, 1);
for (i = 19; i < 25; i++) /* print positions 19-24 */
if (board[i])
bsect(board[i], 3, 29 + 4 * (i - 19), 1);
l = (off[0] < 0 ? off[0] + 15 : off[0]); /* print red's home */
bsect(-l, 13, 54, -1);
for (i = 0; i < 26; i++)/* save board position for refresh later */
oldb[i] = board[i];
oldr = (off[1] < 0 ? off[1] + 15 : off[1]);
oldw = -(off[0] < 0 ? off[0] + 15 : off[0]);
}
/*
* bsect (b,rpos,cpos,cnext)
* Print the contents of a board position. "b" has the value of the
* position, "rpos" is the row to start printing, "cpos" is the column to
* start printing, and "cnext" is positive if the position starts at the top
* and negative if it starts at the bottom. The value of "cpos" is checked
* to see if the position is a player's home, since those are printed
* differently.
*/
static void
bsect(int b, int rpos, int cpos, int cnext)
{
int j; /* index */
int n; /* number of men on position */
int bct; /* counter */
int k; /* index */
char pc; /* color of men on position */
bct = 0;
n = abs(b); /* initialize n and pc */
pc = (b > 0 ? 'r' : 'w');
if (n < 6 && cpos < 54) /* position cursor at start */
curmove(rpos, cpos + 1);
else
curmove(rpos, cpos);
for (j = 0; j < 5; j++) { /* print position row by row */
for (k = 0; k < 15; k += 5) /* print men */
if (n > j + k)
fancyc(pc);
if (j < 4) { /* figure how far to back up for next row */
if (n < 6) { /* stop if none left */
if (j + 1 == n)
break;
bct = 1; /* single column */
} else {
if (n < 11) { /* two columns */
if (cpos == 54) { /* home pos */
if (j + 5 >= n)
bct = 1;
else
bct = 2;
}
if (cpos < 54) { /* not home */
if (j + 6 >= n)
bct = 1;
else
bct = 2;
}
} else { /* three columns */
if (j + 10 >= n)
bct = 2;
else
bct = 3;
}
}
/* reposition cursor */
curmove(curr + cnext, curc - bct);
}
}
}
void
refresh(void)
{
int i, r, c;
r = curr; /* save current position */
c = curc;
for (i = 12; i > 6; i--)/* fix positions 12-7 */
if (board[i] != oldb[i]) {
fixpos(oldb[i], board[i], 13, 1 + (12 - i) * 4, -1);
oldb[i] = board[i];
}
if (board[0] != oldb[0]) { /* fix red men on bar */
fixpos(oldb[0], board[0], 13, 25, -1);
oldb[0] = board[0];
}
for (i = 6; i > 0; i--) /* fix positions 6-1 */
if (board[i] != oldb[i]) {
fixpos(oldb[i], board[i], 13, 29 + (6 - i) * 4, -1);
oldb[i] = board[i];
}
i = -(off[0] < 0 ? off[0] + 15 : off[0]); /* fix white's home */
if (oldw != i) {
fixpos(oldw, i, 13, 54, -1);
oldw = i;
}
for (i = 13; i < 19; i++) /* fix positions 13-18 */
if (board[i] != oldb[i]) {
fixpos(oldb[i], board[i], 3, 1 + (i - 13) * 4, 1);
oldb[i] = board[i];
}
if (board[25] != oldb[25]) { /* fix white men on bar */
fixpos(oldb[25], board[25], 3, 25, 1);
oldb[25] = board[25];
}
for (i = 19; i < 25; i++) /* fix positions 19-24 */
if (board[i] != oldb[i]) {
fixpos(oldb[i], board[i], 3, 29 + (i - 19) * 4, 1);
oldb[i] = board[i];
}
i = (off[1] < 0 ? off[1] + 15 : off[1]); /* fix red's home */
if (oldr != i) {
fixpos(oldr, i, 3, 54, 1);
oldr = i;
}
curmove(r, c); /* return to saved position */
newpos();
buflush();
}
static void
fixpos(int cur, int new, int r, int c, int inc)
{
int o, n, nv;
int ov, nc;
char col;
nc = 0;
if (cur * new >= 0) {
ov = abs(cur);
nv = abs(new);
col = (cur + new > 0 ? 'r' : 'w');
o = (ov - 1) / 5;
n = (nv - 1) / 5;
if (o == n) {
if (o == 2)
nc = c + 2;
if (o == 1)
nc = c < 54 ? c : c + 1;
if (o == 0)
nc = c < 54 ? c + 1 : c;
if (ov > nv)
fixcol(r + inc * (nv - n * 5), nc,
abs(ov - nv), ' ', inc);
else
fixcol(r + inc * (ov - o * 5), nc,
abs(ov - nv), col, inc);
return;
} else {
if (c < 54) {
if (o + n == 1) {
if (n) {
fixcol(r, c, abs(nv - 5), col,
inc);
if (ov != 5)
fixcol(r + inc * ov,
c + 1, abs(ov - 5),
col, inc);
} else {
fixcol(r, c, abs(ov - 5), ' ',
inc);
if (nv != 5)
fixcol(r + inc * nv,
c + 1, abs(nv - 5),
' ', inc);
}
return;
}
if (n == 2) {
if (ov != 10)
fixcol(r + inc * (ov - 5), c,
abs(ov - 10), col, inc);
fixcol(r, c + 2, abs(nv - 10), col,
inc);
} else {
if (nv != 10)
fixcol(r + inc * (nv - 5), c,
abs(nv - 10), ' ', inc);
fixcol(r, c + 2, abs(ov - 10), ' ',
inc);
}
return;
}
if (n > o) {
fixcol(r + inc * (ov % 5), c + o,
abs(5 * n - ov), col, inc);
if (nv != 5 * n)
fixcol(r, c + n, abs(5 * n - nv),
col, inc);
} else {
fixcol(r + inc * (nv % 5), c + n,
abs(5 * n - nv), ' ', inc);
if (ov != 5 * o)
fixcol(r, c + o, abs(5 * o - ov),
' ', inc);
}
return;
}
}
nv = abs(new);
fixcol(r, c + 1, nv, new > 0 ? 'r' : 'w', inc);
if (abs(cur) <= abs(new))
return;
fixcol(r + inc * new, c + 1, abs(cur + new), ' ', inc);
}
static void
fixcol(int r, int c, int l, int ch, int inc)
{
int i;
curmove(r, c);
fancyc(ch);
for (i = 1; i < l; i++) {
curmove(curr + inc, curc - 1);
fancyc(ch);
}
}
void
curmove(int r, int c)
{
if (curr == r && curc == c)
return;
if (realr == -1) {
realr = curr;
realc = curc;
}
curr = r;
curc = c;
}
void
newpos(void)
{
int r; /* destination row */
int c; /* destination column */
int mode = -1; /* mode of movement */
int ccount = 1000; /* character count */
int i; /* index */
int n; /* temporary variable */
char *m; /* string containing CM movement */
m = NULL;
if (realr == -1) /* see if already there */
return;
r = curr; /* set current and dest. positions */
c = curc;
curr = realr;
curc = realc;
/* double check position */
if (curr == r && curc == c) {
realr = realc = -1;
return;
}
if (CM) { /* try CM to get there */
mode = 0;
m = (char *) tgoto(CM, c, r);
ccount = strlen(m);
}
/* try HO and local movement */
if (HO && (n = r + c * lND + lHO) < ccount) {
mode = 1;
ccount = n;
}
/* try various LF combinations */
if (r >= curr) {
/* CR, LF, and ND */
if ((n = (r - curr) + c * lND + 1) < ccount) {
mode = 2;
ccount = n;
}
/* LF, ND */
if (c >= curc && (n = (r - curr) + (c - curc) * lND) < ccount) {
mode = 3;
ccount = n;
}
/* LF, BS */
if (c < curc && (n = (r - curr) + (curc - c) * lBC) < ccount) {
mode = 4;
ccount = n;
}
}
/* try corresponding UP combinations */
if (r < curr) {
/* CR, UP, and ND */
if ((n = (curr - r) * lUP + c * lND + 1) < ccount) {
mode = 5;
ccount = n;
}
/* UP and ND */
if (c >= curc &&
(n = (curr - r) * lUP + (c - curc) * lND) < ccount) {
mode = 6;
ccount = n;
}
/* UP and BS */
if (c < curc &&
(n = (curr - r) * lUP + (curc - c) * lBC) < ccount) {
mode = 7;
ccount = n;
}
}
/* space over */
if (curr == r && c > curc && linect[r] < curc && c - curc < ccount)
mode = 8;
switch (mode) {
case -1: /* error! */
write(2, "\r\nInternal cursor error.\r\n", 26);
getout(0);
/* direct cursor motion */
case 0:
tputs(m, abs(curr - r), addbuf);
break;
/* relative to "home" */
case 1:
tputs(HO, r, addbuf);
for (i = 0; i < r; i++)
addbuf('\012');
for (i = 0; i < c; i++)
tputs(ND, 1, addbuf);
break;
/* CR and down and over */
case 2:
addbuf('\015');
for (i = 0; i < r - curr; i++)
addbuf('\012');
for (i = 0; i < c; i++)
tputs(ND, 1, addbuf);
break;
/* down and over */
case 3:
for (i = 0; i < r - curr; i++)
addbuf('\012');
for (i = 0; i < c - curc; i++)
tputs(ND, 1, addbuf);
break;
/* down and back */
case 4:
for (i = 0; i < r - curr; i++)
addbuf('\012');
for (i = 0; i < curc - c; i++)
addbuf('\010');
break;
/* CR and up and over */
case 5:
addbuf('\015');
for (i = 0; i < curr - r; i++)
tputs(UP, 1, addbuf);
for (i = 0; i < c; i++)
tputs(ND, 1, addbuf);
break;
/* up and over */
case 6:
for (i = 0; i < curr - r; i++)
tputs(UP, 1, addbuf);
for (i = 0; i < c - curc; i++)
tputs(ND, 1, addbuf);
break;
/* up and back */
case 7:
for (i = 0; i < curr - r; i++)
tputs(UP, 1, addbuf);
for (i = 0; i < curc - c; i++) {
if (BC)
tputs(BC, 1, addbuf);
else
addbuf('\010');
}
break;
/* safe space */
case 8:
for (i = 0; i < c - curc; i++)
addbuf(' ');
}
/* fix positions */
curr = r;
curc = c;
realr = -1;
realc = -1;
}
void
clear(void)
{
int i;
/* double space if can't clear */
if (CL == 0) {
writel("\n\n");
return;
}
curr = curc = 0; /* fix position markers */
realr = realc = -1;
for (i = 0; i < 24; i++)/* clear line counts */
linect[i] = -1;
buffnum = -1; /* ignore leftover buffer contents */
tputs(CL, CO, addbuf); /* put CL in buffer */
}
void
fancyc(int c)
{
int sp; /* counts spaces in a tab */
if (c == '\007') { /* bells go in blindly */
addbuf(c);
return;
}
/* process tabs, use spaces if the tab should be erasing things,
* otherwise use cursor movement routines. Note this does not use
* hardware tabs at all. */
if (c == '\t') {
sp = (curc + 8) & (~7); /* compute spaces */
/* check line length */
if (linect[curr] >= curc || sp < 4) {
for (; sp > curc; sp--)
addbuf(' ');
curc = sp; /* fix curc */
} else
curmove(curr, sp);
return;
}
/* do newline be calling newline */
if (c == '\n') {
newline();
return;
}
/* ignore any other control chars */
if (c < ' ')
return;
/* if an erasing space or non-space, just add it to buffer. Otherwise
* use cursor movement routine, so that multiple spaces will be
* grouped together */
if (c > ' ' || linect[curr] >= curc) {
newpos(); /* make sure position correct */
addbuf(c); /* add character to buffer */
/* fix line length */
if (c == ' ' && linect[curr] == curc)
linect[curr]--;
else
if (linect[curr] < curc)
linect[curr] = curc;
curc++; /* fix curc */
} else
/* use cursor movement routine */
curmove(curr, curc + 1);
}
void
clend(void)
{
int i;
if (CD) {
tputs(CD, CO - curr, addbuf);
for (i = curr; i < LI; i++)
linect[i] = -1;
return;
}
curmove(i = curr, 0);
cline();
while (curr < LI - 1) {
curmove(curr + 1, 0);
if (linect[curr] > -1)
cline();
}
curmove(i, 0);
}
void
cline(void)
{
int c;
if (curc > linect[curr])
return;
newpos();
if (CE) {
tputs(CE, 1, addbuf);
linect[curr] = curc - 1;
} else {
c = curc - 1;
while (linect[curr] > c) {
addbuf(' ');
curc++;
linect[curr]--;
}
curmove(curr, c + 1);
}
}
static void
newline(void)
{
cline();
if (curr == LI - 1)
curmove(begscr, 0);
else
curmove(curr + 1, 0);
}
int
getcaps(const char *s)
{
char *code; /* two letter code */
char ***cap; /* pointer to cap string */
char *bufp; /* pointer to cap buffer */
char tentry[1024]; /* temporary uncoded caps buffer */
tgetent(tentry, s); /* get uncoded termcap entry */
LI = tgetnum("li"); /* get number of lines */
if (LI == -1)
LI = 12;
CO = tgetnum("co"); /* get number of columns */
if (CO == -1)
CO = 65;
bufp = tbuf; /* get padding character */
tgetstr("pc", &bufp);
if (bufp != tbuf)
PC = *tbuf;
else
PC = 0;
bufp = tbuf; /* get string entries */
cap = tstr;
for (code = tcap; *code; code += 2)
**cap++ = (char *) tgetstr(code, &bufp);
/* get pertinent lengths */
if (HO)
lHO = strlen(HO);
if (BC)
lBC = strlen(BC);
else
lBC = 1;
if (UP)
lUP = strlen(UP);
if (ND)
lND = strlen(ND);
if (LI < 24 || CO < 72 || !(CL && UP && ND))
return (0);
linect = (int *) calloc(LI + 1, sizeof(int));
if (linect == NULL) {
write(2, "\r\nOut of memory!\r\n", 18);
getout(0);
}
return (1);
}
|
9bbb823bf082fb058fa21f1e57dcd2726a297df4
|
9ceacf33fd96913cac7ef15492c126d96cae6911
|
/sys/dev/pci/cmpci.c
|
fcd232708677f6b61fbbb63762f55677890009b2
|
[] |
no_license
|
openbsd/src
|
ab97ef834fd2d5a7f6729814665e9782b586c130
|
9e79f3a0ebd11a25b4bff61e900cb6de9e7795e9
|
refs/heads/master
| 2023-09-02T18:54:56.624627
| 2023-09-02T15:16:12
| 2023-09-02T15:16:12
| 66,966,208
| 3,394
| 1,235
| null | 2023-08-08T02:42:25
| 2016-08-30T18:18:25
|
C
|
UTF-8
|
C
| false
| false
| 50,752
|
c
|
cmpci.c
|
/* $OpenBSD: cmpci.c,v 1.53 2023/03/08 04:43:08 guenther Exp $ */
/* $NetBSD: cmpci.c,v 1.25 2004/10/26 06:32:20 xtraeme Exp $ */
/*
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Takuya SHIOZAKI <tshiozak@NetBSD.org> .
*
* This code is derived from software contributed to The NetBSD Foundation
* by ITOH Yasufumi.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
/*
* C-Media CMI8x38, CMI8768 Audio Chip Support.
*
* TODO:
* - Joystick support.
*
*/
#if defined(AUDIO_DEBUG) || defined(DEBUG)
#define DPRINTF(x) if (cmpcidebug) printf x
int cmpcidebug = 0;
#else
#define DPRINTF(x)
#endif
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/device.h>
#include <dev/pci/pcidevs.h>
#include <dev/pci/pcivar.h>
#include <sys/audioio.h>
#include <dev/audio_if.h>
#include <dev/midi_if.h>
#include <dev/pci/cmpcireg.h>
#include <dev/pci/cmpcivar.h>
#include <machine/bus.h>
#include <machine/intr.h>
/*
* Low-level HW interface
*/
uint8_t cmpci_mixerreg_read(struct cmpci_softc *, uint8_t);
void cmpci_mixerreg_write(struct cmpci_softc *, uint8_t, uint8_t);
void cmpci_reg_partial_write_1(struct cmpci_softc *, int, int,
unsigned, unsigned);
void cmpci_reg_partial_write_4(struct cmpci_softc *, int, int,
uint32_t, uint32_t);
void cmpci_reg_set_1(struct cmpci_softc *, int, uint8_t);
void cmpci_reg_clear_1(struct cmpci_softc *, int, uint8_t);
void cmpci_reg_set_4(struct cmpci_softc *, int, uint32_t);
void cmpci_reg_clear_4(struct cmpci_softc *, int, uint32_t);
void cmpci_reg_set_reg_misc(struct cmpci_softc *, uint32_t);
void cmpci_reg_clear_reg_misc(struct cmpci_softc *, uint32_t);
int cmpci_rate_to_index(int);
int cmpci_index_to_rate(int);
int cmpci_index_to_divider(int);
int cmpci_adjust(int, int);
void cmpci_set_mixer_gain(struct cmpci_softc *, int);
void cmpci_set_out_ports(struct cmpci_softc *);
int cmpci_set_in_ports(struct cmpci_softc *);
void cmpci_resume(struct cmpci_softc *);
/*
* autoconf interface
*/
int cmpci_match(struct device *, void *, void *);
void cmpci_attach(struct device *, struct device *, void *);
int cmpci_activate(struct device *, int);
struct cfdriver cmpci_cd = {
NULL, "cmpci", DV_DULL
};
const struct cfattach cmpci_ca = {
sizeof (struct cmpci_softc), cmpci_match, cmpci_attach, NULL,
cmpci_activate
};
/* interrupt */
int cmpci_intr(void *);
/*
* DMA stuff
*/
int cmpci_alloc_dmamem(struct cmpci_softc *,
size_t, int,
int, caddr_t *);
int cmpci_free_dmamem(struct cmpci_softc *, caddr_t,
int);
struct cmpci_dmanode * cmpci_find_dmamem(struct cmpci_softc *,
caddr_t);
/*
* Interface to machine independent layer
*/
int cmpci_open(void *, int);
void cmpci_close(void *);
int cmpci_set_params(void *, int, int,
struct audio_params *,
struct audio_params *);
int cmpci_round_blocksize(void *, int);
int cmpci_halt_output(void *);
int cmpci_halt_input(void *);
int cmpci_set_port(void *, mixer_ctrl_t *);
int cmpci_get_port(void *, mixer_ctrl_t *);
int cmpci_query_devinfo(void *, mixer_devinfo_t *);
void *cmpci_malloc(void *, int, size_t, int, int);
void cmpci_free(void *, void *, int);
size_t cmpci_round_buffersize(void *, int, size_t);
int cmpci_trigger_output(void *, void *, void *, int,
void (*)(void *), void *,
struct audio_params *);
int cmpci_trigger_input(void *, void *, void *, int,
void (*)(void *), void *,
struct audio_params *);
const struct audio_hw_if cmpci_hw_if = {
.open = cmpci_open,
.close = cmpci_close,
.set_params = cmpci_set_params,
.round_blocksize = cmpci_round_blocksize,
.halt_output = cmpci_halt_output,
.halt_input = cmpci_halt_input,
.set_port = cmpci_set_port,
.get_port = cmpci_get_port,
.query_devinfo = cmpci_query_devinfo,
.allocm = cmpci_malloc,
.freem = cmpci_free,
.round_buffersize = cmpci_round_buffersize,
.trigger_output = cmpci_trigger_output,
.trigger_input = cmpci_trigger_input,
};
/*
* Low-level HW interface
*/
/* mixer register read/write */
uint8_t
cmpci_mixerreg_read(struct cmpci_softc *sc, uint8_t no)
{
uint8_t ret;
bus_space_write_1(sc->sc_iot, sc->sc_ioh, CMPCI_REG_SBADDR, no);
delay(10);
ret = bus_space_read_1(sc->sc_iot, sc->sc_ioh, CMPCI_REG_SBDATA);
delay(10);
return ret;
}
void
cmpci_mixerreg_write(struct cmpci_softc *sc, uint8_t no, uint8_t val)
{
bus_space_write_1(sc->sc_iot, sc->sc_ioh, CMPCI_REG_SBADDR, no);
delay(10);
bus_space_write_1(sc->sc_iot, sc->sc_ioh, CMPCI_REG_SBDATA, val);
delay(10);
}
/* register partial write */
void
cmpci_reg_partial_write_1(struct cmpci_softc *sc, int no, int shift,
unsigned mask, unsigned val)
{
bus_space_write_1(sc->sc_iot, sc->sc_ioh, no,
(val<<shift) |
(bus_space_read_1(sc->sc_iot, sc->sc_ioh, no) & ~(mask<<shift)));
delay(10);
}
void
cmpci_reg_partial_write_4(struct cmpci_softc *sc, int no, int shift,
uint32_t mask, uint32_t val)
{
bus_space_write_4(sc->sc_iot, sc->sc_ioh, no,
(val<<shift) |
(bus_space_read_4(sc->sc_iot, sc->sc_ioh, no) & ~(mask<<shift)));
delay(10);
}
/* register set/clear bit */
void
cmpci_reg_set_1(struct cmpci_softc *sc, int no, uint8_t mask)
{
bus_space_write_1(sc->sc_iot, sc->sc_ioh, no,
(bus_space_read_1(sc->sc_iot, sc->sc_ioh, no) | mask));
delay(10);
}
void
cmpci_reg_clear_1(struct cmpci_softc *sc, int no, uint8_t mask)
{
bus_space_write_1(sc->sc_iot, sc->sc_ioh, no,
(bus_space_read_1(sc->sc_iot, sc->sc_ioh, no) & ~mask));
delay(10);
}
void
cmpci_reg_set_4(struct cmpci_softc *sc, int no, uint32_t mask)
{
/* use cmpci_reg_set_reg_misc() for CMPCI_REG_MISC */
KDASSERT(no != CMPCI_REG_MISC);
bus_space_write_4(sc->sc_iot, sc->sc_ioh, no,
(bus_space_read_4(sc->sc_iot, sc->sc_ioh, no) | mask));
delay(10);
}
void
cmpci_reg_clear_4(struct cmpci_softc *sc, int no, uint32_t mask)
{
/* use cmpci_reg_clear_reg_misc() for CMPCI_REG_MISC */
KDASSERT(no != CMPCI_REG_MISC);
bus_space_write_4(sc->sc_iot, sc->sc_ioh, no,
(bus_space_read_4(sc->sc_iot, sc->sc_ioh, no) & ~mask));
delay(10);
}
/*
* The CMPCI_REG_MISC register needs special handling, since one of
* its bits has different read/write values.
*/
void
cmpci_reg_set_reg_misc(struct cmpci_softc *sc, uint32_t mask)
{
sc->sc_reg_misc |= mask;
bus_space_write_4(sc->sc_iot, sc->sc_ioh, CMPCI_REG_MISC,
sc->sc_reg_misc);
delay(10);
}
void
cmpci_reg_clear_reg_misc(struct cmpci_softc *sc, uint32_t mask)
{
sc->sc_reg_misc &= ~mask;
bus_space_write_4(sc->sc_iot, sc->sc_ioh, CMPCI_REG_MISC,
sc->sc_reg_misc);
delay(10);
}
/* rate */
static const struct {
int rate;
int divider;
} cmpci_rate_table[CMPCI_REG_NUMRATE] = {
#define _RATE(n) { n, CMPCI_REG_RATE_ ## n }
_RATE(5512),
_RATE(8000),
_RATE(11025),
_RATE(16000),
_RATE(22050),
_RATE(32000),
_RATE(44100),
_RATE(48000)
#undef _RATE
};
int
cmpci_rate_to_index(int rate)
{
int i;
for (i = 0; i < CMPCI_REG_NUMRATE - 1; i++)
if (rate <=
(cmpci_rate_table[i].rate + cmpci_rate_table[i+1].rate) / 2)
return i;
return i; /* 48000 */
}
int
cmpci_index_to_rate(int index)
{
return cmpci_rate_table[index].rate;
}
int
cmpci_index_to_divider(int index)
{
return cmpci_rate_table[index].divider;
}
const struct pci_matchid cmpci_devices[] = {
{ PCI_VENDOR_CMI, PCI_PRODUCT_CMI_CMI8338A },
{ PCI_VENDOR_CMI, PCI_PRODUCT_CMI_CMI8338B },
{ PCI_VENDOR_CMI, PCI_PRODUCT_CMI_CMI8738 },
{ PCI_VENDOR_CMI, PCI_PRODUCT_CMI_CMI8738B }
};
/*
* interface to configure the device.
*/
int
cmpci_match(struct device *parent, void *match, void *aux)
{
return (pci_matchbyid((struct pci_attach_args *)aux, cmpci_devices,
nitems(cmpci_devices)));
}
void
cmpci_attach(struct device *parent, struct device *self, void *aux)
{
struct cmpci_softc *sc = (struct cmpci_softc *)self;
struct pci_attach_args *pa = (struct pci_attach_args *)aux;
struct audio_attach_args aa;
pci_intr_handle_t ih;
char const *intrstr;
int i, v, d;
sc->sc_id = pa->pa_id;
sc->sc_class = pa->pa_class;
switch (PCI_PRODUCT(sc->sc_id)) {
case PCI_PRODUCT_CMI_CMI8338A:
/*FALLTHROUGH*/
case PCI_PRODUCT_CMI_CMI8338B:
sc->sc_capable = CMPCI_CAP_CMI8338;
break;
case PCI_PRODUCT_CMI_CMI8738:
/*FALLTHROUGH*/
case PCI_PRODUCT_CMI_CMI8738B:
sc->sc_capable = CMPCI_CAP_CMI8738;
break;
}
/* map I/O space */
if (pci_mapreg_map(pa, CMPCI_PCI_IOBASEREG, PCI_MAPREG_TYPE_IO, 0,
&sc->sc_iot, &sc->sc_ioh, NULL, NULL, 0)) {
printf(": can't map i/o space\n");
return;
}
/* interrupt */
if (pci_intr_map(pa, &ih)) {
printf(": can't map interrupt\n");
return;
}
intrstr = pci_intr_string(pa->pa_pc, ih);
sc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_AUDIO | IPL_MPSAFE,
cmpci_intr, sc, sc->sc_dev.dv_xname);
if (sc->sc_ih == NULL) {
printf(": can't establish interrupt");
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
return;
}
printf(": %s\n", intrstr);
sc->sc_dmat = pa->pa_dmat;
audio_attach_mi(&cmpci_hw_if, sc, NULL, &sc->sc_dev);
/* attach OPL device */
aa.type = AUDIODEV_TYPE_OPL;
aa.hwif = NULL;
aa.hdl = NULL;
(void)config_found(&sc->sc_dev, &aa, audioprint);
/* attach MPU-401 device */
aa.type = AUDIODEV_TYPE_MPU;
aa.hwif = NULL;
aa.hdl = NULL;
if (bus_space_subregion(sc->sc_iot, sc->sc_ioh,
CMPCI_REG_MPU_BASE, CMPCI_REG_MPU_SIZE, &sc->sc_mpu_ioh) == 0)
sc->sc_mpudev = config_found(&sc->sc_dev, &aa, audioprint);
/* get initial value (this is 0 and may be omitted but just in case) */
sc->sc_reg_misc = bus_space_read_4(sc->sc_iot, sc->sc_ioh,
CMPCI_REG_MISC) & ~CMPCI_REG_SPDIF48K;
/* extra capabilities check */
d = bus_space_read_4(sc->sc_iot, sc->sc_ioh, CMPCI_REG_INTR_CTRL) &
CMPCI_REG_CHIP_MASK2;
if (d) {
if (d & CMPCI_REG_CHIP_8768) {
sc->sc_version = 68;
sc->sc_capable |= CMPCI_CAP_4CH | CMPCI_CAP_6CH |
CMPCI_CAP_8CH;
} else if (d & CMPCI_REG_CHIP_055) {
sc->sc_version = 55;
sc->sc_capable |= CMPCI_CAP_4CH | CMPCI_CAP_6CH;
} else if (d & CMPCI_REG_CHIP_039) {
sc->sc_version = 39;
sc->sc_capable |= CMPCI_CAP_4CH |
((d & CMPCI_REG_CHIP_039_6CH) ? CMPCI_CAP_6CH : 0);
} else {
/* unknown version */
sc->sc_version = 0;
}
} else {
d = bus_space_read_4(sc->sc_iot, sc->sc_ioh,
CMPCI_REG_CHANNEL_FORMAT) & CMPCI_REG_CHIP_MASK1;
if (d)
sc->sc_version = 37;
else
sc->sc_version = 33;
}
cmpci_mixerreg_write(sc, CMPCI_SB16_MIXER_RESET, 0);
cmpci_mixerreg_write(sc, CMPCI_SB16_MIXER_ADCMIX_L, 0);
cmpci_mixerreg_write(sc, CMPCI_SB16_MIXER_ADCMIX_R, 0);
cmpci_mixerreg_write(sc, CMPCI_SB16_MIXER_OUTMIX,
CMPCI_SB16_SW_CD|CMPCI_SB16_SW_MIC|CMPCI_SB16_SW_LINE);
for (i = 0; i < CMPCI_NDEVS; i++) {
switch(i) {
/*
* CMI8738 defaults are
* master: 0xe0 (0x00 - 0xf8)
* FM, DAC: 0xc0 (0x00 - 0xf8)
* PC speaker: 0x80 (0x00 - 0xc0)
* others: 0
*/
/* volume */
case CMPCI_MASTER_VOL:
v = 128; /* 224 */
break;
case CMPCI_FM_VOL:
case CMPCI_DAC_VOL:
v = 192;
break;
case CMPCI_PCSPEAKER:
v = 128;
break;
/* booleans, set to true */
case CMPCI_CD_MUTE:
case CMPCI_MIC_MUTE:
case CMPCI_LINE_IN_MUTE:
case CMPCI_AUX_IN_MUTE:
v = 1;
break;
/* volume with initial value 0 */
case CMPCI_CD_VOL:
case CMPCI_LINE_IN_VOL:
case CMPCI_AUX_IN_VOL:
case CMPCI_MIC_VOL:
case CMPCI_MIC_RECVOL:
/* FALLTHROUGH */
/* others are cleared */
case CMPCI_MIC_PREAMP:
case CMPCI_RECORD_SOURCE:
case CMPCI_PLAYBACK_MODE:
case CMPCI_SPDIF_IN_SELECT:
case CMPCI_SPDIF_IN_PHASE:
case CMPCI_SPDIF_LOOP:
case CMPCI_SPDIF_OUT_PLAYBACK:
case CMPCI_SPDIF_OUT_VOLTAGE:
case CMPCI_MONITOR_DAC:
case CMPCI_REAR:
case CMPCI_INDIVIDUAL:
case CMPCI_REVERSE:
case CMPCI_SURROUND:
default:
v = 0;
break;
}
sc->sc_gain[i][CMPCI_LEFT] = sc->sc_gain[i][CMPCI_RIGHT] = v;
cmpci_set_mixer_gain(sc, i);
}
sc->sc_play_channel = 0;
}
int
cmpci_activate(struct device *self, int act)
{
struct cmpci_softc *sc = (struct cmpci_softc *)self;
switch (act) {
case DVACT_RESUME:
cmpci_resume(sc);
break;
default:
break;
}
return (config_activate_children(self, act));
}
void
cmpci_resume(struct cmpci_softc *sc)
{
cmpci_mixerreg_write(sc, CMPCI_SB16_MIXER_RESET, 0);
}
int
cmpci_intr(void *handle)
{
struct cmpci_softc *sc = handle;
struct cmpci_channel *chan;
uint32_t intrstat;
uint16_t hwpos;
mtx_enter(&audio_lock);
intrstat = bus_space_read_4(sc->sc_iot, sc->sc_ioh,
CMPCI_REG_INTR_STATUS);
if (!(intrstat & CMPCI_REG_ANY_INTR)) {
mtx_leave(&audio_lock);
return 0;
}
delay(10);
/* disable and reset intr */
if (intrstat & CMPCI_REG_CH0_INTR)
cmpci_reg_clear_4(sc, CMPCI_REG_INTR_CTRL,
CMPCI_REG_CH0_INTR_ENABLE);
if (intrstat & CMPCI_REG_CH1_INTR)
cmpci_reg_clear_4(sc, CMPCI_REG_INTR_CTRL,
CMPCI_REG_CH1_INTR_ENABLE);
if (intrstat & CMPCI_REG_CH0_INTR) {
chan = &sc->sc_ch0;
if (chan->intr != NULL) {
hwpos = bus_space_read_2(sc->sc_iot, sc->sc_ioh,
CMPCI_REG_DMA0_BYTES);
hwpos = hwpos * chan->bps / chan->blksize;
hwpos = chan->nblocks - hwpos - 1;
while (chan->swpos != hwpos) {
(*chan->intr)(chan->intr_arg);
chan->swpos++;
if (chan->swpos >= chan->nblocks)
chan->swpos = 0;
if (chan->swpos != hwpos) {
DPRINTF(("%s: DMA0 hwpos=%d swpos=%d\n",
__func__, hwpos, chan->swpos));
}
}
}
}
if (intrstat & CMPCI_REG_CH1_INTR) {
chan = &sc->sc_ch1;
if (chan->intr != NULL) {
hwpos = bus_space_read_2(sc->sc_iot, sc->sc_ioh,
CMPCI_REG_DMA1_BYTES);
hwpos = hwpos * chan->bps / chan->blksize;
hwpos = chan->nblocks - hwpos - 1;
while (chan->swpos != hwpos) {
(*chan->intr)(chan->intr_arg);
chan->swpos++;
if (chan->swpos >= chan->nblocks)
chan->swpos = 0;
if (chan->swpos != hwpos) {
DPRINTF(("%s: DMA1 hwpos=%d swpos=%d\n",
__func__, hwpos, chan->swpos));
}
}
}
}
/* enable intr */
if (intrstat & CMPCI_REG_CH0_INTR)
cmpci_reg_set_4(sc, CMPCI_REG_INTR_CTRL,
CMPCI_REG_CH0_INTR_ENABLE);
if (intrstat & CMPCI_REG_CH1_INTR)
cmpci_reg_set_4(sc, CMPCI_REG_INTR_CTRL,
CMPCI_REG_CH1_INTR_ENABLE);
#if 0
if (intrstat & CMPCI_REG_UART_INTR && sc->sc_mpudev != NULL)
mpu_intr(sc->sc_mpudev);
#endif
mtx_leave(&audio_lock);
return 1;
}
/* open/close */
int
cmpci_open(void *handle, int flags)
{
return 0;
}
void
cmpci_close(void *handle)
{
}
int
cmpci_set_params(void *handle, int setmode, int usemode,
struct audio_params *play, struct audio_params *rec)
{
int i;
struct cmpci_softc *sc = handle;
for (i = 0; i < 2; i++) {
int md_format;
int md_divide;
int md_index;
int mode;
struct audio_params *p;
switch (i) {
case 0:
mode = AUMODE_PLAY;
p = play;
break;
case 1:
mode = AUMODE_RECORD;
p = rec;
break;
default:
return EINVAL;
}
if (!(setmode & mode))
continue;
if (setmode & AUMODE_RECORD) {
if (p->channels > 2)
p->channels = 2;
sc->sc_play_channel = 0;
cmpci_reg_clear_reg_misc(sc, CMPCI_REG_ENDBDAC);
cmpci_reg_clear_reg_misc(sc, CMPCI_REG_XCHGDAC);
} else {
sc->sc_play_channel = 1;
cmpci_reg_set_reg_misc(sc, CMPCI_REG_ENDBDAC);
cmpci_reg_set_reg_misc(sc, CMPCI_REG_XCHGDAC);
}
cmpci_reg_clear_4(sc, CMPCI_REG_LEGACY_CTRL,
CMPCI_REG_NXCHG);
if (sc->sc_capable & CMPCI_CAP_4CH)
cmpci_reg_clear_4(sc, CMPCI_REG_CHANNEL_FORMAT,
CMPCI_REG_CHB3D);
if (sc->sc_capable & CMPCI_CAP_6CH) {
cmpci_reg_clear_4(sc, CMPCI_REG_CHANNEL_FORMAT,
CMPCI_REG_CHB3D5C);
cmpci_reg_clear_4(sc, CMPCI_REG_LEGACY_CTRL,
CMPCI_REG_CHB3D6C);
cmpci_reg_clear_reg_misc(sc, CMPCI_REG_ENCENTER);
}
if (sc->sc_capable & CMPCI_CAP_8CH)
cmpci_reg_clear_4(sc, CMPCI_REG_8768_MISC,
CMPCI_REG_CHB3D8C);
/* format */
switch (p->channels) {
case 1:
md_format = CMPCI_REG_FORMAT_MONO;
break;
case 2:
md_format = CMPCI_REG_FORMAT_STEREO;
break;
case 4:
if (mode & AUMODE_PLAY) {
if (sc->sc_capable & CMPCI_CAP_4CH) {
cmpci_reg_clear_reg_misc(sc,
CMPCI_REG_N4SPK3D);
cmpci_reg_set_4(sc,
CMPCI_REG_CHANNEL_FORMAT,
CMPCI_REG_CHB3D);
cmpci_reg_set_4(sc,
CMPCI_REG_LEGACY_CTRL,
CMPCI_REG_NXCHG);
} else
p->channels = 2;
}
md_format = CMPCI_REG_FORMAT_STEREO;
break;
case 6:
if (mode & AUMODE_PLAY) {
if (sc->sc_capable & CMPCI_CAP_6CH) {
cmpci_reg_clear_reg_misc(sc,
CMPCI_REG_N4SPK3D);
cmpci_reg_set_4(sc,
CMPCI_REG_CHANNEL_FORMAT,
CMPCI_REG_CHB3D5C);
cmpci_reg_set_4(sc,
CMPCI_REG_LEGACY_CTRL,
CMPCI_REG_CHB3D6C);
cmpci_reg_set_reg_misc(sc,
CMPCI_REG_ENCENTER);
cmpci_reg_set_4(sc,
CMPCI_REG_LEGACY_CTRL,
CMPCI_REG_NXCHG);
} else
p->channels = 2;
}
md_format = CMPCI_REG_FORMAT_STEREO;
break;
case 8:
if (mode & AUMODE_PLAY) {
if (sc->sc_capable & CMPCI_CAP_8CH) {
cmpci_reg_clear_reg_misc(sc,
CMPCI_REG_N4SPK3D);
cmpci_reg_set_4(sc,
CMPCI_REG_CHANNEL_FORMAT,
CMPCI_REG_CHB3D5C);
cmpci_reg_set_4(sc,
CMPCI_REG_LEGACY_CTRL,
CMPCI_REG_CHB3D6C);
cmpci_reg_set_reg_misc(sc,
CMPCI_REG_ENCENTER);
cmpci_reg_set_4(sc,
CMPCI_REG_8768_MISC,
CMPCI_REG_CHB3D8C);
cmpci_reg_set_4(sc,
CMPCI_REG_LEGACY_CTRL,
CMPCI_REG_NXCHG);
} else
p->channels = 2;
}
md_format = CMPCI_REG_FORMAT_STEREO;
break;
default:
return (EINVAL);
}
if (p->precision >= 16) {
p->precision = 16;
p->encoding = AUDIO_ENCODING_SLINEAR_LE;
md_format |= CMPCI_REG_FORMAT_16BIT;
} else {
p->precision = 8;
p->encoding = AUDIO_ENCODING_ULINEAR_LE;
md_format |= CMPCI_REG_FORMAT_8BIT;
}
p->bps = AUDIO_BPS(p->precision);
p->msb = 1;
if (mode & AUMODE_PLAY) {
if (sc->sc_play_channel == 1) {
cmpci_reg_partial_write_4(sc,
CMPCI_REG_CHANNEL_FORMAT,
CMPCI_REG_CH1_FORMAT_SHIFT,
CMPCI_REG_CH1_FORMAT_MASK, md_format);
} else {
cmpci_reg_partial_write_4(sc,
CMPCI_REG_CHANNEL_FORMAT,
CMPCI_REG_CH0_FORMAT_SHIFT,
CMPCI_REG_CH0_FORMAT_MASK, md_format);
}
} else {
cmpci_reg_partial_write_4(sc,
CMPCI_REG_CHANNEL_FORMAT,
CMPCI_REG_CH1_FORMAT_SHIFT,
CMPCI_REG_CH1_FORMAT_MASK, md_format);
}
/* sample rate */
md_index = cmpci_rate_to_index(p->sample_rate);
md_divide = cmpci_index_to_divider(md_index);
p->sample_rate = cmpci_index_to_rate(md_index);
DPRINTF(("%s: sample:%d, divider=%d\n",
sc->sc_dev.dv_xname, (int)p->sample_rate, md_divide));
if (mode & AUMODE_PLAY) {
if (sc->sc_play_channel == 1) {
cmpci_reg_partial_write_4(sc,
CMPCI_REG_FUNC_1, CMPCI_REG_ADC_FS_SHIFT,
CMPCI_REG_ADC_FS_MASK, md_divide);
sc->sc_ch1.md_divide = md_divide;
} else {
cmpci_reg_partial_write_4(sc,
CMPCI_REG_FUNC_1, CMPCI_REG_DAC_FS_SHIFT,
CMPCI_REG_DAC_FS_MASK, md_divide);
sc->sc_ch0.md_divide = md_divide;
}
} else {
cmpci_reg_partial_write_4(sc,
CMPCI_REG_FUNC_1, CMPCI_REG_ADC_FS_SHIFT,
CMPCI_REG_ADC_FS_MASK, md_divide);
sc->sc_ch1.md_divide = md_divide;
}
}
return 0;
}
int
cmpci_round_blocksize(void *handle, int block)
{
return ((block + 3) & -4);
}
int
cmpci_halt_output(void *handle)
{
struct cmpci_softc *sc = handle;
uint32_t reg_intr, reg_enable, reg_reset;
mtx_enter(&audio_lock);
if (sc->sc_play_channel == 1) {
sc->sc_ch1.intr = NULL;
reg_intr = CMPCI_REG_CH1_INTR_ENABLE;
reg_enable = CMPCI_REG_CH1_ENABLE;
reg_reset = CMPCI_REG_CH1_RESET;
} else {
sc->sc_ch0.intr = NULL;
reg_intr = CMPCI_REG_CH0_INTR_ENABLE;
reg_enable = CMPCI_REG_CH0_ENABLE;
reg_reset = CMPCI_REG_CH0_RESET;
}
cmpci_reg_clear_4(sc, CMPCI_REG_INTR_CTRL, reg_intr);
cmpci_reg_clear_4(sc, CMPCI_REG_FUNC_0, reg_enable);
/* wait for reset DMA */
cmpci_reg_set_4(sc, CMPCI_REG_FUNC_0, reg_reset);
delay(10);
cmpci_reg_clear_4(sc, CMPCI_REG_FUNC_0, reg_reset);
mtx_leave(&audio_lock);
return 0;
}
int
cmpci_halt_input(void *handle)
{
struct cmpci_softc *sc = handle;
mtx_enter(&audio_lock);
sc->sc_ch1.intr = NULL;
cmpci_reg_clear_4(sc, CMPCI_REG_INTR_CTRL, CMPCI_REG_CH1_INTR_ENABLE);
cmpci_reg_clear_4(sc, CMPCI_REG_FUNC_0, CMPCI_REG_CH1_ENABLE);
/* wait for reset DMA */
cmpci_reg_set_4(sc, CMPCI_REG_FUNC_0, CMPCI_REG_CH1_RESET);
delay(10);
cmpci_reg_clear_4(sc, CMPCI_REG_FUNC_0, CMPCI_REG_CH1_RESET);
mtx_leave(&audio_lock);
return 0;
}
/* mixer device information */
int
cmpci_query_devinfo(void *handle, mixer_devinfo_t *dip)
{
static const char *const mixer_port_names[] = {
AudioNdac, AudioNfmsynth, AudioNcd, AudioNline, AudioNaux,
AudioNmicrophone
};
static const char *const mixer_classes[] = {
AudioCinputs, AudioCoutputs, AudioCrecord, CmpciCplayback,
CmpciCspdif
};
struct cmpci_softc *sc = handle;
int i;
dip->prev = dip->next = AUDIO_MIXER_LAST;
switch (dip->index) {
case CMPCI_INPUT_CLASS:
case CMPCI_OUTPUT_CLASS:
case CMPCI_RECORD_CLASS:
case CMPCI_PLAYBACK_CLASS:
case CMPCI_SPDIF_CLASS:
dip->type = AUDIO_MIXER_CLASS;
dip->mixer_class = dip->index;
strlcpy(dip->label.name,
mixer_classes[dip->index - CMPCI_INPUT_CLASS],
sizeof dip->label.name);
return 0;
case CMPCI_AUX_IN_VOL:
dip->un.v.delta = 1 << (8 - CMPCI_REG_AUX_VALBITS);
goto vol1;
case CMPCI_DAC_VOL:
case CMPCI_FM_VOL:
case CMPCI_CD_VOL:
case CMPCI_LINE_IN_VOL:
case CMPCI_MIC_VOL:
dip->un.v.delta = 1 << (8 - CMPCI_SB16_MIXER_VALBITS);
vol1: dip->mixer_class = CMPCI_INPUT_CLASS;
dip->next = dip->index + 6; /* CMPCI_xxx_MUTE */
strlcpy(dip->label.name, mixer_port_names[dip->index],
sizeof dip->label.name);
dip->un.v.num_channels = (dip->index == CMPCI_MIC_VOL ? 1 : 2);
vol:
dip->type = AUDIO_MIXER_VALUE;
strlcpy(dip->un.v.units.name, AudioNvolume,
sizeof dip->un.v.units.name);
return 0;
case CMPCI_MIC_MUTE:
dip->next = CMPCI_MIC_PREAMP;
/* FALLTHROUGH */
case CMPCI_DAC_MUTE:
case CMPCI_FM_MUTE:
case CMPCI_CD_MUTE:
case CMPCI_LINE_IN_MUTE:
case CMPCI_AUX_IN_MUTE:
dip->prev = dip->index - 6; /* CMPCI_xxx_VOL */
dip->mixer_class = CMPCI_INPUT_CLASS;
strlcpy(dip->label.name, AudioNmute, sizeof dip->label.name);
goto on_off;
on_off:
dip->type = AUDIO_MIXER_ENUM;
dip->un.e.num_mem = 2;
strlcpy(dip->un.e.member[0].label.name, AudioNoff,
sizeof dip->un.e.member[0].label.name);
dip->un.e.member[0].ord = 0;
strlcpy(dip->un.e.member[1].label.name, AudioNon,
sizeof dip->un.e.member[1].label.name);
dip->un.e.member[1].ord = 1;
return 0;
case CMPCI_MIC_PREAMP:
dip->mixer_class = CMPCI_INPUT_CLASS;
dip->prev = CMPCI_MIC_MUTE;
strlcpy(dip->label.name, AudioNpreamp, sizeof dip->label.name);
goto on_off;
case CMPCI_PCSPEAKER:
dip->mixer_class = CMPCI_INPUT_CLASS;
strlcpy(dip->label.name, AudioNspeaker, sizeof dip->label.name);
dip->un.v.num_channels = 1;
dip->un.v.delta = 1 << (8 - CMPCI_SB16_MIXER_SPEAKER_VALBITS);
goto vol;
case CMPCI_RECORD_SOURCE:
dip->mixer_class = CMPCI_RECORD_CLASS;
strlcpy(dip->label.name, AudioNsource, sizeof dip->label.name);
dip->type = AUDIO_MIXER_SET;
dip->un.s.num_mem = 7;
strlcpy(dip->un.s.member[0].label.name, AudioNmicrophone,
sizeof dip->un.s.member[0].label.name);
dip->un.s.member[0].mask = CMPCI_RECORD_SOURCE_MIC;
strlcpy(dip->un.s.member[1].label.name, AudioNcd,
sizeof dip->un.s.member[1].label.name);
dip->un.s.member[1].mask = CMPCI_RECORD_SOURCE_CD;
strlcpy(dip->un.s.member[2].label.name, AudioNline,
sizeof dip->un.s.member[2].label.name);
dip->un.s.member[2].mask = CMPCI_RECORD_SOURCE_LINE_IN;
strlcpy(dip->un.s.member[3].label.name, AudioNaux,
sizeof dip->un.s.member[3].label.name);
dip->un.s.member[3].mask = CMPCI_RECORD_SOURCE_AUX_IN;
strlcpy(dip->un.s.member[4].label.name, AudioNwave,
sizeof dip->un.s.member[4].label.name);
dip->un.s.member[4].mask = CMPCI_RECORD_SOURCE_WAVE;
strlcpy(dip->un.s.member[5].label.name, AudioNfmsynth,
sizeof dip->un.s.member[5].label.name);
dip->un.s.member[5].mask = CMPCI_RECORD_SOURCE_FM;
strlcpy(dip->un.s.member[6].label.name, CmpciNspdif,
sizeof dip->un.s.member[6].label.name);
dip->un.s.member[6].mask = CMPCI_RECORD_SOURCE_SPDIF;
return 0;
case CMPCI_MIC_RECVOL:
dip->mixer_class = CMPCI_RECORD_CLASS;
strlcpy(dip->label.name, AudioNmicrophone, sizeof dip->label.name);
dip->un.v.num_channels = 1;
dip->un.v.delta = 1 << (8 - CMPCI_REG_ADMIC_VALBITS);
goto vol;
case CMPCI_PLAYBACK_MODE:
dip->mixer_class = CMPCI_PLAYBACK_CLASS;
dip->type = AUDIO_MIXER_ENUM;
strlcpy(dip->label.name, AudioNmode, sizeof dip->label.name);
dip->un.e.num_mem = 2;
strlcpy(dip->un.e.member[0].label.name, AudioNdac,
sizeof dip->un.e.member[0].label.name);
dip->un.e.member[0].ord = CMPCI_PLAYBACK_MODE_WAVE;
strlcpy(dip->un.e.member[1].label.name, CmpciNspdif,
sizeof dip->un.e.member[1].label.name);
dip->un.e.member[1].ord = CMPCI_PLAYBACK_MODE_SPDIF;
return 0;
case CMPCI_SPDIF_IN_SELECT:
dip->mixer_class = CMPCI_SPDIF_CLASS;
dip->type = AUDIO_MIXER_ENUM;
dip->next = CMPCI_SPDIF_IN_PHASE;
strlcpy(dip->label.name, AudioNinput, sizeof dip->label.name);
i = 0;
strlcpy(dip->un.e.member[i].label.name, CmpciNspdin1,
sizeof dip->un.e.member[i].label.name);
dip->un.e.member[i++].ord = CMPCI_SPDIF_IN_SPDIN1;
if (CMPCI_ISCAP(sc, 2ND_SPDIN)) {
strlcpy(dip->un.e.member[i].label.name, CmpciNspdin2,
sizeof dip->un.e.member[i].label.name);
dip->un.e.member[i++].ord = CMPCI_SPDIF_IN_SPDIN2;
}
strlcpy(dip->un.e.member[i].label.name, CmpciNspdout,
sizeof dip->un.e.member[i].label.name);
dip->un.e.member[i++].ord = CMPCI_SPDIF_IN_SPDOUT;
dip->un.e.num_mem = i;
return 0;
case CMPCI_SPDIF_IN_PHASE:
dip->mixer_class = CMPCI_SPDIF_CLASS;
dip->prev = CMPCI_SPDIF_IN_SELECT;
strlcpy(dip->label.name, CmpciNphase, sizeof dip->label.name);
dip->type = AUDIO_MIXER_ENUM;
dip->un.e.num_mem = 2;
strlcpy(dip->un.e.member[0].label.name, CmpciNpositive,
sizeof dip->un.e.member[0].label.name);
dip->un.e.member[0].ord = CMPCI_SPDIF_IN_PHASE_POSITIVE;
strlcpy(dip->un.e.member[1].label.name, CmpciNnegative,
sizeof dip->un.e.member[1].label.name);
dip->un.e.member[1].ord = CMPCI_SPDIF_IN_PHASE_NEGATIVE;
return 0;
case CMPCI_SPDIF_LOOP:
dip->mixer_class = CMPCI_SPDIF_CLASS;
dip->next = CMPCI_SPDIF_OUT_PLAYBACK;
strlcpy(dip->label.name, AudioNoutput, sizeof dip->label.name);
dip->type = AUDIO_MIXER_ENUM;
dip->un.e.num_mem = 2;
strlcpy(dip->un.e.member[0].label.name, CmpciNplayback,
sizeof dip->un.e.member[0].label.name);
dip->un.e.member[0].ord = CMPCI_SPDIF_LOOP_OFF;
strlcpy(dip->un.e.member[1].label.name, CmpciNspdin,
sizeof dip->un.e.member[1].label.name);
dip->un.e.member[1].ord = CMPCI_SPDIF_LOOP_ON;
return 0;
case CMPCI_SPDIF_OUT_PLAYBACK:
dip->mixer_class = CMPCI_SPDIF_CLASS;
dip->prev = CMPCI_SPDIF_LOOP;
dip->next = CMPCI_SPDIF_OUT_VOLTAGE;
strlcpy(dip->label.name, CmpciNplayback, sizeof dip->label.name);
dip->type = AUDIO_MIXER_ENUM;
dip->un.e.num_mem = 2;
strlcpy(dip->un.e.member[0].label.name, AudioNwave,
sizeof dip->un.e.member[0].label.name);
dip->un.e.member[0].ord = CMPCI_SPDIF_OUT_PLAYBACK_WAVE;
strlcpy(dip->un.e.member[1].label.name, CmpciNlegacy,
sizeof dip->un.e.member[1].label.name);
dip->un.e.member[1].ord = CMPCI_SPDIF_OUT_PLAYBACK_LEGACY;
return 0;
case CMPCI_SPDIF_OUT_VOLTAGE:
dip->mixer_class = CMPCI_SPDIF_CLASS;
dip->prev = CMPCI_SPDIF_OUT_PLAYBACK;
strlcpy(dip->label.name, CmpciNvoltage, sizeof dip->label.name);
dip->type = AUDIO_MIXER_ENUM;
dip->un.e.num_mem = 2;
strlcpy(dip->un.e.member[0].label.name, CmpciNhigh_v,
sizeof dip->un.e.member[0].label.name);
dip->un.e.member[0].ord = CMPCI_SPDIF_OUT_VOLTAGE_HIGH;
strlcpy(dip->un.e.member[1].label.name, CmpciNlow_v,
sizeof dip->un.e.member[1].label.name);
dip->un.e.member[1].ord = CMPCI_SPDIF_OUT_VOLTAGE_LOW;
return 0;
case CMPCI_MONITOR_DAC:
dip->mixer_class = CMPCI_SPDIF_CLASS;
strlcpy(dip->label.name, AudioNmonitor, sizeof dip->label.name);
dip->type = AUDIO_MIXER_ENUM;
dip->un.e.num_mem = 3;
strlcpy(dip->un.e.member[0].label.name, AudioNoff,
sizeof dip->un.e.member[0].label.name);
dip->un.e.member[0].ord = CMPCI_MONITOR_DAC_OFF;
strlcpy(dip->un.e.member[1].label.name, CmpciNspdin,
sizeof dip->un.e.member[1].label.name);
dip->un.e.member[1].ord = CMPCI_MONITOR_DAC_SPDIN;
strlcpy(dip->un.e.member[2].label.name, CmpciNspdout,
sizeof dip->un.e.member[2].label.name);
dip->un.e.member[2].ord = CMPCI_MONITOR_DAC_SPDOUT;
return 0;
case CMPCI_MASTER_VOL:
dip->mixer_class = CMPCI_OUTPUT_CLASS;
strlcpy(dip->label.name, AudioNmaster, sizeof dip->label.name);
dip->un.v.num_channels = 2;
dip->un.v.delta = 1 << (8 - CMPCI_SB16_MIXER_VALBITS);
goto vol;
case CMPCI_REAR:
dip->mixer_class = CMPCI_OUTPUT_CLASS;
dip->next = CMPCI_INDIVIDUAL;
strlcpy(dip->label.name, CmpciNrear, sizeof dip->label.name);
goto on_off;
case CMPCI_INDIVIDUAL:
dip->mixer_class = CMPCI_OUTPUT_CLASS;
dip->prev = CMPCI_REAR;
dip->next = CMPCI_REVERSE;
strlcpy(dip->label.name, CmpciNindividual, sizeof dip->label.name);
goto on_off;
case CMPCI_REVERSE:
dip->mixer_class = CMPCI_OUTPUT_CLASS;
dip->prev = CMPCI_INDIVIDUAL;
strlcpy(dip->label.name, CmpciNreverse, sizeof dip->label.name);
goto on_off;
case CMPCI_SURROUND:
dip->mixer_class = CMPCI_OUTPUT_CLASS;
strlcpy(dip->label.name, CmpciNsurround, sizeof dip->label.name);
goto on_off;
}
return ENXIO;
}
int
cmpci_alloc_dmamem(struct cmpci_softc *sc, size_t size, int type, int flags,
caddr_t *r_addr)
{
int error = 0;
struct cmpci_dmanode *n;
int w;
n = malloc(sizeof(struct cmpci_dmanode), type, flags);
if (n == NULL) {
error = ENOMEM;
goto quit;
}
w = (flags & M_NOWAIT) ? BUS_DMA_NOWAIT : BUS_DMA_WAITOK;
#define CMPCI_DMABUF_ALIGN 0x4
#define CMPCI_DMABUF_BOUNDARY 0x0
n->cd_tag = sc->sc_dmat;
n->cd_size = size;
error = bus_dmamem_alloc(n->cd_tag, n->cd_size,
CMPCI_DMABUF_ALIGN, CMPCI_DMABUF_BOUNDARY, n->cd_segs,
nitems(n->cd_segs), &n->cd_nsegs, w);
if (error)
goto mfree;
error = bus_dmamem_map(n->cd_tag, n->cd_segs, n->cd_nsegs, n->cd_size,
&n->cd_addr, w | BUS_DMA_COHERENT);
if (error)
goto dmafree;
error = bus_dmamap_create(n->cd_tag, n->cd_size, 1, n->cd_size, 0,
w, &n->cd_map);
if (error)
goto unmap;
error = bus_dmamap_load(n->cd_tag, n->cd_map, n->cd_addr, n->cd_size,
NULL, w);
if (error)
goto destroy;
n->cd_next = sc->sc_dmap;
sc->sc_dmap = n;
*r_addr = KVADDR(n);
return 0;
destroy:
bus_dmamap_destroy(n->cd_tag, n->cd_map);
unmap:
bus_dmamem_unmap(n->cd_tag, n->cd_addr, n->cd_size);
dmafree:
bus_dmamem_free(n->cd_tag,
n->cd_segs, nitems(n->cd_segs));
mfree:
free(n, type, 0);
quit:
return error;
}
int
cmpci_free_dmamem(struct cmpci_softc *sc, caddr_t addr, int type)
{
struct cmpci_dmanode **nnp;
for (nnp = &sc->sc_dmap; *nnp; nnp = &(*nnp)->cd_next) {
if ((*nnp)->cd_addr == addr) {
struct cmpci_dmanode *n = *nnp;
bus_dmamap_unload(n->cd_tag, n->cd_map);
bus_dmamap_destroy(n->cd_tag, n->cd_map);
bus_dmamem_unmap(n->cd_tag, n->cd_addr, n->cd_size);
bus_dmamem_free(n->cd_tag, n->cd_segs,
nitems(n->cd_segs));
free(n, type, 0);
return 0;
}
}
return -1;
}
struct cmpci_dmanode *
cmpci_find_dmamem(struct cmpci_softc *sc, caddr_t addr)
{
struct cmpci_dmanode *p;
for (p = sc->sc_dmap; p; p = p->cd_next) {
if (KVADDR(p) == (void *)addr)
break;
}
return p;
}
#if 0
void cmpci_print_dmamem(struct cmpci_dmanode *p);
void
cmpci_print_dmamem(struct cmpci_dmanode *p)
{
DPRINTF(("DMA at virt:%p, dmaseg:%p, mapseg:%p, size:%p\n",
(void *)p->cd_addr, (void *)p->cd_segs[0].ds_addr,
(void *)DMAADDR(p), (void *)p->cd_size));
}
#endif /* DEBUG */
void *
cmpci_malloc(void *handle, int direction, size_t size, int type,
int flags)
{
caddr_t addr;
if (cmpci_alloc_dmamem(handle, size, type, flags, &addr))
return NULL;
return addr;
}
void
cmpci_free(void *handle, void *addr, int type)
{
cmpci_free_dmamem(handle, addr, type);
}
#define MAXVAL 256
int
cmpci_adjust(int val, int mask)
{
val += (MAXVAL - mask) >> 1;
if (val >= MAXVAL)
val = MAXVAL-1;
return val & mask;
}
void
cmpci_set_mixer_gain(struct cmpci_softc *sc, int port)
{
int src;
int bits, mask;
switch (port) {
case CMPCI_MIC_VOL:
cmpci_mixerreg_write(sc, CMPCI_SB16_MIXER_MIC,
CMPCI_ADJUST_MIC_GAIN(sc, sc->sc_gain[port][CMPCI_LR]));
return;
case CMPCI_MASTER_VOL:
src = CMPCI_SB16_MIXER_MASTER_L;
break;
case CMPCI_LINE_IN_VOL:
src = CMPCI_SB16_MIXER_LINE_L;
break;
case CMPCI_AUX_IN_VOL:
bus_space_write_1(sc->sc_iot, sc->sc_ioh, CMPCI_REG_MIXER_AUX,
CMPCI_ADJUST_AUX_GAIN(sc, sc->sc_gain[port][CMPCI_LEFT],
sc->sc_gain[port][CMPCI_RIGHT]));
return;
case CMPCI_MIC_RECVOL:
cmpci_reg_partial_write_1(sc, CMPCI_REG_MIXER25,
CMPCI_REG_ADMIC_SHIFT, CMPCI_REG_ADMIC_MASK,
CMPCI_ADJUST_ADMIC_GAIN(sc, sc->sc_gain[port][CMPCI_LR]));
return;
case CMPCI_DAC_VOL:
src = CMPCI_SB16_MIXER_VOICE_L;
break;
case CMPCI_FM_VOL:
src = CMPCI_SB16_MIXER_FM_L;
break;
case CMPCI_CD_VOL:
src = CMPCI_SB16_MIXER_CDDA_L;
break;
case CMPCI_PCSPEAKER:
cmpci_mixerreg_write(sc, CMPCI_SB16_MIXER_SPEAKER,
CMPCI_ADJUST_2_GAIN(sc, sc->sc_gain[port][CMPCI_LR]));
return;
case CMPCI_MIC_PREAMP:
if (sc->sc_gain[port][CMPCI_LR])
cmpci_reg_clear_1(sc, CMPCI_REG_MIXER25,
CMPCI_REG_MICGAINZ);
else
cmpci_reg_set_1(sc, CMPCI_REG_MIXER25,
CMPCI_REG_MICGAINZ);
return;
case CMPCI_DAC_MUTE:
if (sc->sc_gain[port][CMPCI_LR])
cmpci_reg_set_1(sc, CMPCI_REG_MIXER24,
CMPCI_REG_WSMUTE);
else
cmpci_reg_clear_1(sc, CMPCI_REG_MIXER24,
CMPCI_REG_WSMUTE);
return;
case CMPCI_FM_MUTE:
if (sc->sc_gain[port][CMPCI_LR])
cmpci_reg_set_1(sc, CMPCI_REG_MIXER24,
CMPCI_REG_FMMUTE);
else
cmpci_reg_clear_1(sc, CMPCI_REG_MIXER24,
CMPCI_REG_FMMUTE);
return;
case CMPCI_AUX_IN_MUTE:
if (sc->sc_gain[port][CMPCI_LR])
cmpci_reg_clear_1(sc, CMPCI_REG_MIXER25,
CMPCI_REG_VAUXRM|CMPCI_REG_VAUXLM);
else
cmpci_reg_set_1(sc, CMPCI_REG_MIXER25,
CMPCI_REG_VAUXRM|CMPCI_REG_VAUXLM);
return;
case CMPCI_CD_MUTE:
mask = CMPCI_SB16_SW_CD;
goto sbmute;
case CMPCI_MIC_MUTE:
mask = CMPCI_SB16_SW_MIC;
goto sbmute;
case CMPCI_LINE_IN_MUTE:
mask = CMPCI_SB16_SW_LINE;
sbmute:
bits = cmpci_mixerreg_read(sc, CMPCI_SB16_MIXER_OUTMIX);
if (sc->sc_gain[port][CMPCI_LR])
bits = bits & ~mask;
else
bits = bits | mask;
cmpci_mixerreg_write(sc, CMPCI_SB16_MIXER_OUTMIX, bits);
return;
case CMPCI_SPDIF_IN_SELECT:
case CMPCI_MONITOR_DAC:
case CMPCI_PLAYBACK_MODE:
case CMPCI_SPDIF_LOOP:
case CMPCI_SPDIF_OUT_PLAYBACK:
cmpci_set_out_ports(sc);
return;
case CMPCI_SPDIF_OUT_VOLTAGE:
if (CMPCI_ISCAP(sc, SPDOUT_VOLTAGE)) {
if (sc->sc_gain[CMPCI_SPDIF_OUT_VOLTAGE][CMPCI_LR]
== CMPCI_SPDIF_OUT_VOLTAGE_HIGH)
cmpci_reg_clear_reg_misc(sc, CMPCI_REG_5V);
else
cmpci_reg_set_reg_misc(sc, CMPCI_REG_5V);
}
return;
case CMPCI_SURROUND:
if (CMPCI_ISCAP(sc, SURROUND)) {
if (sc->sc_gain[CMPCI_SURROUND][CMPCI_LR])
cmpci_reg_set_1(sc, CMPCI_REG_MIXER24,
CMPCI_REG_SURROUND);
else
cmpci_reg_clear_1(sc, CMPCI_REG_MIXER24,
CMPCI_REG_SURROUND);
}
return;
case CMPCI_REAR:
if (CMPCI_ISCAP(sc, REAR)) {
if (sc->sc_gain[CMPCI_REAR][CMPCI_LR])
cmpci_reg_set_reg_misc(sc, CMPCI_REG_N4SPK3D);
else
cmpci_reg_clear_reg_misc(sc, CMPCI_REG_N4SPK3D);
}
return;
case CMPCI_INDIVIDUAL:
if (CMPCI_ISCAP(sc, INDIVIDUAL_REAR)) {
if (sc->sc_gain[CMPCI_REAR][CMPCI_LR])
cmpci_reg_set_1(sc, CMPCI_REG_MIXER24,
CMPCI_REG_INDIVIDUAL);
else
cmpci_reg_clear_1(sc, CMPCI_REG_MIXER24,
CMPCI_REG_INDIVIDUAL);
}
return;
case CMPCI_REVERSE:
if (CMPCI_ISCAP(sc, REVERSE_FR)) {
if (sc->sc_gain[CMPCI_REVERSE][CMPCI_LR])
cmpci_reg_set_1(sc, CMPCI_REG_MIXER24,
CMPCI_REG_REVERSE_FR);
else
cmpci_reg_clear_1(sc, CMPCI_REG_MIXER24,
CMPCI_REG_REVERSE_FR);
}
return;
case CMPCI_SPDIF_IN_PHASE:
if (CMPCI_ISCAP(sc, SPDIN_PHASE)) {
if (sc->sc_gain[CMPCI_SPDIF_IN_PHASE][CMPCI_LR]
== CMPCI_SPDIF_IN_PHASE_POSITIVE)
cmpci_reg_clear_1(sc, CMPCI_REG_CHANNEL_FORMAT,
CMPCI_REG_SPDIN_PHASE);
else
cmpci_reg_set_1(sc, CMPCI_REG_CHANNEL_FORMAT,
CMPCI_REG_SPDIN_PHASE);
}
return;
default:
return;
}
cmpci_mixerreg_write(sc, src,
CMPCI_ADJUST_GAIN(sc, sc->sc_gain[port][CMPCI_LEFT]));
cmpci_mixerreg_write(sc, CMPCI_SB16_MIXER_L_TO_R(src),
CMPCI_ADJUST_GAIN(sc, sc->sc_gain[port][CMPCI_RIGHT]));
}
void
cmpci_set_out_ports(struct cmpci_softc *sc)
{
struct cmpci_channel *chan;
u_int8_t v;
int enspdout = 0;
if (!CMPCI_ISCAP(sc, SPDLOOP))
return;
/* SPDIF/out select */
if (sc->sc_gain[CMPCI_SPDIF_LOOP][CMPCI_LR] == CMPCI_SPDIF_LOOP_OFF) {
/* playback */
cmpci_reg_clear_4(sc, CMPCI_REG_FUNC_1, CMPCI_REG_SPDIF_LOOP);
} else {
/* monitor SPDIF/in */
cmpci_reg_set_4(sc, CMPCI_REG_FUNC_1, CMPCI_REG_SPDIF_LOOP);
}
/* SPDIF in select */
v = sc->sc_gain[CMPCI_SPDIF_IN_SELECT][CMPCI_LR];
if (v & CMPCI_SPDIFIN_SPDIFIN2)
cmpci_reg_set_reg_misc(sc, CMPCI_REG_2ND_SPDIFIN);
else
cmpci_reg_clear_reg_misc(sc, CMPCI_REG_2ND_SPDIFIN);
if (v & CMPCI_SPDIFIN_SPDIFOUT)
cmpci_reg_set_reg_misc(sc, CMPCI_REG_SPDFLOOPI);
else
cmpci_reg_clear_reg_misc(sc, CMPCI_REG_SPDFLOOPI);
if (sc->sc_play_channel == 1)
chan = &sc->sc_ch1;
else
chan = &sc->sc_ch0;
/* disable ac3 and 24 and 32 bit s/pdif modes */
cmpci_reg_clear_4(sc, CMPCI_REG_CHANNEL_FORMAT, CMPCI_REG_AC3EN1);
cmpci_reg_clear_reg_misc(sc, CMPCI_REG_AC3EN2);
cmpci_reg_clear_reg_misc(sc, CMPCI_REG_SPD32SEL);
cmpci_reg_clear_4(sc, CMPCI_REG_CHANNEL_FORMAT, CMPCI_REG_SPDIF_24);
/* playback to ... */
if (CMPCI_ISCAP(sc, SPDOUT) &&
sc->sc_gain[CMPCI_PLAYBACK_MODE][CMPCI_LR]
== CMPCI_PLAYBACK_MODE_SPDIF &&
(chan->md_divide == CMPCI_REG_RATE_44100 ||
(CMPCI_ISCAP(sc, SPDOUT_48K) &&
chan->md_divide == CMPCI_REG_RATE_48000))) {
/* playback to SPDIF */
if (sc->sc_play_channel == 0)
cmpci_reg_set_4(sc, CMPCI_REG_FUNC_1,
CMPCI_REG_SPDIF0_ENABLE);
else
cmpci_reg_set_4(sc, CMPCI_REG_FUNC_1,
CMPCI_REG_SPDIF1_ENABLE);
enspdout = 1;
if (chan->md_divide == CMPCI_REG_RATE_48000)
cmpci_reg_set_reg_misc(sc,
CMPCI_REG_SPDIFOUT_48K | CMPCI_REG_SPDIF48K);
else
cmpci_reg_clear_reg_misc(sc,
CMPCI_REG_SPDIFOUT_48K | CMPCI_REG_SPDIF48K);
/* XXX assume sample rate <= 48kHz */
cmpci_reg_clear_4(sc, CMPCI_REG_CHANNEL_FORMAT,
CMPCI_REG_DBL_SPD_RATE);
} else {
/* playback to DAC */
if (sc->sc_play_channel == 0)
cmpci_reg_clear_4(sc, CMPCI_REG_FUNC_1,
CMPCI_REG_SPDIF0_ENABLE);
else
cmpci_reg_clear_4(sc, CMPCI_REG_FUNC_1,
CMPCI_REG_SPDIF1_ENABLE);
if (CMPCI_ISCAP(sc, SPDOUT_48K))
cmpci_reg_clear_reg_misc(sc,
CMPCI_REG_SPDIFOUT_48K | CMPCI_REG_SPDIF48K);
}
/* legacy to SPDIF/out or not */
if (CMPCI_ISCAP(sc, SPDLEGACY)) {
if (sc->sc_gain[CMPCI_SPDIF_OUT_PLAYBACK][CMPCI_LR]
== CMPCI_SPDIF_OUT_PLAYBACK_WAVE)
cmpci_reg_clear_4(sc, CMPCI_REG_LEGACY_CTRL,
CMPCI_REG_LEGACY_SPDIF_ENABLE);
else {
cmpci_reg_set_4(sc, CMPCI_REG_LEGACY_CTRL,
CMPCI_REG_LEGACY_SPDIF_ENABLE);
enspdout = 1;
}
}
/* enable/disable SPDIF/out */
if (CMPCI_ISCAP(sc, XSPDOUT) && enspdout)
cmpci_reg_set_4(sc, CMPCI_REG_LEGACY_CTRL,
CMPCI_REG_XSPDIF_ENABLE);
else
cmpci_reg_clear_4(sc, CMPCI_REG_LEGACY_CTRL,
CMPCI_REG_XSPDIF_ENABLE);
/* SPDIF monitor (digital to analog output) */
if (CMPCI_ISCAP(sc, SPDIN_MONITOR)) {
v = sc->sc_gain[CMPCI_MONITOR_DAC][CMPCI_LR];
if (!(v & CMPCI_MONDAC_ENABLE))
cmpci_reg_clear_1(sc, CMPCI_REG_MIXER24,
CMPCI_REG_SPDIN_MONITOR);
if (v & CMPCI_MONDAC_SPDOUT)
cmpci_reg_set_4(sc, CMPCI_REG_FUNC_1,
CMPCI_REG_SPDIFOUT_DAC);
else
cmpci_reg_clear_4(sc, CMPCI_REG_FUNC_1,
CMPCI_REG_SPDIFOUT_DAC);
if (v & CMPCI_MONDAC_ENABLE)
cmpci_reg_set_1(sc, CMPCI_REG_MIXER24,
CMPCI_REG_SPDIN_MONITOR);
}
}
int
cmpci_set_in_ports(struct cmpci_softc *sc)
{
int mask;
int bitsl, bitsr;
mask = sc->sc_in_mask;
/*
* Note CMPCI_RECORD_SOURCE_CD, CMPCI_RECORD_SOURCE_LINE_IN and
* CMPCI_RECORD_SOURCE_FM are defined to the corresponding bit
* of the mixer register.
*/
bitsr = mask & (CMPCI_RECORD_SOURCE_CD | CMPCI_RECORD_SOURCE_LINE_IN |
CMPCI_RECORD_SOURCE_FM);
bitsl = CMPCI_SB16_MIXER_SRC_R_TO_L(bitsr);
if (mask & CMPCI_RECORD_SOURCE_MIC) {
bitsl |= CMPCI_SB16_MIXER_MIC_SRC;
bitsr |= CMPCI_SB16_MIXER_MIC_SRC;
}
cmpci_mixerreg_write(sc, CMPCI_SB16_MIXER_ADCMIX_L, bitsl);
cmpci_mixerreg_write(sc, CMPCI_SB16_MIXER_ADCMIX_R, bitsr);
if (mask & CMPCI_RECORD_SOURCE_AUX_IN)
cmpci_reg_set_1(sc, CMPCI_REG_MIXER25,
CMPCI_REG_RAUXREN | CMPCI_REG_RAUXLEN);
else
cmpci_reg_clear_1(sc, CMPCI_REG_MIXER25,
CMPCI_REG_RAUXREN | CMPCI_REG_RAUXLEN);
if (mask & CMPCI_RECORD_SOURCE_WAVE)
cmpci_reg_set_1(sc, CMPCI_REG_MIXER24,
CMPCI_REG_WAVEINL | CMPCI_REG_WAVEINR);
else
cmpci_reg_clear_1(sc, CMPCI_REG_MIXER24,
CMPCI_REG_WAVEINL | CMPCI_REG_WAVEINR);
if (CMPCI_ISCAP(sc, SPDIN) &&
(sc->sc_ch1.md_divide == CMPCI_REG_RATE_44100 ||
(CMPCI_ISCAP(sc, SPDOUT_48K) &&
sc->sc_ch1.md_divide == CMPCI_REG_RATE_48000/* XXX? */))) {
if (mask & CMPCI_RECORD_SOURCE_SPDIF) {
/* enable SPDIF/in */
cmpci_reg_set_4(sc,
CMPCI_REG_FUNC_1,
CMPCI_REG_SPDIF1_ENABLE);
} else {
cmpci_reg_clear_4(sc,
CMPCI_REG_FUNC_1,
CMPCI_REG_SPDIF1_ENABLE);
}
}
return 0;
}
int
cmpci_set_port(void *handle, mixer_ctrl_t *cp)
{
struct cmpci_softc *sc = handle;
int lgain, rgain;
switch (cp->dev) {
case CMPCI_MIC_VOL:
case CMPCI_PCSPEAKER:
case CMPCI_MIC_RECVOL:
if (cp->un.value.num_channels != 1)
return EINVAL;
/* FALLTHROUGH */
case CMPCI_DAC_VOL:
case CMPCI_FM_VOL:
case CMPCI_CD_VOL:
case CMPCI_LINE_IN_VOL:
case CMPCI_AUX_IN_VOL:
case CMPCI_MASTER_VOL:
if (cp->type != AUDIO_MIXER_VALUE)
return EINVAL;
switch (cp->un.value.num_channels) {
case 1:
lgain = rgain =
cp->un.value.level[AUDIO_MIXER_LEVEL_MONO];
break;
case 2:
lgain = cp->un.value.level[AUDIO_MIXER_LEVEL_LEFT];
rgain = cp->un.value.level[AUDIO_MIXER_LEVEL_RIGHT];
break;
default:
return EINVAL;
}
sc->sc_gain[cp->dev][CMPCI_LEFT] = lgain;
sc->sc_gain[cp->dev][CMPCI_RIGHT] = rgain;
cmpci_set_mixer_gain(sc, cp->dev);
break;
case CMPCI_RECORD_SOURCE:
if (cp->type != AUDIO_MIXER_SET)
return EINVAL;
if (cp->un.mask & ~(CMPCI_RECORD_SOURCE_MIC |
CMPCI_RECORD_SOURCE_CD | CMPCI_RECORD_SOURCE_LINE_IN |
CMPCI_RECORD_SOURCE_AUX_IN | CMPCI_RECORD_SOURCE_WAVE |
CMPCI_RECORD_SOURCE_FM | CMPCI_RECORD_SOURCE_SPDIF))
return EINVAL;
if (cp->un.mask & CMPCI_RECORD_SOURCE_SPDIF)
cp->un.mask = CMPCI_RECORD_SOURCE_SPDIF;
sc->sc_in_mask = cp->un.mask;
return cmpci_set_in_ports(sc);
/* boolean */
case CMPCI_DAC_MUTE:
case CMPCI_FM_MUTE:
case CMPCI_CD_MUTE:
case CMPCI_LINE_IN_MUTE:
case CMPCI_AUX_IN_MUTE:
case CMPCI_MIC_MUTE:
case CMPCI_MIC_PREAMP:
case CMPCI_PLAYBACK_MODE:
case CMPCI_SPDIF_IN_PHASE:
case CMPCI_SPDIF_LOOP:
case CMPCI_SPDIF_OUT_PLAYBACK:
case CMPCI_SPDIF_OUT_VOLTAGE:
case CMPCI_REAR:
case CMPCI_INDIVIDUAL:
case CMPCI_REVERSE:
case CMPCI_SURROUND:
if (cp->type != AUDIO_MIXER_ENUM)
return EINVAL;
sc->sc_gain[cp->dev][CMPCI_LR] = cp->un.ord != 0;
cmpci_set_mixer_gain(sc, cp->dev);
break;
case CMPCI_SPDIF_IN_SELECT:
switch (cp->un.ord) {
case CMPCI_SPDIF_IN_SPDIN1:
case CMPCI_SPDIF_IN_SPDIN2:
case CMPCI_SPDIF_IN_SPDOUT:
break;
default:
return EINVAL;
}
goto xenum;
case CMPCI_MONITOR_DAC:
switch (cp->un.ord) {
case CMPCI_MONITOR_DAC_OFF:
case CMPCI_MONITOR_DAC_SPDIN:
case CMPCI_MONITOR_DAC_SPDOUT:
break;
default:
return EINVAL;
}
xenum:
if (cp->type != AUDIO_MIXER_ENUM)
return EINVAL;
sc->sc_gain[cp->dev][CMPCI_LR] = cp->un.ord;
cmpci_set_mixer_gain(sc, cp->dev);
break;
default:
return EINVAL;
}
return 0;
}
int
cmpci_get_port(void *handle, mixer_ctrl_t *cp)
{
struct cmpci_softc *sc = handle;
switch (cp->dev) {
case CMPCI_MIC_VOL:
case CMPCI_PCSPEAKER:
case CMPCI_MIC_RECVOL:
if (cp->un.value.num_channels != 1)
return EINVAL;
/*FALLTHROUGH*/
case CMPCI_DAC_VOL:
case CMPCI_FM_VOL:
case CMPCI_CD_VOL:
case CMPCI_LINE_IN_VOL:
case CMPCI_AUX_IN_VOL:
case CMPCI_MASTER_VOL:
switch (cp->un.value.num_channels) {
case 1:
cp->un.value.level[AUDIO_MIXER_LEVEL_MONO] =
sc->sc_gain[cp->dev][CMPCI_LEFT];
break;
case 2:
cp->un.value.level[AUDIO_MIXER_LEVEL_LEFT] =
sc->sc_gain[cp->dev][CMPCI_LEFT];
cp->un.value.level[AUDIO_MIXER_LEVEL_RIGHT] =
sc->sc_gain[cp->dev][CMPCI_RIGHT];
break;
default:
return EINVAL;
}
break;
case CMPCI_RECORD_SOURCE:
cp->un.mask = sc->sc_in_mask;
break;
case CMPCI_DAC_MUTE:
case CMPCI_FM_MUTE:
case CMPCI_CD_MUTE:
case CMPCI_LINE_IN_MUTE:
case CMPCI_AUX_IN_MUTE:
case CMPCI_MIC_MUTE:
case CMPCI_MIC_PREAMP:
case CMPCI_PLAYBACK_MODE:
case CMPCI_SPDIF_IN_SELECT:
case CMPCI_SPDIF_IN_PHASE:
case CMPCI_SPDIF_LOOP:
case CMPCI_SPDIF_OUT_PLAYBACK:
case CMPCI_SPDIF_OUT_VOLTAGE:
case CMPCI_MONITOR_DAC:
case CMPCI_REAR:
case CMPCI_INDIVIDUAL:
case CMPCI_REVERSE:
case CMPCI_SURROUND:
cp->un.ord = sc->sc_gain[cp->dev][CMPCI_LR];
break;
default:
return EINVAL;
}
return 0;
}
size_t
cmpci_round_buffersize(void *handle, int direction, size_t bufsize)
{
if (bufsize > 0x10000)
bufsize = 0x10000;
return bufsize;
}
int
cmpci_trigger_output(void *handle, void *start, void *end, int blksize,
void (*intr)(void *), void *arg, struct audio_params *param)
{
struct cmpci_softc *sc = handle;
struct cmpci_dmanode *p;
struct cmpci_channel *chan;
uint32_t reg_dma_base, reg_dma_bytes, reg_dma_samples, reg_dir,
reg_intr_enable, reg_enable;
uint32_t length;
size_t buffer_size = (caddr_t)end - (caddr_t)start;
cmpci_set_out_ports(sc);
if (sc->sc_play_channel == 1) {
chan = &sc->sc_ch1;
reg_dma_base = CMPCI_REG_DMA1_BASE;
reg_dma_bytes = CMPCI_REG_DMA1_BYTES;
reg_dma_samples = CMPCI_REG_DMA1_SAMPLES;
reg_dir = CMPCI_REG_CH1_DIR;
reg_intr_enable = CMPCI_REG_CH1_INTR_ENABLE;
reg_enable = CMPCI_REG_CH1_ENABLE;
} else {
chan = &sc->sc_ch0;
reg_dma_base = CMPCI_REG_DMA0_BASE;
reg_dma_bytes = CMPCI_REG_DMA0_BYTES;
reg_dma_samples = CMPCI_REG_DMA0_SAMPLES;
reg_dir = CMPCI_REG_CH0_DIR;
reg_intr_enable = CMPCI_REG_CH0_INTR_ENABLE;
reg_enable = CMPCI_REG_CH0_ENABLE;
}
chan->bps = (param->channels > 1 ? 2 : 1) * param->bps;
if (!chan->bps)
return EINVAL;
chan->intr = intr;
chan->intr_arg = arg;
chan->blksize = blksize;
chan->nblocks = buffer_size / chan->blksize;
chan->swpos = 0;
/* set DMA frame */
if (!(p = cmpci_find_dmamem(sc, start)))
return EINVAL;
bus_space_write_4(sc->sc_iot, sc->sc_ioh, reg_dma_base,
DMAADDR(p));
delay(10);
length = (buffer_size + 1) / chan->bps - 1;
bus_space_write_2(sc->sc_iot, sc->sc_ioh, reg_dma_bytes, length);
delay(10);
/* set interrupt count */
length = (chan->blksize + chan->bps - 1) / chan->bps - 1;
bus_space_write_2(sc->sc_iot, sc->sc_ioh, reg_dma_samples, length);
delay(10);
/* start DMA */
mtx_enter(&audio_lock);
cmpci_reg_clear_4(sc, CMPCI_REG_FUNC_0, reg_dir); /* PLAY */
cmpci_reg_set_4(sc, CMPCI_REG_INTR_CTRL, reg_intr_enable);
cmpci_reg_set_4(sc, CMPCI_REG_FUNC_0, reg_enable);
mtx_leave(&audio_lock);
return 0;
}
int
cmpci_trigger_input(void *handle, void *start, void *end, int blksize,
void (*intr)(void *), void *arg, struct audio_params *param)
{
struct cmpci_softc *sc = handle;
struct cmpci_dmanode *p;
struct cmpci_channel *chan = &sc->sc_ch1;
size_t buffer_size = (caddr_t)end - (caddr_t)start;
cmpci_set_in_ports(sc);
chan->bps = param->channels * param->bps;
if (!chan->bps)
return EINVAL;
chan->intr = intr;
chan->intr_arg = arg;
chan->blksize = blksize;
chan->nblocks = buffer_size / chan->blksize;
chan->swpos = 0;
/* set DMA frame */
if (!(p = cmpci_find_dmamem(sc, start)))
return EINVAL;
bus_space_write_4(sc->sc_iot, sc->sc_ioh, CMPCI_REG_DMA1_BASE,
DMAADDR(p));
delay(10);
bus_space_write_2(sc->sc_iot, sc->sc_ioh, CMPCI_REG_DMA1_BYTES,
(buffer_size + 1) / chan->bps - 1);
delay(10);
/* set interrupt count */
bus_space_write_2(sc->sc_iot, sc->sc_ioh, CMPCI_REG_DMA1_SAMPLES,
(chan->blksize + chan->bps - 1) / chan->bps - 1);
delay(10);
/* start DMA */
mtx_enter(&audio_lock);
cmpci_reg_set_4(sc, CMPCI_REG_FUNC_0, CMPCI_REG_CH1_DIR); /* REC */
cmpci_reg_set_4(sc, CMPCI_REG_INTR_CTRL, CMPCI_REG_CH1_INTR_ENABLE);
cmpci_reg_set_4(sc, CMPCI_REG_FUNC_0, CMPCI_REG_CH1_ENABLE);
mtx_leave(&audio_lock);
return 0;
}
/* end of file */
|
996dc011436f1f7d991a79d56f80fb4b1248c660
|
4d78977ee7a816f97134d92b5826e929fb56c571
|
/source/app-log.c
|
21c9b3155123fce38839c204271a7413977517c3
|
[
"MIT"
] |
permissive
|
ireader/sdk
|
312e3ebdd4b0f694977236efab012d75cbd4bdd1
|
9fb240206c4d925d12be5b29aeb94c7884ea8262
|
refs/heads/master
| 2023-09-01T17:49:04.171634
| 2023-07-22T01:56:22
| 2023-07-22T01:56:22
| 11,940,320
| 394
| 250
|
MIT
| 2022-05-01T08:18:58
| 2013-08-07T03:16:47
|
C
|
UTF-8
|
C
| false
| false
| 4,112
|
c
|
app-log.c
|
#include "app-log.h"
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
#if defined(OS_WINDOWS)
#include <Windows.h>
#else
#include <sys/time.h>
#include <pthread.h>
#include <syslog.h>
#if defined(OS_ANDROID)
#include <android/log.h>
#endif
#endif
#if defined(OS_WINDOWS)
#define THREAD_LOCAL static __declspec(thread)
#elif defined(__GNUC__) || defined(__clang__)
#define THREAD_LOCAL static __thread
#else
#define THREAD_LOCAL
#endif
#if !defined(OS_ANDROID) && (defined(OS_LINUX) || defined(OS_WINDOWS) || defined(OS_MAC))
#define N_LOG_BUFFER 1024 * 8 // TLS/SDP
#else
#define N_LOG_BUFFER 1024 * 2
#endif
//static const char s_month[][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
//static const char* s_level_tag[] = { "EMERG", "ALERT", "CRIT", "ERROR", "WARNING", "NOTICE", "INFO", "DEBUG" };
static const char* s_level_tag[] = { "X", "A", "C", "E", "W", "N", "I", "D" };
static const char* s_level_color_default[] = { "\033[0m", "\033[0;35m", "\033[0;34m", "\033[0;33m", "\033[0;31m", "\033[0;33m", "\033[0;37m", "\033[0;32m", "\033[0m", };
static const char* s_level_color_none[] = { "", "", "", "", "", "", "", "", "", };
static const char** s_level_color = s_level_color_none;
#define LOG_LEVEL(level) ((LOG_EMERG <= level && level <= LOG_DEBUG) ? level : LOG_DEBUG)
#if !defined(OS_WINDOWS) && !defined(OS_ANDROID)
static void app_log_init(void)
{
//char name[256] = { 0 };
//readlink("/proc/self/exe", name, sizeof(name)-1);
openlog(NULL, LOG_PID, LOG_USER /*| LOG_LOCAL0*/);
}
#endif
/// @return time format string, e.g. 00:00:00.000|
static int app_log_time(char timestr[], unsigned int bytes)
{
#if defined(OS_WINDOWS)
SYSTEMTIME t;
GetLocalTime(&t);
return snprintf(timestr, bytes, "%04hu-%02hu-%02huT%02hu:%02hu:%02hu.%03hu|", t.wYear, t.wMonth, t.wDay, t.wHour, t.wMinute, t.wSecond, t.wMilliseconds);
#else
struct tm t;
struct timeval tv;
gettimeofday(&tv, NULL);
localtime_r(&tv.tv_sec, &t);
return snprintf(timestr, bytes, "%04d-%02d-%02dT%02d:%02d:%02d.%03d|", (int)t.tm_year + 1900, (int)t.tm_mon+1, (int)t.tm_mday, (int)t.tm_hour, (int)t.tm_min, (int)t.tm_sec, (int)(tv.tv_usec / 1000) % 1000);
#endif
//return snprintf(timestr, sizeof(timestr), "%s-%02d %02d:%02d:%02d.%03d|", /*t.year+1900,*/ s_month[t.month % 12], t.day, t.hour, t.minute, t.second, t.millisecond);
}
static void app_log_syslog(int level, const char* format, va_list args)
{
#if defined(OS_WINDOWS)
int n = 0;
THREAD_LOCAL char log[N_LOG_BUFFER];
#if defined(_DEBUG) || defined(DEBUG)
n += app_log_time(log + n, sizeof(log) - n - 1);
#endif
n += snprintf(log + n, sizeof(log) -n - 1, "%s|", s_level_tag[LOG_LEVEL(level)]);
vsnprintf(log + n, sizeof(log) - n - 1, format, args);
OutputDebugStringA(log);
#elif defined(OS_ANDROID)
static int s_level[] = { ANDROID_LOG_FATAL/*emerg*/, ANDROID_LOG_FATAL/*alert*/, ANDROID_LOG_FATAL/*critical*/, ANDROID_LOG_ERROR/*error*/, ANDROID_LOG_WARN/*warning*/, ANDROID_LOG_INFO/*notice*/, ANDROID_LOG_INFO/*info*/, ANDROID_LOG_DEBUG/*debug*/ };
__android_log_vprint(s_level[level % 8], "android", format, args);
#else
static pthread_once_t s_onetime = PTHREAD_ONCE_INIT;
pthread_once(&s_onetime, app_log_init);
vsyslog(level, format, args);
#endif
}
static void app_log_print(int level, const char* format, va_list args)
{
int n;
char timestr[65];
THREAD_LOCAL char log[N_LOG_BUFFER];
app_log_time(timestr, sizeof(timestr));
n = vsnprintf(log, sizeof(log) - 1, format, args);
printf("%s%s%s|%.*s%s", s_level_color[LOG_LEVEL(level) + 1], timestr, s_level_tag[LOG_LEVEL(level)], n, log, s_level_color[0]);
}
static int s_syslog_level = LOG_INFO;
void app_log_setlevel(int level)
{
s_syslog_level = level;
}
void app_log(int level, const char* format, ...)
{
va_list args;
if (level <= s_syslog_level)
{
va_start(args, format);
app_log_print(level, format, args);
va_end(args);
va_start(args, format);
app_log_syslog(level, format, args);
va_end(args);
}
}
void app_log_setcolor(int enable)
{
s_level_color = enable ? s_level_color_default : s_level_color_none;
}
|
4ea5de226a6ceec6d342d1924211049a6cafaa70
|
bb7a80648bf830c2fb813cdb335032142cbee06d
|
/mod/mpp/3559a/inc/hisisdk/mpi_hdr.h
|
219d486cd89bc90d21460e93ccdbf2766e3a8dbe
|
[] |
no_license
|
openhisilicon/HIVIEW
|
44574a29da60e3bb400c7ce97c722dfc9f2959e6
|
60bbfa5cb66cc82f0cdc0bba1242dbc9491b0f37
|
refs/heads/master
| 2023-09-01T01:42:19.069724
| 2023-08-31T09:57:39
| 2023-08-31T09:57:39
| 189,036,134
| 336
| 121
| null | 2023-01-07T14:10:22
| 2019-05-28T13:41:40
|
C
|
UTF-8
|
C
| false
| false
| 1,987
|
h
|
mpi_hdr.h
|
/*
* Copyright (C) Hisilicon Technologies Co., Ltd. 2017-2019. All rights reserved.
* Description: hdr function header file
* Author: Hisilicon multimedia software group
* Create: 2017-04-01
*/
#ifndef __MPI_HDR_H__
#define __MPI_HDR_H__
#include "hi_common.h"
#include "hi_comm_video.h"
#include "hi_comm_hdr.h"
#include "hi_comm_vpss.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */
HI_S32 HI_MPI_HDR_SetOETFParam(VI_PIPE ViPipe, VPSS_GRP VpssGrp, VPSS_CHN VpssChn,
const HDR_OETF_PARAM_S *pstOETFParam);
HI_S32 HI_MPI_HDR_GetOETFParam(VI_PIPE ViPipe, VPSS_GRP VpssGrp, VPSS_CHN VpssChn, HDR_OETF_PARAM_S *pstOETFParam);
HI_S32 HI_MPI_HDR_SetTMParam(VI_PIPE ViPipe, VPSS_GRP VpssGrp, VPSS_CHN VpssChn, const HDR_TM_PARAM_S *pstTmParam);
HI_S32 HI_MPI_HDR_GetTMParam(VI_PIPE ViPipe, VPSS_GRP VpssGrp, VPSS_CHN VpssChn, HDR_TM_PARAM_S *pstTmParam);
HI_S32 HI_MPI_HDR_SetCSCParam(VI_PIPE ViPipe, VPSS_GRP VpssGrp, VPSS_CHN VpssChn, const HDR_CSC_PARAM_S *pstCscParam);
HI_S32 HI_MPI_HDR_GetCSCParam(VI_PIPE ViPipe, VPSS_GRP VpssGrp, VPSS_CHN VpssChn, HDR_CSC_PARAM_S *pstCscParam);
HI_S32 HI_MPI_HDR_SetCCMParam(VI_PIPE ViPipe, VPSS_GRP VpssGrp, VPSS_CHN VpssChn, const HDR_CCM_PARAM_S *pstCcmParam);
HI_S32 HI_MPI_HDR_GetCCMParam(VI_PIPE ViPipe, VPSS_GRP VpssGrp, VPSS_CHN VpssChn, HDR_CCM_PARAM_S *pstCcmParam);
HI_S32 HI_MPI_HDR_SetCLUTParam(VI_PIPE ViPipe, VPSS_GRP VpssGrp, VPSS_CHN VpssChn,
const HDR_CLUT_PARAM_S *pstClutParam);
HI_S32 HI_MPI_HDR_GetCLUTParam(VI_PIPE ViPipe, VPSS_GRP VpssGrp, VPSS_CHN VpssChn, HDR_CLUT_PARAM_S *pstClutParam);
HI_S32 HI_MPI_HDR_SetCLUTCoef(VI_PIPE ViPipe, VPSS_GRP VpssGrp, VPSS_CHN VpssChn, const HDR_CLUT_LUT_S *pstClutLut);
HI_S32 HI_MPI_HDR_GetCLUTCoef(VI_PIPE ViPipe, VPSS_GRP VpssGrp, VPSS_CHN VpssChn, HDR_CLUT_LUT_S *pstClutLut);
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */
#endif /* __MPI_HDR_H__ */
|
35116872ed14e87e270c63ea76655d7a2d48276c
|
b39dba38a99bc970d7c861517ab82bb92f5fc548
|
/include/cryptopp/config_os.h
|
77ee9c408f080358f88e0f725bc124878d0f5121
|
[
"BSL-1.0",
"LicenseRef-scancode-public-domain",
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
OpenMPT/openmpt
|
711aef385c6a098a9a2aaefa25f6563e4501d2e8
|
41c5bde364ed61afb414ac38792715ee9433c01c
|
refs/heads/master
| 2023-09-01T21:37:18.329917
| 2023-09-01T10:10:22
| 2023-09-01T10:10:22
| 82,913,630
| 501
| 87
|
BSD-3-Clause
| 2023-07-14T08:47:12
| 2017-02-23T10:04:01
|
C++
|
UTF-8
|
C
| false
| false
| 6,270
|
h
|
config_os.h
|
// config_os.h - written and placed in public domain by Jeffrey Walton
// the bits that make up this source file are from the
// library's monolithic config.h.
/// \file config_os.h
/// \brief Library configuration file
/// \details <tt>config_os.h</tt> provides defines for platforms and operating
/// systems.
/// \details <tt>config.h</tt> was split into components in May 2019 to better
/// integrate with Autoconf and its feature tests. The splitting occurred so
/// users could continue to include <tt>config.h</tt> while allowing Autoconf
/// to write new <tt>config_asm.h</tt> and new <tt>config_cxx.h</tt> using
/// its feature tests.
/// \note You should include <tt>config.h</tt> rather than <tt>config_os.h</tt>
/// directly.
/// \sa <A HREF="https://github.com/weidai11/cryptopp/issues/835">Issue 835,
/// Make config.h more autoconf friendly</A>,
/// <A HREF="https://www.cryptopp.com/wiki/Configure.sh">Configure.sh script</A>
/// on the Crypto++ wiki
/// \since Crypto++ 8.3
#ifndef CRYPTOPP_CONFIG_OS_H
#define CRYPTOPP_CONFIG_OS_H
#include "config_ver.h"
// It is OK to remove the hard stop below, but you are on your own.
// After building the library be sure to run self tests described
// https://www.cryptopp.com/wiki/Release_Process#Self_Tests
// The problems with Clang pretending to be other compilers is
// discussed at http://github.com/weidai11/cryptopp/issues/147.
#if (defined(_MSC_VER) && defined(__clang__) && \
!(defined( __clang_analyzer__)) && !defined(__INTEL_LLVM_COMPILER))
# error: "Unsupported configuration"
#endif
// Windows platform
#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__)
#define CRYPTOPP_WIN32_AVAILABLE
#endif
// Unix and Linux platforms
#if defined(__unix__) || defined(__MACH__) || defined(__NetBSD__) || defined(__sun)
#define CRYPTOPP_UNIX_AVAILABLE
#endif
// BSD platforms
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
#define CRYPTOPP_BSD_AVAILABLE
#endif
// Microsoft compilers
#if defined(_MSC_VER) || defined(__fastcall)
#define CRYPTOPP_FASTCALL __fastcall
#else
#define CRYPTOPP_FASTCALL
#endif
// Microsoft compilers
#if defined(_MSC_VER)
#define CRYPTOPP_NO_VTABLE __declspec(novtable)
#else
#define CRYPTOPP_NO_VTABLE
#endif
// Define this if you want to disable all OS-dependent features,
// such as sockets and OS-provided random number generators
// #define NO_OS_DEPENDENCE
// Define this to use features provided by Microsoft's CryptoAPI.
// Currently the only feature used is Windows random number generation.
// This macro will be ignored if NO_OS_DEPENDENCE is defined.
// #define USE_MS_CRYPTOAPI
// Define this to use features provided by Microsoft's CryptoNG API.
// CryptoNG API is available in Vista and above and its cross platform,
// including desktop apps and store apps. Currently the only feature
// used is Windows random number generation.
// This macro will be ignored if NO_OS_DEPENDENCE is defined.
// #define USE_MS_CNGAPI
// If the user did not make a choice, then select CryptoNG if
// targeting Windows 8 or above.
#if !defined(USE_MS_CRYPTOAPI) && !defined(USE_MS_CNGAPI)
# if !defined(_USING_V110_SDK71_) && ((WINVER >= 0x0602 /*_WIN32_WINNT_WIN8*/) || \
(_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/))
# define USE_MS_CNGAPI
# else
# define USE_MS_CRYPTOAPI
# endif
#endif
// Begin OS features, like init priorities and random numbers
#ifndef NO_OS_DEPENDENCE
// CRYPTOPP_INIT_PRIORITY attempts to manage initialization of C++ static objects.
// Under GCC, the library uses init_priority attribute in the range
// [CRYPTOPP_INIT_PRIORITY, CRYPTOPP_INIT_PRIORITY+100]. Under Windows,
// CRYPTOPP_INIT_PRIORITY enlists "#pragma init_seg(lib)". The platforms
// with gaps are Apple and Sun because they require linker scripts. Apple and
// Sun will use the library's Singletons to initialize and acquire resources.
// Also see http://cryptopp.com/wiki/Static_Initialization_Order_Fiasco
#ifndef CRYPTOPP_INIT_PRIORITY
# define CRYPTOPP_INIT_PRIORITY 250
#endif
// CRYPTOPP_USER_PRIORITY is for other libraries and user code that is using Crypto++
// and managing C++ static object creation. It is guaranteed not to conflict with
// values used by (or would be used by) the Crypto++ library.
#ifndef CRYPTOPP_USER_PRIORITY
# define CRYPTOPP_USER_PRIORITY (CRYPTOPP_INIT_PRIORITY+101)
#endif
// Most platforms allow us to specify when to create C++ objects. Apple and Sun do not.
#if (CRYPTOPP_INIT_PRIORITY > 0) && !(defined(NO_OS_DEPENDENCE) || defined(__APPLE__) || defined(__sun__))
# if (CRYPTOPP_GCC_VERSION >= 30000) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20900) || (_INTEL_COMPILER >= 800)
# define HAVE_GCC_INIT_PRIORITY 1
# elif (CRYPTOPP_MSC_VERSION >= 1310)
# define HAVE_MSC_INIT_PRIORITY 1
# elif defined(__xlc__) || defined(__xlC__) || defined(__ibmxl__)
# define HAVE_XLC_INIT_PRIORITY 1
# endif
#endif // CRYPTOPP_INIT_PRIORITY, NO_OS_DEPENDENCE, Apple, Sun
#if defined(CRYPTOPP_WIN32_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE)
# define HIGHRES_TIMER_AVAILABLE
#endif
#ifdef CRYPTOPP_WIN32_AVAILABLE
# if !defined(WINAPI_FAMILY)
# define THREAD_TIMER_AVAILABLE
# elif defined(WINAPI_FAMILY)
# if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP))
# define THREAD_TIMER_AVAILABLE
# endif
# endif
#endif
#if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
# define NONBLOCKING_RNG_AVAILABLE
# define BLOCKING_RNG_AVAILABLE
# define OS_RNG_AVAILABLE
#endif
// Cygwin/Newlib requires _XOPEN_SOURCE=600
#if defined(CRYPTOPP_UNIX_AVAILABLE)
# define UNIX_SIGNALS_AVAILABLE 1
#endif
#ifdef CRYPTOPP_WIN32_AVAILABLE
# if !defined(WINAPI_FAMILY)
# define NONBLOCKING_RNG_AVAILABLE
# define OS_RNG_AVAILABLE
# elif defined(WINAPI_FAMILY)
# if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP))
# define NONBLOCKING_RNG_AVAILABLE
# define OS_RNG_AVAILABLE
# elif !(WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP))
# if ((WINVER >= 0x0A00 /*_WIN32_WINNT_WIN10*/) || (_WIN32_WINNT >= 0x0A00 /*_WIN32_WINNT_WIN10*/))
# define NONBLOCKING_RNG_AVAILABLE
# define OS_RNG_AVAILABLE
# endif
# endif
# endif
#endif
#endif // NO_OS_DEPENDENCE
#endif // CRYPTOPP_CONFIG_OS_H
|
7e3ab653a2320ab73202f41935ebd627bf4441bb
|
0744dcc5394cebf57ebcba343747af6871b67017
|
/os/net/lwip/src/core/snmp2backup/asn1_enc.c
|
52efb0ed9ed7f8ddcf347e809bde6f0e2937affd
|
[
"Apache-2.0",
"BSD-3-Clause",
"GPL-1.0-or-later",
"ISC",
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-other-permissive"
] |
permissive
|
Samsung/TizenRT
|
96abf62f1853f61fcf91ff14671a5e0c6ca48fdb
|
1a5c2e00a4b1bbf4c505bbf5cc6a8259e926f686
|
refs/heads/master
| 2023-08-31T08:59:33.327998
| 2023-08-08T06:09:20
| 2023-08-31T04:38:20
| 82,517,252
| 590
| 719
|
Apache-2.0
| 2023-09-14T06:54:49
| 2017-02-20T04:38:30
|
C
|
UTF-8
|
C
| false
| false
| 13,568
|
c
|
asn1_enc.c
|
/****************************************************************************
*
* Copyright 2018 Samsung Electronics All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*
****************************************************************************/
/*
* Copyright (c) 2006 Axon Digital Design B.V., The Netherlands.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* Author: Christiaan Simons <christiaan.simons@axon.tv>
*/
/**
* @file
* Abstract Syntax Notation One (ISO 8824, 8825) encoding
*
* @todo not optimised (yet), favor correctness over speed, favor speed over size
*/
#include "lwip/opt.h"
#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
#include "lwip/snmp_asn1.h"
/**
* Returns octet count for length.
*
* @param length
* @param octets_needed points to the return value
*/
void snmp_asn1_enc_length_cnt(u16_t length, u8_t *octets_needed)
{
if (length < 0x80U) {
*octets_needed = 1;
} else if (length < 0x100U) {
*octets_needed = 2;
} else {
*octets_needed = 3;
}
}
/**
* Returns octet count for an u32_t.
*
* @param value
* @param octets_needed points to the return value
*
* @note ASN coded integers are _always_ signed. E.g. +0xFFFF is coded
* as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value
* of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!!
*/
void snmp_asn1_enc_u32t_cnt(u32_t value, u16_t *octets_needed)
{
if (value < 0x80UL) {
*octets_needed = 1;
} else if (value < 0x8000UL) {
*octets_needed = 2;
} else if (value < 0x800000UL) {
*octets_needed = 3;
} else if (value < 0x80000000UL) {
*octets_needed = 4;
} else {
*octets_needed = 5;
}
}
/**
* Returns octet count for an s32_t.
*
* @param value
* @param octets_needed points to the return value
*
* @note ASN coded integers are _always_ signed.
*/
void snmp_asn1_enc_s32t_cnt(s32_t value, u16_t *octets_needed)
{
if (value < 0) {
value = ~value;
}
if (value < 0x80L) {
*octets_needed = 1;
} else if (value < 0x8000L) {
*octets_needed = 2;
} else if (value < 0x800000L) {
*octets_needed = 3;
} else {
*octets_needed = 4;
}
}
/**
* Returns octet count for an object identifier.
*
* @param ident_len object identifier array length
* @param ident points to object identifier array
* @param octets_needed points to the return value
*/
void snmp_asn1_enc_oid_cnt(u8_t ident_len, s32_t *ident, u16_t *octets_needed)
{
s32_t sub_id;
u8_t cnt;
cnt = 0;
if (ident_len > 1) {
/* compressed prefix in one octet */
cnt++;
ident_len -= 2;
ident += 2;
}
while (ident_len > 0) {
ident_len--;
sub_id = *ident;
sub_id >>= 7;
cnt++;
while (sub_id > 0) {
sub_id >>= 7;
cnt++;
}
ident++;
}
*octets_needed = cnt;
}
/**
* Encodes ASN type field into a pbuf chained ASN1 msg.
*
* @param p points to output pbuf to encode value into
* @param ofs points to the offset within the pbuf chain
* @param type input ASN1 type
* @return ERR_OK if successfull, ERR_ARG if we can't (or won't) encode
*/
err_t snmp_asn1_enc_type(struct pbuf *p, u16_t ofs, u8_t type)
{
u16_t plen, base;
u8_t *msg_ptr;
plen = 0;
while (p != NULL) {
base = plen;
plen += p->len;
if (ofs < plen) {
msg_ptr = (u8_t *) p->payload;
msg_ptr += ofs - base;
*msg_ptr = type;
return ERR_OK;
}
p = p->next;
}
/* p == NULL, ofs >= plen */
return ERR_ARG;
}
/**
* Encodes host order length field into a pbuf chained ASN1 msg.
*
* @param p points to output pbuf to encode length into
* @param ofs points to the offset within the pbuf chain
* @param length is the host order length to be encoded
* @return ERR_OK if successfull, ERR_ARG if we can't (or won't) encode
*/
err_t snmp_asn1_enc_length(struct pbuf *p, u16_t ofs, u16_t length)
{
u16_t plen, base;
u8_t *msg_ptr;
plen = 0;
while (p != NULL) {
base = plen;
plen += p->len;
if (ofs < plen) {
msg_ptr = (u8_t *) p->payload;
msg_ptr += ofs - base;
if (length < 0x80) {
*msg_ptr = (u8_t) length;
return ERR_OK;
} else if (length < 0x100) {
*msg_ptr = 0x81;
ofs += 1;
if (ofs >= plen) {
/* next octet in next pbuf */
p = p->next;
if (p == NULL) {
return ERR_ARG;
}
msg_ptr = (u8_t *) p->payload;
} else {
/* next octet in same pbuf */
msg_ptr++;
}
*msg_ptr = (u8_t) length;
return ERR_OK;
} else {
u8_t i;
/* length >= 0x100 && length <= 0xFFFF */
*msg_ptr = 0x82;
i = 2;
while (i > 0) {
i--;
ofs += 1;
if (ofs >= plen) {
/* next octet in next pbuf */
p = p->next;
if (p == NULL) {
return ERR_ARG;
}
msg_ptr = (u8_t *) p->payload;
plen += p->len;
} else {
/* next octet in same pbuf */
msg_ptr++;
}
if (i == 0) {
/* least significant length octet */
*msg_ptr = (u8_t) length;
} else {
/* most significant length octet */
*msg_ptr = (u8_t)(length >> 8);
}
}
return ERR_OK;
}
}
p = p->next;
}
/* p == NULL, ofs >= plen */
return ERR_ARG;
}
/**
* Encodes u32_t (counter, gauge, timeticks) into a pbuf chained ASN1 msg.
*
* @param p points to output pbuf to encode value into
* @param ofs points to the offset within the pbuf chain
* @param octets_needed encoding length (from snmp_asn1_enc_u32t_cnt())
* @param value is the host order u32_t value to be encoded
* @return ERR_OK if successfull, ERR_ARG if we can't (or won't) encode
*
* @see snmp_asn1_enc_u32t_cnt()
*/
err_t snmp_asn1_enc_u32t(struct pbuf *p, u16_t ofs, u16_t octets_needed, u32_t value)
{
u16_t plen, base;
u8_t *msg_ptr;
plen = 0;
while (p != NULL) {
base = plen;
plen += p->len;
if (ofs < plen) {
msg_ptr = (u8_t *) p->payload;
msg_ptr += ofs - base;
if (octets_needed == 5) {
/* not enough bits in 'value' add leading 0x00 */
octets_needed--;
*msg_ptr = 0x00;
ofs += 1;
if (ofs >= plen) {
/* next octet in next pbuf */
p = p->next;
if (p == NULL) {
return ERR_ARG;
}
msg_ptr = (u8_t *) p->payload;
plen += p->len;
} else {
/* next octet in same pbuf */
msg_ptr++;
}
}
while (octets_needed > 1) {
octets_needed--;
*msg_ptr = (u8_t)(value >> (octets_needed << 3));
ofs += 1;
if (ofs >= plen) {
/* next octet in next pbuf */
p = p->next;
if (p == NULL) {
return ERR_ARG;
}
msg_ptr = (u8_t *) p->payload;
plen += p->len;
} else {
/* next octet in same pbuf */
msg_ptr++;
}
}
/* (only) one least significant octet */
*msg_ptr = (u8_t) value;
return ERR_OK;
}
p = p->next;
}
/* p == NULL, ofs >= plen */
return ERR_ARG;
}
/**
* Encodes s32_t integer into a pbuf chained ASN1 msg.
*
* @param p points to output pbuf to encode value into
* @param ofs points to the offset within the pbuf chain
* @param octets_needed encoding length (from snmp_asn1_enc_s32t_cnt())
* @param value is the host order s32_t value to be encoded
* @return ERR_OK if successfull, ERR_ARG if we can't (or won't) encode
*
* @see snmp_asn1_enc_s32t_cnt()
*/
err_t snmp_asn1_enc_s32t(struct pbuf *p, u16_t ofs, u16_t octets_needed, s32_t value)
{
u16_t plen, base;
u8_t *msg_ptr;
plen = 0;
while (p != NULL) {
base = plen;
plen += p->len;
if (ofs < plen) {
msg_ptr = (u8_t *) p->payload;
msg_ptr += ofs - base;
while (octets_needed > 1) {
octets_needed--;
*msg_ptr = (u8_t)(value >> (octets_needed << 3));
ofs += 1;
if (ofs >= plen) {
/* next octet in next pbuf */
p = p->next;
if (p == NULL) {
return ERR_ARG;
}
msg_ptr = (u8_t *) p->payload;
plen += p->len;
} else {
/* next octet in same pbuf */
msg_ptr++;
}
}
/* (only) one least significant octet */
*msg_ptr = (u8_t) value;
return ERR_OK;
}
p = p->next;
}
/* p == NULL, ofs >= plen */
return ERR_ARG;
}
/**
* Encodes object identifier into a pbuf chained ASN1 msg.
*
* @param p points to output pbuf to encode oid into
* @param ofs points to the offset within the pbuf chain
* @param ident_len object identifier array length
* @param ident points to object identifier array
* @return ERR_OK if successfull, ERR_ARG if we can't (or won't) encode
*/
err_t snmp_asn1_enc_oid(struct pbuf *p, u16_t ofs, u8_t ident_len, s32_t *ident)
{
u16_t plen, base;
u8_t *msg_ptr;
plen = 0;
while (p != NULL) {
base = plen;
plen += p->len;
if (ofs < plen) {
msg_ptr = (u8_t *) p->payload;
msg_ptr += ofs - base;
if (ident_len > 1) {
if ((ident[0] == 1) && (ident[1] == 3)) {
/* compressed (most common) prefix .iso.org */
*msg_ptr = 0x2b;
} else {
/* calculate prefix */
*msg_ptr = (u8_t)((ident[0] * 40) + ident[1]);
}
ofs += 1;
if (ofs >= plen) {
/* next octet in next pbuf */
p = p->next;
if (p == NULL) {
return ERR_ARG;
}
msg_ptr = (u8_t *) p->payload;
plen += p->len;
} else {
/* next octet in same pbuf */
msg_ptr++;
}
ident_len -= 2;
ident += 2;
} else {
/* @bug: allow empty varbinds for symmetry (we must decode them for getnext), allow partial compression?? */
/* ident_len <= 1, at least we need zeroDotZero (0.0) (ident_len == 2) */
return ERR_ARG;
}
while (ident_len > 0) {
s32_t sub_id;
u8_t shift, tail;
ident_len--;
sub_id = *ident;
tail = 0;
shift = 28;
while (shift > 0) {
u8_t code;
code = (u8_t)(sub_id >> shift);
if ((code != 0) || (tail != 0)) {
tail = 1;
*msg_ptr = code | 0x80;
ofs += 1;
if (ofs >= plen) {
/* next octet in next pbuf */
p = p->next;
if (p == NULL) {
return ERR_ARG;
}
msg_ptr = (u8_t *) p->payload;
plen += p->len;
} else {
/* next octet in same pbuf */
msg_ptr++;
}
}
shift -= 7;
}
*msg_ptr = (u8_t) sub_id & 0x7F;
if (ident_len > 0) {
ofs += 1;
if (ofs >= plen) {
/* next octet in next pbuf */
p = p->next;
if (p == NULL) {
return ERR_ARG;
}
msg_ptr = (u8_t *) p->payload;
plen += p->len;
} else {
/* next octet in same pbuf */
msg_ptr++;
}
}
/* proceed to next sub-identifier */
ident++;
}
return ERR_OK;
}
p = p->next;
}
/* p == NULL, ofs >= plen */
return ERR_ARG;
}
/**
* Encodes raw data (octet string, opaque) into a pbuf chained ASN1 msg.
*
* @param p points to output pbuf to encode raw data into
* @param ofs points to the offset within the pbuf chain
* @param raw_len raw data length
* @param raw points raw data
* @return ERR_OK if successfull, ERR_ARG if we can't (or won't) encode
*/
err_t snmp_asn1_enc_raw(struct pbuf *p, u16_t ofs, u16_t raw_len, u8_t *raw)
{
u16_t plen, base;
u8_t *msg_ptr;
plen = 0;
while (p != NULL) {
base = plen;
plen += p->len;
if (ofs < plen) {
msg_ptr = (u8_t *) p->payload;
msg_ptr += ofs - base;
while (raw_len > 1) {
/* copy raw_len - 1 octets */
raw_len--;
*msg_ptr = *raw;
raw++;
ofs += 1;
if (ofs >= plen) {
/* next octet in next pbuf */
p = p->next;
if (p == NULL) {
return ERR_ARG;
}
msg_ptr = (u8_t *) p->payload;
plen += p->len;
} else {
/* next octet in same pbuf */
msg_ptr++;
}
}
if (raw_len > 0) {
/* copy last or single octet */
*msg_ptr = *raw;
}
return ERR_OK;
}
p = p->next;
}
/* p == NULL, ofs >= plen */
return ERR_ARG;
}
#endif /* LWIP_SNMP */
|
c78d44e30ff5486aa3274734c8e98efd6ad863c2
|
e683a0b8dbb87c7ceb99e0d06896174a559d2c67
|
/Tools/glue/vm.c
|
d0e256919167f8ae31a0cf1fcb22975077066f16
|
[
"Apache-2.0"
] |
permissive
|
bluewaysw/pcgeos
|
f093d79567d977d992f47065056d14d5a04b9f14
|
c6ae4c8e77b54b9ff654c3916f2191f8b1a1b65d
|
refs/heads/master
| 2023-08-31T00:17:54.481175
| 2023-08-29T19:00:49
| 2023-08-29T19:00:49
| 157,968,410
| 603
| 88
|
Apache-2.0
| 2023-09-13T07:44:06
| 2018-11-17T09:09:55
|
Assembly
|
UTF-8
|
C
| false
| false
| 20,903
|
c
|
vm.c
|
/***********************************************************************
*
* Copyright (c) Berkeley Softworks 1989 -- All Rights Reserved
*
* PROJECT: PCGEOS
* MODULE: Glue -- VM file creation
* FILE: vm.c
*
* AUTHOR: Adam de Boor: Oct 24, 1989
*
* ROUTINES:
* Name Description
* ---- -----------
*
* REVISION HISTORY:
* Date Name Description
* ---- ---- -----------
* 10/24/89 ardeb Initial version
*
* DESCRIPTION:
* Output-related functions for creating a VM file.
*
* Each segment or group in the file gets its own VM block, with
* the exception of segments in groups, which go into the block
* allocated for the group.
*
* HANDLE and SEGMENT relocations yield the VM block handle of the
* segment or group. RESID relocations yield the index of the VM
* block (the index is (the block handle - 32)/12, i.e. the index of
* the block within the block array in the header).
*
* For a given segment or group <name>, three constants are looked for
* within the segment:
* - <name>ID is the user ID with which the block should be allocated.
* - <name>PRESERVE indicates the preserve flag for the block
* should be set
* - <name>LMEM indicates whether the block should be marked as
* lmem. This overrides the segment's combine type.
*
* The compaction threshold can be specified in one of two ways:
* * by defining the constant COMPACTION in some segment in the
* file.
* * by using the -C <n> argument
* The attributes for the file can be specified in one of two ways:
* * by defining the constant ATTRIBUTES, in some segment in the
* file, to contain the desired attribute bits.
* * by using the -A <n> argument.
* The map block for the file is a segment named "MapBlock", by
* default. The name sought may, however, be changed with the
* -M <name> flag.
*
***********************************************************************/
#ifndef lint
static char *rcsid =
"$Id: vm.c,v 2.18 96/07/08 17:31:14 tbradley Exp $";
#endif lint
#include "glue.h"
#include "output.h"
#include "geo.h"
#include <config.h>
#include <compat/file.h>
#include <stddef.h>
#include <vm.h>
#ifdef sparc
#include <alloca.h>
#endif
/* Goddamn HighC won't let me use my nice typedefs... */
static int VmPrepare(char *, char *, char *);
static int VmReloc(int, SegDesc *, void *, SegDesc *, int, word *);
static void VmWrite(void *, int, char *);
static int VmCheckFixed(SegDesc *);
static int attributes = -1;
static int compaction = -1;
static char *mapName = "MapBlock";
static char *protocol = "0.0";
static char *release = "0.0.0.0";
static char *token = NULL;
static char *creator = NULL;
static char *longname = NULL;
static char *libtabGeode = NULL;
static char *userNotes = "";
static FileOption vmOpts[] = {
{'A', OPT_INTARG, (void *)&attributes, "attributes"},
{'C', OPT_INTARG, (void *)&compaction, "compaction threshold"},
{'M', OPT_STRARG, (void *)&mapName, "map segment"},
{'P', OPT_STRARG, (void *)&protocol, "protocol number"},
{'R', OPT_STRARG, (void *)&release, "release number"},
{'t', OPT_STRARG, (void *)&token, "file's token"},
{'c', OPT_STRARG, (void *)&creator, "creator's token"},
{'l', OPT_STRARG, (void *)&longname, "long name"},
{'i', OPT_STRARG, (void *)&libtabGeode, "geode with library table"},
{'u', OPT_STRARG, (void *)&userNotes, "user notes"},
{'\0', OPT_NOARG, (void *)NULL, NULL}
};
FileOps vmOps = {
VmPrepare, /* prepare function */
0, /* Runtime relocation size */
VmReloc, /* Convert runtime relocation */
VmWrite, /* Write vm header and the rest of the file. */
VmCheckFixed, /* See if a segment is in fixed memory */
(SetEntryProc *)0,
FILE_NOCALL, /* Should be no call relocations here */
"vm", /* File suffix */
vmOpts, /* Extra options required */
};
static VMHandle outFile; /* Output file, opened during preparation
* as we need the block handles */
/***********************************************************************
* VmSwapArea
***********************************************************************
* SYNOPSIS: Swap an area of shortwords.
* CALLED BY: VmPrepare
* RETURN: Nothing
* SIDE EFFECTS: All the words in the area are byte-swapped.
*
* STRATEGY:
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
* ardeb 11/ 3/89 Initial Revision
*
***********************************************************************/
static inline void
VmSwapArea(word *s, /* Start of area to swap */
int i) /* Number of bytes to swap */
{
while (i > 0) {
swapsp(s);
s++;
i -= 2;
}
}
/***********************************************************************
* VmFindSegSym
***********************************************************************
* SYNOPSIS: Find a constant specific to the given segment
* CALLED BY: (INTERNAL) VmPrepare
* RETURN: TRUE if found the symbol, *valPtr filled in
* FALSE if didn't find the symbol, *valPtr == 0
* SIDE EFFECTS: none
*
* STRATEGY:
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
* ardeb 11/ 9/94 Initial Revision
*
***********************************************************************/
static int
VmFindSegSym(ID segName,
const char *suffix,
int *valPtr)
{
const char *sname;
char *idname;
int result;
/*
* Allocate a buffer for the name.
*/
sname = ST_Lock(symbols, segName);
idname = (char *)malloc(strlen(sname)+strlen(suffix)+1);
/*
* Create the name, please, and release the segment name
*/
strcpy(idname, sname);
strcat(idname, suffix);
ST_Unlock(symbols, segName);
/*
* Look for the silly thing.
*/
result = Out_FindConstSym(idname, valPtr);
/*
* Set the value to something consistent, if symbol not found.
*/
if (!result) {
*valPtr = 0;
}
free(idname);
return(result);
}
/***********************************************************************
* VmPrepare
***********************************************************************
* SYNOPSIS: Prepare the data structures for creating a vm file
* CALLED BY: InterPass
* RETURN: The size of the resulting file
* SIDE EFFECTS: vmHeader is filled in.
*
* STRATEGY:
* Make all groups into segments, merging all symbol and line data
* into the new segment. The individual segments continue to exist,
* but are handled specially (placed in seg_SubSegs) where they can
* be found for purposes of figuring where in the executable the
* data are to be put, but are otherwise unused.
*
* The positions assigned to segments/groups are only for positioning
* in the output buffer, from which the data are copied into the
* blocks in the output VM file.
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
* ardeb 10/20/89 Initial Revision
*
***********************************************************************/
static int
VmPrepare(char *outfile,
char *paramfile,
char *mapfile)
{
int cbase;
int i, j;
short status;
if (libtabGeode != NULL) {
/*
* Link in the ldf files for the libraries imported by the given geode,
* so object blocks in this file can be properly relocated when loaded
* by the geode.
*/
word libCount;
ImportedLibraryEntry *ile;
FILE *geode;
geode = fopen(libtabGeode, "rb");
if (geode == NULL) {
Notify(NOTIFY_ERROR, "%s: cannot open", libtabGeode);
return(0);
}
if (geosRelease >= 2) {
fseek(geode, offsetof(GeodeHeader2, libCount), L_SET);
libCount = getc(geode) | (getc(geode) << 8);
fseek(geode, sizeof(GeodeHeader2), L_SET);
} else {
fseek(geode, offsetof(GeodeHeader, libCount), L_SET);
libCount = getc(geode) | (getc(geode) << 8);
fseek(geode, sizeof(GeodeHeader), L_SET);
}
/*
* File is positioned at the library table. Alloc room for it and read
* it in.
*/
ile = (ImportedLibraryEntry *)malloc(libCount *
sizeof(ImportedLibraryEntry));
if (fread(ile, sizeof(ImportedLibraryEntry), libCount, geode) !=
libCount)
{
Notify(NOTIFY_ERROR,
"%s: unable to read entire imported library table",
libtabGeode);
(void)fclose(geode);
free((malloc_t)ile);
return(0);
}
(void)fclose(geode);
/*
* Now link in the symbols for the libraries one at a time.
*/
for (i = 0; i < libCount; i++) {
char libname[GEODE_NAME_SIZE+1];
char *cp;
char *cp2;
for (cp = ile[i].name, cp2 = libname, j = GEODE_NAME_SIZE;
j > 0 && *cp != ' ';
*cp2++ = *cp++)
{
;
}
*cp2 = '\0';
Library_Link(libname, LLT_DYNAMIC, swaps(ile[i].geodeAttrs));
}
free((malloc_t)ile);
}
/*
* Promote groups to be segments so we can just use the array of segments
* as the list of blocks to create.
*/
Out_PromoteGroups();
/*
* Look for COMPACTION and ATTRIBUTES symbols.
*/
if (compaction == -1) {
(void)Out_FindConstSym("COMPACTION", &compaction);
/*
* If level still not determined, set to 0 so VM functions
* can set the default.
*/
if (compaction == -1) {
compaction = 0;
}
}
if (attributes == -1) {
(void)Out_FindConstSym("ATTRIBUTES", &attributes);
if (attributes == -1) {
attributes = 0;
}
}
/*
* Remove and recreate the output file now, as we need to get block
* handles.
*/
(void)unlink(outfile);
outFile = VMOpen(VMO_CREATE_ONLY|FILE_DENY_W|FILE_ACCESS_RW,
compaction, outfile, &status);
if (outFile == NULL) {
Notify(NOTIFY_ERROR, "%s: cannot open", outfile);
return(0);
}
/*
* Set the various pieces of the file header that aren't set automatically
* by VMOpen.
*/
if (geosRelease > 1) {
GeosFileHeader2 gfh;
VMGetHeader(outFile, (char *)&gfh);
Geo_DecodeRP(release, 4, (word *)&gfh.release);
VmSwapArea((word *)&gfh.release, sizeof(gfh.release));
Geo_DecodeRP(protocol, 2, (word *)&gfh.protocol);
VmSwapArea((word *)&gfh.protocol, sizeof(gfh.protocol));
if (!longname) {
longname = outfile;
}
if (dbcsRelease) {
VMCopyToDBCSString(gfh.longName, longname, sizeof(gfh.longName)-1);
} else {
strncpy(gfh.longName, longname, sizeof(gfh.longName)-1);
}
if (creator) {
if (strlen(creator) < TOKEN_CHARS_SIZE) {
Notify(NOTIFY_ERROR,
"creator's token too small (must be %d chars minimum)",
TOKEN_CHARS_SIZE);
VMClose(outFile);
unlink(outfile);
return(0);
} else {
bcopy(creator, gfh.creator.chars, TOKEN_CHARS_SIZE);
}
}
if (token) {
if (strlen(token) < TOKEN_CHARS_SIZE) {
Notify(NOTIFY_ERROR,
"file's token too small (must be %d chars minimum)",
TOKEN_CHARS_SIZE);
VMClose(outFile);
unlink(outfile);
return(0);
} else {
bcopy(token, gfh.token.chars, TOKEN_CHARS_SIZE);
}
}
/*
* Install the copyright notice.
*/
strncpy(gfh.notice, copyright, COPYRIGHT_SIZE);
/*
* Install any user notes.
*/
strncpy(gfh.userNotes, userNotes, GFH_USER_NOTES_SIZE);
/* XXX: NEED TO SUPPORT {token,creator}.manufID AS WELL */
VMSetHeader(outFile, (char *)&gfh);
} else {
GeosFileHeader gfh;
VMGetHeader(outFile, (char *)&gfh);
Geo_DecodeRP(release, 4, (word *)&gfh.core.release);
VmSwapArea((word *)&gfh.core.release, sizeof(gfh.core.release));
Geo_DecodeRP(protocol, 2, (word *)&gfh.core.protocol);
VmSwapArea((word *)&gfh.core.protocol, sizeof(gfh.core.protocol));
if (!longname) {
longname = outfile;
}
strncpy(gfh.core.longName, longname, sizeof(gfh.core.longName)-1);
if (creator) {
if (strlen(creator) < TOKEN_CHARS_SIZE) {
Notify(NOTIFY_ERROR,
"creator's token too small (must be %d chars minimum)",
TOKEN_CHARS_SIZE);
VMClose(outFile);
unlink(outfile);
return(0);
} else {
bcopy(creator, gfh.core.creator.chars, TOKEN_CHARS_SIZE);
}
}
if (token) {
if (strlen(token) < TOKEN_CHARS_SIZE) {
Notify(NOTIFY_ERROR,
"file's token too small (must be %d chars minimum)",
TOKEN_CHARS_SIZE);
VMClose(outFile);
unlink(outfile);
return(0);
} else {
bcopy(token, gfh.core.token.chars, TOKEN_CHARS_SIZE);
}
}
/*
* Install the copyright notice.
*/
strncpy(gfh.reserved, copyright, COPYRIGHT_SIZE);
/*
* Install any user notes.
*/
strncpy(gfh.userNotes, userNotes, GFH_USER_NOTES_SIZE);
/* XXX: NEED TO SUPPORT {token,creator}.manufID AS WELL */
VMSetHeader(outFile, (char *)&gfh);
}
VMSetAttributes(outFile, attributes, -1);
/*
* Assign buffer positions for all the blocks and allocate handles as
* well (for relocation purposes). NOTE WE SKIP OVER SEGMENT 0, WHICH
* IS THE GLOBAL SCOPE.
*/
cbase = 0;
for (i = 1; i < seg_NumSegs; i++) {
SegDesc *sd = seg_Segments[i];
int vmid = 0;
if (sd->combine != SEG_LIBRARY) {
sd->foff = sd->nextOff = cbase;
/*
* Tack "ID" onto the end of the segment so we can try and find the
* desired ID for the block.
*/
(void)VmFindSegSym(sd->name, "ID", &vmid);
sd->pdata.block = VMAlloc(outFile, sd->size, vmid);
if (VmFindSegSym(sd->name, "LMEM", &vmid)) {
if (vmid) {
VMSetLMemFlag(outFile, sd->pdata.block);
}
} else if (sd->combine == SEG_LMEM) {
VMSetLMemFlag(outFile, sd->pdata.block);
}
if (VmFindSegSym(sd->name, "PRESERVE", &vmid)) {
if (vmid) {
VMSetPreserveFlag(outFile, sd->pdata.block);
}
} else if (sd->isObjSeg) {
VMSetPreserveFlag(outFile, sd->pdata.block);
}
cbase += sd->size;
}
}
/*
* Now set the offsets for all the sub-segments.
*/
for (i = 0; i < seg_NumSubSegs; i++) {
SegDesc *sd = seg_SubSegs[i];
for (j = 0; j < seg_NumSegs; j++) {
if ((seg_Segments[j]->name == sd->group->name) &&
(seg_Segments[j]->class == NullID))
{
sd->foff = sd->nextOff = seg_Segments[j]->foff + sd->grpOff;
sd->pdata.block = seg_Segments[j]->pdata.block;
/*
* No further relocation is required for symbols in this
* segment when the group is the frame.
*/
sd->grpOff = 0;
break;
}
}
}
/*
* All done with the group descriptors.
*/
seg_NumGroups = 0;
if (mapfile) {
/*
* We always print the map to stdout...
*/
printf("Name VM Block Size\n");
printf("--------------------------------------------\n");
for (i = 1; i < seg_NumSegs; i++) {
SegDesc *sd = seg_Segments[i];
if (sd->combine != SEG_LIBRARY) {
printf("%-30.30i %04xh %5d\n",
sd->name, sd->pdata.block, sd->size);
}
}
fflush(stdout);
}
return(cbase);
}
/***********************************************************************
* VmReloc
***********************************************************************
* SYNOPSIS: Enter another runtime relocation
* CALLED BY: Pass2_Load
* RETURN: Nothing
* SIDE EFFECTS: Maybe.
*
* STRATEGY:
* For OREL_CALL, the routine number (if library) or offset (if in
* vmde) is stored at *val.
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
* ardeb 10/20/89 Initial Revision
*
***********************************************************************/
static int
VmReloc(int type, /* Relocation type (from obj file) */
SegDesc *frame, /* Descriptor of relocation frame */
void *rbuf, /* Place to store runtime relocation */
SegDesc *targ, /* Target segment */
int off, /* Offset w/in segment of relocation */
word *val) /* Word being relocated. Store
* value needed at runtime in
* PC byte-order */
{
Library *lib;
/*
* If frame is a group (through the wonders of Pass 2), map it into its
* proper segment descriptor so we don't get confused below.
*/
if (frame->type == S_GROUP) {
int i;
for (i = 0; i < seg_NumSegs; i++) {
if ((seg_Segments[i]->name == frame->name) &&
(seg_Segments[i]->class == NullID))
{
frame = seg_Segments[i];
break;
}
}
}
/*
* If relocation to a library, fetch the library descriptor pointer and
* make sure it exists. If it's still NULL, the library wasn't linked in
* and we declare an error. We also set up 'info' and 'extra' properly
* based on the library number as most of the things below require this if
* the segment is a library.
*/
if (frame->combine == SEG_LIBRARY) {
lib = &libs[frame->pdata.library];
} else {
lib = 0; /* Be quiet, GCC (only used if frame->
* combine is SEG_LIBRARY, & that doesn't
* change...) */
}
if (type == OREL_SEGMENT || type == OREL_HANDLE) {
/*
* Segment relocations get replaced with the VM block handle of
* the frame, but we still don't register any sort of runtime
* relocation.
*/
byte *bp = (byte *)val;
if (frame->combine == SEG_LIBRARY) {
Notify(NOTIFY_ERROR,
"cannot have segment reference to library segment %i in a VM file",
frame->name);
} else {
*bp++ = frame->pdata.block;
*bp = frame->pdata.block >> 8;
}
} else if (type == OREL_RESID) {
/*
* This is something we handle. Note we have to add the thing
* in, rather than storing it, to support the object system
* that uses this to generate object relocations as
* dw ORS_OWNING_GEODE+resid foo
*
* Note also that for a similar reason, we count RESID
* relocations to library segments as desiring their library
* numbers...
*/
word w;
byte *bp = (byte *)val;
if (frame->combine == SEG_ABSOLUTE) {
Pass2_RelocError(targ,off,
"cannot get resource ID of %i -- not part of geode",
frame->name);
return(0);
}
w = (*bp | (bp[1] << 8));
if (frame->combine == SEG_LIBRARY) {
/*
* Add in the library number
*/
w += lib->lnum;
} else {
/*
* Add in the segment's index, which is simply the
* block handle, minus 32 (offset VMH_blockTable) divided
* by 12 (size VMBlockHandle).
*/
w += (frame->pdata.block - 32)/12;
}
*bp++ = w;
*bp = w >> 8;
}
/*
* Non-SEGMENT, non-RESID relocations are completely ignored.
*/
return(0);
}
/***********************************************************************
* VmWrite
***********************************************************************
* SYNOPSIS: Finish with the header and flush all data to disk
* CALLED BY: Out_Final
* RETURN: Nothing
* SIDE EFFECTS:
*
* STRATEGY:
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
* ardeb 10/20/89 Initial Revision
*
***********************************************************************/
static void
VmWrite(void *base, /* Base of file buffer */
int len, /* Length of same */
char *outfile) /* Name of output file */
{
void *block;
int i;
ID map = ST_LookupNoLen(symbols, strings, mapName);
ID dbMap = ST_LookupNoLen(symbols, strings, "__DBMapBlock");
/*
* For each segment, lock its block down and copy the data from the
* output buffer to the actual block, the mark the block dirty and
* release it.
*/
for (i = 1; i < seg_NumSegs; i++) {
SegDesc *sd = seg_Segments[i];
if (sd->combine != SEG_LIBRARY) {
/*
* If segment has the same name as the map block, set the
* handle as the map block handle...
*/
if (sd->name == map) {
VMSetMapBlock(outFile, sd->pdata.block);
} else if (sd->name == dbMap) {
VMSetDBMap(outFile, sd->pdata.block);
}
block = VMLock(outFile, sd->pdata.block, (MemHandle *)NULL);
bcopy((genptr)base+sd->foff, block, sd->size);
VMUnlockDirty(outFile, sd->pdata.block);
}
}
/*
* Flush all the data to the output file. That's all we need to do.
*/
VMClose(outFile);
}
/***********************************************************************
* VmCheckFixed
***********************************************************************
* SYNOPSIS: Make sure a resource isn't movable
* CALLED BY: EXTERNAL
* RETURN: Non-zero if resource is fixed
* SIDE EFFECTS: None
*
* STRATEGY:
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
* ardeb 12/18/89 Initial Revision
*
***********************************************************************/
static int
VmCheckFixed(SegDesc *targ)
{
return(1); /* All segments here are in fixed memory */
}
|
9a344dac9198a0070eca7a65461466c353e3a778
|
675d31c0346323f7e2b0ac2438d4b7cb352d414a
|
/include/sys/sysdepend/iote_stm32l4/sysdef.h
|
e42b044597fd3b95f1f679de790446fef489446f
|
[] |
no_license
|
tron-forum/mtkernel_3
|
04688868b7c20605407ee65e1204c177abd4fb39
|
308092c361b6f91621874083fad637ebcac7466a
|
refs/heads/master
| 2023-04-07T13:01:44.475830
| 2022-10-17T08:40:05
| 2022-10-17T08:40:05
| 227,035,186
| 145
| 30
| null | 2023-03-14T05:28:39
| 2019-12-10T05:20:05
|
C
|
UTF-8
|
C
| false
| false
| 1,888
|
h
|
sysdef.h
|
/*
*----------------------------------------------------------------------
* micro T-Kernel 3.00.06
*
* Copyright (C) 2006-2022 by Ken Sakamura.
* This software is distributed under the T-License 2.2.
*----------------------------------------------------------------------
*
* Released by TRON Forum(http://www.tron.org) at 2022/10.
*
*----------------------------------------------------------------------
*/
/*
* sysdef.h
*
* System dependencies definition (STM32L4 IoT-Engine depended)
* Included also from assembler program.
*/
#ifndef __SYS_SYSDEF_DEPEND_H__
#define __SYS_SYSDEF_DEPEND_H__
/* CPU-dependent definition */
#include "../cpu/stm32l4/sysdef.h"
/* ------------------------------------------------------------------------ */
/*
* Clock control definition
*/
/* RCC register initial value */
#define RCC_CFGR_INIT (0x00000000) // SYSCLK = PLL ,SYSCLK,HCLK not divided.
#define RCC_PLLCFGR_INIT (0x00002810) // M = 2, N = 40, P = 7, Q = 2, R =2
#define RCC_PLLSAI1CFGR_INIT (0x00002000) // N = 32, P = 7, Q = 2, R =2
#define RCC_PLLSAI2CFGR_INIT (0x00001000) // N = 16, P = 7, Q = 2, R =2
#define RCC_CFGR_SW_INIT (RCC_CFGR_SW_PLL)
#define RCC_PLLCFGR_PLLSRC_INIT (RCC_PLLCFGR_PLLSRC_HSE)
/* Clock frequency */
#define SYSCLK (80) /* System clock */
#define HCLK (SYSCLK) /* Peripheral clock (AHB) */
#define PCLK1 (HCLK) /* Peripheral clock (APB1) */
#define PCLK2 (HCLK) /* Peripheral clock (APB2) */
#define TMCLK (HCLK) /* System timer clock input (MHz) */
#define TMCLK_KHz (TMCLK * 1000) /* System timer clock input (kHz) */
/* ------------------------------------------------------------------------ */
/*
* Maximum value of Power-saving mode switching prohibition request.
* Used in tk_set_pow API.
*/
#define LOWPOW_LIMIT 0x7fff /* Maximum number for disabling */
#endif /* __TK_SYSDEF_DEPEND_H__ */
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.