mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-04-23 21:39:10 -04:00
Fixed floating point support in assembler.
This commit is contained in:
parent
0e0aa64e74
commit
021f08e180
2 changed files with 6 additions and 6 deletions
|
@ -94,9 +94,9 @@ static uint64_t readParenExpression(const string &s, const map<string, Word> &d,
|
|||
exit(1);
|
||||
}
|
||||
|
||||
int lexerBytes;
|
||||
int lexerFloatBytes;
|
||||
Obj *AsmReader::read(std::istream &input) {
|
||||
lexerBytes = wordSize;
|
||||
lexerFloatBytes = wordSize;
|
||||
FlexLexer *f = new yyFlexLexer(&input);
|
||||
Obj *o = new Obj();
|
||||
std::vector<Chunk>::reverse_iterator cur;
|
||||
|
|
|
@ -16,14 +16,14 @@
|
|||
#include "include/asm-tokens.h"
|
||||
#include "include/harpfloat.h"
|
||||
|
||||
extern int lexerBytes;
|
||||
extern int lexerFloatBytes;
|
||||
static int64_t read_number(const char *s) {
|
||||
while (!isdigit(*s) && *s != '-' && *s != '+') s++;
|
||||
|
||||
if (strchr(s, 'f') || strchr(s, '.')) {
|
||||
if (strchr(s, 'f') && !strchr(s, 'x') || strchr(s, '.')) {
|
||||
double d;
|
||||
sscanf(s, "%f", &d);
|
||||
return Harp::Word_u(Harp::Float(d, lexerBytes));
|
||||
sscanf(s, "%lf", &d);
|
||||
return Harp::Word_u(Harp::Float(d, lexerFloatBytes));
|
||||
} else {
|
||||
long long u;
|
||||
sscanf(s, "%lli", &u);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue