new opcode OP_LOADF (load immediate float)

This commit is contained in:
Roberto Ierusalimschy
2017-09-19 15:38:14 -03:00
parent e0c0e2ee14
commit abb17cf19b
4 changed files with 25 additions and 5 deletions

7
lvm.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lvm.c,v 2.291 2017/08/14 18:33:14 roberto Exp roberto $
** $Id: lvm.c,v 2.292 2017/09/13 19:50:08 roberto Exp roberto $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -829,6 +829,11 @@ void luaV_execute (lua_State *L) {
setivalue(s2v(ra), b);
vmbreak;
}
vmcase(OP_LOADF) {
int b = GETARG_sBx(i);
setfltvalue(s2v(ra), cast_num(b));
vmbreak;
}
vmcase(OP_LOADKX) {
TValue *rb;
lua_assert(GET_OPCODE(*pc) == OP_EXTRAARG);